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

[hidden] {
    display: none !important;
}

:root {
    --bg-base: #fff7f8;
    --bg-gradient: radial-gradient(circle at 12% 15%, #ffe4ea 0%, transparent 45%),
                   radial-gradient(circle at 88% 20%, #fde8f3 0%, transparent 42%),
                   radial-gradient(circle at 50% 90%, #fff0e5 0%, transparent 50%),
                   linear-gradient(160deg, #fff8f9 0%, #fff1f4 52%, #fef6f0 100%);
    --text-main: #3b1d26;
    --text-letter: #7c1931;
    --text-muted: #8c6b74;
    --rose-500: #f43f5e;
    --rose-600: #e11d48;
    --rose-700: #be123c;
    --rose-soft: rgba(244, 63, 94, 0.1);
    --rose-border: rgba(225, 29, 72, 0.16);
    --glass-bg: rgba(255, 251, 252, 0.74);
    --glass-strong: rgba(255, 252, 253, 0.88);
    --shadow-soft: 0 18px 48px rgba(190, 18, 60, 0.08), 0 4px 14px rgba(190, 18, 60, 0.04);
    --nav-height: 58px;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    background: var(--bg-base);
    color: var(--text-main);
    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Ambient Romantic Backdrop */
.ambient-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: var(--bg-gradient);
    overflow: hidden;
}

.ambient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(75px);
    opacity: 0.55;
    will-change: transform;
}

.orb-1 {
    width: 420px;
    height: 420px;
    left: -120px;
    top: 8%;
    background: radial-gradient(circle, rgba(251, 113, 133, 0.36), transparent 70%);
    animation: float-orb-1 18s ease-in-out infinite alternate;
}

.orb-2 {
    width: 480px;
    height: 480px;
    right: -140px;
    top: 22%;
    background: radial-gradient(circle, rgba(244, 114, 182, 0.28), transparent 70%);
    animation: float-orb-2 22s ease-in-out infinite alternate;
}

.orb-3 {
    width: 380px;
    height: 380px;
    left: 35%;
    bottom: -140px;
    background: radial-gradient(circle, rgba(253, 186, 116, 0.28), transparent 70%);
    animation: float-orb-3 20s ease-in-out infinite alternate;
}

#ambient-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

@keyframes float-orb-1 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(60px, 45px) scale(1.12); }
}

@keyframes float-orb-2 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-70px, 50px) scale(1.08); }
}

@keyframes float-orb-3 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(40px, -55px) scale(1.1); }
}

/* App Shell */
.app-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* Floating Glass Navbar */
.navbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255, 249, 250, 0.72);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(225, 29, 72, 0.1);
    box-shadow: 0 4px 20px rgba(190, 18, 60, 0.04);
}

.navbar-inner {
    max-width: 1200px;
    height: var(--nav-height);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    user-select: none;
}

.brand-logo {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 6px rgba(225, 29, 72, 0.25));
    animation: heartbeat 2.4s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    14% { transform: scale(1.12); }
    28% { transform: scale(1); }
    42% { transform: scale(1.08); }
    56% { transform: scale(1); }
}

.brand-text {
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.03em;
    background: linear-gradient(120deg, #9f1239, #e11d48 55%, #f43f5e);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.menu-toggle {
    display: none;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: background-color 0.2s ease;
}

.menu-toggle:hover {
    background: var(--rose-soft);
}

.menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--rose-700);
    border-radius: 2px;
    transition: transform 0.22s ease;
}

.menu-toggle.is-open span:first-child {
    transform: translateY(3.5px) rotate(45deg);
}

.menu-toggle.is-open span:last-child {
    transform: translateY(-3.5px) rotate(-45deg);
}

/* Segmented Sliding Pill Tabs */
.nav-tabs {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(225, 29, 72, 0.12);
    box-shadow: inset 0 1px 2px rgba(190, 18, 60, 0.04);
}

.nav-pill {
    position: absolute;
    top: 4px;
    left: 4px;
    height: calc(100% - 8px);
    width: 66px;
    border-radius: 999px;
    background: linear-gradient(135deg, #fb7185, #e11d48);
    box-shadow: 0 4px 12px rgba(225, 29, 72, 0.28);
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), width 0.32s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}

