
/* 全局样式设置 */
body {
    font-family: 'Roboto', sans-serif; /* 使用无衬线字体，提升可读性 */
    color: #ffffff; /* 主文字颜色为白色 */
    background-color: #0f0f1e; /* 设置页面背景色，避免使用白色 */
    margin: 0;
    padding: 0;
}

/* 导航栏样式 */
.navbar {
    position: fixed; /* 固定定位，始终在顶部 */
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(26, 26, 46, 0.9); /* 半透明背景色 */
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000; /* 确保导航栏在最上层 */
    transition: background-color 0.3s ease;
}

.navbar.scrolled {
    background-color: rgba(26, 26, 46, 1); /* 滚动后背景色不透明 */
}

.navbar a {
    color: #00ffcc; /* 导航链接颜色 */
    text-decoration: none; /* 去掉下划线 */
    margin: 0 15px;
    font-size: 16px; /* 导航文字大小 */
    transition: color 0.3s ease;
}

.navbar a:hover {
    color: #66ff66; /* 悬停时颜色变化 */
}

/* 主内容区样式 */
.container {
    padding: 100px 20px 50px; /* 避免被固定导航栏遮挡 */
    max-width: 1200px;
    margin: 0 auto;
}

/* 文章标题样式 */
article h2 {
    font-size: 24px; /* 一级标题大小 */
    margin-bottom: 20px;
    color: #00ffcc; /* 标题颜色 */
}

article h3 {
    font-size: 20px; /* 二级标题大小 */
    margin-top: 30px;
    margin-bottom: 15px;
    color: #66ff66; /* 二级标题颜色 */
}

article p {
    font-size: 16px; /* 正文字体大小 */
    line-height: 1.6;
    margin-bottom: 20px;
    color: #ffffff; /* 正文字体颜色 */
}

/* 代码块样式 */
article pre {
    background-color: #1a1a2e; /* 代码块背景色 */
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 20px;
    border: 1px solid #00ffcc;
}

article code {
    color: #00ffcc; /* 代码文字颜色 */
    font-family: 'Courier New', Courier, monospace; /* 等宽字体 */
}

/* 图片样式 */
.article-image {
    width: 100%;
    max-width: 320px;
    height: auto;
    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); /* 增强阴影 */
}

/* 渐变线条装饰 */
.decorative-line {
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #00ffcc, #66ff66);
    margin: 40px 0;
}

/* 按钮样式 */
.button {
    background-color: #00ffcc; /* 按钮背景色 */
    color: #0f0f1e; /* 按钮文字颜色 */
    padding: 10px 20px;
    border: none;
    border-radius: 5px; /* 圆角 */
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.3s ease;
    font-size: 16px;
}

.button:hover {
    transform: scale(1.05); /* 悬停时放大 */
    background-color: #66ff66; /* 悬停时背景色变化 */
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar a {
        margin: 0 10px;
        font-size: 14px; /* 缩小导航文字 */
    }
    
    article h2 {
        font-size: 20px; /* 缩小标题文字 */
    }
    
    article h3 {
        font-size: 18px; /* 缩小二级标题 */
    }
    
    .button {
        font-size: 14px; /* 缩小按钮文字 */
    }
}

@media (max-width: 480px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .navbar a {
        margin: 5px 0;
        font-size: 12px; /* 再次缩小 */
    }
    
    article h2 {
        font-size: 18px; /* 再次缩小 */
    }
    
    article h3 {
        font-size: 16px; /* 再次缩小 */
    }
    
    .button {
        font-size: 12px; /* 再次缩小 */
        padding: 8px 16px;
    }
}

/* 留白与区块划分 */
.section-block {
    padding: 50px 20px;
    background-color: #1a1a2e; /* 区块背景色 */
    margin-bottom: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* 阴影效果 */
}

.section-block:nth-child(even) {
    background-color: #162447; /* 交替背景色 */
}

/* 黄金比例布局 */
.main-content {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.main-content .text {
    flex: 2;
    min-width: 300px;
}

.main-content .images {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 导航系统样式 */
.chapter-navigation {
    position: fixed;
    right: 20px;
    top: 100px;
    width: 200px;
    background-color: rgba(26, 26, 46, 0.9);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

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

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

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

.chapter-navigation a:hover {
    color: #66ff66;
}

/* 提示文本样式 */
.reference-note {
    text-align: center;
    font-size: 18px;
    color: #ffcc00; /* 点缀色 */
    margin: 40px 0;
    animation: fadeIn 2s ease-in-out;
}

/* 渐变动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 无衬线字体引入 */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');


