
/* 
 * 全局样式定义
 * 设置页面的基础样式，包括字体、颜色、布局等
 */

/* 使用Roboto字体，保证文本清晰易读 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #1E3A8A, #F0F6FC); /* 主色调深蓝与灰色渐变背景 */
    color: #333;
    line-height: 1.6;
}

/* 顶部导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(30, 58, 138, 0.8); /* 磨砂玻璃效果 */
    backdrop-filter: blur(10px);
    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);
}

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

.navbar a:hover {
    color: #34D399; /* 点缀色青绿色 */
}

/* 章节导航系统样式 */
.chapter-nav {
    position: fixed;
    top: 80px;
    left: 20px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    padding: 10px 20px;
    border-radius: 8px;
}

.chapter-nav a {
    display: block;
    color: #FFFFFF;
    text-decoration: none;
    margin: 10px 0;
    font-size: 14px;
    transition: color 0.3s ease, transform 0.3s ease;
}

.chapter-nav a:hover {
    color: #FFA500; /* 点缀色橙色 */
    transform: translateX(5px);
}

/* 主内容区域样式 */
.container {
    max-width: 1200px;
    margin: 150px auto 50px auto; /* 顶部留白避免遮挡导航 */
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}

/* 独立视觉区块 */
.section {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.section:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 40px rgba(0, 0, 0, 0.2);
}

/* 标题样式 */
.section h2, .section h3, .section h4 {
    color: #FFFFFF;
    margin-bottom: 20px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.section h2 {
    font-size: 24px;
}

.section h3 {
    font-size: 20px;
}

.section h4 {
    font-size: 18px;
}

/* 段落文本样式 */
.section p {
    font-size: 16px;
    color: #F0F6FC;
    margin-bottom: 20px;
}

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

.section img:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(0,0,0,0.4);
}

/* 代码块样式 */
.code-block {
    background: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    margin-bottom: 20px;
}

.code-block code {
    color: #FFD700;
    display: block;
}

/* 按钮样式 */
.button {
    background-color: #34D399; /* 青绿色 */
    color: #FFFFFF;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
    font-size: 16px;
    text-decoration: none;
    display: inline-block;
}

.button:hover {
    background-color: #2AA67E;
    transform: translateY(-3px);
}

/* 背景分隔线样式 */
.divider {
    height: 2px;
    background: linear-gradient(to right, #34D399, #FFA500); /* 渐变线条 */
    margin: 40px 0;
    border: none;
}

/* 响应式设计 */
@media (min-width: 768px) {
    .container {
        grid-template-columns: 3fr 1fr; /* 两栏布局 */
    }

    .chapter-nav {
        top: 100px;
    }
}

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

    .chapter-nav {
        position: static;
        margin-bottom: 20px;
    }

    .container {
        margin: 100px 10px 30px 10px;
    }
}

