@import url('../fonts/NotoSerifSC.css');

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

:root {
    --primary: #5D4E37;
    --primary-light: #7A6A53;
    --bg-warm: #FAF8F5;
    --paper: #F2EFE9;
    --text-dark: #3D3529;
    --text-medium: #5D4E37;
    --text-light: #8B7D6B;
    --accent-red: #8B4513;
    --accent-gold: #A0826D;
    --border-color: #D4C8B8;
}

body {
    font-family: "KaiTi", "KaiTi_GB2312", "STKaiti", "楷体", serif;
    background: linear-gradient(135deg, #E8E0D5 0%, #D4C8B8 50%, #C4B8A8 100%);
    min-height: 100vh;
    padding: 15px;
    line-height: 1.8;
}

/* 返回首页 */
.back-home {
    position: fixed;
    top: 20px;
    left: 20px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 14px;
    z-index: 100;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.2s;
    font-family: "Noto Serif SC", serif;
}
.back-home:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

/* 打印按钮 */
.print-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 14px;
    z-index: 100;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: all 0.2s;
}
.print-btn:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.main-container {
    max-width: 850px;
    margin: 0 auto;
    background: linear-gradient(180deg, var(--bg-warm) 0%, var(--paper) 100%);
    border-radius: 8px;
    box-shadow:
        0 25px 80px rgba(0,0,0,0.18),
        0 0 0 1px rgba(139, 115, 85, 0.12),
        inset 0 0 100px rgba(139, 115, 85, 0.06);
    overflow: hidden;
    position: relative;
}

.main-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 3px,
            rgba(139, 115, 85, 0.03) 3px,
            rgba(139, 115, 85, 0.03) 6px
        );
    pointer-events: none;
    z-index: 1;
}

.mountains {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 180px;
    background: linear-gradient(
        to top,
        rgba(93, 78, 55, 0.2) 0%,
        rgba(122, 106, 83, 0.1) 50%,
        transparent 100%
    );
    clip-path: polygon(
        0% 100%, 0% 70%, 10% 50%, 22% 65%, 35% 45%,
        48% 60%, 60% 40%, 72% 55%, 85% 35%, 100% 50%, 100% 100%
    );
    z-index: 0;
}

.mountains-2 {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(
        to top,
        rgba(61, 53, 41, 0.28) 0%,
        rgba(93, 78, 55, 0.15) 60%,
        transparent 100%
    );
    clip-path: polygon(
        0% 100%, 0% 80%, 15% 60%, 30% 75%, 45% 55%,
        60% 70%, 75% 50%, 90% 65%, 100% 55%, 100% 100%
    );
    z-index: 0;
}

.content {
    position: relative;
    z-index: 10;
    padding: 30px 25px;
}

.header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
    padding-top: 10px;
}

.seal {
    position: absolute;
    top: 0;
    right: 10px;
    width: 50px;
    height: 50px;
    background: var(--accent-red);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(139, 69, 19, 0.35);
    transform: rotate(3deg);
}

.seal span {
    color: white;
    font-size: 22px;
    font-family: "Ma Shan Zheng", cursive;
    writing-mode: vertical-rl;
    letter-spacing: 3px;
}

.title {
    font-family: "Ma Shan Zheng", cursive;
    font-size: clamp(56px, 12vw, 80px);
    color: var(--text-dark);
    margin-bottom: 8px;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.12);
    letter-spacing: 20px;
    padding-left: 20px;
}

.author {
    font-size: clamp(16px, 4vw, 20px);
    color: var(--text-medium);
    letter-spacing: 8px;
    font-weight: 600;
}

.author::before,
.author::after {
    content: '◆';
    margin: 0 12px;
    color: var(--accent-gold);
    font-size: 12px;
}

.text-section {
    background: linear-gradient(135deg, rgba(255,255,255,0.7) 0%, rgba(250,248,245,0.6) 100%);
    border-radius: 12px;
    padding: 30px 35px;
    margin-bottom: 18px;
    border: 1px solid var(--border-color);
    box-shadow: inset 0 2px 10px rgba(139, 115, 85, 0.06);
}

.paragraph {
    margin-bottom: 20px;
    text-indent: 2em;
}

.paragraph:last-child {
    margin-bottom: 0;
}

.paragraph p {
    font-family: "KaiTi", "KaiTi_GB2312", "STKaiti", "楷体", serif;
    font-size: clamp(16px, 3.5vw, 20px);
    color: var(--text-dark);
    line-height: 2;
    text-align: justify;
    letter-spacing: 1px;
}

