/* ═══ 纸质日记风 ═══ */
@import url('https://fonts.googleapis.com/css2?family=Ma+Shan+Zheng&family=ZCOOL+XiaoWei&family=Long+Cang&family=Zhi+Mang+Xing&family=Liu+Jian+Mao+Cao&family=ZCOOL+QingKe+HuangYou&family=ZCOOL+KuaiLe&family=Noto+Serif+SC:wght@400;700&family=Noto+Sans+SC:wght@400;700&display=swap');

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

/* ─── 背景音乐按钮 ─────────────────────────── */
.bgm-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(247,242,234,0.9);
    border: 1px solid #e8dfd0;
    box-shadow: 0 2px 8px rgba(101,80,50,0.12);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

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

.bgm-icon {
    display: block;
    width: 20px;
    height: 20px;
    color: #2c2c2c;
}

.bgm-off { opacity: 0.4; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: 'ZCOOL XiaoWei', 'PingFang SC', serif;
    color: #2c2c2c;
    background: #c8b99a;
    line-height: 1.8;
    overflow-x: hidden;
}

/* ─── 纸张容器 ─────────────────────────────── */
.paper {
    max-width: 780px;
    margin: 0 auto;
    background: #f7f2ea;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    padding: 60px 50px;
    box-shadow:
        0 2px 4px rgba(101,80,50,0.05),
        0 8px 16px rgba(101,80,50,0.08),
        0 20px 40px rgba(101,80,50,0.1),
        0 40px 80px rgba(101,80,50,0.12);
    min-height: 100vh;
}

/* ─── 字体 ─────────────────────────────────── */
.font-title { font-family: 'Ma Shan Zheng', cursive; }
.font-hand { font-family: 'Long Cang', cursive; }
.font-body { font-family: 'ZCOOL XiaoWei', serif; }

/* ─── Section ──────────────────────────────── */
.section {
    padding: 60px 0;
    border-bottom: 1px dashed rgba(180,160,130,0.5);
}

.section:last-child { border-bottom: none; }

.section-title {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 2.4rem;
    color: #2c2c2c;
    text-align: center;
    margin-bottom: 8px;
}

.section-subtitle {
    text-align: center;
    font-family: 'Long Cang', cursive;
    font-size: 1.15rem;
    color: #888;
    margin-bottom: 36px;
}

.section-desc {
    text-align: center;
    font-size: 1.05rem;
    color: #555;
    margin-bottom: 36px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 2;
}

.hl { color: #cc3333; font-weight: 600; }

/* ─── 字体预设 ─────────────────────────────── */
body.font-diary { --ft: 'Ma Shan Zheng', cursive; --fb: 'ZCOOL XiaoWei', serif; --fh: 'Long Cang', cursive; }
body.font-literary { --ft: 'Zhi Mang Xing', cursive; --fb: 'Noto Serif SC', serif; --fh: 'Liu Jian Mao Cao', cursive; }
body.font-gentle { --ft: 'ZCOOL QingKe HuangYou', cursive; --fb: 'Noto Sans SC', sans-serif; --fh: 'ZCOOL XiaoWei', serif; }
body.font-classic { --ft: 'Ma Shan Zheng', cursive; --fb: 'Noto Serif SC', serif; --fh: 'Long Cang', cursive; }
body.font-cute { --ft: 'ZCOOL KuaiLe', cursive; --fb: 'Noto Sans SC', sans-serif; --fh: 'ZCOOL QingKe HuangYou', cursive; }

body { font-family: var(--fb, 'ZCOOL XiaoWei', 'PingFang SC', serif); }
.font-title, .section-title, .hero-title, .stat-number, .fact-num, .chronicle-year, .yearly-year, .wc-name, .fun-num { font-family: var(--ft, 'Ma Shan Zheng', cursive); }
.font-hand, .section-subtitle, .origin-narrative, .quote-text, .moment-quote, .tender-quote, .ending-text, .yearly-echo-text { font-family: var(--fh, 'Long Cang', cursive); }

/* ─── 字体切换器 ───────────────────────────── */
.font-switcher {
    position: fixed;
    top: 70px;
    right: 20px;
    z-index: 999;
}

.font-switcher-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(247,242,234,0.9);
    border: 1px solid #e8dfd0;
    box-shadow: 0 2px 8px rgba(101,80,50,0.12);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2c2c2c;
    font-family: var(--ft, 'Ma Shan Zheng', cursive);
    font-size: 1rem;
    transition: transform 0.2s;
}

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

.font-panel {
    display: none;
    position: absolute;
    top: 48px;
    right: 0;
    background: rgba(247,242,234,0.97);
    border: 1px solid #e8dfd0;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(101,80,50,0.15);
    padding: 12px;
    min-width: 140px;
}

.font-panel.open { display: block; }

