/* 基础样式 */
body {
    margin: 0;
    padding: 0;
    font-family: '微软雅黑', sans-serif;
    background: linear-gradient(to bottom, #E0E0E0 0%, #F5F5F5 100%);
    color: #333333;
    line-height: 1.6;
    transition: background 0.5s ease;
}
h2, h3, h4 {
    color: #2F855A;
    margin-top: 2em;
    margin-bottom: 0.5em;
    font-weight: 700;
    transition: color 0.3s ease;
}
h2 {
    font-size: 24px;
}
h3 {
    font-size: 20px;
}
h4 {
    font-size: 18px;
}
p {
    font-size: 16px;
    margin-bottom: 1.2em;
    position: relative;
}
img {
    max-width: 90%;
    min-width: 500px;
    max-width: 900px;
    width: 100%;
    height: auto;
    display: block;
    margin: 1.5em auto;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}
section {
    padding: 2em;
    background: linear-gradient(135deg, rgba(168, 213, 186, 0.05), rgba(245, 245, 245, 0.05));
    margin: 1em 0;
    border-left: 5px solid #A8D5BA;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.05);
    border-radius: 10px;
}
nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #2F855A;
    color: #FFFFFF;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1em 2em;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1000;
}
nav .logo {
    font-size: 1.5em;
    font-weight: bold;
}
nav ul {
    list-style: none;
    display: flex;
    gap: 1.5em;
}
nav ul li {
    position: relative;
}
nav ul li a {
    color: #FFFFFF;
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s ease;
}
nav ul li a:hover {
    color: #FFDAB9;
}
.chapter-nav {
    position: fixed;
    top: 70px;
    left: 20px;
    background-color: rgba(47, 133, 90, 0.9);
    padding: 1em;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    max-height: 80vh;
    overflow-y: auto;
    transition: transform 0.3s ease;
}
.chapter-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.chapter-nav ul li {
    margin-bottom: 0.5em;
}
.chapter-nav ul li a {
    color: #FFFFFF;
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s ease;
}
.chapter-nav ul li a:hover {
    color: #FFDAB9;
}
@media (max-width: 768px) {
    .chapter-nav {
        position: fixed;
        top: 60px;
        left: -100%;
        width: 200px;
        height: 100%;
        transform: translateX(0);
        transition: left 0.3s ease;
    }
    .chapter-nav.active {
        left: 0;
    }
    nav ul {
        display: none;
    }
    nav .menu-toggle {
        display: block;
        cursor: pointer;
    }
}
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
}
.menu-toggle div {
    width: 25px;
    height: 3px;
    background-color: #FFFFFF;
    transition: all 0.3s ease;
}
footer {
    background-color: #333333;
    color: #FFFFFF;
    padding: 2em;
    text-align: center;
    margin-top: 2em;
}
footer a {
    color: #FFDAB9;
    text-decoration: none;
    margin: 0 0.5em;
    transition: color 0.3s ease;
}
footer a:hover {
    color: #A8D5BA;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
section h2, section h3, section h4 {
    animation: fadeIn 1s ease forwards;
    opacity: 0;
}
section p {
    animation: fadeIn 1.5s ease forwards;
    opacity: 0;
}
section img {
    animation: fadeIn 2s ease forwards;
    opacity: 0;
}
body.loaded section h2,
body.loaded section h3,
body.loaded section h4,
body.loaded section p,
body.loaded section img {
    opacity: 1;
}
a.internal-link {
    position: relative;
    color: #2F855A;
    text-decoration: none;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}
a.internal-link:hover {
    color: #FFDAB9;
    text-shadow: 0 0 5px rgba(168, 213, 186, 0.7);
}
.decorative-line {
    height: 2px;
    background: linear-gradient(to right, #A8D5BA, #FFDAB9);
    margin: 2em 0;
    border: none;
}
.highlight {
    background: rgba(168, 213, 186, 0.1);
    padding: 0.2em 0.4em;
    border-radius: 5px;
}
button, .button {
    background-color: #FFDAB9;
    color: #2F855A;
    border: none;
    padding: 0.8em 1.5em;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
}
button:hover, .button:hover {
    background-color: #A8D5BA;
    transform: scale(1.05);
}
@media (max-width: 1920px) {
    body {
        max-width: 1920px;
        margin: 0 auto;
    }
}
@media (max-width: 1200px) {
    .chapter-nav {
        display: none;
    }
}
@media (min-width: 1201px) {
    .chapter-nav {
        display: block;
    }
}
