
/* 
整体页面的样式设定
使用深色背景搭配亮色调，营造科技感与专业性
采用响应式设计，确保在不同设备上的良好展示
使用CSS变量便于主题色彩的统一管理
*/
:root {
    --primary-color: #0A192F; /* 主色调：深蓝色，体现科技感 */
    --accent-color: #00A8E8; /* 辅助色调：电光蓝，突出重点 */
    --secondary-color: #C0C0C0; /* 次色调：银灰色，增加层次 */
    --highlight-color: #8A2BE2; /* 点缀色：紫色，吸引注意力 */
    --background-gradient: linear-gradient(135deg, var(--primary-color), #1E2A47); /* 页面背景渐变 */
    --font-family: 'Roboto', sans-serif; /* 全局字体 */
}

/* 设置全局样式 */
body {
    margin: 0;
    padding: 0;
    background: var(--background-gradient);
    color: #FFFFFF;
    font-family: var(--font-family);
    line-height: 1.6;
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(10, 25, 47, 0.9);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 15px 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 添加阴影提升层次感 */
}

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

.navbar a:hover {
    color: var(--accent-color); /* 悬停时变色 */
}

/* 进度指示器样式 */
.progress-indicator {
    position: fixed;
    top: 60px;
    right: 20px;
    width: 5px;
    height: 80vh;
    background: var(--secondary-color);
    border-radius: 2.5px;
}

.progress-bar {
    width: 100%;
    height: 30%;
    background: var(--accent-color);
    border-radius: 2.5px;
    transition: height 0.25s ease;
}

/* 主容器样式，使用网格布局 */
.container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 100px 40px 40px 40px; /* 上边距为导航栏留白 */
}

/* 模块样式 */
.module {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.module:hover {
    transform: translateY(-10px); /* 悬停上移效果 */
    box-shadow: 0 8px 60px rgba(0, 0, 0, 0.2); /* 加强阴影 */
}

/* 标题样式 */
h2, h3, h4 {
    color: var(--accent-color);
}

h2 {
    font-size: 2em;
    margin-bottom: 10px;
}

h3 {
    font-size: 1.5em;
    margin-bottom: 8px;
}

h4 {
    font-size: 1.2em;
    margin-bottom: 6px;
}

/* 按钮样式 */
.button {
    background: var(--accent-color);
    border: none;
    padding: 10px 20px;
    color: #FFFFFF;
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.3s ease, transform 0.3s ease;
    position: relative;
    overflow: hidden;
}

.button:hover {
    background: var(--highlight-color); /* 悬停变色 */
    transform: scale(1.05); /* 放大效果 */
}

.button::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 0;
    left: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.2);
    transition: height 0.3s ease;
}

.button:hover::after {
    height: 100%;
}

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

.module img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

/* 代码块样式 */
pre {
    background: rgba(0, 0, 0, 0.7);
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    font-size: 14px;
    line-height: 1.5;
    margin-top: 10px;
}

code {
    color: #00FFAA;
}

/* 折叠区域样式 */
.details {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    padding: 10px;
    margin-top: 10px;
}

.summary {
    cursor: pointer;
    color: var(--highlight-color);
    font-weight: bold;
}

/* 章节导航样式 */
.chapter-nav {
    position: fixed;
    top: 100px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chapter-nav a {
    background: var(--accent-color);
    color: #FFFFFF;
    padding: 8px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.3s ease;
}

.chapter-nav a:hover {
    background: var(--highlight-color);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: center;
        padding: 10px 0;
    }

    .container {
        padding: 120px 20px 20px 20px;
        grid-template-columns: 1fr;
    }

    .progress-indicator {
        display: none;
    }

    .chapter-nav {
        display: none;
    }
}

@media (min-width: 769px) {
    .container {
        padding: 100px 40px 40px 40px;
    }
}

/* 动画效果 */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

.floating-element {
    animation: float 3s ease-in-out infinite;
}

/* 数据可视化图表样式 */
.chart {
    width: 100%;
    height: 300px;
    background: var(--primary-color);
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.chart::before {
    content: '';
    position: absolute;
    width: 2px;
    height: 100%;
    background: var(--accent-color);
    animation: moveLine 5s linear infinite;
}

@keyframes moveLine {
    0% { left: 0; }
    100% { left: 100%; }
}

/* 代码示例块样式 */
.code-example {
    background: rgba(0, 0, 0, 0.8);
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.code-example code {
    display: block;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: #00FFAA;
}

