
/* 全局样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif; /* 使用现代无衬线字体 */
    background-color: #121212; /* 深色背景，符合暗黑模式 */
    color: #E0E0E0; /* 浅灰色文本，提高可读性 */
    transition: background-color 0.3s ease, color 0.3s ease; /* 平滑过渡效果 */
}

/* 主导航栏样式 */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(135deg, #00BCD4, #8BC34A); /* 渐变背景 */
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.header h1 {
    margin: 0;
    font-size: 24px;
    color: #FFFFFF; /* 白色标题 */
}

.navbar {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

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

.navbar a:hover {
    color: #FFD700; /* 悬停时变为金色 */
}

.navbar a::after {
    content: '';
    display: block;
    width: 0;
    height: 2px;
    background: #FFD700; /* 金色下划线 */
    transition: width 0.3s;
    position: absolute;
    bottom: -5px;
    left: 0;
}

.navbar a:hover::after {
    width: 100%;
}

/* 章节导航 */
.chapter-nav {
    position: fixed;
    top: 80px;
    left: 20px;
    background-color: rgba(18, 18, 18, 0.8);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

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

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

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

.chapter-nav a:hover {
    color: #8BC34A;
}

/* 主要内容区域 */
.main-content {
    margin: 120px 40px 40px 300px; /* 为导航留出空间 */
    max-width: 1200px;
}

.main-content h2, .main-content h3, .main-content h4 {
    color: #00BCD4;
    margin-top: 40px;
}

.main-content p {
    line-height: 1.6;
    font-size: 16px;
    margin-bottom: 20px;
}

.main-content pre {
    background-color: #1E1E1E;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
}

.main-content code {
    color: #FFD700;
}

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

.image-gallery img {
    width: 100%;
    height: auto;
    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);
}

/* 提示信息 */
.reference-note {
    background-color: #2C2C2C;
    color: #FFFFFF;
    padding: 20px;
    border-left: 5px solid #00BCD4;
    margin: 40px 0;
    border-radius: 4px;
}

/* 代码示例样式 */
.code-example {
    background-color: #1E1E1E;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 40px 0;
}

.code-example code {
    color: #00BCD4;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .main-content {
        margin-left: 250px;
    }
}

@media (max-width: 768px) {
    .chapter-nav {
        display: none;
    }
    .main-content {
        margin: 120px 20px 20px 20px;
    }
    .navbar {
        flex-direction: column;
        align-items: center;
    }
    .navbar a {
        margin: 10px 0;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 20px;
    }
    .navbar a {
        font-size: 14px;
    }
    .main-content h2 {
        font-size: 20px;
    }
    .main-content h3, .main-content h4 {
        font-size: 18px;
    }
    .main-content p {
        font-size: 14px;
    }
}