.nav-tab {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 66px;
    padding: 6px 18px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 999px;
    transition: color 0.22s ease;
}

.nav-tab:hover {
    color: var(--rose-600);
}

.nav-tab.is-active {
    color: #ffffff;
    font-weight: 600;
}

.tab-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.5;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-tab.is-active .tab-dot {
    opacity: 1;
    transform: scale(1.15);
}

/* Navbar Actions & Buttons */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: scale(0.96);
}

.btn-music {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(225, 29, 72, 0.14);
    color: var(--text-main);
}

.btn-music:hover {
    background: #fff0f3;
    border-color: rgba(225, 29, 72, 0.3);
    color: var(--rose-600);
}

.btn-music.is-playing {
    background: linear-gradient(135deg, rgba(251, 113, 133, 0.16), rgba(225, 29, 72, 0.14));
    border-color: rgba(225, 29, 72, 0.35);
    color: var(--rose-600);
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.08);
}

.music-note-icon {
    width: 14px;
    height: 14px;
}

.btn-music.is-playing .music-note-icon {
    display: none;
}

.music-bars {
    display: none;
    align-items: flex-end;
    gap: 2px;
    height: 12px;
}

.btn-music.is-playing .music-bars {
    display: inline-flex;
}

.music-bars i {
    display: block;
    width: 2.5px;
    height: 4px;
    border-radius: 2px;
    background: currentColor;
    animation: eq-wave 0.9s ease-in-out infinite;
}

.music-bars i:nth-child(2) { animation-delay: 0.15s; }
.music-bars i:nth-child(3) { animation-delay: 0.3s; }
.music-bars i:nth-child(4) { animation-delay: 0.45s; }

@keyframes eq-wave {
    0%, 100% { height: 4px; }
    50% { height: 12px; }
}

.btn-gallery {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(225, 29, 72, 0.18);
    color: var(--rose-700);
}

.btn-gallery:hover {
    background: linear-gradient(135deg, #fb7185, #e11d48);
    border-color: transparent;
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(225, 29, 72, 0.25);
}

.btn-gallery .arrow-icon {
    transition: transform 0.22s ease;
}

.btn-gallery:hover .arrow-icon {
    transform: translate(2px, -2px);
}

.btn-replay {
    height: 30px;
    padding: 0 12px;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.82);
    border-color: rgba(225, 29, 72, 0.2);
    color: var(--rose-600);
}

.btn-replay:hover {
    background: #fff0f3;
    box-shadow: 0 4px 12px rgba(225, 29, 72, 0.15);
}

.btn-replay svg {
    transition: transform 0.35s ease;
}

.btn-replay:hover svg {
    transform: rotate(-45deg);
}

.btn-danger-soft {
    background: var(--rose-soft);
    color: var(--rose-600);
}

.btn-danger-soft:hover {
    background: rgba(244, 63, 94, 0.18);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
}

.btn-ghost:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-main);
}

/* Mobile Menu */
.mobile-menu {
    display: none;
    flex-direction: column;
    gap: 6px;
    padding: 10px 16px 14px;
    border-top: 1px solid rgba(225, 29, 72, 0.08);
    background: rgba(255, 250, 251, 0.96);
}

.mobile-menu.is-open {
    display: flex;
    animation: slide-down 0.22s ease;
}

@keyframes slide-down {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.mobile-tab {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 15px;
    text-decoration: none;
    color: var(--text-main);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.mobile-tab.is-active {
    color: var(--rose-600);
    background: var(--rose-soft);
    font-weight: 600;
}

/* Main Content & Tab Transition */
.main-content {
    flex: 1;
    width: 100%;
    padding: 20px 16px 40px;
}

.panel-section {
    width: 100%;
}

.panel-section.is-entered {
    animation: panel-fade-up 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes panel-fade-up {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================================================
   HE TAB: Romantic Love Tree Stage + Editorial Letter + Glass Clock
   ========================================================================= */
.stage-shell {
    max-width: 1140px;
    margin: 0 auto;
}

.stage-card {
    position: relative;
    border-radius: 28px;
    background: var(--glass-bg);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.88);
    box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    overflow: hidden;
}

.stage-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 72% 45%, rgba(255, 228, 234, 0.45), transparent 55%),
                radial-gradient(circle at 22% 55%, rgba(255, 244, 236, 0.55), transparent 55%);
    pointer-events: none;
}

.stage-topbar {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    border-bottom: 1px solid rgba(225, 29, 72, 0.08);
    background: rgba(255, 255, 255, 0.42);
}

.stage-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--rose-700);
    letter-spacing: 0.04em;
}