.font-option {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #555;
    line-height: 1.4;
    transition: background 0.15s;
}

.font-option:hover { background: rgba(200,169,110,0.15); }
.font-option.active { background: rgba(200,169,110,0.25); color: #cc3333; }

.font-option-name {
    font-weight: 600;
    display: block;
    font-size: 0.9rem;
}

.font-option-desc {
    display: block;
    font-size: 0.75rem;
    color: #999;
    margin-top: 1px;
}

/* ─── 1. 封面 ──────────────────────────────── */
.hero {
    text-align: center;
    padding: 80px 0 60px;
    border-bottom: none;
}

.hero-quote {
    font-family: 'Long Cang', cursive;
    font-size: 1.3rem;
    color: #999;
    margin-bottom: 16px;
}

.hero-title {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 4rem;
    color: #2c2c2c;
    margin-bottom: 8px;
    letter-spacing: 8px;
}

.hero-date {
    font-family: 'ZCOOL XiaoWei', serif;
    font-size: 1rem;
    color: #999;
    margin-bottom: 48px;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
    margin-bottom: 48px;
}

.stat-item { text-align: center; }

.stat-number {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 3.5rem;
    color: #cc3333;
    line-height: 1.1;
    display: block;
}

.stat-label {
    font-size: 0.95rem;
    color: #888;
    display: block;
    margin-top: 4px;
}

.scroll-hint {
    color: #bbb;
    font-size: 0.85rem;
    animation: bounce 2s infinite;
}

.scroll-arrow {
    width: 16px; height: 16px;
    border-right: 1.5px solid #bbb;
    border-bottom: 1.5px solid #bbb;
    transform: rotate(45deg);
    margin: 8px auto 0;
}

@keyframes bounce {
    0%, 100% { transform: rotate(45deg) translateY(0); }
    50% { transform: rotate(45deg) translateY(8px); }
}

/* ─── 聊天气泡 ─────────────────────────────── */
.chat-bubbles {
    max-width: 520px;
    margin: 0 auto;
}

.bubble-row {
    display: flex;
    margin-bottom: 8px;
    align-items: flex-end;
}

.bubble-row.right {
    flex-direction: row-reverse;
}

.bubble-name {
    font-size: 0.75rem;
    color: #aaa;
    margin: 0 6px;
    white-space: nowrap;
}

.bubble-time {
    font-size: 0.7rem;
    color: #ccc;
    margin: 0 4px;
    white-space: nowrap;
}

.bubble {
    max-width: 65%;
    padding: 8px 14px;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.6;
    word-break: break-all;
}

.bubble.left {
    background: #fff;
    color: #2c2c2c;
    border: 1px solid #e8e0d0;
    border-bottom-left-radius: 4px;
}

.bubble.right {
    background: #c8a96e;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.bubble.highlight {
    background: #cc3333;
    color: #fff;
    border-color: #cc3333;
}

.bubble.sticker {
    background: transparent;
    border: none;
    font-size: 0.85rem;
    color: #888;
    padding: 4px 8px;
}

/* ─── 图表卡片 ─────────────────────────────── */
.chart-card {
    background: #fdf8ef;
    border: 1px solid #e8dfd0;
    border-radius: 4px;
    padding: 24px;
    margin: 24px 0;
    box-shadow: 0 2px 8px rgba(101,80,50,0.06);
}

.chart { width: 100%; height: 380px; }
.chart-tall { height: 650px; }
.chart-sq { height: 300px; }
.chart-half { height: 260px; }

/* ─── 21秒 ────────────────────────────────── */
.reply-hero { text-align: center; margin-bottom: 32px; }

.reply-big {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 8rem;
    color: #cc3333;
    line-height: 1;
}

.reply-unit {
    font-family: 'ZCOOL XiaoWei', serif;
    font-size: 1.5rem;
    color: #888;
    margin-left: 8px;
}

.reply-sub {
    display: block;
    font-size: 0.95rem;
    color: #999;
    margin-top: 8px;
}

.reply-row {
    display: flex;
    gap: 16px;
}

.reply-row .chart-card { flex: 1; }

/* ─── 人物对比 ─────────────────────────────── */
.person-row {
    display: flex;
    gap: 24px;
    justify-content: center;
    margin-top: 24px;
}

.person-card {
    background: #fdf8ef;
    border: 1px solid #e8dfd0;
    border-radius: 4px;
    padding: 20px 32px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(101,80,50,0.06);
}

.person-name {
    font-family: 'Ma Shan Zheng', cursive;
    display: block;
    font-size: 1.2rem;
    color: #2c2c2c;
    margin-bottom: 6px;
}

.person-count {
    font-family: 'Ma Shan Zheng', cursive;
    display: block;
    font-size: 2rem;
    color: #cc3333;
    margin-bottom: 10px;
}

.person-bar {
    display: block;
    height: 5px;
    background: #e8dfd0;
    border-radius: 3px;
    overflow: hidden;
}

.person-bar-fill {
    display: block;
    height: 100%;
    background: #c8a96e;
    border-radius: 3px;
    transition: width 1.5s ease;
    width: 0;
}

/* ─── 词云 ────────────────────────────────── */
.wc-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin: 24px 0; }

