
/* 变量定义，用于统一管理颜色 */
:root {
    --main-color: #1E90FF; /* 科技蓝，主色调 */
    --secondary-color: #4B0082; /* 深紫色，辅色调 */
    --accent-color: #FFA500; /* 亮橙色，点缀色 */
    --highlight-color: #32CD32; /* 绿色，用于突出显示 */
    --background-gradient: linear-gradient(135deg, var(--secondary-color), var(--main-color));
    --font-primary: 'Montserrat', sans-serif; /* 主要字体 */
    --font-secondary: 'Roboto', sans-serif; /* 辅助字体 */
    --transition-speed: 0.3s; /* 过渡速度 */
}

/* 全局样式 */
body {
    margin: 0;
    padding: 0;
    background: var(--background-gradient);
    color: #ffffff;
    font-family: var(--font-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* 固定导航栏 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(75, 0, 130, 0.9);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 导航菜单 */
.nav-menu {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    margin-left: 20px;
}

.nav-menu a {
    color: #ffffff;
    text-decoration: none;
    font-weight: bold;
    transition: color var(--transition-speed) ease;
}

.nav-menu a:hover {
    color: var(--accent-color);
}

/* 响应式侧边菜单 */
.sidebar {
    display: none;
    flex-direction: column;
    position: fixed;
    top: 60px;
    left: 0;
    width: 200px;
    height: 100%;
    background-color: rgba(75, 0, 130, 0.95);
    padding: 20px;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
}

.sidebar.active {
    display: flex;
}

.sidebar a {
    color: #ffffff;
    text-decoration: none;
    margin-bottom: 15px;
    font-weight: 500;
    transition: color var(--transition-speed) ease;
}

.sidebar a:hover {
    color: var(--highlight-color);
}

/* 主内容区 */
.main-content {
    padding: 100px 50px 50px 50px;
    max-width: 1200px;
    margin: 0 auto;
}

/* 章节导航 */
.section-nav {
    position: fixed;
    top: 100px;
    right: 30px;
    background-color: rgba(75, 0, 130, 0.8);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.section-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.section-nav li {
    margin-bottom: 10px;
}

.section-nav a {
    color: #ffffff;
    text-decoration: none;
    transition: color var(--transition-speed) ease;
}

.section-nav a:hover {
    color: var(--accent-color);
}

/* 提示信息 */
.prompt {
    text-align: center;
    font-size: 1.2em;
    margin-bottom: 40px;
    color: var(--highlight-color);
    font-weight: bold;
}

/* 文章样式 */
article {
    background: rgba(75, 0, 130, 0.6);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

article h2, article h3, article h4 {
    font-family: var(--font-secondary);
    margin-top: 20px;
    margin-bottom: 15px;
}

article h2 {
    font-size: 2em;
    color: var(--accent-color);
}

article h3 {
    font-size: 1.5em;
    color: var(--highlight-color);
}

article p {
    font-size: 1em;
    color: #f0f0f0;
    margin-bottom: 15px;
}

article code {
    font-family: 'Courier New', monospace;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 3px 5px;
    border-radius: 4px;
}

article pre {
    background-color: rgba(0, 0, 0, 0.8);
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 20px;
}

article table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

article table, article th, article td {
    border: 1px solid #ffffff;
}

article th, article td {
    padding: 10px;
    text-align: left;
}

article th {
    background-color: rgba(30, 144, 255, 0.7);
}

.article-images {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
}

.article-images img {
    width: 320px;
    height: 320px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

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

/* 按钮样式 */
.btn-primary {
    background-color: var(--accent-color);
    border: none;
    color: #ffffff;
    padding: 12px 25px;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color var(--transition-speed) ease, transform var(--transition-speed) ease;
}

.btn-primary:hover {
    background-color: var(--highlight-color);
    transform: translateY(-3px);
}

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

.fade-in-up {
    animation: fadeInUp 0.8s ease forwards;
    opacity: 0;
}

/* 可视区域内模块显示 */
.module-visible {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.6s ease-out;
}

/* 渐变线条 */
.divider {
    height: 2px;
    background: linear-gradient(to right, var(--accent-color), var(--highlight-color));
    margin: 40px 0;
    border: none;
    border-radius: 5px;
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

th, td {
    padding: 12px 15px;
    border: 1px solid #ffffff;
}

th {
    background-color: rgba(30, 144, 255, 0.7);
    color: #ffffff;
}

td {
    background-color: rgba(75, 0, 130, 0.5);
    color: #f0f0f0;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .main-content {
        padding: 100px 30px 30px 30px;
    }
}

@media (max-width: 992px) {
    .section-nav {
        display: none;
    }

    .main-content {
        padding: 100px 20px 20px 20px;
    }

    .article-images {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .nav-menu {
        flex-direction: column;
        width: 100%;
        display: none;
    }

    .nav-menu.active {
        display: flex;
    }

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

    .sidebar {
        display: flex;
    }

    .main-content {
        padding: 100px 15px 15px 15px;
    }

    .article-images img {
        width: 100%;
        height: auto;
    }
}

/* 特定模块样式 */
.intro-section {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 30px;
    margin-bottom: 50px;
}

.intro-section img {
    width: 400px;
    border-radius: 10px;
}

@media (max-width: 768px) {
    .intro-section {
        flex-direction: column;
        align-items: flex-start;
    }

    .intro-section img {
        width: 100%;
    }
}

/* 图片展示样式 */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.image-gallery img {
    width: 100%;
    height: 320px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.image-gallery img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 12px rgba(0,0,0,0.4);
}

