/* ===== 色彩与字体变量 ===== */
:root {
    --pink-50:  #fff5f7;
    --pink-100: #ffe5ec;
    --pink-200: #ffd1dc;
    --pink-300: #ffc2d1;
    --pink-400: #ffa8bf;
    --pink-500: #ff8fab;
    --pink-600: #fb6f92;
    --pink-700: #e54a76;

    --paper-bg:    #fffaf3;
    --paper-bg-2:  #fff3ea;

    --text-dark:    #5d3a4a;
    --text-medium:  #8a5a6e;
    --text-light:   #b88da0;

    --font-handwrite: 'LXGW WenKai', 'LXGW WenKai Lite', '霞鹜文楷', 'STKaiti', '楷体', 'KaiTi', serif;
    --font-poetry:    'Zhi Mang Xing', 'STXingkai', '华文行楷', 'STKaiti', '楷体', 'KaiTi', cursive;
    --font-serif:     'LXGW WenKai', 'LXGW WenKai Lite', 'Noto Serif SC', '华文楷体', 'STKaiti', serif;

    --shadow-soft:    0 10px 30px rgba(251, 111, 146, 0.18);
    --shadow-medium:  0 18px 50px rgba(251, 111, 146, 0.28);
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    height: var(--app-vh, 100dvh);
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%;
    user-select: none;
}
body {
    font-family: var(--font-serif);
    color: var(--text-dark);
    background: linear-gradient(135deg, var(--pink-50) 0%, var(--pink-100) 50%, var(--pink-200) 100%);
    background-attachment: fixed;
    overscroll-behavior: none;
}

/* ===== Screen 切换 ===== */
.screen {
    position: fixed; inset: 0;
    display: flex; align-items: center; justify-content: center;
    padding:
        env(safe-area-inset-top)
        env(safe-area-inset-right)
        env(safe-area-inset-bottom)
        env(safe-area-inset-left);
    opacity: 0; pointer-events: none;
    transition: opacity 1.2s ease;
    z-index: 1;
}
.screen.active {
    opacity: 1; pointer-events: auto;
    z-index: 10;
}

/* ===== 阶段 1：欢迎页 ===== */
#start-screen {
    background: radial-gradient(ellipse at top, var(--pink-100) 0%, var(--pink-200) 60%, var(--pink-300) 100%);
}
#start-screen::before,
#start-screen::after {
    content: ''; position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.55;
    pointer-events: none;
}
#start-screen::before {
    width: 60vw; height: 60vw;
    top: -20vw; left: -15vw;
    background: var(--pink-300);
}
#start-screen::after {
    width: 50vw; height: 50vw;
    bottom: -15vw; right: -10vw;
    background: var(--pink-400);
}

.start-inner {
    position: relative; z-index: 2;
    text-align: center;
    padding: 0 8vw;
    animation: fadeUp 1.4s ease both;
}

.title-block { margin-bottom: 12vh; }

.subtitle {
    font-family: var(--font-serif);
    font-size: clamp(13px, 3.6vw, 16px);
    color: var(--text-medium);
    letter-spacing: 0.4em;
    margin-bottom: 18px;
    opacity: 0.85;
}

.title {
    font-family: var(--font-handwrite);
    font-size: clamp(56px, 18vw, 96px);
    color: var(--text-dark);
    font-weight: normal;
    line-height: 1.1;
    margin-bottom: 24px;
    text-shadow: 0 2px 12px rgba(251, 111, 146, 0.2);
}
.title .name {
    color: var(--pink-600);
    position: relative;
    display: inline-block;
}
.title .name::after {
    content: '';
    position: absolute;
    left: 8%; right: 8%; bottom: -2px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--pink-500), transparent);
    border-radius: 2px;
    animation: shimmer 2.4s ease-in-out infinite;
}

.hint {
    font-size: clamp(14px, 4vw, 18px);
    color: var(--text-medium);
    line-height: 1.9;
    letter-spacing: 0.08em;
}

