/* ========== 基础重置 ========== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: #04050d;
  color: #f6efe2;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

.bg-gradient {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(130% 70% at 50% 118%, rgba(64,74,170,.38) 0%, rgba(64,74,170,0) 58%),
    radial-gradient(100% 55% at 50% -12%, rgba(38,48,120,.60) 0%, rgba(38,48,120,0) 70%),
    linear-gradient(180deg, #03040b 0%, #060919 38%, #0b0a1b 72%, #120c1e 100%);
}
#sky {
  position: fixed; inset: 0; width: 100%; height: 100%;
  display: block; z-index: 1; pointer-events: none;
}
#fireworks {
  position: fixed; inset: 0; width: 100%; height: 100%;
  display: block; z-index: 1; pointer-events: none;
}
.vignette {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  background: radial-gradient(125% 95% at 50% 42%, transparent 42%, rgba(0,0,0,.5) 100%);
}

/* ===== 滚动容器 ===== */
.pages {
  position: fixed; inset: 0; z-index: 3;
  overflow-y: scroll; overflow-x: hidden;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  overscroll-behavior-y: contain;
}
.pages::-webkit-scrollbar { display: none; }

.page {
  position: relative;
  height: 100vh; height: 100svh;
  width: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: normal;
  display: flex; flex-direction: column;
  overflow: hidden;
  padding: clamp(42px, 7.5vh, 78px) clamp(20px, 6vw, 40px);
  contain: layout paint style;
}

.page-content {
  margin: auto; width: 100%; max-width: 620px;
  display: flex; flex-direction: column;
  align-items: center; text-align: center;
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .7s ease, transform .7s cubic-bezier(.2,.8,.3,1);
}
.reveal.in { opacity: 1; transform: translateY(0); }

/* ===== 序章 · 月亮 ===== */
.moon-wrap {
  position: relative;
  width: clamp(126px, 33vw, 196px);
  aspect-ratio: 1 / 1;
  cursor: pointer;
  margin-bottom: 32px;
  animation: moonRise 2s cubic-bezier(.22,.9,.28,1) both;
  -webkit-user-select: none; user-select: none;
}
@keyframes moonRise {
  from { opacity: 0; transform: translateY(60px) scale(.72); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.halo {
  position: absolute; inset: -80%;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(255,228,165,.32) 0%,
    rgba(255,210,130,.14) 30%,
    rgba(255,200,110,.06) 52%,
    transparent 72%);
  animation: haloPulse 5.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes haloPulse {
  0%,100% { transform: scale(1);    opacity: .78; }
  50%     { transform: scale(1.13); opacity: 1; }
}

.moon {
  position: absolute; inset: 0;
  border-radius: 50%;
  overflow: hidden;
  background-image: url('moon.png');
  background-repeat: no-repeat;
  background-size: 225% auto;
  background-position: 50% 5%;
  box-shadow:
    0 0 12px  rgba(255,246,220,.95),
    0 0 36px  rgba(255,228,160,.70),
    0 0 80px  rgba(255,212,130,.40),
    0 0 150px rgba(255,200,110,.22),
    0 0 260px rgba(255,190,100,.10);
  filter: brightness(1.06) contrast(1.05) saturate(1.08);
}
.moon-wrap.pop .moon { animation: moonPop .6s cubic-bezier(.3,1.5,.5,1); }
@keyframes moonPop {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.09); }
  100% { transform: scale(1); }
}

.hint {
  font-size: 12px;
  letter-spacing: .3em; text-indent: .3em;
  color: rgba(247,213,139,.55);
  animation: hintPulse 2.8s ease-in-out infinite;
}
@keyframes hintPulse {
  0%,100% { opacity: .45; }
  50%     { opacity: .9; }
}

