/* =========================================================
   我们的年度报告 — 手机优先
   ========================================================= */

:root {
  --ink: #17121d;
  --ink-2: #221a2b;
  --paper: #f7f1ea;
  --pink: #f0bdcf;
  --violet: #b8a3cf;
  --gold: #e3c08a;
  --text: #f2ecf4;
  --text-dim: #a99fb4;

  --pad: clamp(20px, 6vw, 34px);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);

  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", system-ui, sans-serif;
  --font-serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC",
                Georgia, serif;

  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  height: 100%;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-sans);
  overscroll-behavior: none;
}

body { overflow: hidden; }

/* 细颗粒噪点，让纯色背景不那么“数字” */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 90; pointer-events: none;
  opacity: .045; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------------- 载入遮罩 ---------------- */
#boot {
  position: fixed; inset: 0; z-index: 200;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 20px; background: var(--ink);
  transition: opacity .6s var(--ease), visibility .6s;
}
/* pointer-events 立刻放开，不等淡出动画结束——动画若被浏览器暂停就会挡住整页点击 */
#boot.done { opacity: 0; visibility: hidden; pointer-events: none; }
.boot-heart { font-size: 34px; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); opacity: .85 } 50% { transform: scale(1.14); opacity: 1 } }
.boot-bar { width: 148px; height: 2px; background: rgba(255,255,255,.12); border-radius: 2px; overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--pink), var(--violet)); transition: width .3s var(--ease); }
.boot-text { margin: 0; font-size: 12.5px; letter-spacing: .16em; color: var(--text-dim); }

/* ---------------- 页面容器 ---------------- */
#deck {
  height: 100vh; height: 100dvh;
  overflow-y: scroll; overflow-x: hidden;
  scroll-snap-type: y mandatory;
  /* 不设 scroll-behavior: smooth —— 它会让 scrollTo 的 behavior 选项失效；
     程序化翻页在 app.js 的 goToPage() 里显式指定。 */
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
#deck::-webkit-scrollbar { display: none; }

.page {
  position: relative;
  height: 100vh; height: 100dvh;
  scroll-snap-align: start; scroll-snap-stop: always;
  overflow: hidden;
  display: flex; flex-direction: column;
  padding: calc(var(--safe-t) + 62px) var(--pad) calc(var(--safe-b) + 30px);
}

