/* 全局样式 */
:root {
    --primary-color: #3a5a78;
    --primary-rgb: 58, 90, 120; /* RGB值用于动画效果 */
    --secondary-color: #f0f4f8;
    --accent-color: #e63946;
    --text-color: #333;
    --light-text: #666;
    --border-color: #ddd;
    --highlight-color: #ffd166;
    --background-color: #f8f9fa;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Serif SC', serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    background-image: url('data:image/svg+xml;utf8,<svg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><rect width="100" height="100" fill="%23f8f9fa"/><path d="M0 0L100 100M100 0L0 100" stroke="%23f0f0f0" stroke-width="1"/></svg>');
    background-size: 20px 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
    background-color: white;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    margin-top: 2rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

/* 页眉样式 */
header {
    text-align: center;
    padding: 2rem 0;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
    position: relative;
}

header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background-color: var(--accent-color);
    border-radius: 2px;
}

.main-title {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-family: 'ZCOOL XiaoWei', serif;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    font-size: 1.8rem;
    color: var(--accent-color);
    font-weight: normal;
    margin-top: 0.5rem;
}

/* 主要内容样式 */
main {
    padding: 1rem 0;
}

section {
    margin-bottom: 3rem;
    padding: 1.5rem;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

section:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.article-title {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    position: relative;
}

.article-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 50px;
    height: 2px;
    background-color: var(--accent-color);
}

.author {
    font-size: 1.2rem;
    color: var(--light-text);
    margin-bottom: 1.5rem;
    font-style: italic;
}

.section-title {
    font-size: 1.4rem;
    color: var(--primary-color);
    margin: 1.5rem 0 1rem;
    padding-left: 1rem;
    border-left: 4px solid var(--accent-color);
}

.article-content p, .reflection p {
    margin-bottom: 1rem;
    text-align: justify;
    text-indent: 2em;
    line-height: 1.8;
}

/* 诗歌样式 */
.poem-content {
    padding: 1.5rem;
    background-color: var(--secondary-color);
    border-radius: 8px;
    font-style: italic;
    line-height: 2;
    text-align: center;
}

.poem-content p {
    margin-bottom: 0.5rem;
}

.poem-author {
    text-align: right;
    margin-top: 1rem;
    font-style: normal;
    color: var(--light-text);
}

/* 问题块样式 */
.issue-block {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: var(--secondary-color);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.issue-title {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.note {
    color: var(--accent-color);
    font-weight: bold;
    margin: 1rem 0;
}

.conclusion {
    font-weight: bold;
    text-align: center;
    margin-top: 2rem;
    font-size: 1.2rem;
    color: var(--primary-color);
}

/* 页脚样式 */
footer {
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
    border-top: 2px solid var(--border-color);
    color: var(--light-text);
}

footer p {
    margin-bottom: 0.5rem;
}

footer a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* 回到顶部按钮 */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

.scroll-top.visible {
    opacity: 1;
}

.scroll-top:hover {
    transform: translateY(-5px);
    background-color: var(--accent-color);
}

.scroll-top span {
    font-size: 1.5rem;
    font-weight: bold;
}

/* 音频播放器样式 */
.audio-section {
    background-color: var(--secondary-color);
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 3rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.audio-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

/* 播放状态的样式 */
.audio-section.playing {
    background: linear-gradient(45deg, var(--secondary-color), var(--primary-color));
    animation: pulse 2s infinite alternate;
}

.audio-section.playing::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 70%);
    opacity: 0;
    animation: ripple 2s linear infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 10px rgba(var(--primary-rgb), 0.5);
    }
    100% {
        box-shadow: 0 0 20px rgba(var(--primary-rgb), 0.8);
    }
}

@keyframes ripple {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 0;
        transform: scale(1.5);
    }
}

.audio-player {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 1.5rem;
}

.audio-player audio {
    width: 100%;
    max-width: 500px;
    margin-bottom: 1rem;
    border-radius: 30px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.audio-player audio::-webkit-media-controls-panel {
    background-color: var(--primary-color);
    color: white;
}

.audio-description {
    text-align: center;
    font-style: italic;
    color: var(--light-text);
    margin-top: 1rem;
    max-width: 80%;
    line-height: 1.6;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
        margin-top: 1rem;
        margin-bottom: 1rem;
    }

    .main-title {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1.5rem;
    }

    .article-title {
        font-size: 1.5rem;
    }

    .section-title {
        font-size: 1.2rem;
    }

    section {
        padding: 1rem;
    }

    .issue-block {
        padding: 1rem;
    }
    
    .audio-player audio {
        max-width: 100%;
    }
}

/* 动画效果 */
.intro, .article, .poem, .reflection, .competition, .farewell {
    opacity: 0;
    animation-fill-mode: forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 首字下沉效果 */
.intro p:first-of-type::first-letter {
    font-size: 3.5em;
    float: left;
    line-height: 0.8;
    margin-right: 0.1em;
    color: var(--accent-color);
    font-family: 'ZCOOL XiaoWei', serif;
}

/* 引用样式 */
blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    border-left: 4px solid var(--highlight-color);
    background-color: var(--secondary-color);
    font-style: italic;
    position: relative;
}

blockquote::before {
    content: '\201C';
    font-size: 4rem;
    position: absolute;
    left: 0.2rem;
    top: -1rem;
    color: var(--highlight-color);
    opacity: 0.5;
}

/* 链接样式 */
a {
    color: var(--accent-color);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

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

a:hover {
    color: var(--primary-color);
}

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

/* 特殊效果 */
.highlight {
    background-color: var(--highlight-color);
    padding: 0 0.3rem;
    border-radius: 3px;
}

/* 打印样式 */
@media print {
    body {
        background: none;
    }

    .container {
        box-shadow: none;
        max-width: 100%;
        margin: 0;
        padding: 1rem;
    }

    .scroll-top {
        display: none;
    }

    section:hover {
        transform: none;
        box-shadow: none;
    }
}