.swipe-tip {
  position: absolute;
  left: 50%;
  bottom: max(26px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex; flex-direction: column;
  align-items: center; gap: 6px;
  font-size: 10.5px;
  letter-spacing: .28em; text-indent: .28em;
  color: rgba(247,213,139,.4);
  animation: swipeFloat 2.4s ease-in-out infinite;
  pointer-events: none;
}
.swipe-tip svg { width: 20px; height: 20px; color: rgba(247,213,139,.55); }
@keyframes swipeFloat {
  0%,100% { transform: translateX(-50%) translateY(0);   opacity: .5; }
  50%     { transform: translateX(-50%) translateY(-6px); opacity: 1; }
}

/* ===== 通用排版 ===== */
.eyebrow {
  font-size: clamp(10px, 2.7vw, 12px);
  letter-spacing: .42em; text-indent: .42em;
  color: rgba(247,213,139,.62);
  margin-bottom: clamp(10px, 1.8vh, 18px);
}
.divider {
  display: flex; align-items: center; gap: 12px;
  width: min(240px, 62vw);
  margin: clamp(16px, 2.6vh, 28px) auto;
}
.divider span {
  flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(247,213,139,.48), transparent);
}
.divider b {
  width: 5px; height: 5px; border-radius: 50%;
  background: #ffd98a;
  box-shadow: 0 0 10px 2px rgba(255,210,130,.85);
  animation: twinkle 2.6s ease-in-out infinite;
}
@keyframes twinkle {
  0%,100% { opacity: .5; transform: scale(.85); }
  50%     { opacity: 1; transform: scale(1.15); }
}

.section-title {
  font-size: clamp(19px, 5.2vw, 26px);
  letter-spacing: .2em; text-indent: .2em;
  font-weight: 600;
  color: #ffe4a8;
  text-shadow: 0 0 20px rgba(255,205,120,.5);
  margin-bottom: clamp(12px, 2.2vh, 22px);
}
.section-sub {
  font-size: clamp(10.5px, 2.9vw, 12.5px);
  letter-spacing: .26em; text-indent: .26em;
  color: rgba(247,213,139,.45);
  margin-bottom: clamp(18px, 3.2vh, 32px);
}

