/**!
 * 四季古风信纸-诗文鉴赏网页样式
 */

:root {
    --primary-font: "SimSun", "宋体", serif;
    --font-size-title: 2.2rem;
    --font-size-subtitle: 1.4rem;
    --font-size-content: 1.1rem;
    --line-height: 1.8;
    --content-width: 800px;
    --main-color: #8c4e1a;
    --paper-color: #f9f3e9;
    --decoration-color: #8c4e1a;
}

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

body {
    font-family: var(--primary-font);
    color: #333;
    background-color: #f5f0e6;
    line-height: var(--line-height);
    transition: background-color 0.5s;
}

/* 季节选择器 */
.season-selector {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    gap: 10px;
}

.season-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s;
}

.season-btn:hover {
    transform: scale(1.1);
}

.spring-btn { background-color: #c8e6c9; color: #2e7d32; }
.summer-btn { background-color: #b3e5fc; color: #0277bd; }
.autumn-btn { background-color: #ffcc80; color: #ef6c00; }
.winter-btn { background-color: #e3f2fd; color: #01579b; }

/* 信纸背景容器 */
.letter-paper {
    position: relative;
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 40px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" opacity="0.1"><path d="M0 0h100v100H0z" fill="none"/><path d="M20 0v100M40 0v100M60 0v100M80 0v100M0 20h100M0 40h100M0 60h100M0 80h100" stroke="%238c4e1a" stroke-width="0.5"/></svg>'),
    linear-gradient(to bottom, var(--paper-color) 0%, #f5f0e6 100%);
    background-repeat: repeat, no-repeat;
    background-size: auto, 100% 100%;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    min-height: 100vh;
    transition: all 0.5s;
}

/* 顶部背景装饰 */
.top-decoration {
    height: 120px;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    margin-bottom: 20px;
    transition: all 0.5s;
}

/* 底部背景装饰 */
.bottom-decoration {
    height: 120px;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    margin-top: 40px;
    transition: all 0.5s;
}

/* 固定标题栏 */
.sticky-header {
    position: sticky;
    top: 0;
    background-color: rgba(249, 243, 233, 0.95);
    padding: 15px 0;
    z-index: 100;
    border-bottom: 1px solid #e8d9c5;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(5px);
    transition: all 0.5s;
}

.main-title {
    font-size: var(--font-size-title);
    color: var(--main-color);
    text-align: center;
    margin-bottom: 5px;
    font-weight: bold;
    letter-spacing: 5px;
    transition: color 0.5s;
}

.subtitle {
    font-size: var(--font-size-subtitle);
    color: #a67c52;
    text-align: center;
    font-style: italic;
    transition: color 0.5s;
}

/* 语音控制区域 */
.voice-control {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.voice-btn {
    background: var(--main-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.voice-btn:hover {
    background: #a67c52;
    transform: scale(1.05);
}

/* 字体选择器 */
.font-selector {
    position: absolute;
    top: 20px;
    left: 20px;
}

.font-option {
    background: transparent;
    border: 1px solid var(--main-color);
    color: var(--main-color);
    padding: 5px 10px;
    margin-right: 5px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.3s;
}

.font-option.active {
    background: var(--main-color);
    color: white;
}

.font-option:hover {
    background: #a67c52;
    color: white;
}

/* 正文内容区域 */
.content {
    padding: 30px 0;
    font-size: var(--font-size-content);
    text-align: justify;
}

.content p {
    margin-bottom: 1.5em;
    text-indent: 2em;
}

.content .poem {
    text-align: center;
    margin: 2em 0;
    font-style: italic;
}

.content .poem .line {
    margin: 0.5em 0;
}

/* 结尾部分 */
.ending {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px dashed #d9c7a8;
}

.reference, .acknowledgment {
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: #777;
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--main-color);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
    z-index: 99;
}

.back-to-top:hover {
    background: #a67c52;
    transform: translateY(-3px);
}

/* 四季主题样式 */
.spring-theme {
    --main-color: #2e7d32;
    --paper-color: #f1f8e9;
    --decoration-color: #2e7d32;
}

.summer-theme {
    --main-color: #0277bd;
    --paper-color: #e1f5fe;
    --decoration-color: #0277bd;
}

.autumn-theme {
    --main-color: #ef6c00;
    --paper-color: #fff3e0;
    --decoration-color: #ef6c00;
}

.winter-theme {
    --main-color: #01579b;
    --paper-color: #e3f2fd;
    --decoration-color: #01579b;
}

/* 响应式设计 */
@media (max-width: 850px) {
    .letter-paper {
        padding: 0 20px;
        margin: 0 10px;
    }

    .voice-control {
        position: static;
        justify-content: center;
        margin-top: 10px;
    }

    .font-selector {
        position: static;
        text-align: center;
        margin-bottom: 10px;
    }

    .sticky-header {
        padding: 10px 0;
    }
}