.wc-col {
    background: #fdf8ef;
    border: 1px solid #e8dfd0;
    border-radius: 4px;
    padding: 16px;
    text-align: center;
}

.wc-name {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1.2rem;
    color: #cc3333;
    margin-bottom: 8px;
}

/* ─── 年度摘要卡片 ────────────────────────── */
.yearly-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 24px 0;
}

.yearly-card {
    background: #fdf8ef;
    border: 1px solid #e8dfd0;
    border-radius: 4px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(101,80,50,0.06);
}

.yearly-year {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1.8rem;
    color: #cc3333;
}

.yearly-total {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1.5rem;
    color: #2c2c2c;
    margin: 4px 0;
}

.yearly-detail {
    font-size: 0.85rem;
    color: #888;
    line-height: 1.6;
}

/* ─── 数字卡片 ─────────────────────────────── */
.fact-row {
    display: flex;
    justify-content: center;
    gap: 48px;
    flex-wrap: wrap;
    margin: 24px 0;
}

.fact { text-align: center; padding: 12px; }

.fact-num {
    font-family: 'Ma Shan Zheng', cursive;
    display: block;
    font-size: 2.2rem;
    color: #cc3333;
    line-height: 1.2;
}

.fact-label {
    display: block;
    font-size: 0.85rem;
    color: #888;
    margin-top: 4px;
    line-height: 1.4;
}

.fact-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 24px 0;
}

/* ─── 彩蛋卡片 ─────────────────────────────── */
.fun-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    max-width: 600px;
    margin: 24px auto;
}

.fun-card {
    background: #fdf8ef;
    border: 1px solid #e8dfd0;
    border-radius: 4px;
    padding: 24px 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(101,80,50,0.06);
}

.fun-num {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1.6rem;
    color: #cc3333;
    margin-bottom: 6px;
    line-height: 1.3;
}

.fun-label { font-size: 0.9rem; color: #888; }

.vs { font-size: 0.9rem; color: #bbb; font-weight: 400; }

.ms-sub {
    display: block;
    font-family: 'ZCOOL XiaoWei', serif;
    font-size: 0.8rem;
    color: #aaa;
    margin-top: 2px;
}

/* ─── 里程碑时间线 ─────────────────────────── */
.timeline {
    max-width: 520px;
    margin: 0 auto;
    position: relative;
    padding-left: 32px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e8dfd0;
}

.timeline-item {
    position: relative;
    margin-bottom: 32px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -26px;
    top: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #cc3333;
    border: 2px solid #f7f2ea;
}

.timeline-date {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1.1rem;
    color: #cc3333;
    margin-bottom: 4px;
}

.timeline-day {
    font-size: 0.8rem;
    color: #aaa;
    margin-bottom: 8px;
}

.timeline-bubbles {
    max-width: 440px;
}

/* ─── 最忙一天 ─────────────────────────────── */
.busiest-label {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1.3rem;
    color: #cc3333;
    text-align: center;
    margin-bottom: 8px;
}

.busiest-sub {
    text-align: center;
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 24px;
}

.busiest-section {
    margin-bottom: 24px;
}

.busiest-section-label {
    font-family: 'Long Cang', cursive;
    font-size: 1rem;
    color: #c8a96e;
    text-align: center;
    margin-bottom: 12px;
}

/* ─── 结尾 ────────────────────────────────── */
.ending {
    text-align: center;
    padding: 80px 0;
    border-bottom: none;
}

.ending-text {
    font-family: 'Long Cang', cursive;
    font-size: 1.8rem;
    color: #2c2c2c;
    line-height: 2;
    margin-bottom: 16px;
}

.ending-sub {
    font-family: 'ZCOOL XiaoWei', serif;
    font-size: 1rem;
    color: #aaa;
}

/* ─── 滚动动画 ─────────────────────────────── */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ─── 相识故事 ─────────────────────────────── */
.origin-narrative {
    font-family: 'Long Cang', cursive;
    font-size: 1.1rem;
    color: #555;
    line-height: 2.2;
    text-align: center;
    max-width: 560px;
    margin: 0 auto 36px;
}

.quote-cards {
    max-width: 520px;
    margin: 0 auto;
}

.quote-card {
    background: #fdf8ef;
    border: 1px solid #e8dfd0;
    border-left: 3px solid #cc3333;
    border-radius: 4px;
    padding: 20px 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(101,80,50,0.06);
}

.quote-text {
    font-family: 'Long Cang', cursive;
    font-size: 1.15rem;
    color: #2c2c2c;
    line-height: 1.8;
    margin-bottom: 8px;
}

.quote-speaker {
    font-size: 0.8rem;
    color: #cc3333;
    font-weight: 600;
}

/* ─── 五年大事记 ───────────────────────────── */
.chronicle {
    max-width: 560px;
    margin: 0 auto;
}

.chronicle-year {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 2rem;
    color: #cc3333;
    text-align: center;
    margin: 48px 0 4px;
}

.chronicle-year:first-child { margin-top: 0; }

.chronicle-year-title {
    font-family: 'Long Cang', cursive;
    font-size: 1rem;
    color: #888;
    text-align: center;
    margin-bottom: 20px;
}

.chronicle-events {
    padding-left: 20px;
    border-left: 2px solid #e8dfd0;
    margin-left: 12px;
}

.chronicle-event {
    position: relative;
    padding: 4px 0 4px 20px;
    margin-bottom: 12px;
    font-size: 0.95rem;
    color: #555;
    line-height: 1.8;
}

.chronicle-event.highlight {
    color: #2c2c2c;
    font-weight: 600;
}

.chronicle-event::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 12px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #c8a96e;
    border: 2px solid #f7f2ea;
}

.chronicle-event.highlight::before {
    background: #cc3333;
}

.chronicle-month {
    font-family: 'Long Cang', cursive;
    color: #c8a96e;
    font-size: 0.85rem;
    margin-right: 6px;
}

/* ─── 搞笑名场面 ───────────────────────────── */
.funny-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    max-width: 600px;
    margin: 24px auto;
}