/* ===== 第一章 · 计数 ===== */
.counter-num {
  font-size: clamp(58px, 19vw, 112px);
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(180deg, #fffdf3 0%, #ffe9a8 45%, #f0c25e 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 24px rgba(255,206,120,.55))
         drop-shadow(0 0 60px rgba(255,180,80,.28));
  font-variant-numeric: tabular-nums;
}
.counter-unit {
  font-size: clamp(15px, 4.6vw, 22px);
  color: rgba(255,228,165,.9);
  letter-spacing: .22em; text-indent: .22em;
  margin-top: 2px; font-weight: 500;
}
.counter-sub {
  margin-top: clamp(16px, 2.8vh, 28px);
  font-size: clamp(11.5px, 3.2vw, 14px);
  letter-spacing: .08em; line-height: 2;
  color: rgba(240,235,225,.72);
  font-variant-numeric: tabular-nums;
}
.counter-sub em { font-style: normal; color: #ffdf9a; padding: 0 3px; }

/* ===== 第二章 · 时间线（内部滚动） ===== */
.timeline-scroll {
  width: 100%; max-width: 480px;
  max-height: min(64svh, 580px);
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
  padding: 4px 6px 4px 0;
  mask-image: linear-gradient(180deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
}
.timeline-scroll::-webkit-scrollbar { display: none; }

.timeline {
  position: relative; width: 100%;
  text-align: left; padding-left: 26px;
}
.timeline::before {
  content: ''; position: absolute;
  left: 5px; top: 8px; bottom: 8px; width: 1px;
  background: linear-gradient(180deg,
    transparent, rgba(247,213,139,.42) 12%, rgba(247,213,139,.42) 88%, transparent);
}
.tl-item { position: relative; padding-bottom: clamp(18px, 2.8vh, 26px); }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute; left: -26px; top: 4px;
  width: 11px; height: 11px; border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #fff3cf, #ffca6a 60%, #e0a240 100%);
  box-shadow: 0 0 10px 2px rgba(255,200,110,.75),
              0 0 22px 3px rgba(255,180,80,.28);
}
.tl-date {
  font-size: clamp(10px, 2.8vw, 11.5px);
  letter-spacing: .18em;
  color: rgba(247,213,139,.72);
  margin-bottom: 3px;
}
.tl-title {
  font-size: clamp(13px, 3.7vw, 15.5px);
  font-weight: 600; letter-spacing: .05em;
  color: #ffe9b5; margin-bottom: 4px;
  text-shadow: 0 0 16px rgba(255,205,120,.35);
}
.tl-desc {
  font-size: clamp(11.5px, 3.1vw, 13px);
  line-height: 1.75; letter-spacing: .02em;
  color: rgba(233,229,220,.7);
}

/* ===== 第三章 · 相册（正方形） ===== */
.slideshow-shell { width: 100%; max-width: 460px; margin: 0 auto; position: relative; }
.slideshow-container {
  position: relative; width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 16px; overflow: hidden;
  border: 1px solid rgba(247,213,139,.18);
  background: rgba(8,10,24,.7);
  box-shadow: 0 12px 34px rgba(0,0,0,.5),
              inset 0 1px 0 rgba(255,235,180,.06);
  contain: layout paint;
}
.slideshow-slide {
  position: absolute; inset: 0;
  opacity: 0; transform: scale(1.06);
  transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.2, 0.8, 0.3, 1);
  display: flex; flex-direction: column; justify-content: flex-end;
  backface-visibility: hidden;
}
.slideshow-slide.active { opacity: 1; transform: scale(1); z-index: 2; }
.slideshow-slide img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.slide-overlay {
  position: relative; z-index: 2;
  padding: clamp(16px, 3.5vw, 24px);
  background: linear-gradient(to top, rgba(0,0,0,.88) 0%, rgba(0,0,0,.4) 60%, transparent 100%);
  text-align: left; width: 100%;
}
.slide-text {
  font-size: clamp(12px, 3.3vw, 13.5px);
  line-height: 1.7; letter-spacing: .03em;
  color: rgba(245,240,230,.9);
}
.slide-fallback {
  position: absolute; inset: 0;
  display: none; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px;
  color: rgba(247,213,139,.42);
  font-size: 11px; letter-spacing: .2em; text-indent: .2em;
  background:
    radial-gradient(circle at 50% 40%, rgba(255,205,120,.07), transparent 65%),
    linear-gradient(160deg, rgba(24,22,48,.7), rgba(10,11,26,.8));
  z-index: 3;
}
.slide-fallback svg { width: 34px; height: 34px; opacity: .55; }
.slide-progress {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; margin-top: clamp(14px, 2.2vh, 20px); height: 8px;
}
.slide-progress i {
  display: block; height: 3px; border-radius: 3px;
  background: rgba(247,213,139,.2);
  transition: width .3s ease, background .3s ease;
  flex: 0 0 auto; width: 12px;
}
.slide-progress i.active {
  width: 26px; background: #ffd98a;
  box-shadow: 0 0 8px rgba(255,210,130,.8);
}
.slide-hint {
  margin-top: 10px; font-size: 10px;
  letter-spacing: .26em; text-indent: .26em;
  color: rgba(247,213,139,.3);
}

/* ===== 第四章 · 月亮 ===== */
.moon-card {
  position: relative;
  width: clamp(150px, 44vw, 196px);
  aspect-ratio: 1 / 1;
  margin-bottom: clamp(16px, 2.6vh, 26px);
}
.moon-phase-wrap {
  position: relative;
  width: 100%; height: 100%;
  border-radius: 50%;
}
.moon-phase-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.moon-phase-label {
  font-size: clamp(14px, 4vw, 17px);
  letter-spacing: .3em; text-indent: .3em;
  color: #ffe4a8; margin-bottom: 10px; font-weight: 500;
}
.moon-phase-note {
  max-width: min(440px, 86vw);
  font-size: clamp(12px, 3.3vw, 14px);
  line-height: 2.05; letter-spacing: .05em;
  color: rgba(240,235,225,.78);
}
.moon-phase-note em {
  font-style: normal; color: #ffdf9a;
  text-shadow: 0 0 12px rgba(255,205,120,.5);
}

/* ===== 第五章 · 清单 ===== */
.todo-list {
  width: 100%; max-width: 480px; text-align: left;
  display: flex; flex-direction: column;
  gap: clamp(7px, 1.2vh, 11px);
}
.todo-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: clamp(10px, 1.6vh, 14px) clamp(13px, 3.2vw, 18px);
  border-radius: 11px;
  border: 1px solid rgba(247,213,139,.14);
  background: linear-gradient(150deg, rgba(30,28,60,.5), rgba(14,15,34,.66));
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  transition: border-color .3s ease, background .3s ease,
              transform .2s ease, box-shadow .3s ease;
  -webkit-tap-highlight-color: transparent;
}
.todo-item:active { transform: scale(.985); }
.todo-item.done {
  border-color: rgba(255,205,120,.5);
  background: linear-gradient(150deg, rgba(58,40,18,.55), rgba(30,20,10,.7));
  box-shadow: 0 0 22px rgba(255,190,90,.16);
}
.todo-check {
  flex: 0 0 auto; width: 18px; height: 18px; margin-top: 1px;
  border-radius: 50%;
  border: 1.5px solid rgba(247,213,139,.42);
  display: grid; place-items: center;
  transition: border-color .3s ease, background .3s ease;
}
.todo-item.done .todo-check {
  border-color: #ffd479; background: rgba(255,205,120,.2);
}
.todo-check svg {
  width: 11px; height: 11px; color: #ffd479;
  opacity: 0; transform: scale(.5);
  transition: opacity .3s ease, transform .35s cubic-bezier(.3,1.6,.5,1);
}
.todo-item.done .todo-check svg { opacity: 1; transform: scale(1); }
.todo-text {
  font-size: clamp(11.5px, 3.2vw, 13.5px);
  line-height: 1.6; letter-spacing: .02em;
  color: rgba(240,235,225,.85);
  transition: color .3s ease;
}
.todo-item.done .todo-text { color: #ffe4a8; }
.todo-progress {
  margin-top: clamp(14px, 2.4vh, 22px);
  font-size: clamp(11px, 3vw, 12.5px);
  letter-spacing: .16em;
  color: rgba(247,213,139,.62);
  font-variant-numeric: tabular-nums;
}
.todo-progress em {
  font-style: normal; color: #ffdf9a;
  font-size: 1.25em; font-weight: 600; padding: 0 2px;
}

/* ===== 第六章 · 信（内部滑动查看全部） ===== */
.letter-scroll {
  width: 100%;
  max-height: min(72svh, 620px);
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
  padding: 4px 4px 12px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  position: relative;
  mask-image: linear-gradient(180deg,
    transparent 0,
    #000 20px,
    #000 calc(100% - 20px),
    transparent 100%);
  -webkit-mask-image: linear-gradient(180deg,
    transparent 0,
    #000 20px,
    #000 calc(100% - 20px),
    transparent 100%);
}
.letter-scroll::-webkit-scrollbar { display: none; }

.letter-paper {
  position: relative;
  width: min(520px, 100%);
  flex: 0 0 auto;
  padding: clamp(26px, 5.5vw, 40px) clamp(22px, 5vw, 40px) clamp(70px, 12vw, 100px);
  border-radius: 3px; text-align: left;
  background:
    repeating-linear-gradient(to bottom,
      transparent 0, transparent 31px,
      rgba(140, 105, 58, .13) 31px, rgba(140, 105, 58, .13) 32px),
    linear-gradient(168deg, #fbf5e7 0%, #f5ebd5 55%, #efe3c8 100%);
  box-shadow: 0 22px 60px rgba(0,0,0,.62),
              0 3px 12px rgba(0,0,0,.35),
              inset 0 1px 0 rgba(255,255,255,.75);
  color: #40331e;
  transform: rotate(-.4deg);
  transform-origin: center top;
}
.letter-paper::before {
  content: ''; position: absolute;
  left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, rgba(190,120,70,.35), rgba(190,120,70,.16));
  border-radius: 3px 0 0 3px;
}
.letter-head {
  font-family: "STKaiti", "KaiTi", "楷体", "Songti SC", serif;
  font-size: clamp(16px, 4.4vw, 20px);
  font-weight: 600; letter-spacing: .1em;
  color: #5a4526;
  margin-bottom: clamp(14px, 2.4vw, 22px);
}
.letter-body {
  font-family: "STKaiti", "KaiTi", "楷体", "Songti SC", serif;
  font-size: clamp(13.5px, 3.7vw, 15.5px);
  line-height: 2.15; letter-spacing: .04em;
  color: #4a3a22;
}
.letter-body p { margin-bottom: .8em; }
.letter-body p:last-child { margin-bottom: 0; }
.letter-sign {
  font-family: "STKaiti", "KaiTi", "楷体", "Songti SC", serif;
  font-size: clamp(13px, 3.5vw, 15px);
  letter-spacing: .08em; color: #5a4526;
  text-align: right;
  margin-top: clamp(16px, 2.6vh, 24px);
}

/* ★ 盖章改为 GIF 后的样式 */
.seal {
  position: absolute;
  right: clamp(16px, 4vw, 28px);
  bottom: clamp(4px, 1vw, 12px);
  width: clamp(60px, 16vw, 86px);
  height: auto;
  transform: rotate(-9deg);
  opacity: .95;
  z-index: 10;
  pointer-events: none;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.35));
}
.seal img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
}