.start-btn {
    position: relative;
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px;
    padding: 18px 42px;
    font-family: var(--font-serif);
    font-size: clamp(16px, 4.6vw, 19px);
    font-weight: 500;
    letter-spacing: 0.15em;
    color: #fff;
    background: linear-gradient(135deg, var(--pink-500), var(--pink-600));
    border: none;
    border-radius: 999px;
    cursor: pointer;
    touch-action: manipulation;
    box-shadow: var(--shadow-medium);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    animation: pulse 2.4s ease-in-out infinite;
}
.start-btn::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, var(--pink-600), var(--pink-700));
    opacity: 0;
    transition: opacity 0.3s ease;
}
.start-btn:active { transform: scale(0.96); }
.start-btn:hover::before { opacity: 1; }
.start-btn > * { position: relative; z-index: 1; }
.start-btn .btn-flower {
    display: inline-block;
    animation: rotate 6s linear infinite;
}

.tip {
    margin-top: 4vh;
    font-size: clamp(11px, 3.2vw, 13px);
    color: var(--text-light);
    letter-spacing: 0.15em;
    opacity: 0.85;
}

/* ===== 阶段 2：朗读页 ===== */
#story-screen {
    background: linear-gradient(180deg, var(--pink-50) 0%, var(--pink-100) 50%, var(--pink-200) 100%);
    overflow: hidden;
}
#sakura-canvas,
#sakura-canvas-2 {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 1;
}

#hearts-layer {
    position: absolute; inset: 0;
    pointer-events: none;
    z-index: 3;
    overflow: hidden;
}
.heart-particle {
    position: absolute;
    font-size: 18px;
    color: var(--pink-600);
    pointer-events: none;
    animation: heartFloat 1.6s ease-out forwards;
    text-shadow: 0 0 6px rgba(251, 111, 146, 0.5);
    will-change: transform, opacity;
}
.heart-particle.burst {
    animation: heartBurst 1.5s cubic-bezier(.2, .8, .3, 1) forwards;
}
@keyframes heartBurst {
    0%   { opacity: 1; transform: translate(-50%, -50%) scale(0.3) rotate(-30deg); }
    50%  { opacity: 1; transform: translate(calc(-50% + var(--burst-dx, 0) * 0.7), calc(-50% + var(--burst-dy, 0) * 0.7)) scale(1.2) rotate(10deg); }
    100% { opacity: 0; transform: translate(calc(-50% + var(--burst-dx, 0)), calc(-50% + var(--burst-dy, 0))) scale(0.4) rotate(30deg); }
}

.subtitle-box {
    position: absolute;
    top: 22%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    width: 86%;
    max-width: 560px;
    padding: 24px 20px;
    text-align: center;
    pointer-events: none;
}
#subtitle-text {
    font-family: var(--font-handwrite);
    font-size: clamp(22px, 6.2vw, 30px);
    line-height: 1.85;
    color: var(--text-dark);
    letter-spacing: 0.08em;
    text-shadow:
        0 1px 0 #fff,
        0 2px 12px rgba(255, 255, 255, 0.85),
        0 0 24px rgba(255, 255, 255, 0.6);
    white-space: pre-line;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
#subtitle-text.show {
    opacity: 1;
    transform: translateY(0);
}