/* 进场动画：只在当前屏触发 */
.page .rise { opacity: 0; transform: translateY(22px); }
.page.is-active .rise {
  opacity: 1; transform: none;
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.page.is-active .rise:nth-child(2) { transition-delay: .08s }
.page.is-active .rise:nth-child(3) { transition-delay: .16s }
.page.is-active .rise:nth-child(4) { transition-delay: .24s }
.page.is-active .d1 { transition-delay: .1s }
.page.is-active .d2 { transition-delay: .2s }
.page.is-active .d3 { transition-delay: .3s }
.page.is-active .d4 { transition-delay: .42s }

@media (prefers-reduced-motion: reduce) {
  .page .rise { opacity: 1; transform: none; }
}

/* ---------------- 封面 ---------------- */
.page--cover { justify-content: center; align-items: center; text-align: center; padding-bottom: 0; }
.cover-glow {
  position: absolute; left: 50%; top: 42%; width: 118vw; aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(240,189,207,.20), rgba(184,163,207,.10) 42%, transparent 68%);
  animation: breathe 9s ease-in-out infinite;
}
@keyframes breathe { 0%,100% { transform: translate(-50%,-50%) scale(1) } 50% { transform: translate(-50%,-50%) scale(1.1) } }
.cover-kicker {
  position: relative; font-size: 12px; letter-spacing: .3em; color: var(--violet);
  text-transform: uppercase; margin: 0 0 22px;
}
.cover-title {
  position: relative; margin: 0; font-family: var(--font-serif); font-weight: 500;
  font-size: clamp(40px, 13vw, 62px); line-height: 1.24; letter-spacing: .04em;
  background: linear-gradient(160deg, #fff 10%, var(--pink) 60%, var(--violet));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.cover-sub {
  position: relative; margin: 22px 0 0; white-space: pre-line;
  font-size: 14.5px; line-height: 2; color: var(--text-dim);
}
.cover-enter {
  position: relative; margin-top: 46px; appearance: none; cursor: pointer;
  border: 1px solid rgba(240,189,207,.42); background: rgba(255,255,255,.05);
  color: var(--text); font-family: inherit; font-size: 14px; letter-spacing: .22em;
  padding: 15px 40px; border-radius: 999px; backdrop-filter: blur(8px);
  transition: transform .3s var(--ease), background .3s, border-color .3s;
}
.cover-enter::after {
  content: ""; position: absolute; inset: -6px; border-radius: 999px;
  border: 1px solid rgba(240,189,207,.25); animation: halo 2.6s ease-out infinite;
}
@keyframes halo { 0% { transform: scale(.94); opacity: .8 } 100% { transform: scale(1.18); opacity: 0 } }
.cover-enter:active { transform: scale(.96); background: rgba(240,189,207,.16); }

/* ---------------- 章节扉页 ---------------- */
.page--chapter { justify-content: center; }
.page--chapter::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 70% at 22% 18%, var(--ch-tone, #b48fc4), transparent 62%);
  opacity: .3;
}
.ch-no {
  position: relative; font-size: 11.5px; letter-spacing: .34em; color: var(--pink);
  text-transform: uppercase; margin: 0 0 20px;
}
.ch-title {
  position: relative; margin: 0; font-family: var(--font-serif); font-weight: 500;
  font-size: clamp(44px, 15vw, 76px); line-height: 1.1; letter-spacing: .05em;
}
.ch-sub { position: relative; margin: 20px 0 0; font-size: 15px; line-height: 1.9; color: var(--text-dim); }
.ch-meta {
  position: relative; margin: 34px 0 0; padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,.13);
  display: flex; gap: 26px; font-size: 12.5px; color: var(--text-dim); letter-spacing: .08em;
}
.ch-meta b { display: block; font-weight: 500; font-size: 21px; color: var(--text); margin-bottom: 5px;
  font-family: var(--font-serif); }
.ch-meta .span-range { margin-left: auto; text-align: right; }
.ch-meta .span-range b { font-size: 13px; letter-spacing: .04em; color: var(--text-dim); }

/* ---------------- 单日页 · 公共 ---------------- */
.day-head { position: relative; z-index: 3; flex: 0 0 auto; margin-bottom: 16px; }
.day-date {
  display: flex; align-items: baseline; gap: 10px;
  font-family: var(--font-serif); letter-spacing: .04em;
}
.day-date b { font-size: 34px; font-weight: 500; line-height: 1; }
.day-date span { font-size: 12.5px; color: var(--text-dim); letter-spacing: .18em; }
.day-place {
  margin: 9px 0 0; font-size: 12.5px; color: var(--violet); letter-spacing: .1em;
  display: flex; align-items: center; gap: 6px;
}
.day-place::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: var(--pink); flex: 0 0 auto;
}
.day-title {
  margin: 13px 0 0; font-family: var(--font-serif); font-weight: 500;
  font-size: clamp(21px, 6vw, 27px); line-height: 1.5; letter-spacing: .02em;
}
.day-text { margin: 9px 0 0; font-size: 13.5px; line-height: 1.95; color: var(--text-dim); white-space: pre-line; }
/* 小标签跟在地点后面，避免和右上角的音乐键打架 */
.day-mood {
  display: inline-block; margin: 11px 0 0;
  font-size: 11px; letter-spacing: .12em; color: var(--gold);
  border: 1px solid rgba(227,192,138,.4); border-radius: 999px; padding: 4px 11px;
  background: rgba(227,192,138,.08);
}
.day-body { position: relative; z-index: 2; flex: 1 1 auto; min-height: 0; display: flex; }