/* ===== 第七章 · 孔明灯 ===== */
.wish-zone {
  position: relative; width: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: clamp(30px, 6vh, 60px) 0;
}
.lantern-btn {
  position: relative; z-index: 2;
  padding: 15px 40px; border-radius: 100px;
  border: 1px solid rgba(255,205,120,.55);
  background: linear-gradient(180deg, rgba(72,40,12,.72), rgba(38,20,6,.86));
  color: #ffe4a8;
  font-size: clamp(13px, 3.6vw, 15px);
  letter-spacing: .3em; text-indent: .3em;
  font-family: inherit; cursor: pointer;
  box-shadow: 0 0 24px rgba(255,190,90,.35),
              0 6px 24px rgba(0,0,0,.5),
              inset 0 1px 0 rgba(255,235,180,.18);
  transition: transform .2s ease, box-shadow .3s ease, border-color .3s ease;
  -webkit-tap-highlight-color: transparent;
}
.lantern-btn:active {
  transform: scale(.95);
  box-shadow: 0 0 40px rgba(255,205,110,.7),
              0 6px 28px rgba(0,0,0,.55),
              inset 0 1px 0 rgba(255,235,180,.3);
}
#wishTitle, #wishSub, #wishZone {
  transition: opacity 1.1s ease, transform 1.1s ease;
}
#wishTitle.hide, #wishSub.hide, #wishZone.hide {
  opacity: 0 !important;
  transform: translateY(10px) !important;
  pointer-events: none !important;
}
.lantern {
  position: fixed; z-index: 40;
  width: 56px; height: 80px;
  pointer-events: none;
  animation: lanternRise linear forwards;
  filter: drop-shadow(0 0 16px rgba(255,190,90,.9));
}
.lantern svg { width: 100%; height: 100%; display: block; }
@keyframes lanternRise {
  0%   { transform: translate(0,0) scale(.4) rotate(0deg); opacity: 0; }
  8%   { opacity: 1; }
  88%  { opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(.3) rotate(var(--rot)); opacity: 0; }
}

