/* ========== 全局 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; }
body {
    background: radial-gradient(circle at top, #76509b, #241735 45%, #080612);
    color: white;
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
    overflow-x: hidden;
}

/* ========== 星空画布 ========== */
#canvas { position: fixed; left: 0; top: 0; width: 100%; height: 100%; z-index: 0; }

/* ========== 开场 ========== */
.opening {
    position: fixed; left: 0; top: 0; width: 100%; height: 100%; height: 100dvh;
    background: #050509; z-index: 99;
    display: flex; align-items: center; justify-content: center; flex-direction: column;
    transition: all 1.8s ease;
}
.opening.hide { opacity: 0; pointer-events: none; }

.open-title {
    font-family: 'ZCOOL XiaoWei', serif; font-size: 40px; letter-spacing: 10px;
    background: linear-gradient(90deg, #fff, #ffd0e6, #fff);
    -webkit-background-clip: text; color: transparent; animation: fadeIn 2s;
}
.open-sub { margin-top: 20px; font-size: 13px; letter-spacing: 5px; opacity: .6; }
.open-date { margin-top: 25px; font-size: 16px; letter-spacing: 3px; color: #ffd5e8; }
.start-btn {
    margin-top: 70px; padding: 15px 45px; border-radius: 50px;
    border: 1px solid rgba(255,255,255,.4); background: rgba(255,255,255,.1);
    color: white; font-size: 14px; letter-spacing: 4px; backdrop-filter: blur(10px);
    cursor: pointer; transition: all .3s;
}
.start-btn:hover { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.6); }

/* ========== 卡片 ========== */
.page {
    position: relative; z-index: 2; width: 100%; min-height: 100vh; min-height: 100dvh;
    padding: 15px 0 70px; display: flex; justify-content: center;
}
.card {
    width: 92%; max-width: 430px; padding: 28px; border-radius: 30px;
    background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25);
    backdrop-filter: blur(25px);
    box-shadow: 0 20px 70px rgba(0,0,0,.45), 0 0 80px rgba(255,117,173,.08);
    opacity: 0; transform: translateY(60px); visibility: hidden;
    transition: opacity .6s ease .2s, transform .6s ease .2s;
    will-change: opacity, transform;
}
.card.show { opacity: 1; transform: translateY(0); visibility: visible; }