.moment-card {
    background: #fdf8ef;
    border: 1px solid #e8dfd0;
    border-radius: 4px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(101,80,50,0.06);
    position: relative;
}

.moment-year {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 0.9rem;
    color: #c8a96e;
    position: absolute;
    top: 12px;
    right: 16px;
}

.moment-context {
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 8px;
}

.moment-quote {
    font-family: 'Long Cang', cursive;
    font-size: 1.1rem;
    color: #2c2c2c;
    line-height: 1.6;
}

.moment-speaker {
    font-size: 0.8rem;
    color: #cc3333;
    margin-top: 6px;
}

.moment-note {
    font-size: 0.8rem;
    color: #aaa;
    margin-top: 4px;
}

/* ─── 感动瞬间 ─────────────────────────────── */
.tender-list {
    max-width: 560px;
    margin: 0 auto;
}

.tender-item {
    padding: 24px 0;
    border-bottom: 1px dashed rgba(180,160,130,0.3);
}

.tender-item:last-child { border-bottom: none; }

.tender-year {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 0.9rem;
    color: #c8a96e;
    margin-bottom: 4px;
}

.tender-context {
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 10px;
}

.tender-quote {
    font-family: 'Long Cang', cursive;
    font-size: 1.15rem;
    color: #2c2c2c;
    line-height: 1.8;
    padding-left: 16px;
    border-left: 2px solid #cc3333;
}

.tender-speaker {
    font-size: 0.8rem;
    color: #aaa;
    margin-top: 6px;
    padding-left: 16px;
}

/* ─── 年度回声（结尾） ─────────────────────── */
.yearly-echoes {
    max-width: 520px;
    margin: 0 auto 48px;
}

.yearly-echo {
    text-align: center;
    margin-bottom: 20px;
    line-height: 2;
}

.yearly-echo-year {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1rem;
    color: #cc3333;
    margin-right: 8px;
}

.yearly-echo-text {
    font-family: 'Long Cang', cursive;
    font-size: 1rem;
    color: #555;
}

/* ─── 响应式 ──────────────────────────────── */
@media (max-width: 860px) {
    .paper { padding: 40px 24px; margin: 0; box-shadow: none; background: #f7f2ea; }
    .hero-title { font-size: 2.8rem; }
    .hero-stats { gap: 24px; }
    .stat-number { font-size: 2.4rem; }
    .section-title { font-size: 1.8rem; }
    .reply-big { font-size: 5rem; }
    .reply-row { flex-direction: column; }
    .wc-grid { grid-template-columns: 1fr; }
    .chart-sq { height: 260px; }
    .person-row { flex-direction: column; align-items: center; }
    .fact-grid { grid-template-columns: 1fr; }
    .fun-grid { grid-template-columns: 1fr; }
    .funny-grid { grid-template-columns: 1fr; }
    .yearly-cards { grid-template-columns: repeat(2, 1fr); }
    .chart-tall { height: 500px; }
    .ending-text { font-size: 1.4rem; }
    .chronicle-year { font-size: 1.6rem; }
    .font-panel { right: -10px; }
}