.audio-progress {
    position: absolute;
    bottom: calc(6vh + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    width: 70%;
    max-width: 360px;
    z-index: 5;
    padding: 14px 0;
    cursor: pointer;
    touch-action: none;
}

/* ===== 朗读页：播放/暂停按钮 ===== */
.play-toggle {
    position: absolute;
    top: calc(env(safe-area-inset-top) + 14px);
    right: calc(env(safe-area-inset-right) + 14px);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(251, 111, 146, 0.32);
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: var(--pink-600);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    touch-action: manipulation;
    z-index: 7;
    box-shadow: 0 2px 10px rgba(251, 111, 146, 0.18);
    transition: transform 0.2s ease, background 0.2s ease;
}
.play-toggle:active { transform: scale(0.9); }
.play-toggle .icon-play { display: none; }
.play-toggle.paused .icon-pause { display: none; }
.play-toggle.paused .icon-play { display: block; }

/* ===== 开场：致敬序幕（约 3.5 秒） ===== */
.prologue {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 6;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.8s ease;
}
.prologue.hide {
    opacity: 0;
}
.prologue-title {
    font-family: 'Ma Shan Zheng', var(--font-handwrite);
    font-size: clamp(48px, 13vw, 72px);
    color: var(--text-dark);
    letter-spacing: 0.25em;
    line-height: 1.2;
    margin-bottom: 28px;
    text-shadow: 0 4px 18px rgba(255, 255, 255, 0.6);
}
.prologue-title .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px) scale(0.92);
    transition: opacity 0.55s ease, transform 0.55s cubic-bezier(.34, 1.3, .64, 1);
}
.prologue-title .char.gap {
    transition-duration: 0s;
    opacity: 1;
    transform: none;
}
.prologue-title .char.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}
.prologue-sub {
    font-family: var(--font-serif);
    font-size: clamp(13px, 3.8vw, 16px);
    color: var(--text-medium);
    letter-spacing: 0.4em;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.prologue-sub.show {
    opacity: 1;
    transform: translateY(0);
}
.progress-bar {
    position: relative;
    width: 100%;
    height: 3px;
    background: rgba(251, 111, 146, 0.22);
    border-radius: 3px;
    overflow: visible;
    transition: height 0.2s ease;
}
.audio-progress.active .progress-bar {
    height: 5px;
}
#progress-fill {
    display: block;
    position: relative;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--pink-400), var(--pink-600));
    border-radius: 3px;
    transition: width 0.15s linear;
}
#progress-fill::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -7px;
    transform: translateY(-50%);
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--pink-600);
    box-shadow: 0 0 0 4px rgba(251, 111, 146, 0.18);
    opacity: 0;
    transition: opacity 0.2s ease;
}
.audio-progress.active #progress-fill::after,
.audio-progress:hover #progress-fill::after {
    opacity: 1;
}

/* ===== 阶段 3：信封 + 手写信收尾 ===== */
#ending-screen {
    background: linear-gradient(180deg, var(--pink-50) 0%, var(--pink-100) 50%, var(--pink-200) 100%);
}

.ending-wrap {
    position: relative;
    z-index: 5;
    width: 86%;
    max-width: 380px;
    height: 76vh;
    height: 76dvh;
    max-height: 560px;
}

/* ----- 信封部分已移除：朗读结束直接进入信纸 ----- */

/* ----- 信纸 ----- */
.letter-paper {
    position: absolute;
    inset: 0;
    padding: 40px 26px 56px;
    background: linear-gradient(135deg, var(--paper-bg) 0%, var(--paper-bg-2) 100%);
    border-radius: 4px;
    text-align: center;
    box-shadow:
        0 1px 1px rgba(0, 0, 0, 0.05),
        0 24px 60px rgba(251, 111, 146, 0.22),
        inset 0 0 0 1px rgba(251, 111, 146, 0.08);
    overflow: hidden;
    cursor: pointer;
    touch-action: manipulation;

    opacity: 0;
    transform: translateY(40px) scale(0.94);
    pointer-events: none;
    transition: opacity 1.2s ease, transform 1.2s cubic-bezier(.34, 1.4, .64, 1);
}
.letter-paper.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
.letter-paper::before {
    content: '';
    position: absolute;
    inset: 10px;
    border: 1px dashed rgba(251, 111, 146, 0.22);
    border-radius: 2px;
    pointer-events: none;
}

.seal {
    position: absolute;
    top: 14px; right: 18px;
    width: 42px; height: 42px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--pink-500), var(--pink-700));
    color: #fff;
    font-size: 20px;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(229, 74, 118, 0.35);
    transform: rotate(15deg);
    animation: sealBeat 2.4s ease-in-out infinite;
    z-index: 4;
    pointer-events: none;
}

.letter-head {
    font-family: var(--font-handwrite);
    font-size: clamp(22px, 6vw, 28px);
    color: var(--text-dark);
    letter-spacing: 0.2em;
    margin-bottom: 22px;
    padding-bottom: 14px;
    border-bottom: 1px dashed rgba(251, 111, 146, 0.25);
}