/* ========== 标题区 ========== */
.small-title { font-size: 12px; letter-spacing: 6px; opacity: .65; text-align: center; }
.names {
    margin-top: 14px; text-align: center; font-family: 'ZCOOL XiaoWei', serif;
    font-size: 36px; letter-spacing: 10px;
    background: linear-gradient(90deg, #fff, #ffd0e6, #fff);
    -webkit-background-clip: text; color: transparent;
}
.divider { width: 90px; height: 2px; margin: 15px auto; background: linear-gradient(90deg, transparent, #ffb5d7, transparent); }
.date { text-align: center; font-size: 18px; letter-spacing: 3px; color: #ffd5e8; }

/* ========== 照片轮播 ========== */
.photo-wrap { margin-top: 20px; text-align: center; }
.photo-slider { position: relative; display: inline-block; width: 100%; aspect-ratio: 3/4; }
.photo-frame {
    border-radius: 20px; overflow: hidden;
    border: 2px solid rgba(255,255,255,.25);
    box-shadow: 0 0 40px rgba(255,117,173,.18), 0 8px 32px rgba(0,0,0,.3);
    width: 100%; height: 100%;
}
.photo-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* 导航箭头 */
.photo-nav {
    position: absolute; top: 50%; left: 0; right: 0; transform: translateY(-50%);
    display: flex; justify-content: space-between; padding: 0 8px;
    pointer-events: none; opacity: 0; transition: opacity .4s;
}
.photo-nav.show { opacity: 1; pointer-events: auto; }
.nav-arrow {
    width: 36px; height: 36px; border-radius: 50%;
    border: 1px solid rgba(255,255,255,.4); background: rgba(0,0,0,.35);
    color: white; font-size: 16px; cursor: pointer;
    backdrop-filter: blur(8px); transition: all .3s;
    display: flex; align-items: center; justify-content: center;
}
.nav-arrow:hover { background: rgba(0,0,0,.55); border-color: rgba(255,255,255,.6); }
.nav-arrow:active { transform: scale(.9); }

/* 指示圆点 */
.photo-dots {
    margin-top: 12px; display: flex; justify-content: center; gap: 8px;
    opacity: 0; transition: opacity .4s;
}
.photo-dots.show { opacity: 1; }
.photo-dots .dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: rgba(255,255,255,.35); transition: all .3s; cursor: pointer;
}
.photo-dots .dot.active { background: #ff75ad; width: 20px; border-radius: 4px; }

/* ========== 爱情语录 ========== */
.quote {
    margin: 10px 0 0; text-align: center; font-family: 'ZCOOL XiaoWei', serif;
    font-size: 17px; line-height: 1.8; color: rgba(255,255,255,.72);
    letter-spacing: 2px; font-style: italic;
}

/* ========== 天数计数器 ========== */
.day-counter { margin-top: 15px; text-align: center; }
.day-counter .label { font-size: 13px; letter-spacing: 4px; opacity: .55; }
.day-counter .num {
    font-family: 'Cormorant Garamond', serif;
    font-size: 58px; font-weight: 600; color: #ffd1e6;
    display: block; line-height: 1; margin: 8px 0;
    /* 防止数字宽度变化导致布局抖动 */
    min-width: 280px; font-variant-numeric: tabular-nums;
}
.day-counter .unit { font-size: 14px; letter-spacing: 6px; opacity: .6; }

/* ========== 心形 ========== */
.heart-section { margin-top: 34px; }
.heart-css {
    width: 38px; height: 38px; margin: 0 auto 24px;
    background: #ff75ad; transform: rotate(-45deg);
    animation: beat 1.5s infinite; position: relative;
}
.heart-css::before, .heart-css::after {
    content: ""; position: absolute; width: 38px; height: 38px;
    background: #ff75ad; border-radius: 50%;
}
.heart-css::before { top: -19px; }
.heart-css::after { left: 19px; }

.love-msg {
    text-align: center; font-size: 13px; line-height: 2.2;
    color: rgba(255,255,255,.7); letter-spacing: 2px;
}

/* ========== 里程碑 ========== */
.milestones { margin-top: 15px; display: flex; justify-content: space-around; }
.milestones .m-item { text-align: center; }
.milestones .m-year {
    display: block; font-family: 'Cormorant Garamond', serif;
    font-size: 24px; font-weight: 600; color: #ffd1e5;
}
.milestones .m-desc { font-size: 11px; letter-spacing: 2px; opacity: .55; margin-top: 4px; }

.footer { margin-top: 20px; text-align: center; font-size: 12px; letter-spacing: 3px; opacity: .5; }

/* ========== 浮动爱心 ========== */
.floating-hearts { position: fixed; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; }
.floating-hearts span {
    position: absolute; bottom: -30px; color: #ff75ad; font-size: 16px;
    animation: floatUp 6s infinite; opacity: 0;
}
.floating-hearts span:nth-child(1) { left: 10%; animation-delay: 0s; }
.floating-hearts span:nth-child(2) { left: 25%; animation-delay: 1.5s; font-size: 12px; }
.floating-hearts span:nth-child(3) { left: 40%; animation-delay: 3s; font-size: 20px; }
.floating-hearts span:nth-child(4) { left: 55%; animation-delay: .8s; font-size: 14px; }
.floating-hearts span:nth-child(5) { left: 70%; animation-delay: 2.2s; }
.floating-hearts span:nth-child(6) { left: 85%; animation-delay: 4s; font-size: 11px; }
.floating-hearts span:nth-child(7) { left: 18%; animation-delay: 3.5s; font-size: 18px; }
.floating-hearts span:nth-child(8) { left: 62%; animation-delay: 5s; font-size: 13px; }

/* ========== 音乐按钮 ========== */
.music-btn {
    position: fixed; top: 20px; right: 20px; z-index: 100;
    width: 44px; height: 44px; border-radius: 50%;
    border: 1px solid rgba(255,255,255,.4);
    background: rgba(255,255,255,.12); backdrop-filter: blur(10px);
    color: white; font-size: 20px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all .3s;
}
.music-btn:hover { background: rgba(255,255,255,.25); border-color: rgba(255,255,255,.6); }
.music-btn.playing { animation: musicPulse 2s infinite; }

/* ========== 动画 ========== */
@keyframes floatUp {
    0%   { transform: translateY(0) rotate(0deg) scale(0); opacity: 0; }
    10%  { opacity: .9; }
    40%  { opacity: .6; }
    80%  { opacity: 0; }
    100% { transform: translateY(-100vh) rotate(30deg) scale(1.2); opacity: 0; }
}
@keyframes beat { 50% { scale: 1.2; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; } }
@keyframes musicPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(255,255,255,.2); }
    50%      { box-shadow: 0 0 20px rgba(255,255,255,.5); }
}