.badge-heart {
    display: inline-block;
    color: var(--rose-500);
    animation: heartbeat 2.4s ease-in-out infinite;
}

.stage-topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.since-tag {
    font-size: 12px;
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(225, 29, 72, 0.1);
    letter-spacing: 0.04em;
}

.stage-body {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 8px 16px 16px;
}

.stage-viewport {
    position: relative;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    overflow: hidden;
}

.stage-scaler {
    width: 1100px;
    height: 680px;
    transform-origin: top center;
    flex-shrink: 0;
}

#wrap {
    position: relative;
    width: 1100px;
    height: 680px;
    background-repeat: no-repeat;
    background-position: center;
}

#love-canvas {
    display: block;
    position: relative;
    z-index: 2;
}

.hand {
    cursor: pointer;
}

/* Pulsing Halo & Hint around Seed Heart */
.seed-halo {
    position: absolute;
    left: 530px;
    top: 326px;
    width: 0;
    height: 0;
    z-index: 1;
    pointer-events: none;
}

.halo-ring {
    position: absolute;
    left: -58px;
    top: -58px;
    width: 116px;
    height: 116px;
    border-radius: 50%;
    border: 2px solid rgba(244, 63, 94, 0.38);
    background: radial-gradient(circle, rgba(251, 113, 133, 0.18), transparent 70%);
    animation: seed-pulse 2.4s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

.halo-ring-2 {
    animation-delay: 1.2s;
}

@keyframes seed-pulse {
    0% {
        transform: scale(0.55);
        opacity: 0.9;
    }
    100% {
        transform: scale(1.65);
        opacity: 0;
    }
}

.seed-hint {
    position: absolute;
    left: 50%;
    top: 404px;
    transform: translateX(-50%);
    z-index: 3;
    pointer-events: none;
}

.seed-hint-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(225, 29, 72, 0.22);
    box-shadow: 0 8px 24px rgba(225, 29, 72, 0.14);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: var(--rose-600);
    white-space: nowrap;
    animation: float-hint 2.2s ease-in-out infinite;
}

@keyframes float-hint {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* Desktop Overlay: Editorial Love Letter + 4-Tile Clock on Left of Tree */
.he-overlay {
    position: absolute;
    left: 36px;
    top: 24px;
    bottom: 24px;
    width: min(465px, 43%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
    pointer-events: none;
}

.letter-card {
    pointer-events: auto;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 20px 24px;
    border-radius: 22px;
    background: var(--glass-strong);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(225, 29, 72, 0.14);
    box-shadow: 0 14px 34px rgba(190, 18, 60, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    scrollbar-width: thin;
    scrollbar-color: rgba(225, 29, 72, 0.2) transparent;
}

.letter-card.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.letter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
    margin-bottom: 12px;
    border-bottom: 1px dashed rgba(225, 29, 72, 0.18);
}

.letter-eyebrow {
    font-family: Georgia, "Times New Roman", serif;
    font-style: italic;
    font-size: 13px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--rose-500);
}

.letter-seal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fb7185, #e11d48);
    color: #ffffff;
    font-size: 12px;
    box-shadow: 0 3px 8px rgba(225, 29, 72, 0.25);
}

.letter-body {
    font-family: "Songti SC", "Noto Serif SC", "STSong", "PingFang SC", Georgia, serif;
    font-size: 15px;
    line-height: 1.85;
    color: var(--text-letter);
}

.say {
    margin: 0 0 8px;
    text-indent: 2em;
}

.say-salutation {
    text-indent: 0;
    font-weight: 600;
    font-size: 16px;
    color: var(--rose-700);
    margin-bottom: 10px;
}

.say-signature {
    text-indent: 0;
    text-align: right;
    font-weight: 600;
    color: var(--rose-600);
    margin-top: 10px;
    margin-bottom: 0;
}

.type-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    margin-left: 2px;
    vertical-align: -2px;
    background: var(--rose-500);
    animation: blink-cursor 0.75s step-end infinite;
}

