
/* 全局样式设置 */
/* 设置整个页面的背景渐变色，避免纯白色 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Helvetica', sans-serif; /* 正文字体 */
    background: linear-gradient(135deg, #8B4513 70%, #F5DEB3 25%, #FF4500 5%); /* 黄金比配色，主色70%，辅色25%，点缀色5% */
    color: #333333;
    transition: background 0.5s ease, color 0.5s ease;
}

/* 顶部导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(139, 69, 19, 0.9); /* 深棕色主色调 */
    padding: 15px 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 导航链接样式 */
.navbar a {
    color: #FFFFFF;
    text-decoration: none;
    margin: 0 15px;
    font-size: 16px;
    transition: color 0.3s ease, border-bottom 0.3s ease;
}

.navbar a:hover {
    color: #1E90FF; /* 点缀色用于悬停效果 */
    border-bottom: 2px solid #1E90FF;
}

/* 主要内容容器 */
.container {
    max-width: 1200px;
    margin: 100px auto 50px auto; /* 顶部留出导航栏空间 */
    padding: 20px;
}

/* 章节导航系统 */
.chapter-nav {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 40px;
    background-color: #FFF8DC; /* 米黄色辅助色 */
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.chapter-nav a {
    margin-right: 20px;
    color: #8B4513;
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s ease;
}

.chapter-nav a:hover {
    color: #1E90FF;
}

/* 文章样式 */
article section {
    margin-bottom: 50px;
}

article h2 {
    font-family: 'Baskerville', serif; /* 复古衬线字体 */
    font-size: 24px;
    color: #8B4513;
    margin-bottom: 10px;
}

article h3 {
    font-family: 'Baskerville', serif;
    font-size: 20px;
    color: #8B4513;
    margin-bottom: 10px;
}

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

/* 代码块样式 */
article pre {
    background-color: #F0F0F0;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

article code {
    font-family: 'Courier New', Courier, monospace;
    color: #D2691E;
}

/* 图片样式 */
.article-images {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.article-images img {
    width: 320px;
    height: 320px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* 提示信息样式 */
.notice {
    text-align: center;
    background-color: #FFD700; /* 点缀色 */
    padding: 20px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 8px;
    margin-bottom: 40px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .navbar a {
        margin: 10px 0;
    }

    .chapter-nav {
        flex-direction: column;
    }

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

    .article-images {
        flex-direction: column;
        align-items: center;
    }

    .article-images img {
        width: 100%;
        height: auto;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 40px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.animate-on-scroll {
    opacity: 0;
    animation: fadeInUp 0.6s forwards;
    animation-delay: 0.3s;
}

/* 按钮样式 */
.button-theme-toggle {
    background-color: #1E90FF;
    color: #FFFFFF;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.button-theme-toggle:hover {
    background-color: #00BFFF;
    transform: scale(1.05);
}

/* 主题切换样式 */
:root {
    --background-color: #F5DEB3;
    --primary-color: #8B4513;
    --accent-color: #1E90FF;
    --font-family-heading: 'Baskerville', serif;
    --font-family-body: 'Helvetica', sans-serif;
}

body.modern {
    --background-color: #FFFFFF;
    --primary-color: #333333;
    --accent-color: #FF4500;
}

body {
    background-color: var(--background-color);
    color: var(--primary-color);
    font-family: var(--font-family-body);
    transition: background-color 0.5s ease, color 0.5s ease;
}

h2, h3 {
    font-family: var(--font-family-heading);
    color: var(--primary-color);
}

.button-theme-toggle {
    background-color: var(--accent-color);
}

.button-theme-toggle:hover {
    background-color: var(--accent-color);
}

/* 提示信息的动画 */
.notice {
    animation: fadeInUp 1s ease forwards;
}