/* 图片容器：未加载时用取自原图的平均色打底 */
.ph {
  position: relative; overflow: hidden; background: var(--tone, #2a2330);
  border-radius: 3px;
}
.ph img, .ph video {
  display: block; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity .75s var(--ease);
}
.ph img.ready, .ph video.ready { opacity: 1; }
.ph--contain img { object-fit: contain; }

/* 当前屏的主图轻微推近，静止的照片有一点呼吸 */
.page.is-active .ph--motion img { animation: kenburns 15s ease-out both; }
@keyframes kenburns { from { transform: scale(1.005) } to { transform: scale(1.075) } }
@media (prefers-reduced-motion: reduce) { .page.is-active .ph--motion img { animation: none } }

.cap {
  margin: 9px 2px 0; font-size: 12px; line-height: 1.75; color: var(--text-dim);
  letter-spacing: .02em;
}

/* live 图角标 */
.live-badge {
  position: absolute; left: 9px; top: 9px; z-index: 3;
  display: flex; align-items: center; gap: 4px;
  font-size: 10px; letter-spacing: .08em; color: #fff;
  background: rgba(0,0,0,.4); backdrop-filter: blur(6px);
  border-radius: 999px; padding: 3px 8px 3px 6px;
}
.live-badge i {
  width: 9px; height: 9px; border-radius: 50%; border: 2px solid #fff;
  animation: livespin 2.4s linear infinite;
}
@keyframes livespin { to { transform: rotate(360deg) } }

/* 视频播放按钮 */
.play {
  position: absolute; inset: 0; z-index: 4; display: grid; place-items: center;
  border: 0; background: transparent; cursor: pointer; color: #fff; font: inherit;
}
.play i {
  width: 62px; height: 62px; border-radius: 50%;
  background: rgba(23,18,29,.42); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.5);
  display: grid; place-items: center;
  transition: transform .3s var(--ease), background .3s;
}
.play i::before {
  content: ""; border-left: 15px solid #fff;
  border-top: 9.5px solid transparent; border-bottom: 9.5px solid transparent;
  margin-left: 4px;
}
.play:active i { transform: scale(.92); background: rgba(240,189,207,.35); }
.play em {
  position: absolute; bottom: 12px; right: 12px; font-style: normal;
  font-size: 11px; letter-spacing: .06em; color: #fff;
  background: rgba(0,0,0,.42); border-radius: 999px; padding: 3px 9px;
  backdrop-filter: blur(6px);
}

/* ---------------- 版式 1：满屏 ---------------- */
/* 日期压在上方浅色遮罩里，标题正文全部下沉到底部深色遮罩，保证任何照片上都读得清 */
.v-full, .v-video { padding: 0; }
.v-full .ph--hero, .v-video .ph--hero { position: absolute; inset: 0; border-radius: 0; }
.v-full .day-head, .v-video .day-head {
  margin: 0; padding: calc(var(--safe-t) + 62px) var(--pad) 0;
  text-shadow: 0 1px 16px rgba(23,18,29,.75);
}
.v-full::before, .v-video::before {
  content: ""; position: absolute; inset: 0; z-index: 2;
  background: linear-gradient(rgba(23,18,29,.8), rgba(23,18,29,.28) 26%, transparent 44%);
}
.v-full-foot {
  position: relative; z-index: 3; margin-top: auto;
  padding: 108px var(--pad) calc(var(--safe-b) + 32px);
  background: linear-gradient(transparent, rgba(23,18,29,.7) 34%, rgba(23,18,29,.94) 62%, rgba(23,18,29,.99));
}
.v-full-foot .day-title { margin-top: 0; }

