
/* 全局样式设置，应用基础的字体和背景渐变效果 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #12263B 70%, #2C3E50 25%, #FF9F43 5%);
    color: #ffffff;
    /* 确保响应式设计，无水平滚动 */
    overflow-x: hidden;
}

/* 导航栏样式，固定在顶部，包含渐变背景和阴影效果 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(18, 38, 59, 0.9);
    display: flex;
    justify-content: space-between;
    padding: 15px 30px;
    z-index: 1000;
    transition: background 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar.scrolled {
    background: #12263B;
}

.navbar a {
    color: #ffffff;
    margin: 0 15px;
    text-decoration: none;
    position: relative;
}

.navbar a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background: #FF9F43;
    left: 0;
    bottom: -5px;
    transition: width 0.3s ease;
}

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

/* 章节导航系统样式，固定在侧边或顶部，便于快速定位 */
.chapter-nav {
    position: fixed;
    top: 60px;
    right: 30px;
    background: rgba(18, 38, 59, 0.8);
    padding: 10px 20px;
    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: #00BFFF;
    text-decoration: none;
    transition: color 0.3s ease;
}

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

/* 主内容区域，使用网格布局 */
.container {
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 20px;
    padding: 100px 30px 30px 30px;
    max-width: 1200px;
    margin: 0 auto;
}

/* 文章内容样式 */
article {
    grid-column: 2 / 3;
}

article h2, article h3 {
    color: #00BFFF;
}

article p {
    font-size: 16px;
    line-height: 1.6;
}

/* 图片样式，添加圆角和阴影，悬停效果 */
.article-image {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin: 20px 0;
}

.article-image:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

/* 代码块样式，使用单独的背景和字体 */
pre {
    background: #1e2a38;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
}

code {
    color: #00BFFF;
    font-family: 'Courier New', monospace;
}

/* 折叠区域样式 */
.details {
    margin: 20px 0;
}

.details summary {
    cursor: pointer;
    font-weight: bold;
    color: #FF9F43;
}

.details[open] summary {
    color: #00BFFF;
}

/* 底部模块样式，使用Flexbox布局 */
.footer {
    background: #12263B;
    color: #ffffff;
    padding: 40px 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
}

.footer-section {
    flex: 1 1 200px;
    margin: 20px;
}

.footer-section h3 {
    border-bottom: 2px solid #00BFFF;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin: 10px 0;
    transition: color 0.3s ease;
}

.footer-section ul li:hover {
    color: #FF9F43;
}

/* 响应式设计：适配各种屏幕宽度 */
@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
        padding: 100px 15px 15px 15px;
    }

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