
/* 全局设置：定义字体、颜色变量以及基本布局 */
:root {
    /* 主色调：深蓝色，用于营造专业与科技感 */
    --primary-color: #1E3A8A;
    /* 辅色调：灰色与靛蓝，用于增强层次感 */
    --secondary-color: #3B82F6;
    --gray-color: #6B7280;
    /* 点缀色：亮橙色与翠绿色，用于吸引注意力 */
    --accent-color-orange: #FB923C;
    --accent-color-green: #10B981;
    /* 背景渐变色，营造科技魅影效果 */
    --background-gradient: linear-gradient(135deg, #3B82F6, #1E3A8A);
    /* 文本颜色 */
    --text-color: #F3F4F6;
    /* 边框颜色 */
    --border-color: #E5E7EB;
}

/* 全局字体与基础样式 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    background: var(--background-gradient);
    color: var(--text-color);
    line-height: 1.6;
    /* 使用Flexbox进行整体布局 */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(30, 58, 138, 0.9);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
}

.navbar a {
    color: var(--text-color);
    margin: 0 10px;
    text-decoration: none;
    transition: color 0.3s ease;
}

.navbar a:hover {
    color: var(--accent-color-orange);
}

/* 首页横幅样式 */
.header-banner {
    margin-top: 60px; /* 留出导航栏高度 */
    position: relative;
    height: 600px;
    background: var(--background-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    text-align: center;
    flex-direction: column;
    transition: height 0.5s ease;
}

.header-banner h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.header-banner p {
    font-size: 1.2rem;
    max-width: 600px;
}

/* 响应式设计：调整横幅高度 */
@media (max-width: 768px) {
    .header-banner {
        height: 400px;
    }

    .header-banner h1 {
        font-size: 2rem;
    }

    .header-banner p {
        font-size: 1rem;
    }
}

/* 模块化内容区 */
.container {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
    padding: 40px 20px;
    flex: 1;
}

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

.module:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.2);
}

/* 12栅格系统：定义各模块所占列数 */
.col-12 {
    grid-column: span 12;
}

.col-6 {
    grid-column: span 6;
}

.col-4 {
    grid-column: span 4;
}

.col-3 {
    grid-column: span 3;
}

/* 图文并茂模块 */
.image-container {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.image-container img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
}

.image-container:hover img {
    transform: scale(1.05);
}

/* 文字内容样式 */
.content {
    padding: 20px;
}

.content h2, .content h3, .content h4 {
    color: var(--accent-color-green);
}

.content p {
    font-size: 16px;
    color: var(--text-color);
}

/* 提示文字样式 */
.reference-note {
    text-align: center;
    font-size: 1.5rem;
    color: var(--accent-color-orange);
    margin: 20px 0;
}

/* 图片展示样式 */
.gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.gallery img {
    width: 100%;
    max-width: 320px;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* 章节导航样式 */
.chapter-nav {
    position: fixed;
    top: 100px;
    right: 20px;
    background-color: rgba(30, 58, 138, 0.8);
    padding: 15px;
    border-radius: 8px;
    z-index: 500;
}

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

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

.chapter-nav a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

/* 折叠区域样式 */
.collapsible {
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--text-color);
    cursor: pointer;
    padding: 10px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 16px;
    border-radius: 5px;
    margin-top: 10px;
}

.active, .collapsible:hover {
    background-color: var(--accent-color-green);
}

.content-collapsible {
    padding: 0 15px;
    display: none;
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

.content-collapsible p {
    padding: 10px 0;
}

/* CSS3代码示例样式 */
.code-example {
    background-color: rgba(0, 0, 0, 0.7);
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
}

.code-example code {
    color: #FFD700;
    font-family: 'Courier New', Courier, monospace;
}

/* 提升可读性的关键帧动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 1s ease-out forwards;
}

/* 响应式调整 */
@media (max-width: 1024px) {
    .chapter-nav {
        top: 80px;
    }
}

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

    .navbar a {
        margin: 5px 0;
    }

    .chapter-nav {
        display: none;
    }
}

