/* 基本样式与变量 */
:root {
    --primary-color: #2E8B57; /* 森林绿 */
    --secondary-color1: #1E3A5F; /* 深蓝 */
    --secondary-color2: #FF8C00; /* 暖橙 */
    --accent-color1: #FFD700; /* 浅橙 */
    --accent-color2: #F5F5DC; /* 米白 */
    --background-gradient: linear-gradient(to bottom, #E0F2F1, #FFE0B2);
    --font-family-sans: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --font-family-serif: 'Georgia', serif;
    --transition-speed: 0.3s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family-sans);
    background: var(--background-gradient);
    color: var(--secondary-color1);
    line-height: 1.6;
    font-size: 16px;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* 导航栏 */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: var(--primary-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 1000;
}

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 20px;
}

nav .logo {
    font-family: var(--font-family-serif);
    font-size: 1.5em;
    color: #fff;
    text-decoration: none;
    text-shadow: 0 0 0.5px #000;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 15px;
}

nav ul li a {
    color: #fff;
    text-decoration: none;
    font-size: 1em;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background-color var(--transition-speed);
}

nav ul li a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* 响应式导航 */
@media (max-width: 768px) {
    nav .container {
        flex-direction: column;
        align-items: flex-start;
    }
    nav ul {
        flex-direction: column;
        width: 100%;
    }
    nav ul li {
        width: 100%;
    }
    nav ul li a {
        width: 100%;
        padding: 10px;
    }
}

/* 主内容样式 */
.main {
    padding: 100px 20px 50px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

section {
    margin-bottom: 50px;
    padding: 20px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    position: relative;
    animation: fadeIn 1s ease-in-out;
}

section h2, section h3, section h4 {
    font-family: var(--font-family-serif);
    color: var(--primary-color);
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
}

section h2 {
    font-size: 2em;
    border-bottom: 2px solid var(--secondary-color1);
    padding-bottom: 10px;
    transition: color var(--transition-speed);
}

section h2:hover {
    color: var(--secondary-color2);
}

section h3 {
    font-size: 1.5em;
    margin-top: 20px;
}

section p {
    margin-bottom: 15px;
    font-size: 1em;
    color: var(--secondary-color1);
    text-shadow: 0 0 0.5px #fff;
}

section img {
    display: block;
    max-width: 900px;
    min-width: 500px;
    width: 100%;
    height: auto;
    margin: 20px auto;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

section img:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

/* 渐变线条 */
.section-divider {
    height: 4px;
    background: linear-gradient(90deg, var(--secondary-color1), var(--secondary-color2));
    margin: 40px 0;
    border-radius: 2px;
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 字体和排版 */
h2, h3, h4 {
    text-transform: capitalize;
}

h2 {
    font-weight: 700;
}

h3 {
    font-weight: 600;
}

h4 {
    font-weight: 500;
}

p {
    font-size: 1em;
}

a {
    color: var(--secondary-color2);
    text-decoration: none;
    position: relative;
}

a::after {
    content: '';
    position: absolute;
    width: 100%;
    transform: scaleX(0);
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: var(--secondary-color2);
    transform-origin: bottom right;
    transition: transform var(--transition-speed);
}

a:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* 图片描述 */
figure {
    margin: 0;
}

figcaption {
    text-align: center;
    font-size: 0.9em;
    color: var(--secondary-color1);
    margin-top: 5px;
}

/* 底部样式 */
footer {
    background-color: var(--primary-color);
    color: #fff;
    padding: 20px;
    text-align: center;
    position: relative;
}

footer a {
    color: var(--accent-color1);
    margin: 0 10px;
    text-decoration: none;
    transition: color var(--transition-speed);
}

footer a:hover {
    color: var(--accent-color2);
}

/* 阅读进度条 */
#progress-bar {
    position: fixed;
    top: 60px;
    left: 0;
    width: 0;
    height: 5px;
    background-color: var(--secondary-color2);
    z-index: 999;
    transition: width 0.25s;
}