/* ----- 翻页书 ----- */
.page-deck {
    position: relative;
    width: 100%;
    height: 100%;
}

.page {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    text-align: center;
    padding: 6px 4px;

    opacity: 0;
    transform: translateX(60px) scale(0.96);
    pointer-events: none;
    transition: opacity 0.55s ease, transform 0.7s cubic-bezier(.4, .85, .4, 1);
}
.page.active {
    opacity: 1;
    transform: translateX(0) scale(1);
    pointer-events: auto;
}
.page.left {
    opacity: 0;
    transform: translateX(-60px) scale(0.96);
    pointer-events: none;
}

/* 第 1 页：封面 */
.page.is-cover {
    justify-content: center;
}
.cover-body {
    flex: 0 0 auto;
    margin-bottom: 48px;
}
.cover-line {
    font-family: var(--font-handwrite);
    font-size: clamp(28px, 8vw, 38px);
    color: #d03030;
    line-height: 1.9;
    letter-spacing: 0.05em;
}
.cover-line.cover-emph {
    color: #d03030;
    font-size: clamp(32px, 9vw, 44px);
}
.cover-foot {
    font-family: var(--font-serif);
    font-size: clamp(13px, 3.6vw, 15px);
    color: var(--text-medium);
    line-height: 2;
    letter-spacing: 0.3em;
}
.cover-foot .from {
    color: var(--text-light);
    font-size: clamp(12px, 3.2vw, 14px);
    margin-top: 2px;
    letter-spacing: 0.35em;
}

/* 第 2~5 页：信文 */
.page-head {
    font-family: var(--font-handwrite);
    font-size: clamp(22px, 6vw, 26px);
    color: var(--text-dark);
    letter-spacing: 0.25em;
    padding-bottom: 14px;
    margin-bottom: 18px;
    border-bottom: 1px dashed rgba(251, 111, 146, 0.25);
}
.page-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.page-body .line {
    font-family: var(--font-handwrite);
    font-size: clamp(17px, 4.8vw, 20px);
    line-height: 2.1;
    color: #1a1a1a;
    letter-spacing: 0.1em;
}
.page-body .line.emph {
    font-family: var(--font-handwrite);
    color: #1a1a1a;
    font-size: clamp(17px, 4.8vw, 20px);
    margin-top: 12px;
    letter-spacing: 0.1em;
}
.page-foot {
    font-family: var(--font-serif);
    font-size: clamp(12px, 3.2vw, 14px);
    color: var(--text-light);
    letter-spacing: 0.3em;
    padding-top: 14px;
    margin-top: 16px;
    border-top: 1px dashed rgba(251, 111, 146, 0.18);
}

/* ----- 翻页指示 ----- */
.page-indicator {
    position: absolute;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 7px;
    z-index: 3;
}
.page-indicator .dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: rgba(251, 111, 146, 0.25);
    transition: background 0.4s ease, transform 0.4s ease;
}
.page-indicator .dot.active {
    background: var(--pink-600);
    transform: scale(1.4);
}

.turn-hint { display: none; }

