/* ==========================================================================
   羽垚 · 小宇宙 ✦ 浪漫唯美恋爱纪念日样式库
   ========================================================================== */

:root {
    --bg-deep-space: #060913;
    --bg-twilight: #0d122b;
    --bg-cosmic-purple: #1f1438;
    
    /* 核心浪漫色系 */
    --gold-starlight: #fce38a;
    --gold-glow: rgba(252, 227, 138, 0.45);
    --pink-rose: #ff758c;
    --pink-blush: #ff7eb3;
    --pink-glow: rgba(255, 117, 140, 0.4);
    --purple-aurora: #a18cd1;
    --cyan-nebula: #38ef7d;

    /* 玻璃拟态与文本 */
    --card-bg: rgba(18, 23, 46, 0.58);
    --card-border: rgba(255, 255, 255, 0.12);
    --card-border-glow: rgba(255, 117, 140, 0.3);
    --card-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.45);
    
    --text-pure: #ffffff;
    --text-primary: #f0f3fc;
    --text-secondary: #b8c1ec;
    --text-muted: #8892b0;
    
    --font-serif: -apple-system, BlinkMacSystemFont, "Songti SC", "SimSun", "Noto Serif SC", serif;
    --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    
    --safe-top: env(safe-area-inset-top, 20px);
    --safe-bottom: env(safe-area-inset-bottom, 20px);
}

/* 基础重置 */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    min-height: 100%;
    background-color: var(--bg-deep-space);
    color: var(--text-primary);
    font-family: var(--font-sans);
    overflow-x: hidden;
    scroll-behavior: smooth;
    line-height: 1.6;
    user-select: none;
    -webkit-user-select: none;
}

/* 背景 Canvas 层 */
#universe-canvas,
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
}

#universe-canvas {
    z-index: 0;
}

#particle-canvas {
    z-index: 1;
}

/* 页面主内容容器 */
.page-wrapper {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: calc(var(--safe-top) + 24px) 18px calc(var(--safe-bottom) + 40px);
    display: flex;
    flex-direction: column;
    gap: 36px;
}

/* ==========================================================================
   音乐悬浮控制器 (Vinyl Record)
   ========================================================================== */
.music-widget {
    position: fixed;
    top: calc(var(--safe-top) + 12px);
    right: 18px;
    z-index: 99;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(13, 18, 43, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 6px 12px 6px 6px;
    border-radius: 40px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.music-widget:active {
    transform: scale(0.95);
}

.vinyl-record {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: radial-gradient(circle, #2a2a2a 30%, #111 70%, #000 100%);
    border: 1px solid rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    animation: spinDisc 6s linear infinite;
    animation-play-state: paused;
}

.music-widget.playing .vinyl-record {
    animation-play-state: running;
}

.record-center {
    width: 14px;
    height: 14px;
    background: linear-gradient(135deg, var(--pink-rose), var(--gold-starlight));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.music-icon {
    font-size: 8px;
    color: #fff;
    opacity: 0.9;
}

.sound-waves {
    display: flex;
    align-items: flex-end;
    gap: 2.5px;
    height: 14px;
}

.wave-bar {
    width: 2.5px;
    height: 4px;
    background: var(--pink-rose);
    border-radius: 2px;
    transition: height 0.2s ease;
}

.music-widget.playing .wave-bar:nth-child(1) { animation: soundWave 0.8s ease-in-out infinite alternate; }
.music-widget.playing .wave-bar:nth-child(2) { animation: soundWave 0.6s ease-in-out 0.2s infinite alternate; }
.music-widget.playing .wave-bar:nth-child(3) { animation: soundWave 0.9s ease-in-out 0.4s infinite alternate; }
.music-widget.playing .wave-bar:nth-child(4) { animation: soundWave 0.7s ease-in-out 0.1s infinite alternate; }

.music-tip {
    font-size: 11px;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

@keyframes spinDisc {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes soundWave {
    0% { height: 3px; background: var(--pink-rose); }
    100% { height: 14px; background: var(--gold-starlight); }
}

/* ==========================================================================
   Hero 序章区域
   ========================================================================== */
.hero-section {
    min-height: 75vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px 10px 10px;
    position: relative;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: 30px;
    background: rgba(255, 117, 140, 0.12);
    border: 1px solid rgba(255, 117, 140, 0.28);
    backdrop-filter: blur(10px);
    margin-bottom: 28px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--pink-rose);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--pink-rose);
    animation: heartPulse 1.8s ease-in-out infinite;
}

.badge-text {
    font-size: 12px;
    color: var(--pink-rose);
    letter-spacing: 1.5px;
    font-weight: 500;
}

/* 专属徽标与星轨 */
.couple-emblem {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.planet-orbit {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 1.5px dashed rgba(252, 227, 138, 0.35);
    animation: rotateOrbit 16s linear infinite;
}

.orbiting-star {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--gold-starlight);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--gold-starlight);
}

.star-1 {
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
}

.star-2 {
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--pink-rose);
    box-shadow: 0 0 12px var(--pink-rose);
}

.couple-names {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: radial-gradient(circle, rgba(35, 23, 64, 0.9) 0%, rgba(13, 18, 43, 0.8) 100%);
    border: 1px solid rgba(255, 255, 255, 0.16);
    width: 108px;
    height: 108px;
    border-radius: 50%;
    box-shadow: 0 0 30px rgba(255, 117, 140, 0.25), inset 0 0 15px rgba(252, 227, 138, 0.15);
}

.name-char {
    font-size: 28px;
    font-weight: 600;
    font-family: var(--font-serif);
    color: var(--text-pure);
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.5);
}

.heart-symbol {
    font-size: 20px;
    color: var(--pink-rose);
    text-shadow: 0 0 15px var(--pink-rose);
    animation: heartBeat 1.2s infinite;
}

.main-title {
    font-size: clamp(30px, 7vw, 42px);
    font-weight: 700;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #ffffff 10%, #ffeaa7 50%, #ff758c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 14px;
}

.love-quote {
    font-size: clamp(14px, 3.8vw, 16px);
    color: var(--text-secondary);
    line-height: 1.8;
    max-width: 480px;
    margin-bottom: 36px;
    font-family: var(--font-serif);
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.scroll-hint {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0.75;
}

.scroll-text {
    font-size: 11px;
    letter-spacing: 2px;
    color: var(--text-muted);
}

.scroll-arrow {
    width: 12px;
    height: 12px;
    border-right: 2px solid var(--gold-starlight);
    border-bottom: 2px solid var(--gold-starlight);
    transform: rotate(45deg);
    animation: bounceArrow 2s infinite;
}

/* ==========================================================================
   通关卡片与标题设计 (Glassmorphism)
   ========================================================================== */
.section-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 30px 22px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--card-shadow);
    transition: border-color 0.3s ease, transform 0.3s ease;
    position: relative;
    overflow: hidden;
}

