/* ============== 主题变量 ============== */
:root{
  --bg-0:        #160a05;
  --bg-1:        #2a1409;
  --bg-2:        #3d1d0e;
  --ink:         #fff3df;
  --ink-soft:    #e8cfa8;
  --ink-dim:     #b8916b;
  --gold:        #e8b478;
  --gold-bright: #f3c98a;
  --rose:        #e87d6a;
  --rose-bright: #ff9b7d;
  --amber-glow:  rgba(255,170,90,0.55);
  --serif-en:    "Cormorant Garamond", "EB Garamond", Georgia, serif;
  --serif-cn:    "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --shadow-warm: 0 30px 80px rgba(120,40,10,0.45);
}

*{ box-sizing: border-box; margin: 0; padding: 0; }
html, body{
  background: var(--bg-0);
  color: var(--ink);
  font-family: var(--serif-cn);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
html{ scroll-behavior: auto; } /* 用 Lenis 接管 */
img{ display: block; max-width: 100%; }
button{ font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection{ background: var(--rose); color: var(--ink); }

/* ============== 入场门 ============== */
.gate{
  position: fixed; inset: 0; z-index: 100;
  background:
    radial-gradient(ellipse at center, rgba(232,180,120,0.18), transparent 65%),
    var(--bg-0);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 1.4s ease, visibility 1.4s ease;
  overflow: hidden;
}
.gate.gone{ opacity: 0; visibility: hidden; pointer-events: none; }
.gate-inner{ text-align: center; padding: 20px; max-width: 900px; }

.hello-svg{
  width: min(720px, 92vw);
  height: auto;
  display: block;
  margin: 0 auto 36px;
}
.hello-svg .heart,
.hello-svg .hl{
  /* dasharray/offset 由 JS 设置 */
  filter: drop-shadow(0 0 14px rgba(255,170,90,0.35));
}
.hello-svg .cn-text{
  letter-spacing: 14px;
  opacity: 0;
  /* JS 用 clip-path 做擦写 */
}
.hello-svg .sp{
  opacity: 0;
  transform-origin: center;
  transform-box: fill-box;
}
.hello-svg .sparkle-twinkle{
  animation: twinkle 2.8s ease-in-out infinite;
}
@keyframes twinkle{
  0%,100% { opacity: 0.5; transform: scale(0.8); }
  50%     { opacity: 1;   transform: scale(1.15); }
}
@media (max-width: 640px){
  .hello-svg{ width: 90vw; margin-bottom: 22px; }
}

.gate-btn{
  font-family: var(--serif-cn);
  font-size: clamp(18px, 3vw, 26px);
  letter-spacing: .25em;
  padding: 18px 42px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  color: var(--ink);
  background: linear-gradient(135deg, rgba(232,125,106,0.12), rgba(232,180,120,0.08));
  backdrop-filter: blur(6px);
  transition: transform .4s ease, background .4s ease, box-shadow .4s ease;
  box-shadow: 0 0 0 0 var(--amber-glow);
  animation: breathe 3s ease-in-out infinite;
  opacity: 0;
}
.gate-btn:hover{
  transform: translateY(-2px) scale(1.02);
  background: linear-gradient(135deg, rgba(232,125,106,0.22), rgba(232,180,120,0.18));
  box-shadow: 0 0 60px 0 var(--amber-glow);
}
.gate-hint{
  margin-top: 28px;
  color: var(--ink-dim);
  font-size: 12px; letter-spacing: .3em;
}
@keyframes breathe{
  0%,100%{ box-shadow: 0 0 0 0 rgba(232,180,120,0.18); }
  50%   { box-shadow: 0 0 80px 0 rgba(232,180,120,0.35); }
}

/* ============== 静音按钮 / 进度条 ============== */
.mute{
  position: fixed; top: 22px; right: 22px; z-index: 50;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(232,180,120,0.5);
  background: rgba(20,10,5,0.45);
  backdrop-filter: blur(8px);
  color: var(--gold);
  font-size: 18px;
  display: grid; place-items: center;
  transition: opacity .6s ease, transform .3s ease;
  opacity: 0;
}
.mute.show{ opacity: 1; }
.mute:hover{ transform: scale(1.08); }
.mute .mute-off{ display: none; }
.mute.muted .mute-on{ display: none; }
.mute.muted .mute-off{ display: inline; }

.progress{
  position: fixed; top: 0; left: 0; height: 2px; width: 0;
  background: linear-gradient(90deg, var(--rose), var(--gold-bright));
  z-index: 60;
  box-shadow: 0 0 12px var(--amber-glow);
}

/* ============== 通用幕样式 ============== */
.act{ position: relative; }

.act-title{
  font-family: var(--serif-cn);
  font-weight: 500;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1.35;
  text-align: center;
  letter-spacing: 0.1em;
  color: var(--ink);
}
.act-title em{
  font-family: var(--serif-en);
  font-style: italic;
  background: linear-gradient(120deg, var(--gold-bright), var(--rose-bright));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: 0;
  font-weight: 500;
}

/* ============== 幕一 序幕 ============== */
.act-prologue{
  min-height: 100vh;
  display: grid; place-items: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 60%, rgba(232,125,106,0.18) 0%, transparent 60%),
    radial-gradient(ellipse at 30% 30%, rgba(232,180,120,0.12) 0%, transparent 55%),
    linear-gradient(180deg, var(--bg-0), var(--bg-1));
}
.bg-glow{
  position: absolute; inset: -10%;
  background: radial-gradient(circle at 50% 55%, rgba(255,170,90,0.18), transparent 50%);
  filter: blur(40px);
  animation: drift 14s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes drift{
  from{ transform: translate3d(-2%, -1%, 0) scale(1); }
  to  { transform: translate3d( 3%,  2%, 0) scale(1.08); }
}
.prologue-stack{
  position: relative; text-align: center; padding: 20px;
}
.kicker{
  font-family: var(--serif-en);
  font-style: italic;
  font-size: 13px;
  letter-spacing: .55em;
  color: var(--gold);
  margin-bottom: 36px;
  opacity: 0;
}
.title{
  font-family: var(--serif-cn);
  font-weight: 700;
  font-size: clamp(40px, 7vw, 96px);
  line-height: 1.25;
  letter-spacing: 0.1em;
}
.title .line{ display: block; overflow: hidden; }
.title .line > span{ display: inline-block; }
.title .line:nth-child(2) > span{
  background: linear-gradient(120deg, var(--gold-bright) 20%, var(--rose-bright) 80%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-style: italic;
  font-family: var(--serif-en), var(--serif-cn);
}
.sub{
  margin-top: 30px;
  font-size: clamp(14px, 1.4vw, 18px);
  color: var(--ink-soft);
  letter-spacing: 0.3em;
  opacity: 0;
}

.day-count{
  margin-top: 36px;
  text-align: center;
  position: relative;
}
.day-count .day-label{
  display: block;
  font-family: var(--serif-en);
  font-style: italic;
  font-size: 12px; letter-spacing: .55em;
  color: var(--gold);
  margin-bottom: 14px;
}
.day-count .day-num{
  display: inline-block;
  font-family: var(--serif-en);
  font-weight: 500;
  font-size: clamp(72px, 12vw, 180px);
  line-height: 1;
  background: linear-gradient(120deg, var(--gold-bright) 30%, var(--rose-bright) 80%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  letter-spacing: 0.02em;
  filter: drop-shadow(0 0 30px rgba(255,170,90,0.25));
}
.day-count .day-foot{
  display: block;
  margin-top: 14px;
  font-family: var(--serif-cn);
  font-size: clamp(13px, 1.3vw, 17px);
  color: var(--ink-soft);
  letter-spacing: 0.3em;
}
.day-count .day-foot em{
  font-family: var(--serif-en);
  font-style: normal;
  color: var(--gold-bright);
  font-size: 1.25em;
  margin: 0 6px;
  font-weight: 500;
}
.scroll-hint{
  position: absolute; left: 50%; bottom: -22vh;
  transform: translateX(-50%);
  text-align: center;
  color: var(--ink-dim);
  font-size: 11px; letter-spacing: .5em;
  opacity: 0;
}
.scroll-hint i{
  display: block;
  width: 1px; height: 60px;
  margin: 14px auto 0;
  background: linear-gradient(180deg, var(--gold), transparent);
  animation: scrollpulse 2.4s ease-in-out infinite;
}
@keyframes scrollpulse{
  0%  { transform: scaleY(0); transform-origin: top; }
  60% { transform: scaleY(1); transform-origin: top; }
  61% { transform-origin: bottom; }
  100%{ transform: scaleY(0); transform-origin: bottom; }
}

/* ============== 幕二 相遇 ============== */
.act-meeting{
  min-height: 100vh;
  padding: 14vh 6vw;
  background:
    radial-gradient(ellipse at 80% 20%, rgba(232,125,106,0.15), transparent 55%),
    linear-gradient(180deg, var(--bg-1), var(--bg-2) 60%, var(--bg-1));
  display: grid; place-items: center;
}
.meeting-grid{
  width: 100%; max-width: 1280px;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 6vw; align-items: center;
}
@media (max-width: 880px){
  .meeting-grid{ grid-template-columns: 1fr; gap: 60px; }
}
.date-label{
  font-family: var(--serif-en);
  font-style: italic;
  font-size: 13px; letter-spacing: .5em;
  color: var(--gold);
}
.date-big{
  font-family: var(--serif-en);
  font-weight: 500;
  font-size: clamp(60px, 11vw, 160px);
  line-height: 1;
  margin: 28px 0;
  color: var(--ink);
  display: flex; align-items: baseline; gap: 0.05em;
  letter-spacing: 0.02em;
}
.date-big i{
  font-style: normal;
  color: var(--rose);
  font-size: 0.6em;
  margin: 0 0.1em;
}
.date-big span:nth-child(1){
  background: linear-gradient(180deg, var(--gold-bright), var(--rose));
  -webkit-background-clip: text;
  background-clip: text; color: transparent;
}
.date-foot{
  font-size: clamp(16px, 1.6vw, 22px);
  color: var(--ink-soft);
  letter-spacing: 0.15em;
  line-height: 1.9;
  margin-top: 12px;
}

.polaroids{
  position: relative; aspect-ratio: 1/1;
  perspective: 1400px;
}
.polaroid{
  position: absolute;
  width: 56%;
  background: #fff8ee;
  padding: 14px 14px 50px;
  box-shadow:
    0 30px 60px rgba(0,0,0,0.45),
    0 6px 18px rgba(0,0,0,0.3);
  transition: transform .6s cubic-bezier(.2,.8,.2,1);
}
.polaroid img{
  width: 100%; aspect-ratio: 3/4; object-fit: cover; background: #2a1409;
}
.polaroid.p1{ top:  4%; left:  4%; transform: rotate(-7deg); z-index: 2; }
.polaroid.p2{ top:  8%; left: 38%; transform: rotate( 5deg); z-index: 4; }
.polaroid.p3{ top: 38%; left: 14%; transform: rotate(-3deg); z-index: 3; }
.polaroid.p4{ top: 36%; left: 44%; transform: rotate( 8deg); z-index: 1; }
.polaroid:hover{ transform: translateY(-8px) rotate(0); z-index: 9; }

/* ============== 幕三 时光剪影 ============== */
.act-memories{ background: var(--bg-0); }
.memory-frame{
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8vh 0;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(ellipse at center, rgba(40,16,8,0.55), rgba(10,4,2,1) 75%),
    var(--bg-0);
}
.mf-stage{
  position: relative;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}
.mf-stage::before{
  /* 图片底部暗渐变，让标题文字更清楚 */
  content: ""; position: absolute; inset: 0; z-index: 2;
  background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.62) 100%);
  pointer-events: none;
}
.memory-frame .mf-img{
  display: block;
  width: 100%;
  height: auto;
  filter: saturate(1.05) brightness(0.95);
  box-shadow: 0 30px 80px rgba(0,0,0,0.55);
}
.mf-caption{
  position: absolute;
  left: clamp(20px, 4%, 50px);
  bottom: clamp(20px, 5%, 60px);
  z-index: 3;
  max-width: min(680px, 88%);
}
.mf-caption .mf-num{
  font-family: var(--serif-en);
  font-style: italic; font-size: 14px; letter-spacing: .35em;
  color: var(--gold);
  margin-bottom: 12px;
  display: block;
}
.mf-caption .mf-line{
  font-family: var(--serif-cn);
  font-weight: 500;
  font-size: clamp(22px, 3vw, 40px);
  line-height: 1.55;
  color: var(--ink);
  text-shadow: 0 4px 24px rgba(0,0,0,0.5);
}
.mf-caption .mf-line em{
  font-family: var(--serif-en);
  font-style: italic;
  background: linear-gradient(120deg, var(--gold-bright), var(--rose-bright));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ============== 幕四 时间轴 ============== */
.act-timeline{
  padding: 22vh 6vw 18vh;
  background:
    radial-gradient(ellipse at 50% 10%, rgba(232,125,106,0.12), transparent 60%),
    linear-gradient(180deg, var(--bg-0), var(--bg-1) 50%, var(--bg-0));
}
.act-timeline .act-title{ margin-bottom: 14vh; }
.timeline{
  list-style: none;
  position: relative;
  max-width: 980px;
  margin: 0 auto;
  padding: 0 4vw;
  --p: 0;
}
.timeline::before{
  content: ""; position: absolute; left: 50%;
  top: 0; bottom: 0; width: 2px;
  background: linear-gradient(180deg,
    transparent 0%,
    var(--gold) 8%,
    var(--rose) 50%,
    var(--gold) 92%,
    transparent 100%);
  transform: translateX(-50%) scaleY(var(--p));
  transform-origin: top;
  box-shadow: 0 0 12px var(--amber-glow);
}
.tl-item{
  position: relative;
  width: 50%;
  padding: 28px 40px;
  opacity: 0;
}
.tl-item.left { left: 0;   text-align: right; }
.tl-item.right{ left: 50%; text-align: left;  }
.tl-item::before{
  content: "";
  position: absolute; top: 38px;
  width: 14px; height: 14px;
  background: var(--gold-bright);
  border-radius: 50%;
  box-shadow: 0 0 0 6px rgba(232,180,120,0.18), 0 0 24px var(--amber-glow);
}
.tl-item.left::before { right: -7px; }
.tl-item.right::before{ left:  -7px; }
.tl-date{
  font-family: var(--serif-en);
  font-size: 14px; letter-spacing: .35em;
  color: var(--gold);
  margin-bottom: 10px;
}
.tl-title{
  font-size: clamp(20px, 2vw, 26px);
  margin-bottom: 8px;
  color: var(--ink);
  letter-spacing: .12em;
}
.tl-text{
  color: var(--ink-soft);
  font-size: 15px; line-height: 1.85;
  letter-spacing: .05em;
}
@media (max-width: 720px){
  .timeline::before{ left: 18px; }
  .tl-item, .tl-item.left, .tl-item.right{
    width: 100%; left: 0; padding-left: 50px; padding-right: 0; text-align: left;
  }
  .tl-item::before, .tl-item.left::before, .tl-item.right::before{ left: 11px; right: auto; }
}

/* ============== 幕五 终幕（多 stage 切换） ============== */
.act-finale{
  position: relative;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: radial-gradient(ellipse at center, var(--bg-1), var(--bg-0) 70%, #050202 100%);
}
.finale-stage{
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  overflow: hidden;
}

/* stage 0 球体：永远显示在底层 */
.finale-stage[data-stage="0"]{
  opacity: 1; visibility: visible; pointer-events: auto;
  z-index: 1;
}

/* stage 1-4：半透明 overlay 叠在球体之上 */
.finale-stage:not([data-stage="0"]){
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: scale(0.97);
  transition: opacity .9s ease, visibility .9s, transform .9s cubic-bezier(.2,.8,.2,1);
  z-index: 5;
  background: radial-gradient(ellipse at center, rgba(20,8,4,0.62) 0%, rgba(8,3,1,0.88) 80%);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 6vh 6vw;
  gap: 28px;
}
.finale-stage:not([data-stage="0"]).stage-active{
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: scale(1);
}

/* 当其他 stage 在前景时，stage 0 自身的提示/标题/按钮淡出，球体保持可见在背景 */
.act-finale.overlay-active .finale-stage[data-stage="0"] .finale-overlay,
.act-finale.overlay-active .finale-stage[data-stage="0"] #toDecision{
  opacity: 0;
  pointer-events: none;
}
.finale-stage[data-stage="0"] .finale-overlay,
.finale-stage[data-stage="0"] #toDecision{
  transition: opacity .8s ease;
}
#sphere{
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
}
#sphere:active{ cursor: grabbing; }
.finale-overlay{
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 80px 6vw 70px;
  pointer-events: none;
}
.finale-hint{
  font-family: var(--serif-en);
  font-style: italic;
  font-size: 14px;
  letter-spacing: .35em;
  color: var(--gold);
  opacity: .8;
}
.finale-title{
  font-family: var(--serif-cn);
  font-weight: 700;
  font-size: clamp(20px, 5vw, 64px);
  letter-spacing: 0.4em;
  text-align: center;
  background: linear-gradient(120deg, var(--gold-bright) 30%, var(--rose-bright) 80%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 60px rgba(255,160,100,0.25);
  max-width: 92vw;
  line-height: 1.5;
}
@media (max-width: 720px){
  .finale-overlay{ padding: 36px 4vw 36px; }
  .finale-title{ font-size: clamp(18px, 4.6vw, 28px); letter-spacing: 0.25em; }
  .finale-hint{ font-size: 11px; letter-spacing: 0.25em; }
}

.photo-detail{
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10,4,2,0.78);
  backdrop-filter: blur(10px);
  opacity: 0; visibility: hidden;
  transition: opacity .5s ease, visibility .5s ease;
  z-index: 5;
}
.photo-detail.show{ opacity: 1; visibility: visible; }
.photo-detail img{
  max-width: 80vw; max-height: 70vh;
  border: 6px solid #fff8ee;
  box-shadow: var(--shadow-warm);
  transform: scale(.9);
  transition: transform .6s cubic-bezier(.2,.8,.2,1);
}
.photo-detail.show img{ transform: scale(1); }
.photo-detail-cap{
  position: absolute; bottom: 6vh; left: 50%; transform: translateX(-50%);
  width: min(720px, 88vw);
  text-align: center;
  color: var(--ink-soft);
}
.photo-detail-cap .dc-num{
  display: block;
  font-family: var(--serif-en);
  font-style: italic;
  font-size: 13px;
  letter-spacing: .35em;
  color: var(--gold);
  margin-bottom: 10px;
}
.photo-detail-cap .dc-whisper{
  display: block;
  font-family: var(--serif-cn);
  font-size: clamp(15px, 1.6vw, 19px);
  letter-spacing: 0.18em;
  line-height: 1.8;
  color: var(--ink);
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}
.photo-detail-close{
  position: absolute; top: 28px; right: 28px;
  width: 44px; height: 44px;
  border: 1px solid rgba(232,180,120,0.5);
  border-radius: 50%;
  color: var(--gold); font-size: 24px;
  display: grid; place-items: center;
  background: rgba(20,10,5,0.4);
}

/* —— stage 共用元素 —— */
.ds-kicker{
  font-family: var(--serif-en);
  font-style: italic;
  font-size: 13px; letter-spacing: .55em;
  color: var(--gold);
}
.big-q{
  font-family: var(--serif-cn);
  font-weight: 700;
  font-size: clamp(28px, 5.4vw, 64px);
  letter-spacing: 0.2em;
  line-height: 1.5;
  background: linear-gradient(120deg, var(--gold-bright) 30%, var(--rose-bright) 80%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 60px rgba(255,160,100,0.25);
  max-width: 92vw;
}
@media (max-width: 720px){
  .big-q{ font-size: clamp(22px, 6.5vw, 36px); letter-spacing: 0.15em; }
}
.decision-row{
  display: flex; gap: 28px; flex-wrap: wrap; justify-content: center;
  margin-top: 12px;
  position: relative;
}
.btn-yes{
  font-family: var(--serif-cn);
  font-weight: 700;
  font-size: clamp(17px, 2.2vw, 22px);
  letter-spacing: .3em;
  padding: 20px 52px;
  border: none;
  border-radius: 999px;
  color: #2a1409;
  background: linear-gradient(135deg, var(--gold-bright), var(--rose-bright));
  box-shadow: 0 12px 40px rgba(232,125,106,0.4);
  cursor: pointer;
  transition: transform .3s ease, box-shadow .3s ease;
  animation: pulse-yes 2.4s ease-in-out infinite;
  white-space: nowrap;
}
.btn-yes:hover{
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 22px 60px rgba(232,125,106,0.65);
}
@keyframes pulse-yes{
  0%,100% { box-shadow: 0 12px 40px rgba(232,125,106,0.35); }
  50%     { box-shadow: 0 14px 60px rgba(232,125,106,0.7); }
}
.btn-no{
  font-family: var(--serif-cn);
  font-size: clamp(15px, 1.8vw, 18px);
  letter-spacing: .25em;
  padding: 16px 36px;
  border: 1px solid rgba(232,180,120,0.4);
  border-radius: 999px;
  color: var(--ink-dim);
  background: rgba(20,10,5,0.4);
  backdrop-filter: blur(6px);
  cursor: pointer;
  transition: transform 0.45s cubic-bezier(.2,.8,.2,1), opacity .3s ease;
  position: relative;
}
.btn-ghost{
  font-family: var(--serif-cn);
  font-size: clamp(14px, 1.6vw, 17px);
  letter-spacing: .3em;
  padding: 14px 32px;
  border: 1px solid rgba(232,180,120,0.4);
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(20,10,5,0.4);
  backdrop-filter: blur(6px);
  cursor: pointer;
}
.hint-soft{
  font-size: 12px; letter-spacing: .4em;
  color: var(--ink-dim);
}
.stage-next{
  position: absolute; bottom: 5vh; left: 50%;
  transform: translateX(-50%);
  font-family: var(--serif-cn);
  font-size: 14px; letter-spacing: .3em;
  color: var(--gold);
  background: rgba(20,10,5,0.55);
  border: 1px solid rgba(232,180,120,0.4);
  padding: 14px 28px;
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  z-index: 10;
  pointer-events: auto;
  white-space: nowrap;
  animation: stageBounce 2.6s ease-in-out infinite;
}
@keyframes stageBounce{
  0%,100% { transform: translate(-50%, 0); }
  50%     { transform: translate(-50%, -7px); }
}
.stage-next:hover{ background: rgba(232,125,106,0.2); }

/* —— Stage 2 长信（继承父 flex column + align/justify center 实现主体垂直居中）—— */
.letter-stage{
  overflow-y: auto;
  padding: 6vh 6vw 4vh;
  scrollbar-width: thin;
  scrollbar-color: rgba(232,180,120,0.45) transparent;
}
.letter-stage .love-letter{
  flex: 0 0 auto;
  width: 100%;
  margin: auto 0;  /* 内容 < 容器时垂直居中；超过容器时 auto 失效保留可滚 */
}
.letter-stage::-webkit-scrollbar{ width: 8px; }
.letter-stage::-webkit-scrollbar-track{ background: transparent; }
.letter-stage::-webkit-scrollbar-thumb{
  background: linear-gradient(180deg, rgba(232,180,120,0.5), rgba(232,125,106,0.5));
  border-radius: 4px;
}

/* —— overlay 锁外层滚动条（stage 1-4 active 时）—— */
html.lock-scroll, html.lock-scroll body{ overflow: hidden; }

/* —— 全局滚动条美化（外层 body）—— */
html{
  scrollbar-width: thin;
  scrollbar-color: rgba(232,180,120,0.45) rgba(20,10,5,0.4);
}
html::-webkit-scrollbar{ width: 10px; height: 10px; }
html::-webkit-scrollbar-track{
  background: rgba(20,10,5,0.4);
}
html::-webkit-scrollbar-thumb{
  background: linear-gradient(180deg, rgba(232,180,120,0.55), rgba(232,125,106,0.55));
  border-radius: 5px;
  border: 2px solid rgba(20,10,5,0.4);
  background-clip: padding-box;
}
html::-webkit-scrollbar-thumb:hover{
  background: linear-gradient(180deg, rgba(243,201,138,0.85), rgba(255,155,125,0.85));
  background-clip: padding-box;
}
html::-webkit-scrollbar-corner{ background: transparent; }
.love-letter{
  max-width: 720px;
  margin: 0 auto;
  position: relative;
}
.ll-head{ text-align: center; margin-bottom: 28px; }
.ll-stamp{
  display: inline-block;
  font-family: var(--serif-en);
  font-style: italic;
  font-size: 12px; letter-spacing: .35em;
  color: var(--gold);
  border: 1px solid rgba(232,180,120,0.4);
  border-radius: 999px;
  padding: 5px 16px;
  margin-bottom: 16px;
}
.ll-stamp em{
  font-style: normal;
  background: linear-gradient(120deg, var(--gold-bright), var(--rose-bright));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin: 0 4px;
}
.ll-title{
  font-family: var(--serif-cn);
  font-weight: 500;
  font-size: clamp(20px, 2.8vw, 30px);
  letter-spacing: 0.18em;
  color: var(--ink);
}
.ll-body p{
  font-family: var(--serif-cn);
  font-size: clamp(15px, 1.35vw, 17px);
  line-height: 1.85;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  margin-bottom: 16px;
  text-align: center;
}
.ll-body em{
  font-style: normal;
  background: linear-gradient(120deg, var(--gold-bright), var(--rose-bright));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-weight: 700;
  padding: 0 2px;
}
.ll-vow{
  font-size: clamp(17px, 1.7vw, 21px) !important;
  line-height: 2.0 !important;
  text-align: center;
  margin-top: 24px !important;
  color: var(--ink) !important;
}
.letter-stage .stage-next{
  position: relative;
  bottom: auto; left: auto;
  margin: 18px auto 0;
  display: block;
  /* 覆盖父级的 stageBounce (含 translateX(-50%)) — 这里只做 Y 方向轻微浮动 */
  animation: stageBounceY 2.6s ease-in-out infinite;
}
@keyframes stageBounceY{
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

/* —— Stage 3 戒指 —— */
.ring-stage .ring-svg{
  width: 160px; height: 190px;
  filter: drop-shadow(0 0 28px rgba(255,170,90,0.5));
}

/* —— Stage 4 永恒结局 —— */
.forever-title{
  font-family: var(--serif-cn);
  font-weight: 700;
  font-size: clamp(34px, 6vw, 78px);
  line-height: 1.45;
  letter-spacing: 0.15em;
  color: var(--ink);
}
.forever-title em{
  font-style: normal;
  background: linear-gradient(120deg, var(--gold-bright), var(--rose-bright));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-weight: 800;
}
.forever-sub{
  font-size: clamp(15px, 1.5vw, 18px);
  letter-spacing: 0.3em;
  color: var(--ink-soft);
  line-height: 2.2;
}
.forever-actions{
  display: flex; gap: 22px; flex-wrap: wrap; justify-content: center;
  margin-top: 8px;
}
.ending-mark{
  font-family: var(--serif-en);
  font-style: italic;
  color: var(--gold);
  letter-spacing: .3em;
  font-size: 14px;
  margin-top: 18px;
}

/* —— 飘心粒子 —— */
.floating-heart{
  position: fixed;
  bottom: -40px;
  pointer-events: none;
  z-index: 90;
  width: 28px; height: 28px;
  animation: floatUp 4.5s cubic-bezier(.4,.1,.4,1) forwards;
}
.floating-heart svg{ width: 100%; height: 100%; }
@keyframes floatUp{
  0%   { opacity: 0; transform: translateY(0) translateX(0) scale(0.5) rotate(0deg); }
  15%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(-110vh) translateX(var(--drift, 30px)) scale(1.1) rotate(var(--rot, 25deg)); }
}

/* ============== SVG 装饰飘动 ============== */
.act-deco{
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 1;
}
.deco-icon{
  position: absolute;
  width: 24px; height: 24px;
  opacity: 0;
  filter: drop-shadow(0 0 8px rgba(255,170,90,0.5));
  animation-fill-mode: both;
}
.deco-icon.heart{ width: 22px; height: 22px; }
.deco-icon.heart use{ fill: var(--rose); stroke: var(--rose-bright); stroke-width: 0.8; }
.deco-icon.spark use{ fill: none; stroke: var(--gold-bright); stroke-width: 2.2; stroke-linecap: round; }
.deco-icon.star  use{ fill: none; stroke: var(--gold); stroke-width: 1.6; stroke-linecap: round; }

.deco-icon.f-a{ animation: float-a 7s ease-in-out infinite alternate, decoFade 1.4s 0.6s ease-out forwards; }
.deco-icon.f-b{ animation: float-b 9s ease-in-out infinite alternate, decoFade 1.4s 0.9s ease-out forwards; }
.deco-icon.f-c{ animation: float-c 11s linear infinite,                decoFade 1.4s 1.2s ease-out forwards; }

@keyframes decoFade{ to { opacity: 0.7; } }
@keyframes float-a{
  from{ transform: translate3d(-6px, -12px, 0) rotate(-4deg) scale(0.95); }
  to  { transform: translate3d( 8px,  10px, 0) rotate( 4deg) scale(1.1);  }
}
@keyframes float-b{
  from{ transform: translate3d(-10px, 6px, 0) scale(0.85); }
  to  { transform: translate3d( 10px, -8px, 0) scale(1.15); }
}
@keyframes float-c{
  from{ transform: rotate(0deg)   scale(0.9); }
  to  { transform: rotate(360deg) scale(1.05); }
}

@media (max-width: 720px){
  .deco-icon{ width: 18px; height: 18px; }
  .deco-icon.heart{ width: 16px; height: 16px; }
}

/* —— 终幕流星 —— */
.finale-streaks{
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 1;
}
.finale-streaks .streak{
  fill: none;
  stroke: url(#streak-grad);
  stroke-width: 0.35;
  stroke-linecap: round;
  filter: drop-shadow(0 0 1px var(--amber-glow));
  stroke-dasharray: 40 200;
  stroke-dashoffset: 240;
}
.finale-streaks .s1{ animation: streak 7s ease-in-out 1.2s infinite; }
.finale-streaks .s2{ animation: streak 9s ease-in-out 3.4s infinite; }
.finale-streaks .s3{ animation: streak 8s ease-in-out 5.8s infinite; }
@keyframes streak{
  0%   { stroke-dashoffset: 240; opacity: 0; }
  10%  { opacity: 1; }
  60%  { stroke-dashoffset: -40; opacity: 1; }
  80%  { stroke-dashoffset: -40; opacity: 0; }
  100% { stroke-dashoffset: -40; opacity: 0; }
}

/* 让序幕 / 终幕 stack 在装饰之上 */
.prologue-stack, .finale-overlay, .ending{ position: relative; z-index: 3; }

/* ============== 减少动画偏好 ============== */
@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