/* ----- 重新播放按钮 ----- */
.replay-btn {
    position: absolute;
    bottom: calc(4vh + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px;
    padding: 11px 26px;
    font-family: var(--font-serif);
    font-size: clamp(13px, 3.6vw, 15px);
    letter-spacing: 0.2em;
    color: var(--pink-600);
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(251, 111, 146, 0.3);
    border-radius: 999px;
    cursor: pointer;
    touch-action: manipulation;
    box-shadow: 0 4px 14px rgba(251, 111, 146, 0.18);

    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease, transform 0.25s ease;
    z-index: 11;
}
.replay-btn.show {
    opacity: 1;
    pointer-events: auto;
}
.replay-btn:active {
    transform: translateX(-50%) scale(0.95);
}
.replay-icon {
    display: inline-block;
    font-size: 1.2em;
    animation: rotate 6s linear infinite;
}


/* ===== 动画 keyframes ===== */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 18px 50px rgba(251, 111, 146, 0.28), 0 0 0 0 rgba(251, 111, 146, 0.45); }
    50%      { box-shadow: 0 18px 50px rgba(251, 111, 146, 0.28), 0 0 0 16px rgba(251, 111, 146, 0); }
}
@keyframes rotate {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
@keyframes shimmer {
    0%, 100% { opacity: 0.4; transform: scaleX(0.6); }
    50%      { opacity: 1;   transform: scaleX(1); }
}
@keyframes heartFloat {
    0%   { opacity: 1; transform: translate(-50%, 0) scale(0.6) rotate(-10deg); }
    20%  { opacity: 1; transform: translate(-50%, -20px) scale(1.1) rotate(5deg); }
    100% { opacity: 0; transform: translate(-50%, -90px) scale(0.5) rotate(20deg); }
}
@keyframes sealBeat {
    0%, 100% { transform: rotate(15deg) scale(1); }
    25%      { transform: rotate(15deg) scale(1.12); }
    50%      { transform: rotate(15deg) scale(0.96); }
    75%      { transform: rotate(15deg) scale(1.08); }
}
@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    25%      { transform: scale(1.15); }
    50%      { transform: scale(0.95); }
    75%      { transform: scale(1.1); }
}
@keyframes hintPulse {
    0%, 100% { opacity: 0.6; transform: translateX(-50%) translateY(0); }
    50%      { opacity: 1;   transform: translateX(-50%) translateY(-4px); }
}

/* ===== 侧边按钮（译·念） ===== */
.side-btns {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    z-index: 5;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}
.side-btns.show {
    opacity: 1;
    pointer-events: auto;
}

.side-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(251, 111, 146, 0.35);
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: var(--pink-600);
    font-family: var(--font-handwrite);
    font-size: 15px;
    letter-spacing: 0.05em;
    cursor: pointer;
    touch-action: manipulation;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    box-shadow: 0 2px 10px rgba(251, 111, 146, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
}
.side-btn:active {
    transform: scale(0.9);
    background: rgba(251, 111, 146, 0.12);
    box-shadow: 0 1px 6px rgba(251, 111, 146, 0.22);
}

/* ===== 模态弹窗 ===== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}
.modal.show {
    opacity: 1;
    pointer-events: auto;
}

.modal-mask {
    position: absolute;
    inset: 0;
    background: rgba(60, 20, 35, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-panel {
    position: relative;
    z-index: 1;
    width: 84%;
    max-width: 400px;
    max-height: 72vh;
    max-height: 72dvh;
    overflow-y: auto;
    background: linear-gradient(135deg, var(--paper-bg) 0%, var(--paper-bg-2) 100%);
    border-radius: 12px;
    padding: 36px 24px 32px;
    box-shadow: 0 24px 60px rgba(251, 111, 146, 0.3);
    transform: translateY(20px) scale(0.96);
    transition: transform 0.45s cubic-bezier(.34, 1.3, .64, 1);
}
.modal.show .modal-panel {
    transform: translateY(0) scale(1);
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 14px;
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    color: var(--text-light);
    font-size: 18px;
    cursor: pointer;
    touch-action: manipulation;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, background 0.2s ease;
}
.modal-close:active {
    color: var(--pink-600);
    background: rgba(251, 111, 146, 0.08);
}

.modal-title {
    font-family: var(--font-poetry);
    font-size: clamp(26px, 7vw, 32px);
    color: var(--pink-700);
    text-align: center;
    letter-spacing: 0.3em;
    margin-bottom: 22px;
    font-weight: normal;
}

.modal-body {
    font-family: var(--font-handwrite);
    font-size: clamp(15px, 4vw, 17px);
    line-height: 2.1;
    color: var(--text-dark);
    letter-spacing: 0.06em;
    text-align: justify;
}
.modal-body p {
    text-indent: 2em;
    margin-bottom: 12px;
}
.modal-emph {
    text-indent: 0 !important;
    text-align: center !important;
    font-family: var(--font-poetry);
    font-size: clamp(22px, 6.4vw, 28px);
    color: var(--pink-700);
    letter-spacing: 0.15em;
    margin-top: 18px;
}

/* ===== ❤ 按钮微调 ===== */
.side-btn-heart {
    font-size: 18px;
    animation: heartBeat 2s ease-in-out infinite;
}