/* 满屏页的配图：底部一排小缩略图，不抢主图 */
.thumbs {
  display: flex; gap: 7px; overflow-x: auto; margin-bottom: 15px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.thumbs::-webkit-scrollbar { display: none; }
.thumbs .ph {
  flex: 0 0 auto; width: 62px; height: 62px; border-radius: 5px;
  border: 1.5px solid rgba(255,255,255,.28);
}
.thumbs .play i { width: 26px; height: 26px; border-width: 1px; }
.thumbs .play i::before { border-left-width: 7px; border-top-width: 4.5px; border-bottom-width: 4.5px; margin-left: 2px; }
.thumbs .play em { display: none; }

/* ---------------- 版式 2：拍立得 ---------------- */
.v-frame { align-items: center; }
.v-frame::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(88% 55% at 50% 42%, var(--tone, #3a3040), transparent 72%);
  opacity: .5;
}
.v-frame .day-head { align-self: stretch; text-align: center; }
.v-frame .day-date, .v-frame .day-place { justify-content: center; }
.v-frame .day-body { align-items: center; justify-content: center; width: 100%; }
.polaroid {
  background: var(--paper); padding: 11px 11px 46px;
  border-radius: 2px; transform: rotate(var(--tilt, -2deg));
  box-shadow: 0 26px 54px rgba(0,0,0,.5), 0 2px 0 rgba(255,255,255,.16) inset;
  max-width: min(84vw, 400px); width: 100%; max-height: 100%;
  display: flex; flex-direction: column;
}
/* 高度封顶，长图不会顶出屏幕；超出部分交给 object-fit 裁切 */
.polaroid .ph {
  border-radius: 1px; aspect-ratio: var(--ar, 4/5);
  min-height: 0; max-height: 100%;
}
.polaroid .cap {
  position: absolute; left: 14px; right: 14px; bottom: 13px; margin: 0;
  color: #6a5f72; font-family: var(--font-serif); font-size: 12.5px; text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.polaroid-wrap { position: relative; max-height: 100%; display: flex; min-height: 0; }
.tape {
  position: absolute; z-index: 5; width: 84px; height: 24px;
  background: linear-gradient(180deg, rgba(240,189,207,.62), rgba(240,189,207,.4));
  box-shadow: 0 2px 8px rgba(0,0,0,.24);
}
.tape--tl { left: -14px; top: -10px; transform: rotate(-28deg); }
.tape--br { right: -14px; bottom: 26px; transform: rotate(-24deg); }

/* ---------------- 版式 3：错位叠放 ---------------- */
.v-stack .day-body { align-items: center; justify-content: center; }
.stack { position: relative; width: 100%; max-width: 420px; height: 100%; }
.stack .ph {
  position: absolute; box-shadow: 0 18px 40px rgba(0,0,0,.48);
  border: 5px solid var(--paper); border-radius: 2px;
}
.stack .ph:nth-child(1) { left: 0; top: 4%; width: 63%; aspect-ratio: 3/4; transform: rotate(-4deg); }
.stack .ph:nth-child(2) { right: 0; bottom: 2%; width: 60%; aspect-ratio: 4/3; transform: rotate(3.4deg); }
.stack .ph:nth-child(3) { left: 24%; bottom: 26%; width: 46%; aspect-ratio: 1/1; transform: rotate(-1.5deg); }

/* ---------------- 版式 4：斜切两张 ---------------- */
.v-split .day-body { flex-direction: column; gap: 10px; }
.v-split .ph { flex: 1 1 0; min-height: 0; }
.v-split .ph:nth-child(1) { clip-path: polygon(0 0, 100% 0, 100% 88%, 0 100%); }
.v-split .ph:nth-child(2) { clip-path: polygon(0 12%, 100% 0, 100% 100%, 0 100%); margin-top: -22px; }

/* ---------------- 版式 5：一大两小 ---------------- */
.v-trio .day-body { display: grid; gap: 8px; grid-template-columns: 1.55fr 1fr;
  grid-template-rows: 1fr 1fr; }
.v-trio .ph:nth-child(1) { grid-row: 1 / 3; }

/* ---------------- 版式 6：瀑布网格 ---------------- */
/* 图少时整体居中，图多时可以在页内上下滚 */
.v-grid .day-body { display: flex; flex-direction: column; overflow-y: auto;
  -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.v-grid .day-body::-webkit-scrollbar { display: none; }
.v-grid .cols { columns: 2; column-gap: 8px; margin: auto 0; }
.v-grid .ph { break-inside: avoid; margin-bottom: 8px; width: 100%; }
.v-grid .ph img { height: auto; }

/* ---------------- 版式 7：横向胶片 ---------------- */
.v-strip .day-body { flex-direction: column; justify-content: center; }
.film {
  display: flex; gap: 10px; overflow-x: auto; padding: 13px 0;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  border-top: 2px dashed rgba(255,255,255,.16);
  border-bottom: 2px dashed rgba(255,255,255,.16);
}
.film::-webkit-scrollbar { display: none; }
.film .ph {
  flex: 0 0 auto; width: 68vw; max-width: 320px; aspect-ratio: 3/4;
  scroll-snap-align: center; border: 5px solid var(--paper); border-radius: 2px;
}
.film-hint { margin: 14px 0 0; font-size: 11.5px; letter-spacing: .16em; color: var(--text-dim); text-align: center; }

/* ---------------- 版式 8：视频 ---------------- */
/* 结构与满屏一致，只是主图换成视频封面；播放键在 .ph--hero 上，层级要高于底部遮罩 */
.v-video .ph--hero { z-index: 4; }
.v-video .ph--hero .play { z-index: 5; }

/* ---------------- 统计页 ---------------- */
.page--stats { justify-content: center; }
.page--stats::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(100% 60% at 50% 34%, rgba(184,163,207,.26), transparent 66%);
}
.stats-title {
  position: relative; margin: 0 0 34px; font-family: var(--font-serif); font-weight: 500;
  font-size: clamp(27px, 8vw, 36px); line-height: 1.4;
}
.stats-grid { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.stat {
  border: 1px solid rgba(255,255,255,.13); border-radius: 14px;
  padding: 21px 17px; background: rgba(255,255,255,.035); backdrop-filter: blur(6px);
}
.stat b {
  display: block; font-family: var(--font-serif); font-weight: 500;
  font-size: clamp(34px, 11vw, 46px); line-height: 1;
  background: linear-gradient(150deg, #fff, var(--pink) 70%, var(--violet));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat span { display: block; margin-top: 10px; font-size: 12px; color: var(--text-dim); letter-spacing: .06em; }
.stats-note { position: relative; margin: 28px 0 0; font-size: 13px; line-height: 2; color: var(--text-dim); }

/* ---------------- 结尾 ---------------- */
.page--ending { justify-content: center; text-align: center; align-items: center; }
.page--ending::before {
  content: ""; position: absolute; left: 50%; top: 44%; width: 130vw; aspect-ratio: 1;
  transform: translate(-50%,-50%);
  background: radial-gradient(circle, rgba(240,189,207,.24), rgba(184,163,207,.1) 40%, transparent 66%);
  animation: breathe 8s ease-in-out infinite;
}
.end-title {
  position: relative; margin: 0; font-family: var(--font-serif); font-weight: 500;
  font-size: clamp(48px, 17vw, 82px); letter-spacing: .1em; line-height: 1.2;
  background: linear-gradient(155deg, #fff, var(--pink) 55%, var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.end-lines { position: relative; margin: 32px 0 0; font-size: 14.5px; line-height: 2.4; color: var(--text-dim); }
.end-lines p { margin: 0; }
.end-sign {
  position: relative; margin: 40px 0 0; font-family: var(--font-serif);
  font-size: 15px; color: var(--pink); letter-spacing: .1em;
}
.end-replay {
  position: relative; margin-top: 44px; appearance: none; cursor: pointer;
  border: 1px solid rgba(255,255,255,.2); background: transparent; color: var(--text-dim);
  font-family: inherit; font-size: 12.5px; letter-spacing: .18em;
  padding: 12px 30px; border-radius: 999px;
}
.end-replay:active { background: rgba(255,255,255,.07); }

/* 飘落的心：压在文字后面 */
.page--ending > *:not(.petals) { z-index: 2; }
.petals { position: absolute; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; }
.petals i {
  position: absolute; top: -8%; font-size: 13px; opacity: 0;
  animation: fall linear infinite;
}
@keyframes fall {
  0% { transform: translateY(-10vh) rotate(0deg); opacity: 0 }
  12% { opacity: .85 }
  88% { opacity: .85 }
  100% { transform: translateY(112vh) rotate(320deg); opacity: 0 }
}

/* ---------------- HUD / 进度轨 ---------------- */
#hud {
  position: fixed; z-index: 60; left: 0; right: 0; top: 0;
  padding: calc(var(--safe-t) + 15px) var(--pad) 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  pointer-events: none;
  opacity: 0; transform: translateY(-8px);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
body.started #hud { opacity: 1; transform: none; }
#hud-chapter {
  font-size: 11.5px; letter-spacing: .2em; color: var(--text-dim);
  text-shadow: 0 1px 10px rgba(0,0,0,.6);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#music {
  pointer-events: auto; flex: 0 0 auto; appearance: none; cursor: pointer;
  width: 36px; height: 36px; border-radius: 50%; padding: 8px;
  border: 1px solid rgba(255,255,255,.16); background: rgba(23,18,29,.4);
  backdrop-filter: blur(8px); color: var(--text);
}
#music svg { width: 100%; height: 100%; display: none; }
#music[data-on="true"] .ic-on { display: block; }
#music[data-on="false"] .ic-off { display: block; }

#rail {
  position: fixed; z-index: 60; right: 9px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 7px;
  opacity: 0; transition: opacity .5s var(--ease);
}
body.started #rail { opacity: 1; }
#rail b {
  display: block; width: 3px; border-radius: 3px; background: rgba(255,255,255,.2);
  transition: background .4s var(--ease), height .4s var(--ease);
}
#rail b.on { background: linear-gradient(var(--pink), var(--violet)); }

#scroll-hint {
  position: fixed; z-index: 55; left: 50%; bottom: calc(var(--safe-b) + 18px);
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  color: var(--text-dim); opacity: 0; transition: opacity .6s var(--ease);
  pointer-events: none;
}
#scroll-hint.show { opacity: .72; }
#scroll-hint span { font-size: 10.5px; letter-spacing: .2em; }
#scroll-hint svg { width: 19px; height: 19px; animation: nudge 1.7s ease-in-out infinite; }
@keyframes nudge { 0%,100% { transform: translateY(0); opacity: .5 } 50% { transform: translateY(5px); opacity: 1 } }

/* ---------------- 视频全屏层 ---------------- */
#viewer {
  position: fixed; inset: 0; z-index: 150; background: #000;
  display: flex; align-items: center; justify-content: center;
}
#viewer[hidden] { display: none; }
#viewer-video { width: 100%; max-height: 100%; }
#viewer-close {
  position: absolute; z-index: 2; right: 14px; top: calc(var(--safe-t) + 14px);
  width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
  border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.1);
  color: #fff; font-size: 17px; line-height: 1; backdrop-filter: blur(8px);
}

/* ---------------- 大屏：把画面收进一个手机框 ---------------- */
@media (min-width: 820px) and (min-height: 640px) {
  body { background: #0d0a11; display: grid; place-items: center; }
  body::before {
    content: ""; position: fixed; inset: 0;
    background: radial-gradient(70% 55% at 50% 40%, rgba(184,163,207,.1), transparent 70%);
  }
  #deck {
    width: 420px; height: min(880px, 94vh);
    border-radius: 30px; border: 1px solid rgba(255,255,255,.1);
    box-shadow: 0 40px 100px rgba(0,0,0,.7);
    position: relative; z-index: 1;
  }
  .page { height: min(880px, 94vh); }
  #hud, #rail, #scroll-hint { position: absolute; }
  #hud { left: 50%; right: auto; width: 420px; transform: translateX(-50%); }
  body.started #hud { transform: translateX(-50%); }
  #rail { right: calc(50% - 210px + 9px); }
  #scroll-hint { bottom: calc(50% - min(440px, 47vh) + 18px); }
}