.section-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
}

.section-header {
    text-align: center;
    margin-bottom: 24px;
}

.section-tag {
    display: inline-block;
    font-size: 10px;
    letter-spacing: 3px;
    font-weight: 700;
    color: var(--gold-starlight);
    text-transform: uppercase;
    margin-bottom: 6px;
    opacity: 0.9;
}

.section-title {
    font-size: clamp(20px, 5vw, 24px);
    color: var(--text-pure);
    font-family: var(--font-serif);
    letter-spacing: 1px;
    margin-bottom: 6px;
}

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

/* ==========================================================================
   纪念日倒数计时器 (Live Timer)
   ========================================================================== */
.countdown-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.time-card {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.time-box {
    width: 100%;
    aspect-ratio: 1 / 1.05;
    background: rgba(10, 14, 32, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.5), 0 4px 15px rgba(0,0,0,0.25);
    margin-bottom: 8px;
    position: relative;
    overflow: hidden;
}

.time-box::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
}

.time-val {
    font-size: clamp(22px, 6vw, 32px);
    font-weight: 700;
    font-family: var(--font-serif);
    color: var(--gold-starlight);
    text-shadow: 0 0 15px rgba(252, 227, 138, 0.4);
}

.time-pulse {
    color: var(--pink-rose);
    text-shadow: 0 0 15px rgba(255, 117, 140, 0.5);
    transition: transform 0.2s ease;
}

.time-label {
    font-size: 10px;
    letter-spacing: 1px;
    color: var(--text-muted);
    text-align: center;
    font-weight: 500;
}