.divider {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, var(--accent-gold) 50%, transparent 100%);
    margin: 25px auto;
    border-radius: 2px;
}

.info-section {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 18px;
}

.info-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.8) 0%, rgba(242,239,233,0.7) 100%);
    border-radius: 10px;
    padding: 22px 25px;
    border-left: 5px solid var(--primary-light);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.info-card:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.info-card h3 {
    font-size: 17px;
    color: var(--primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}

.info-card h3::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    background: var(--accent-red);
    border-radius: 2px;
    transform: rotate(45deg);
}

.info-card p {
    font-size: 15px;
    color: var(--text-medium);
    line-height: 2;
    text-align: justify;
    text-indent: 2em;
}

.explanation-section {
    background: linear-gradient(135deg, rgba(255,255,255,0.8) 0%, rgba(242,239,233,0.7) 100%);
    border-radius: 10px;
    padding: 25px;
    border-left: 5px solid var(--accent-gold);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 18px;
}

.explanation-section h3 {
    font-size: 17px;
    color: var(--primary);
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}

.explanation-section h3::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    background: var(--accent-gold);
    border-radius: 2px;
    transform: rotate(45deg);
}

.explanation-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.explanation-item {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    padding: 15px;
    background: rgba(255,255,255,0.6);
    border-radius: 8px;
    border: 1px solid rgba(139, 115, 85, 0.12);
}

.explanation-item .line-num {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(93, 78, 55, 0.3);
}

.explanation-item .line-text {
    font-size: 16px;
    color: var(--text-dark);
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: 1px;
}

.explanation-item .line-meaning {
    font-size: 14px;
    color: var(--text-medium);
    line-height: 1.9;
    text-align: justify;
}

.corner {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 2px solid var(--border-color);
    z-index: 5;
}

.corner-tl {
    top: 12px;
    left: 12px;
    border-right: none;
    border-bottom: none;
}

.corner-br {
    bottom: 12px;
    right: 12px;
    border-left: none;
    border-top: none;
}

.footer {
    text-align: center;
    padding: 18px;
    font-size: 13px;
    color: var(--text-light);
    border-top: 1px solid var(--border-color);
    background: rgba(255,255,255,0.5);
    letter-spacing: 3px;
}

.petal {
    position: absolute;
    width: 12px;
    height: 8px;
    background: linear-gradient(135deg, #C4B8A8 0%, #D4C8B8 50%, #C4B8A8 100%);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    opacity: 0.5;
    pointer-events: none;
}

.petal-1 { top: 12%; left: 8%; transform: rotate(-30deg); animation: fall 12s ease-in-out infinite; }
.petal-2 { top: 22%; left: 88%; transform: rotate(20deg); animation: fall 14s ease-in-out infinite 3s; }
.petal-3 { top: 38%; left: 3%; transform: rotate(-15deg); animation: fall 11s ease-in-out infinite 5s; }
.petal-4 { top: 55%; left: 92%; transform: rotate(45deg); animation: fall 13s ease-in-out infinite 2s; }

@keyframes fall {
    0%, 100% { transform: translateY(0) rotate(var(--rot, 0deg)); opacity: 0.5; }
    50% { transform: translateY(25px) rotate(calc(var(--rot, 0deg) + 12deg)); opacity: 0.3; }
}

@media print {
    body {
        background: white !important;
        padding: 0 !important;
    }
    .back-home, .print-btn {
        display: none !important;
    }
    .main-container {
        box-shadow: none !important;
        border-radius: 0 !important;
        max-width: 100% !important;
        background: white !important;
    }
    .content {
        padding: 20px !important;
    }
    .info-section, .explanation-section {
        display: block !important;
        margin-bottom: 30px !important;
    }
    .info-card {
        box-shadow: none !important;
        background: white !important;
        border: 1px solid #eee !important;
        margin-bottom: 20px !important;
        page-break-inside: avoid;
    }
    .info-card:last-child {
        margin-bottom: 0 !important;
    }
    .explanation-section {
        background: white !important;
        border: 1px solid #eee !important;
        page-break-inside: avoid;
    }
    .explanation-item {
        background: white !important;
        border-bottom: 1px solid #eee !important;
        page-break-inside: avoid;
    }
    .footer {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .content {
        padding: 25px 18px;
    }
    .text-section {
        padding: 25px 20px;
    }
    .info-card {
        padding: 18px 20px;
    }
    .explanation-item {
        padding: 12px;
    }
}