@keyframes blink-cursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* 4-Tile Glass Clock */
.clock-card {
    pointer-events: auto;
    padding: 14px 18px 16px;
    border-radius: 20px;
    background: var(--glass-strong);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(225, 29, 72, 0.14);
    box-shadow: 0 10px 26px rgba(190, 18, 60, 0.07);
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.15s, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.15s;
}

.clock-card.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.clock-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.clock-heart {
    color: var(--rose-500);
    animation: heartbeat 2.4s ease-in-out infinite;
}

.clock-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.clock-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 6px;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 241, 244, 0.8));
    border: 1px solid rgba(225, 29, 72, 0.1);
}

.clock-num {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
    background: linear-gradient(135deg, #9f1239, #e11d48 60%, #fb7185);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.clock-unit {
    margin-top: 2px;
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.08em;
}

.canvas-error {
    text-align: center;
    margin: 40px auto;
    padding: 0 16px;
    color: var(--rose-600);
}

/* =========================================================================
   SHE TAB: Romantic Memory Gallery
   ========================================================================= */
.gallery-header {
    max-width: 720px;
    margin: 12px auto 0;
    padding: 0 16px;
    text-align: center;
}

.gallery-eyebrow {
    display: inline-block;
    font-family: Georgia, "Times New Roman", serif;
    font-style: italic;
    font-size: 13px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--rose-500);
}

.gallery-title {
    margin: 6px 0 12px;
    font-family: "Songti SC", "Noto Serif SC", "STSong", "PingFang SC", Georgia, serif;
    font-size: clamp(24px, 4vw, 32px);
    font-weight: 700;
    background: linear-gradient(120deg, #881337, #e11d48);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.gallery-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 10px;
}

.gallery-divider span {
    width: 48px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(225, 29, 72, 0.35), transparent);
}

.gallery-divider i {
    font-style: normal;
    font-size: 12px;
    color: var(--rose-500);
}