.timer-footnote {
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    padding-top: 10px;
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.sparkle-icon {
    color: var(--gold-starlight);
    font-size: 14px;
}

/* ==========================================================================
   浪漫天文数据 (Cosmic Stats)
   ========================================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.stat-card {
    background: rgba(12, 16, 36, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: rgba(255, 117, 140, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.stat-card.full-span {
    grid-column: 1 / -1;
}

.stat-icon-wrapper {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.sunrise-icon { background: rgba(255, 154, 60, 0.15); border-color: rgba(255, 154, 60, 0.3); }
.stars-icon { background: rgba(161, 140, 209, 0.15); border-color: rgba(161, 140, 209, 0.3); }
.heart-icon { background: rgba(255, 117, 140, 0.15); border-color: rgba(255, 117, 140, 0.3); }
.breath-icon { background: rgba(56, 239, 125, 0.15); border-color: rgba(56, 239, 125, 0.3); }
.moon-icon { background: rgba(252, 227, 138, 0.15); border-color: rgba(252, 227, 138, 0.3); }

.stat-num-row {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.stat-num {
    font-size: clamp(24px, 5.5vw, 30px);
    font-weight: 700;
    font-family: var(--font-serif);
    color: var(--text-pure);
    letter-spacing: -0.5px;
}

.stat-unit {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-name {
    font-size: 15px;
    color: var(--gold-starlight);
    font-weight: 600;
    margin-bottom: 4px;
}

.stat-detail {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
}

.stat-detail strong {
    color: var(--pink-blush);
    font-weight: 600;
}

/* ==========================================================================
   专属情书与打字机效果 (Letter Section)
   ========================================================================== */
.letter-section {
    background: linear-gradient(145deg, rgba(22, 27, 54, 0.75), rgba(16, 20, 42, 0.65));
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 36px 26px;
    position: relative;
}

.letter-stamp {
    position: absolute;
    top: 20px;
    right: 20px;
    border: 1.5px dashed rgba(252, 227, 138, 0.4);
    border-radius: 8px;
    padding: 4px 10px;
    transform: rotate(6deg);
}

.letter-stamp span {
    font-size: 10px;
    letter-spacing: 2px;
    color: var(--gold-starlight);
    font-weight: 700;
}

.letter-salutation {
    font-size: 18px;
    color: var(--gold-starlight);
    font-family: var(--font-serif);
    margin-bottom: 16px;
    letter-spacing: 0.5px;
}

.typewriter-text {
    font-size: 14.5px;
    color: var(--text-primary);
    font-family: var(--font-serif);
    line-height: 2;
    min-height: 120px;
    white-space: pre-line;
    text-shadow: 0 1px 8px rgba(0,0,0,0.5);
}

.typewriter-cursor {
    display: inline-block;
    width: 2px;
    height: 16px;
    background: var(--pink-rose);
    margin-left: 2px;
    vertical-align: middle;
    animation: blinkCursor 0.8s infinite;
}

.letter-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.letter-date {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.letter-signature {
    font-size: 13px;
    color: var(--pink-blush);
    font-family: var(--font-serif);
    font-weight: 600;
}

@keyframes blinkCursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ==========================================================================
   抽取今日专属星语 (Love Oracle Card)
   ========================================================================== */
.oracle-card {
    background: radial-gradient(circle at 50% 20%, rgba(42, 28, 77, 0.7) 0%, rgba(13, 17, 39, 0.8) 100%);
    border: 1px solid rgba(252, 227, 138, 0.25);
    border-radius: 20px;
    padding: 28px 22px;
    text-align: center;
    margin-bottom: 22px;
    position: relative;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4), inset 0 0 20px rgba(161, 140, 209, 0.15);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.oracle-card.pulse-draw {
    transform: scale(0.97);
    border-color: var(--pink-rose);
}

.oracle-quote-mark {
    font-size: 40px;
    color: var(--gold-starlight);
    opacity: 0.3;
    line-height: 1;
    display: block;
    margin-bottom: -10px;
}

.oracle-text {
    font-size: clamp(14px, 4vw, 16px);
    color: var(--text-pure);
    font-family: var(--font-serif);
    line-height: 1.8;
    margin-bottom: 12px;
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.oracle-author {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.oracle-action {
    display: flex;
    justify-content: center;
}

.btn-celestial {
    background: linear-gradient(135deg, #ff758c 0%, #ff7eb3 50%, #fce38a 100%);
    border: none;
    outline: none;
    border-radius: 30px;
    padding: 13px 32px;
    color: #111425;
    font-weight: 700;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(255, 117, 140, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-celestial:active {
    transform: scale(0.95);
    box-shadow: 0 2px 10px rgba(255, 117, 140, 0.3);
}

.btn-icon {
    font-size: 12px;
}

/* ==========================================================================
   页脚
   ========================================================================== */
.page-footer {
    text-align: center;
    padding: 30px 10px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.footer-orbit {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px dashed rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: rotateOrbit 12s linear infinite;
}

.footer-heart {
    font-size: 14px;
    color: var(--pink-rose);
}

.footer-title {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: var(--text-primary);
}

.footer-domain {
    font-size: 12px;
    color: var(--gold-starlight);
    letter-spacing: 2px;
}

.footer-sub {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-serif);
}

/* ==========================================================================
   核心动画效果
   ========================================================================== */
@keyframes heartPulse {
    0%, 100% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 16px var(--pink-rose); }
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    14% { transform: scale(1.3); }
    28% { transform: scale(1); }
    42% { transform: scale(1.25); }
    70% { transform: scale(1); }
}

@keyframes rotateOrbit {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes bounceArrow {
    0%, 20%, 50%, 80%, 100% { transform: rotate(45deg) translate(0, 0); }
    40% { transform: rotate(45deg) translate(5px, 5px); }
    60% { transform: rotate(45deg) translate(3px, 3px); }
}

/* 响应式调整 */
@media (max-width: 480px) {
    .page-wrapper {
        padding-left: 14px;
        padding-right: 14px;
        gap: 28px;
    }

    .countdown-grid {
        gap: 8px;
    }

    .time-box {
        border-radius: 12px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .letter-section {
        padding: 26px 18px;
    }
}