/* 右上角小月亮 */
.wish-moon {
  position: absolute;
  top: max(22px, calc(env(safe-area-inset-top) + 18px));
  right: clamp(20px, 5vw, 40px);
  width: clamp(44px, 13vw, 68px);
  aspect-ratio: 1 / 1;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transform: translateY(-12px) scale(.9);
  transition: opacity 1.2s ease, transform 1.2s ease;
}
.wish-moon.in {
  opacity: 1; transform: translateY(0) scale(1);
}
.wish-moon::before {
  content: '';
  position: absolute; inset: -70%;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(255, 224, 158, .30) 0%,
    rgba(255, 205, 118, .12) 34%,
    transparent 72%);
  pointer-events: none; z-index: -1;
  animation: haloPulse 5.5s ease-in-out infinite;
}
.wish-moon-img {
  position: absolute; inset: 0;
  border-radius: 50%; overflow: hidden;
  background-image: url('moon.png');
  background-repeat: no-repeat;
  background-size: 225% auto;
  background-position: 50% 5%;
  box-shadow:
    0 0 8px   rgba(255, 235, 180, .55),
    0 0 22px  rgba(255, 215, 130, .30),
    0 0 50px  rgba(255, 195, 90, .16);
  filter: brightness(1.06) contrast(1.05) saturate(1.08);
}

