
/* 基本样式设置 */
:root {
    --主色: #1E90FF; /* 科技蓝 */
    --辅色: #F5F5F5; /* 浅灰色 */
    --点缀色: #FFA500; /* 橙色 */
    --绿色: #32CD32; /* 数据增长绿色 */
    --红色: #FF4500; /* 警示红色 */
    --字体主: 'Roboto', sans-serif;
    --字体辅助: 'Open Sans', sans-serif;
}

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--字体辅助);
    background-color: var(--辅色);
    color: #333;
    line-height: 1.6;
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: var(--主色);
    padding: 20px 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar ul {
    display: flex;
    justify-content: center;
    list-style: none;
}

.navbar li {
    margin: 0 15px;
}

.navbar a {
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s ease;
}

.navbar a:hover {
    color: var(--点缀色);
}

/* Hero区样式 */
.hero {
    height: 100vh;
    background: linear-gradient(135deg, var(--主色) 0%, #00c6ff 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.hero::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(30, 144, 255, 0.6);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    color: #fff;
}

.hero-content h1 {
    font-size: 3em;
    margin-bottom: 20px;
    font-family: var(--字体主);
}

.hero-content p {
    font-size: 1.2em;
    margin-bottom: 30px;
}

.cta-button {
    background-color: var(--点缀色);
    color: #fff;
    padding: 15px 30px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.cta-button:hover {
    background-color: darken(var(--点缀色), 10%);
    transform: scale(1.05);
}

/* 主内容区样式 */
.main-content {
    padding: 80px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* 章节导航样式 */
.chapter-nav {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(30, 144, 255, 0.8);
    padding: 10px;
    border-radius: 8px;
    z-index: 1000;
}

.chapter-nav ul {
    list-style: none;
}

.chapter-nav li {
    margin: 10px 0;
}

.chapter-nav a {
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    display: block;
    transition: color 0.3s ease;
}

.chapter-nav a:hover {
    color: var(--点缀色);
}

/* 文章内容样式 */
article {
    margin-top: 60px;
}

article h2, article h3, article h4 {
    font-family: var(--字体主);
    margin-bottom: 15px;
    color: var(--主色);
}

article p {
    margin-bottom: 20px;
    font-size: 16px;
}

article pre {
    background-color: #2d2d2d;
    color: #ccc;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 20px;
    font-size: 14px;
}

article code {
    font-family: 'Courier New', Courier, monospace;
}

/* 图片样式 */
img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

/* 卡片式布局 */
.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.card {
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-10px);
}

/* 按钮样式 */
button {
    background-color: var(--主色);
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

button:hover {
    background-color: darken(var(--主色), 10%);
    transform: scale(1.05);
}

/* Footer样式 */
.footer {
    background-color: var(--主色);
    color: #fff;
    padding: 40px 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.footer-section {
    flex: 1 1 200px;
    margin: 10px;
}

.footer-section h4 {
    margin-bottom: 15px;
    border-bottom: 2px solid #fff;
    padding-bottom: 5px;
}

.footer-section p, .footer-section a {
    color: #fff;
    text-decoration: none;
    margin-bottom: 10px;
    display: block;
    font-size: 14px;
}

.social-icons a {
    margin-right: 10px;
    display: inline-block;
    transition: transform 0.3s ease;
}

.social-icons a:hover {
    transform: scale(1.2);
}

/* 订阅表单样式 */
.subscribe-form input[type="email"] {
    padding: 10px;
    border: none;
    border-radius: 5px;
    margin-right: 10px;
    width: 70%;
}

.subscribe-form button {
    padding: 10px 20px;
    background-color: var(--点缀色);
    border: none;
    border-radius: 5px;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.subscribe-form button:hover {
    background-color: darken(var(--点缀色), 10%);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar ul {
        flex-direction: column;
    }

    .chapter-nav {
        display: none;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 2em;
    }

    .hero-content p {
        font-size: 1em;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1s forwards;
}

