
/* 全局样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Open Sans', sans-serif; /* 使用无衬线字体，提升可读性 */
    background: linear-gradient(135deg, #1e3c72, #2a5298); /* 使用线性渐变作为背景，增强视觉层次 */
    color: #ffffff; /* 设置文本颜色为白色，确保与背景的对比度 */
}

/* 导航栏样式 */
.navbar {
    position: fixed; /* 固定在顶部，随页面滚动 */
    top: 0;
    width: 100%;
    background-color: rgba(0, 47, 108, 0.9); /* 半透明背景，增加科技感 */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 添加阴影效果，提升层次感 */
    z-index: 1000; /* 确保导航栏在最上层 */
}

.navbar ul {
    list-style: none;
    display: flex;
    gap: 20px;
}

.navbar ul li {
    position: relative;
}

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

.navbar ul li a:hover {
    color: #ffcc00; /* 悬停时改变颜色，增加交互性 */
}

.navbar ul li ul {
    display: none;
    position: absolute;
    top: 40px;
    left: 0;
    background-color: rgba(0, 47, 108, 0.95);
    padding: 10px;
    border-radius: 4px;
}

.navbar ul li:hover ul {
    display: block;
}

.breadcrumb {
    display: flex;
    align-items: center;
    font-size: 14px;
    margin: 80px 30px 20px 30px; /* 顶部留出导航栏空间 */
}

.breadcrumb a {
    color: #4B9CD3;
    text-decoration: none;
    margin-right: 5px;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: #ffcc00;
}

.breadcrumb span {
    margin-right: 5px;
}

.container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* 使用自动适应的网格布局 */
    gap: 20px;
    padding: 20px 30px;
}

.section {
    background-color: rgba(255, 255, 255, 0.1); /* 半透明背景，突出内容 */
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* 添加阴影，增加立体感 */
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.section:hover {
    transform: translateY(-10px); /* 悬停时轻微上移，增加动感 */
    background-color: rgba(255, 255, 255, 0.15);
}

.section:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.05); /* 偶数章节背景稍微不同，增加层次 */
}

.header {
    text-align: center;
    padding: 100px 30px 50px 30px; /* 顶部空间，确保导航栏不遮挡 */
}

.header h1 {
    font-size: 48px;
    margin-bottom: 20px;
    color: #ffcc00; /* 主要标题颜色，突出显示 */
}

.header p {
    font-size: 18px;
    line-height: 1.6;
    color: #dddddd;
}

/* 图片样式 */
.image-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.image-gallery img {
    width: 100%;
    max-width: 320px;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* 阴影效果，增加立体感 */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.image-gallery img:hover {
    transform: scale(1.05); /* 悬停时放大图片 */
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

/* 代码块样式 */
pre {
    background-color: rgba(0, 0, 0, 0.8); /* 深色背景，突出代码 */
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    color: #00ff00; /* 使用绿色字体，常见于代码编辑器 */
    margin: 20px 0;
}

pre code {
    display: block;
    white-space: pre-wrap;
}

/* 按钮样式 */
.button-primary {
    background-color: #ffcc00;
    border: none;
    color: #002F6C;
    padding: 12px 24px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 16px;
    transition: background-color 0.3s ease, transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.button-primary:hover {
    background-color: #e6b800;
    transform: scale(1.05);
}

/* 折叠区域样式 */
.collapsible {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    cursor: pointer;
    padding: 18px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 18px;
    transition: background-color 0.3s ease;
    border-radius: 4px;
    margin: 10px 0;
}

.collapsible:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.content {
    padding: 0 18px;
    display: none;
    background-color: rgba(255, 255, 255, 0.05);
    overflow: hidden;
    border-radius: 4px;
    margin-bottom: 10px;
}

/* 章节导航样式 */
.chapter-nav {
    position: fixed;
    right: 20px;
    top: 100px;
    background-color: rgba(0, 47, 108, 0.8);
    padding: 10px 15px;
    border-radius: 8px;
}

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

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

.chapter-nav ul li a {
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.chapter-nav ul li a:hover {
    color: #ffcc00;
}

/* 提示信息样式 */
.prompt {
    text-align: center;
    background-color: rgba(255, 204, 0, 0.8);
    color: #002F6C;
    padding: 20px;
    font-size: 20px;
    font-weight: bold;
    border-radius: 8px;
    margin: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar ul {
        display: none; /* 隐藏菜单，适配移动端 */
    }
    .navbar .hamburger {
        display: block;
        cursor: pointer;
    }
    .navbar ul.active {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background-color: rgba(0, 47, 108, 0.95);
        padding: 20px 0;
    }
    .chapter-nav {
        display: none; /* 隐藏章节导航，避免占用过多空间 */
    }
}