.gallery-subtitle {
    margin: 0;
    font-size: 14px;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

.view-switcher {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 18px;
    padding: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(225, 29, 72, 0.14);
    box-shadow: 0 4px 14px rgba(190, 18, 60, 0.05);
}

.view-btn {
    border: none;
    border-radius: 999px;
    padding: 7px 18px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    color: var(--text-muted);
    background: transparent;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.view-btn:hover {
    color: var(--rose-600);
}

.view-btn.is-active {
    background: linear-gradient(135deg, #fb7185, #e11d48);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(225, 29, 72, 0.25);
}

/* Mode 1: Polaroid Scrapbook + 3D Flip + Love Thread */
.polaroid-stage {
    position: relative;
    max-width: 1020px;
    margin: 0 auto;
    padding: 42px 24px 48px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 56px;
    align-items: center;
}

.love-thread {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 220px;
    height: 90px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 0;
}

.thread-path {
    animation: thread-flow 12s linear infinite;
}

@keyframes thread-flow {
    from { stroke-dashoffset: 0; }
    to { stroke-dashoffset: -120; }
}

.thread-knot {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 4;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 250, 252, 0.94);
    border: 1px solid rgba(225, 29, 72, 0.24);
    box-shadow: 0 8px 20px rgba(225, 29, 72, 0.16);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    color: var(--rose-600);
    pointer-events: none;
}

.thread-knot span {
    display: inline-block;
    text-align: center;
    animation: heartbeat 2.4s ease-in-out infinite;
}

.polaroid-card {
    position: relative;
    z-index: 2;
    perspective: 1100px;
    animation: card-stagger 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.polaroid-left {
    transform: rotate(-2.5deg);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.polaroid-right {
    transform: rotate(2.5deg);
    animation-delay: 0.12s;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.polaroid-card:hover {
    transform: rotate(0deg) translateY(-6px);
    z-index: 5;
}

@keyframes card-stagger {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
    }
    to {
        opacity: 1;
    }
}

.washi-tape {
    position: absolute;
    top: -12px;
    left: 50%;
    width: 96px;
    height: 24px;
    z-index: 6;
    background: linear-gradient(90deg, rgba(253, 164, 175, 0.65), rgba(251, 113, 133, 0.45));
    border-left: 2px dotted rgba(255, 255, 255, 0.6);
    border-right: 2px dotted rgba(255, 255, 255, 0.6);
    box-shadow: 0 2px 6px rgba(190, 18, 60, 0.08);
    backdrop-filter: blur(4px);
    pointer-events: none;
}

.tape-left {
    transform: translateX(-50%) rotate(-4deg);
}

.tape-right {
    transform: translateX(-50%) rotate(5deg);
}

.polaroid-tilt {
    transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
    transition: transform 0.25s ease-out;
    transform-style: preserve-3d;
}

.polaroid-inner {
    position: relative;
    width: 100%;
    transform-style: preserve-3d;
    transition: transform 0.72s cubic-bezier(0.22, 1, 0.36, 1);
}

.polaroid-card.is-flipped .polaroid-inner {
    transform: rotateY(180deg);
}

.polaroid-face {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 18px;
    background: #fffdfd;
    border: 1px solid rgba(255, 255, 255, 0.95);
    box-shadow: 0 18px 42px rgba(190, 18, 60, 0.1), 0 4px 12px rgba(0, 0, 0, 0.04);
}

.polaroid-front {
    padding: 16px 16px 18px;
}

.polaroid-photo-box {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    aspect-ratio: 3 / 2;
    background: #fdeef1;
    cursor: zoom-in;
}

.polaroid-photo-box img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.polaroid-photo-box:hover img {
    transform: scale(1.05);
}

.zoom-badge {
    position: absolute;
    right: 10px;
    bottom: 10px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(39, 12, 20, 0.52);
    backdrop-filter: blur(6px);
    color: #ffffff;
    font-size: 11px;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
}

.polaroid-photo-box:hover .zoom-badge {
    opacity: 1;
    transform: translateY(0);
}

.polaroid-caption-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 4px 2px;
}

.polaroid-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.polaroid-name {
    font-family: "Songti SC", "Noto Serif SC", "STSong", "PingFang SC", Georgia, serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
}

.polaroid-sub {
    font-size: 12.5px;
    color: var(--text-muted);
}

.flip-btn {
    flex-shrink: 0;
    border: 1px solid rgba(225, 29, 72, 0.18);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    color: var(--rose-600);
    background: var(--rose-soft);
    cursor: pointer;
    transition: all 0.2s ease;
}

.flip-btn:hover {
    background: linear-gradient(135deg, #fb7185, #e11d48);
    border-color: transparent;
    color: #ffffff;
    transform: translateY(-1px);
}

.polaroid-back {
    position: absolute;
    inset: 0;
    transform: rotateY(180deg);
    padding: 24px 24px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: repeating-linear-gradient(
        180deg,
        #fffbfc 0px,
        #fffbfc 31px,
        rgba(225, 29, 72, 0.08) 32px
    );
}

.postcard-stamp {
    align-self: flex-end;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border: 1.5px dashed rgba(225, 29, 72, 0.4);
    border-radius: 8px;
    color: var(--rose-600);
    transform: rotate(4deg);
}

.postcard-stamp span {
    font-size: 9px;
    letter-spacing: 0.14em;
    opacity: 0.75;
}

.postcard-stamp strong {
    font-size: 12px;
    font-weight: 700;
}

.postcard-to {
    margin: 0;
    font-family: "Songti SC", "Noto Serif SC", "STSong", Georgia, serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--rose-700);
}

.postcard-note {
    margin: 8px 0 auto;
    padding-top: 6px;
    font-family: "Songti SC", "Noto Serif SC", "STSong", "PingFang SC", Georgia, serif;
    font-size: 14.5px;
    line-height: 2;
    color: var(--text-letter);
}

.postcard-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
}

.postcard-sign {
    font-family: "Songti SC", "Noto Serif SC", "STSong", Georgia, serif;
    font-size: 14px;
    color: var(--rose-600);
    font-weight: 600;
}

/* Mode 2: Interactive Dual-Portrait Curtain */
.curtain-stage {
    max-width: 800px;
    margin: 0 auto;
    padding: 28px 20px 40px;
    text-align: center;
    animation: panel-fade-up 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.curtain-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 2;
    border-radius: 24px;
    overflow: hidden;
    background: #fdeef1;
    border: 6px solid rgba(255, 255, 255, 0.92);
    box-shadow: 0 22px 54px rgba(190, 18, 60, 0.14);
    user-select: none;
}

.curtain-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.curtain-top {
    clip-path: inset(0 calc(100% - var(--split, 50%)) 0 0);
}

.curtain-label {
    position: absolute;
    top: 16px;
    z-index: 3;
    padding: 5px 14px;
    border-radius: 999px;
    background: rgba(255, 250, 252, 0.84);
    backdrop-filter: blur(8px);
    color: var(--rose-700);
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    pointer-events: none;
}

.label-left { left: 16px; }
.label-right { right: 16px; }

.curtain-divider {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--split, 50%);
    width: 2px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 0 12px rgba(225, 29, 72, 0.45);
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 4;
}

.curtain-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fb7185, #e11d48);
    border: 3px solid #ffffff;
    box-shadow: 0 6px 20px rgba(225, 29, 72, 0.4);
    color: #ffffff;
    font-size: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.curtain-range {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: ew-resize;
    z-index: 5;
}

.curtain-hint {
    margin: 14px 0 0;
    font-size: 13px;
    color: var(--text-muted);
}

/* Photo Modal Lightbox */
.modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(39, 12, 20, 0.52);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fade-in 0.22s ease;
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 840px;
    background: #fffcfd;
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 22px;
    box-shadow: 0 28px 60px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: modal-pop 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes modal-pop {
    from { opacity: 0; transform: scale(0.94) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 22px;
    border-bottom: 1px solid rgba(225, 29, 72, 0.08);
}

.modal-heading {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.modal-date {
    font-size: 12px;
    color: var(--rose-600);
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--rose-soft);
}

.modal-close-x {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 999px;
    background: transparent;
    font-size: 20px;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.modal-close-x:hover {
    background: var(--rose-soft);
    color: var(--rose-600);
}

.modal-body {
    padding: 18px 22px;
    display: flex;
    justify-content: center;
    background: #fdf6f8;
}

.modal-body img {
    max-width: 100%;
    max-height: 68vh;
    border-radius: 14px;
    object-fit: contain;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 22px;
    border-top: 1px solid rgba(225, 29, 72, 0.08);
}

.modal-caption {
    font-size: 13px;
    color: var(--text-muted);
}

.modal-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Click Floating Heart Sparkles */
.click-heart {
    position: fixed;
    z-index: 80;
    pointer-events: none;
    color: var(--rose-500);
    font-size: 14px;
    user-select: none;
    will-change: transform, opacity;
    animation: burst-heart 0.95s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes burst-heart {
    0% {
        opacity: 0.95;
        transform: translate(-50%, -50%) scale(0.5) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% + var(--dy, -60px))) scale(1.25) rotate(var(--rot, 15deg));
    }
}

/* =========================================================================
   Responsive Layout
   ========================================================================= */
@media (max-width: 960px) {
    .he-overlay {
        position: static;
        width: 100%;
        padding: 4px 4px 8px;
    }

    .letter-card {
        flex: none;
        overflow-y: visible;
    }
}

@media (max-width: 768px) {
    .polaroid-stage {
        grid-template-columns: 1fr;
        gap: 34px;
        padding: 32px 14px 36px;
    }

    .love-thread,
    .thread-knot {
        display: none;
    }

    .polaroid-left,
    .polaroid-right {
        transform: rotate(0deg);
    }
}

@media (max-width: 640px) {
    .navbar-inner {
        padding: 0 14px;
    }

    .menu-toggle {
        display: inline-flex;
    }

    .nav-tabs {
        display: none;
    }

    .music-label {
        display: none;
    }

    .btn {
        padding: 0 12px;
    }

    .main-content {
        padding: 14px 10px 32px;
    }

    .stage-card {
        border-radius: 20px;
    }

    .stage-topbar {
        padding: 12px 14px;
    }

    .since-tag {
        display: none;
    }

    .stage-body {
        padding: 6px 10px 12px;
    }

    .letter-card {
        padding: 16px 16px;
        border-radius: 16px;
    }

    .letter-body {
        font-size: 14.5px;
        line-height: 1.8;
    }

    .clock-num {
        font-size: 20px;
    }

    .curtain-stage {
        padding: 20px 6px 28px;
    }

    .curtain-handle {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .modal-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .modal-actions {
        justify-content: flex-end;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