/* ===== 终章 ===== */
.sign {
  font-size: clamp(12px, 3.2vw, 14px);
  letter-spacing: .24em; text-indent: .24em;
  color: rgba(247,213,139,.8);
}
.ending-note {
  margin-top: 22px;
  font-size: clamp(11px, 3vw, 12.5px);
  letter-spacing: .14em; line-height: 2;
  color: rgba(247,213,139,.4);
}
.heart-line {
  margin-top: 32px; display: flex; gap: 8px; justify-content: center;
}
.heart-line i {
  width: 6px; height: 6px; border-radius: 50%;
  background: #ff8fae;
  box-shadow: 0 0 10px rgba(255,143,174,.8);
  animation: dotPulse 2.4s ease-in-out infinite;
}
.heart-line i:nth-child(2) {
  animation-delay: .3s; background: #ffd479;
  box-shadow: 0 0 10px rgba(255,212,121,.8);
}
.heart-line i:nth-child(3) { animation-delay: .6s; }
@keyframes dotPulse {
  0%,100% { transform: scale(.7); opacity: .45; }
  50%     { transform: scale(1.3); opacity: 1; }
}

.ending-photo {
  width: min(340px, 76vw);
  margin: 0 auto clamp(18px, 3vh, 30px);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(247,213,139,.22);
  background: rgba(8,10,24,.55);
  box-shadow:
    0 14px 40px rgba(0,0,0,.55),
    0 0 40px rgba(255,205,120,.16),
    inset 0 1px 0 rgba(255,235,180,.08);
  transform: rotate(-1.2deg);
  transition: transform .6s cubic-bezier(.2,.8,.3,1),
              box-shadow .6s ease;
}
.ending-photo img {
  width: 100%;
  height: auto;
  display: block;
}
.ending-photo:hover {
  transform: rotate(0deg) scale(1.02);
  box-shadow:
    0 18px 50px rgba(0,0,0,.6),
    0 0 60px rgba(255,205,120,.28),
    inset 0 1px 0 rgba(255,235,180,.12);
}

/* ===== 爱心粒子 ===== */
.heart {
  position: fixed; z-index: 40;
  width: 18px; height: 18px;
  margin: -9px 0 0 -9px; pointer-events: none;
  animation: heartUp 2.2s cubic-bezier(.18,.72,.32,1) forwards;
}
.heart svg {
  width: 100%; height: 100%; display: block;
  filter: drop-shadow(0 0 6px currentColor);
}
@keyframes heartUp {
  0%   { opacity: 0; transform: translate(0,0) scale(.35) rotate(0deg); }
  14%  { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(1.05) rotate(var(--rot)); }
}