/* ===== 相识天数弹窗 —— Love Card ===== */
.modal-panel-date {
    padding: 0;
    overflow: hidden;
    background: transparent;
    box-shadow: none;
    border-radius: 24px;
}
.modal-panel-date .modal-close {
    top: 6px;
    right: 10px;
    color: rgba(255,255,255,0.85);
    z-index: 3;
}
.modal-panel-date .modal-close:active {
    color: #fff;
    background: rgba(255,255,255,0.15);
}

.love-card {
    background: linear-gradient(135deg, #f9a8c9 0%, #f472b6 50%, #e879a0 100%);
    border-radius: 24px;
    padding: 22px 20px 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 200px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(232, 121, 160, 0.35);
}

.love-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 2;
}

/* 星星 */
.star {
    position: absolute;
    color: rgba(255,255,255,0.7);
    font-size: 10px;
    pointer-events: none;
    animation: twinkle 2s ease-in-out infinite;
    z-index: 1;
}
.star-1 { top: 12px; left: 36%; animation-delay: 0s; }
.star-2 { top: 30px; left: 44%; animation-delay: 0.7s; font-size: 7px; }
.star-3 { bottom: 16px; left: 38%; animation-delay: 1.3s; font-size: 8px; }

@keyframes twinkle {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50%      { opacity: 1;   transform: scale(1.2); }
}

/* 左侧文字 */
.love-card-left {
    flex: 1;
    z-index: 2;
    min-width: 0;
}
.love-card-title {
    font-size: clamp(16px, 4.2vw, 20px);
    font-weight: 500;
    color: #fff;
    margin-bottom: 4px;
}
.love-card-date {
    font-size: clamp(11px, 2.8vw, 13px);
    color: rgba(255,255,255,0.85);
}

/* 底部：小熊 + 爱心 */
.love-card-bottom {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 12px;
    z-index: 2;
    padding-top: 4px;
}

.bear-wrap {
    animation: bearBounce 1.8s ease-in-out infinite;
    transform-origin: bottom center;
}
@keyframes bearBounce {
    0%, 100% { transform: translateY(0) rotate(-3deg); }
    30%      { transform: translateY(-8px) rotate(2deg); }
    60%      { transform: translateY(-4px) rotate(-1deg); }
}

.hearts-group {
    display: flex;
    gap: 6px;
    align-items: flex-end;
}
.heart-item {
    animation: heartBeat 1.2s ease-in-out infinite;
}
.heart-item-2 { animation-delay: 0.4s; }
@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    25%      { transform: scale(1.25); }
    50%      { transform: scale(0.95); }
    75%      { transform: scale(1.15); }
}

/* 右侧：环形天数 */
.love-card-right {
    z-index: 2;
    flex-shrink: 0;
}
.circle-ring {
    width: 100px; height: 100px;
    border-radius: 50%;
    background: rgba(255,255,255,0.22);
    border: 3px solid rgba(255,255,255,0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    animation: ringPulse 3s ease-in-out infinite;
}
@keyframes ringPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0.25); }
    50%      { box-shadow: 0 0 0 10px rgba(255,255,255,0); }
}
.circle-num {
    font-size: 28px;
    font-weight: 500;
    color: #fff;
    line-height: 1;
    z-index: 2;
}
.circle-label {
    font-size: 13px;
    color: rgba(255,255,255,0.9);
    z-index: 2;
}

/* ===== 小屏适配 ===== */
@media (max-height: 600px) {
    .title-block  { margin-bottom: 6vh; }
    .start-btn    { padding: 14px 32px; }
    .letter-paper { padding: 32px 22px 24px; }
    .ending-wrap  { height: 88vh; height: 88dvh; }
}