/* ===== 右侧进度点 ===== */
.dots {
  position: fixed;
  right: max(9px, env(safe-area-inset-right));
  top: 50%; transform: translateY(-50%);
  z-index: 45;
  display: flex; flex-direction: column;
  align-items: center; gap: 9px;
  padding: 12px 7px; border-radius: 100px;
  background: rgba(6, 8, 20, .35);
  border: 1px solid rgba(247,213,139,.1);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.dots i {
  display: block; width: 5px; height: 5px;
  border-radius: 50%;
  background: rgba(247,213,139,.25);
  transition: background .3s ease, transform .3s ease, box-shadow .3s ease;
  cursor: pointer;
}
.dots i.active {
  background: #ffd98a;
  transform: scale(1.6);
  box-shadow: 0 0 10px rgba(255,210,130,.9);
}

/* ===== 音乐按钮 ===== */
.music-btn {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 50;
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid rgba(247,213,139,.30);
  background: rgba(10,12,28,.6);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: #f3cd80;
  display: grid; place-items: center;
  padding: 0; cursor: pointer; outline: none;
  box-shadow: 0 6px 20px rgba(0,0,0,.45);
  transition: border-color .3s ease, box-shadow .3s ease,
              transform .2s ease, color .3s ease;
}
.music-btn:hover { border-color: rgba(247,213,139,.65); color: #ffdf9a; }
.music-btn:active { transform: scale(.93); }
.music-btn.playing {
  border-color: rgba(255,215,130,.85);
  color: #ffe4a8;
  box-shadow: 0 0 16px rgba(255,205,120,.55),
              0 0 40px rgba(255,200,110,.24),
              0 6px 20px rgba(0,0,0,.45);
}
.music-btn.playing svg { animation: noteBounce 1.7s ease-in-out infinite; }
@keyframes noteBounce {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-2px); }
}
.music-btn::after {
  content: ''; position: absolute; inset: -3px;
  border-radius: 50%;
  border: 1px solid rgba(255,215,130,.6);
  opacity: 0; pointer-events: none;
}
.music-btn.playing::after { animation: ringPulse 2.6s ease-out infinite; }
@keyframes ringPulse {
  0%   { opacity: .7; transform: scale(.92); }
  70%  { opacity: 0;  transform: scale(1.55); }
  100% { opacity: 0;  transform: scale(1.55); }
}

/* ===== 彩蛋 ===== */
.secret-mask {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center;
  padding: 24px;
  background: rgba(3, 4, 12, .9);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  opacity: 0; pointer-events: none;
  transition: opacity .6s ease;
}
.secret-mask.show { opacity: 1; pointer-events: auto; }
.secret-card {
  max-width: min(420px, 90vw);
  padding: clamp(28px, 5.5vw, 42px) clamp(22px, 5vw, 38px);
  border-radius: 16px;
  border: 1px solid rgba(255,215,130,.34);
  background: linear-gradient(160deg, rgba(40,32,64,.9), rgba(16,15,36,.95));
  box-shadow: 0 0 60px rgba(255,190,90,.2), 0 24px 60px rgba(0,0,0,.6);
  text-align: center;
  transform: scale(.92);
  transition: transform .6s cubic-bezier(.2,1.1,.4,1);
}
.secret-mask.show .secret-card { transform: scale(1); }
.secret-eyebrow {
  font-size: 10px; letter-spacing: .4em; text-indent: .4em;
  color: rgba(247,213,139,.55); margin-bottom: 14px;
}
.secret-title {
  font-size: clamp(17px, 4.8vw, 22px);
  letter-spacing: .16em; text-indent: .16em;
  color: #ffe4a8; font-weight: 600; margin-bottom: 18px;
  text-shadow: 0 0 22px rgba(255,205,120,.55);
}
.secret-text {
  font-size: clamp(12.5px, 3.5vw, 14.5px);
  line-height: 2.1; letter-spacing: .04em;
  color: rgba(245,238,225,.86);
}
.secret-close {
  margin-top: 24px; padding: 11px 34px;
  border-radius: 100px;
  border: 1px solid rgba(255,205,120,.45);
  background: transparent; color: #ffdf9a;
  font-family: inherit; font-size: 13px;
  letter-spacing: .24em; text-indent: .24em;
  cursor: pointer;
  transition: border-color .3s ease, background .3s ease;
  -webkit-tap-highlight-color: transparent;
}
.secret-close:hover {
  border-color: rgba(255,215,130,.85);
  background: rgba(255,205,120,.1);
}

@media (prefers-reduced-motion: reduce) {
  .halo, .hint, .swipe-tip,
  .wish-moon::before, .wish-moon,
  .music-btn.playing svg, .music-btn.playing::after,
  .heart-line i { animation: none !important; }
  .reveal { transition-duration: .01ms; }
  .slideshow-slide { transition-duration: .01ms; }
}