/* ==========================================================================
   styles.css — 新中式留白 · 斜切百叶窗
   两套屏底：photo（满屏照片）/ info（宣纸底）
   ========================================================================== */

@font-face {
  font-family: 'WenKai';
  src: url('fonts/wenkai-subset.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f6f1e7;
  --paper-2: #efe6d5;
  --ink: #1c1a19;
  --ink-60: rgba(28, 26, 25, 0.6);
  --red: #9e2b25;
  --red-deep: #7d1f1c;
  --gold: #c9a227;
  --night: #14100e;
  --white: #fffdf8;

  --f-display: 'WenKai', 'Songti SC', 'STSong', 'SimSun', serif;
  --f-body: 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;
  --f-num: Georgia, 'Times New Roman', serif;

  --ease: cubic-bezier(0.76, 0, 0.24, 1);
  --dur: 620ms;
  --pad-x: clamp(24px, 8vw, 56px);

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

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

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--night);
  color: var(--ink);
  font-family: var(--f-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* ---------- 舞台 ---------- */

#stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--night);
  touch-action: none;
}

.screen {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  will-change: transform;
}
.screen.is-active { opacity: 1; visibility: visible; }

/* ---------- 入场：屏内文字逐行浮现 ---------- */

/* ==========================================================================
   照片屏（12 种版式）
   图框一律 aspect-ratio 4:5 = 素材原比例，绝不裁切人物；
   非出血版式用流式布局，图与文案互不遮盖。
   ========================================================================== */

.photo {
  background: var(--night);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.photo.paper { background: var(--paper); }

/* 图片列：承载图 + 落款，侧栏版式靠它在两端分配留白 */
.photo .pic {
  position: relative;
  flex: none;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.photo.bleed .pic { position: static; width: 100%; height: 100%; }

.photo .bg {
  position: relative;
  flex: none;
  display: block;
  width: min(100%, 50vh);
  margin-inline: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 50% 50%;
  cursor: pointer;
  -webkit-user-drag: none;
}
.screen.is-active .bg { animation: kenburns 9s ease-out forwards; }
/* 流式图改用自上而下的擦入：尺寸不变，不会压到下方文案 */
.screen.is-active.photo:not(.bleed):not(.cover):not(.ending) .bg {
  animation: imgWipe 760ms var(--ease) both;
}
@keyframes kenburns { from { transform: scale(1.05); } to { transform: scale(1); } }
@keyframes imgWipe { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }

.photo .veil {
  position: absolute;
  left: 0;
  right: 0;
  height: 34%;
  pointer-events: none;
  z-index: 1;
}
.photo .veil.top { top: 0; background: linear-gradient(to bottom, rgba(20, 16, 14, 0.55), transparent); }
.photo .veil.bottom { bottom: 0; background: linear-gradient(to top, rgba(20, 16, 14, 0.7), transparent); }

/* 满屏出血版式（6、8）：图铺满，文案独立浮层 */
.photo.bleed .bg { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; margin: 0; }
.photo.bleed .cap { position: absolute; }

/* 文案容器（默认：图下方居中排布） */
.photo .cap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: var(--ink);
  padding: clamp(20px, 3.6vh, 34px) var(--pad-x) calc(var(--safe-b) + 78px);
}
.photo .cap .cap-no {
  font-family: var(--f-num);
  font-size: 11px;
  letter-spacing: 0.34em;
  color: var(--red);
}
.photo .cap h3 {
  font-family: var(--f-display);
  font-weight: normal;
  font-size: clamp(23px, 6.6vw, 29px);
  letter-spacing: 0.18em;
  color: var(--ink);
  margin-bottom: 12px;
}
.photo .cap p {
  font-size: clamp(13px, 3.7vw, 15.5px);
  line-height: 1.95;
  letter-spacing: 0.05em;
  color: var(--ink-60);
}
.photo .cap .cap-no { margin-bottom: 14px; }

/* 侧栏版式中部的大字水印：与信息屏序号同一语言，填住图与落款之间的空档 */
.photo .big-no {
  font-family: var(--f-display);
  font-size: clamp(84px, 26vw, 132px);
  line-height: 1;
  color: rgba(158, 43, 37, 0.075);
  user-select: none;
  pointer-events: none;
}

/* 落款：侧栏版式底部的日期 / 地点 / 签名，撑起留白 */
.photo .fill { width: 100%; padding: 0 clamp(4px, 1.6vw, 10px); }
.photo .fill .fill-rule { display: block; width: 44px; height: 1px; background: var(--gold); margin-bottom: 14px; }
.photo .fill .fill-date {
  font-family: var(--f-num);
  font-size: clamp(21px, 5.6vw, 27px);
  letter-spacing: 0.1em;
  color: var(--red-deep);
}
.photo .fill .fill-place { margin-top: 9px; font-size: clamp(12px, 3.3vw, 13.5px); line-height: 1.7; color: var(--ink-60); }
.photo .fill .fill-sign { margin-top: 10px; font-family: var(--f-display); font-size: clamp(12.5px, 3.5vw, 14.5px); letter-spacing: 0.2em; color: var(--ink); }
.photo .cap.vertical h3,
.photo .cap.vertical p { writing-mode: vertical-rl; margin: 0; }
.photo .cap.vertical h3 { font-size: clamp(21px, 5.8vw, 27px); letter-spacing: 0.24em; }
.photo .cap.vertical p { line-height: 2.1; letter-spacing: 0.1em; max-height: 58vh; }

/* ---- 12 种版式 ---- */

/* 1 满宽图上 + 文案下 */
.lay-1 .cap { text-align: left; }

/* 2 留白居中图 + 居中文案 */
.lay-2 .bg { width: min(82%, 48vh); margin-top: clamp(34px, 7vh, 84px); }
.lay-2 .cap { text-align: center; padding-inline: 9%; }

/* 3 左图 + 右侧竖排 */
.lay-3 { flex-direction: row; }
.lay-3 .pic { width: 58%; align-self: stretch; justify-content: space-between; padding-top: clamp(42px, 9vh, 96px); padding-bottom: calc(var(--safe-b) + 74px); }
.lay-3 .cap {
  flex: none; width: 42%; align-self: stretch;
  flex-direction: row-reverse; align-items: center; justify-content: center;
  gap: 18px; padding: 32px 14px calc(var(--safe-b) + 78px);
}
.lay-3 .cap .cap-no { position: absolute; right: 14px; bottom: calc(var(--safe-b) + 76px); }

/* 4 满宽图 + 下方文案 */
.lay-4 .cap { padding-top: clamp(16px, 3vh, 26px); }

/* 5 上方文案 + 下方满宽图 */
.lay-5 { flex-direction: column-reverse; }
.lay-5 .cap { justify-content: flex-end; padding-top: calc(var(--safe-t) + 56px); padding-bottom: clamp(18px, 3vh, 30px); }

/* 6 满屏出血 + 左下宣纸卡 */
.lay-6 .cap {
  left: var(--pad-x); right: calc(var(--pad-x) + 14px);
  bottom: calc(var(--safe-b) + 92px);
  display: block;
  background: rgba(246, 241, 231, 0.95);
  border-left: 3px solid var(--gold);
  padding: 16px 20px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.35);
}
.lay-6 .cap .cap-no { display: block; margin-bottom: 8px; }
.lay-6 .cap h3 { font-size: clamp(21px, 5.8vw, 26px); margin-bottom: 8px; }

/* 7 月洞门（拱形裁切） */
.lay-7 .bg {
  width: min(76%, 44vh);
  margin-top: clamp(26px, 5vh, 56px);
  border-radius: 50% 50% 6px 6px / 34% 34% 6px 6px;
  box-shadow: 0 0 0 5px rgba(201, 162, 39, 0.5);
}
.lay-7 .cap { text-align: center; padding-inline: 9%; }

/* 8 满屏出血 + 斜切，文案在斜边下方的宣纸上 */
.lay-8 .bg { clip-path: polygon(0 0, 100% 0, 100% 58%, 0 74%); }
.lay-8 .cap {
  left: var(--pad-x); right: var(--pad-x); top: 76%;
  display: block;
  padding: 0 0 calc(var(--safe-b) + 60px);
}

/* 9 左侧文案 + 右图 */
.lay-9 { flex-direction: row-reverse; }
.lay-9 .pic { width: 56%; align-self: stretch; justify-content: space-between; padding-top: clamp(42px, 9vh, 96px); padding-bottom: calc(var(--safe-b) + 74px); }
.lay-9 .cap { flex: none; width: 44%; align-self: stretch; justify-content: center; padding: 32px var(--pad-x) calc(var(--safe-b) + 78px) 20px; }

/* 10 深底居中图块（无遮挡） */
.lay-10 .bg { width: min(78%, 46vh); margin-top: clamp(34px, 7vh, 76px); }
.lay-10 .cap { text-align: center; padding-inline: 9%; color: var(--white); }
.lay-10 .cap .cap-no { color: var(--gold); }
.lay-10 .cap h3 { color: var(--white); }
.lay-10 .cap p { color: rgba(255, 253, 248, 0.74); }

/* 11 金框图 + 双栏文案 */
.lay-11 .bg { width: min(86%, 50vh); margin-top: clamp(26px, 5vh, 60px); box-shadow: 0 0 0 1px rgba(201, 162, 39, 0.75); }
.lay-11 .cap { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; align-content: center; padding-inline: 7%; }
.lay-11 .cap .cap-no { grid-column: 1 / -1; margin-bottom: 0; }
.lay-11 .cap h3 { grid-row: 2; margin-bottom: 0; font-size: clamp(20px, 5.6vw, 25px); }
.lay-11 .cap p { grid-row: 2; align-self: center; }

/* 12 左竖排文案 + 右侧竖长图 */
.lay-12 { flex-direction: row-reverse; }
.lay-12 .pic { width: 54%; align-self: stretch; justify-content: space-between; padding-top: clamp(34px, 7vh, 76px); padding-bottom: calc(var(--safe-b) + 74px); }
.lay-12 .cap {
  flex: none; width: 46%; align-self: stretch;
  flex-direction: row-reverse; align-items: center; justify-content: center;
  gap: 16px; padding: 32px 10px calc(var(--safe-b) + 78px);
}
.lay-12 .cap .cap-no { position: absolute; left: 12px; bottom: calc(var(--safe-b) + 76px); }

/* ==========================================================================
   信息屏
   ========================================================================== */

.info {
  background:
    radial-gradient(120% 80% at 85% -10%, rgba(201, 162, 39, 0.1), transparent 60%),
    radial-gradient(90% 60% at 0% 110%, rgba(158, 43, 37, 0.07), transparent 60%),
    var(--paper);
  padding:
    calc(var(--safe-t) + clamp(52px, 9vh, 92px))
    var(--pad-x)
    calc(var(--safe-b) + clamp(76px, 12vh, 116px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* 背景水印序号 */
.info .ordinal {
  position: absolute;
  top: calc(var(--safe-t) + 8px);
  right: calc(var(--pad-x) - 6px);
  font-family: var(--f-display);
  font-size: clamp(96px, 34vw, 168px);
  line-height: 1;
  color: rgba(158, 43, 37, 0.07);
  pointer-events: none;
  user-select: none;
}

.head { position: relative; margin-bottom: clamp(20px, 4vh, 34px); }
.head .tick { width: 42px; height: 2px; background: var(--gold); margin-bottom: 16px; }
.head .eyebrow {
  font-family: var(--f-num);
  font-size: 11px;
  letter-spacing: 0.4em;
  color: var(--red);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.head h2 {
  font-family: var(--f-display);
  font-weight: normal;
  font-size: clamp(28px, 8.4vw, 40px);
  letter-spacing: 0.1em;
  color: var(--ink);
}

.body { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; }

.rule { height: 1px; background: rgba(28, 26, 25, 0.14); border: 0; }

/* ---------- 封面 ---------- */

.cover { background: var(--night); }
.cover .bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover .shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(20, 16, 14, 0.5), rgba(20, 16, 14, 0.18) 40%, rgba(20, 16, 14, 0.78));
}
.cover .eyebrow {
  position: absolute;
  top: calc(var(--safe-t) + clamp(44px, 9vh, 78px));
  left: 0;
  right: 0;
  text-align: center;
  color: var(--white);
  font-family: var(--f-display);
  font-size: clamp(15px, 4.2vw, 18px);
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  opacity: 0.92;
}
.cover .names {
  position: absolute;
  inset: 0;
  padding-bottom: 14vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
}
.cover .names .row {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: clamp(18px, 6vw, 30px);
}
.cover .names b {
  writing-mode: vertical-rl;
  font-family: var(--f-display);
  font-weight: normal;
  font-size: clamp(40px, 13.5vw, 62px);
  letter-spacing: 0.3em;
  text-shadow: 0 6px 26px rgba(0, 0, 0, 0.5);
}
.cover .names em {
  writing-mode: vertical-rl;
  font-style: normal;
  font-family: var(--f-display);
  font-size: clamp(14px, 4vw, 17px);
  letter-spacing: 0.6em;
  color: var(--gold);
  opacity: 0.95;
}
.cover .names .bar { width: 1px; align-self: stretch; background: linear-gradient(to bottom, transparent, var(--gold), transparent); }
.cover .date {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(var(--safe-b) + clamp(64px, 11vh, 96px));
  text-align: center;
  color: var(--white);
  font-family: var(--f-num);
  font-size: clamp(13px, 3.6vw, 15px);
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  opacity: 0.88;
}
.cover .date small { display: block; margin-top: 10px; font-family: var(--f-body); font-size: 11px; letter-spacing: 0.3em; opacity: 0.72; }

/* ---------- 倒计时 ---------- */

.countdown .cells { display: flex; align-items: stretch; gap: clamp(8px, 2.4vw, 14px); }
.countdown .cell {
  flex: 1;
  text-align: center;
  padding: clamp(14px, 3.4vh, 22px) 4px clamp(12px, 2.6vh, 18px);
  background: rgba(255, 253, 248, 0.7);
  border: 1px solid rgba(28, 26, 25, 0.1);
}
.countdown .cell strong {
  display: block;
  font-family: var(--f-num);
  font-weight: normal;
  font-size: clamp(30px, 10vw, 46px);
  line-height: 1;
  color: var(--red-deep);
  font-variant-numeric: tabular-nums;
}
.countdown .cell span { display: block; margin-top: 9px; font-size: 11px; letter-spacing: 0.24em; color: var(--ink-60); }
.countdown .lead { font-size: clamp(13px, 3.6vw, 15px); letter-spacing: 0.3em; color: var(--ink-60); margin-bottom: clamp(16px, 3.4vh, 26px); text-align: center; }
.countdown .done { font-family: var(--f-display); font-size: clamp(24px, 7vw, 34px); letter-spacing: 0.14em; color: var(--red); text-align: center; }
.countdown .lunar {
  margin-top: clamp(18px, 3.6vh, 28px);
  text-align: center;
  font-family: var(--f-display);
  font-size: clamp(13px, 3.6vw, 15px);
  letter-spacing: 0.2em;
  color: var(--ink-60);
}

/* ---------- 邀请语 ---------- */

.invitation .greet {
  font-family: var(--f-display);
  font-size: clamp(24px, 7vw, 32px);
  letter-spacing: 0.18em;
  color: var(--red);
  margin-bottom: clamp(18px, 3.6vh, 28px);
}
.invitation .msg {
  font-size: clamp(15px, 4.2vw, 17px);
  line-height: 2.15;
  letter-spacing: 0.06em;
  color: var(--ink);
}
.invitation .sign {
  margin-top: clamp(22px, 4.4vh, 34px);
  font-family: var(--f-display);
  font-size: clamp(15px, 4.2vw, 18px);
  letter-spacing: 0.24em;
  color: var(--ink-60);
  text-align: right;
}

/* ---------- 故事时间轴 ---------- */

.timeline { display: flex; flex-direction: column; gap: clamp(14px, 2.8vh, 22px); }
.timeline li { list-style: none; display: grid; grid-template-columns: 68px 1fr; gap: 14px; align-items: start; }
.timeline .when {
  font-family: var(--f-display);
  font-size: clamp(12px, 3.4vw, 14px);
  letter-spacing: 0.14em;
  color: var(--red);
  padding-top: 3px;
  border-top: 1px solid rgba(158, 43, 37, 0.35);
}
.timeline .what b {
  display: block;
  font-family: var(--f-display);
  font-weight: normal;
  font-size: clamp(16px, 4.6vw, 19px);
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}
.timeline .what p { font-size: clamp(13px, 3.6vw, 14.5px); line-height: 1.85; color: var(--ink-60); }

/* ---------- 婚礼信息 ---------- */

.event .date-line {
  font-family: var(--f-num);
  font-size: clamp(34px, 11vw, 52px);
  line-height: 1.05;
  color: var(--red-deep);
  letter-spacing: 0.02em;
}
.event .date-sub { margin-top: 12px; font-family: var(--f-display); font-size: clamp(14px, 4vw, 16px); letter-spacing: 0.18em; color: var(--ink-60); }
.event .block { margin-top: clamp(20px, 4vh, 32px); }
.event .block h3 { font-family: var(--f-display); font-weight: normal; font-size: clamp(17px, 4.8vw, 20px); letter-spacing: 0.14em; margin-bottom: 8px; }
.event .block p { font-size: clamp(13.5px, 3.8vw, 15px); line-height: 1.8; color: var(--ink-60); }
.event .almanac {
  margin-top: clamp(18px, 3.6vh, 26px);
  padding-top: clamp(14px, 2.6vh, 20px);
  border-top: 1px dashed rgba(28, 26, 25, 0.2);
  font-family: var(--f-display);
  font-size: clamp(12.5px, 3.5vw, 14px);
  letter-spacing: 0.08em;
  line-height: 2;
  color: var(--ink-60);
}
.event .almanac b { color: var(--red); font-weight: normal; }

/* ---------- 交通 ---------- */

.transport .ways { display: flex; flex-direction: column; gap: clamp(14px, 3vh, 20px); }
.transport .way { display: grid; grid-template-columns: 34px 1fr; gap: 14px; align-items: start; }
.transport .way .ico { width: 30px; height: 30px; color: var(--red); }
.transport .way b { display: block; font-family: var(--f-display); font-weight: normal; font-size: clamp(15px, 4.2vw, 17px); letter-spacing: 0.16em; margin-bottom: 5px; }
.transport .way p { font-size: clamp(13px, 3.6vw, 14.5px); line-height: 1.75; color: var(--ink-60); }

.actions { margin-top: clamp(22px, 4.4vh, 34px); display: flex; flex-direction: column; gap: 10px; }
.actions button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 16px;
  font-size: clamp(14px, 3.9vw, 15px);
  letter-spacing: 0.18em;
  border: 1px solid rgba(28, 26, 25, 0.18);
  background: rgba(255, 253, 248, 0.75);
  transition: transform 180ms var(--ease), background 180ms linear, border-color 180ms linear;
}
.actions button.primary { background: var(--red); border-color: var(--red); color: var(--white); }
.actions button:active { transform: scale(0.985); }

/* ---------- 流程 ---------- */

.schedule .rows { display: flex; flex-direction: column; }
.schedule .row {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 16px;
  padding: clamp(13px, 2.6vh, 18px) 0;
  border-bottom: 1px solid rgba(28, 26, 25, 0.12);
}
.schedule .row:first-child { border-top: 1px solid rgba(28, 26, 25, 0.12); }
.schedule .t {
  font-family: var(--f-display);
  font-size: clamp(15px, 4.2vw, 17px);
  letter-spacing: 0.14em;
  color: var(--red);
}
.schedule .row b { display: block; font-family: var(--f-display); font-weight: normal; font-size: clamp(15px, 4.2vw, 17px); letter-spacing: 0.12em; margin-bottom: 5px; }
.schedule .row p { font-size: clamp(12.5px, 3.5vw, 14px); line-height: 1.7; color: var(--ink-60); }

/* ---------- 温馨提示 ---------- */

.notes .grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(14px, 3vw, 20px); }
.notes .card {
  padding: clamp(14px, 3vw, 18px);
  background: rgba(255, 253, 248, 0.72);
  border: 1px solid rgba(28, 26, 25, 0.1);
}
.notes .card .ico { width: 26px; height: 26px; color: var(--red); margin-bottom: 10px; }
.notes .card b { display: block; font-family: var(--f-display); font-weight: normal; font-size: clamp(14.5px, 4vw, 16px); letter-spacing: 0.12em; margin-bottom: 7px; }
.notes .card p { font-size: clamp(12px, 3.3vw, 13.5px); line-height: 1.75; color: var(--ink-60); }

/* ---------- 结尾 ---------- */

.ending {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: calc(var(--safe-t) + 7vh) var(--pad-x) calc(var(--safe-b) + 70px);
  background:
    radial-gradient(70% 40% at 50% 0%, rgba(158, 43, 37, 0.35), transparent 70%),
    var(--night);
}
.ending .bg {
  width: min(74%, 42vh);
  aspect-ratio: 1 / 1;
  flex: none;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(201, 162, 39, 0.6), 0 24px 60px rgba(0, 0, 0, 0.55);
}
.ending .center {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--white);
}
.ending .center h2 {
  font-family: var(--f-display);
  font-weight: normal;
  font-size: clamp(23px, 6.6vw, 32px);
  letter-spacing: 0.16em;
  line-height: 1.8;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}
.ending .center .wait {
  margin-top: clamp(14px, 2.8vh, 22px);
  font-family: var(--f-display);
  font-size: clamp(14px, 4vw, 16px);
  letter-spacing: 0.34em;
  color: #ecc94b;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.6);
}
.ending .again {
  margin-top: clamp(22px, 4.4vh, 36px);
  padding: 12px 26px;
  border: 1px solid rgba(255, 253, 248, 0.5);
  color: var(--white);
  font-size: 13px;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
}
.ending .music-title {
  position: absolute;
  left: 0; right: 0;
  bottom: calc(var(--safe-b) + clamp(56px, 9vh, 84px));
  text-align: center;
  color: rgba(255, 253, 248, 0.6);
  font-size: 11px;
  letter-spacing: 0.28em;
}

/* ==========================================================================
   切屏转场：6 种花样，按屏序号循环
   blinds 竖百叶 · push 整屏上推 · bands 横带 · shutter 光圈 · wave 同向波浪 · split 对开
   ========================================================================== */

#strips {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  pointer-events: none;
  overflow: hidden;
}
#strips.on { display: flex; }
#strips.axis-v { flex-direction: row; }
#strips.axis-h { flex-direction: column; }

#strips .strip {
  position: relative;
  flex: 1 1 0;
  overflow: hidden;
  transform: translate3d(var(--fx, 0), var(--fy, 0), 0);
}
/* 条带互相压 1px：抵消 flex 亚像素取整，杜绝落地瞬间露底缝 */
#strips.axis-v .strip { margin-right: -1px; }
#strips.axis-h .strip { margin-bottom: -1px; }
/* 默认不加阴影、不画金线 —— 多条同时出现会像互相隔离的卡片；
   只在「对开」的中缝保留金线、「上推」保留投影 */
#strips .strip::after { display: none; }
#strips.t-split .strip:first-child::after {
  content: '';
  display: block;
  position: absolute;
  top: 0; bottom: 0; right: 0;
  width: 1px;
  background: rgba(201, 162, 39, 0.5);
}
#strips.t-push .strip { box-shadow: 0 -14px 44px rgba(0, 0, 0, 0.45); }

/* 每条内嵌一整屏的克隆，按条带窗口偏移定位 */
#strips .inner { position: absolute; }
#strips.axis-v .inner {
  width: calc(var(--n, 6) * 100%);
  height: 100%;
  left: calc(var(--i, 0) * -100%);
  top: 0;
}
#strips.axis-h .inner {
  width: 100%;
  height: calc(var(--n, 6) * 100%);
  top: calc(var(--i, 0) * -100%);
  left: 0;
}

#strips.run .strip { animation: stripIn var(--tdur, 620ms) var(--ease) forwards; }
#strips.t-shutter.run .strip { animation-name: shutterIn; }
@keyframes stripIn {
  from { transform: translate3d(var(--fx, 0), var(--fy, 0), 0); }
  to { transform: translate3d(0, 0, 0); }
}
@keyframes shutterIn {
  from { clip-path: circle(0% at 50% 50%); }
  to { clip-path: circle(100% at 50% 50%); }
}

/* 克隆体：文字与装饰保持初始隐藏 —— 落地后由真屏逐行入场，
   避免「先显示再重播」造成闪跳（用户反馈的第 1→2 页冲突即此） */
#strips .inner .rise,
#strips .inner .ordinal { animation: none; opacity: 0; }
#strips .inner .tick,
#strips .inner .fill-rule { animation: none; transform: scaleX(0); }
/* 相册图：克隆体里的擦入与切屏同速同步长，落地时刚好演完 */
#strips .inner .photo:not(.bleed):not(.cover):not(.ending) .bg {
  animation-duration: var(--tdur, 620ms) !important;
  animation-delay: 0ms !important;
}
/* 满屏背景图（封面/出血/尾屏）：克隆体定格在缓推起点 scale(1.05)，
   落地后真屏的 Ken Burns 恰好从 1.05 起步，消除缩放跳变 */
#strips .inner .cover .bg,
#strips .inner .ending .bg,
#strips .inner .bleed .bg {
  animation: none !important;
  transform: scale(1.05);
}
/* 落地接管：只跳过已在克隆体里演完的相册擦入；满屏背景照常缓推 */
.screen.is-active.arrived.photo:not(.cover):not(.ending):not(.bleed) .bg {
  animation: none !important;
}

/* 被替换的旧屏：按转场类型后退 + 压暗 */
#stage .screen.leaving {
  opacity: 1;
  visibility: visible;
  animation: leaveShade var(--tdur, 620ms) var(--ease) forwards;
}
@keyframes leaveShade {
  from { transform: translate3d(0, 0, 0); filter: brightness(1); }
  to {
    transform: translate3d(0, calc(var(--dir, 1) * var(--leave, -6%)), 0);
    filter: brightness(var(--dim, 0.62));
  }
}

/* ==========================================================================
   入场动效：4 套变体，按屏序号轮换（en-1 顶起 · en-2 深推 · en-3 左入 · en-4 缩放）
   ========================================================================== */

.rise { opacity: 0; transform: translateY(16px); }
.screen.is-active .rise {
  animation: rise 720ms var(--ease) both;
  animation-delay: calc(var(--d, 0) * 1ms + 240ms);
}
.screen.en-2 .rise { transform: translateY(30px); }
.screen.en-2.is-active .rise { animation-name: riseDeep; animation-duration: 880ms; }
.screen.en-3 .rise { transform: translateX(-20px); }
.screen.en-3.is-active .rise { animation-name: riseX; }
.screen.en-4 .rise { transform: scale(0.94); }
.screen.en-4.is-active .rise { animation-name: risePop; animation-duration: 780ms; }

@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes riseDeep { to { opacity: 1; transform: translateY(0); } }
@keyframes riseX { to { opacity: 1; transform: translateX(0); } }
@keyframes risePop { to { opacity: 1; transform: scale(1); } }

/* 图片入场：4 套变体（上擦 · 下起 · 横揭 · 框收） */
.screen.is-active.photo:not(.bleed):not(.cover):not(.ending) .bg {
  animation: imgWipe 760ms var(--ease) both;
}
.screen.en-2.is-active.photo:not(.bleed):not(.cover):not(.ending) .bg { animation-name: imgWipeUp; animation-duration: 820ms; }
.screen.en-3.is-active.photo:not(.bleed):not(.cover):not(.ending) .bg { animation-name: imgRevealX; }
.screen.en-4.is-active.photo:not(.bleed):not(.cover):not(.ending) .bg { animation-name: imgFrame; animation-duration: 840ms; }

@keyframes imgWipe { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes imgWipeUp { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes imgRevealX { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes imgFrame { from { clip-path: inset(7% 9% 7% 9%); } to { clip-path: inset(0 0 0 0); } }

/* 细线抽出：信息屏标题短线与落款金线 */
.screen.is-active .head .tick,
.screen.is-active .fill .fill-rule {
  transform-origin: left center;
  animation: ruleDraw 660ms var(--ease) both;
  animation-delay: calc(var(--d, 0) * 1ms + 320ms);
}
@keyframes ruleDraw { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* 信息屏大字水印淡入 */
.screen.is-active .ordinal {
  animation: ordIn 1100ms var(--ease) both;
  animation-delay: 120ms;
}
@keyframes ordIn { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: scale(1); } }

/* ==========================================================================
   常驻 UI
   ========================================================================== */

#hud {
  position: fixed;
  top: calc(var(--safe-t) + 14px);
  right: 16px;
  z-index: 50;
  display: flex;
  gap: 10px;
}
#hud button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(20, 16, 14, 0.42);
  border: 1px solid rgba(255, 253, 248, 0.28);
  color: var(--white);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: transform 200ms var(--ease), opacity 200ms linear,
    background-color 280ms linear, border-color 280ms linear, color 280ms linear;
}
#hud button:active { transform: scale(0.92); }
#hud .note { position: relative; width: 15px; height: 15px; }
#hud .note::before {
  content: '♪';
  position: absolute;
  inset: 0;
  font-size: 17px;
  line-height: 15px;
  text-align: center;
}
#hud button.playing .note { animation: swing 1.6s ease-in-out infinite; color: var(--gold); }
@keyframes swing { 0%, 100% { transform: rotate(-12deg); } 50% { transform: rotate(12deg); } }
#hud .muted .note::after {
  content: '';
  position: absolute;
  left: -2px; right: -2px; top: 50%;
  height: 1.5px;
  background: currentColor;
  transform: rotate(-45deg);
}

#foot {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(var(--safe-b) + 14px);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
  pointer-events: none;
}
#foot .num {
  font-family: var(--f-num);
  font-size: 12px;
  letter-spacing: 0.24em;
  color: rgba(255, 253, 248, 0.85);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
  min-width: 74px;
  transition: color 280ms linear;
}
#foot .track {
  flex: 1;
  height: 2px;
  background: rgba(255, 253, 248, 0.24);
  position: relative;
  transition: background-color 280ms linear;
}
#foot .track i {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: var(--gold);
  width: 0;
  transition: width var(--dur) var(--ease);
}
#foot .nav { display: flex; gap: 8px; pointer-events: auto; }
#foot .nav button {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  color: var(--white);
  background: rgba(20, 16, 14, 0.42);
  border: 1px solid rgba(255, 253, 248, 0.24);
  border-radius: 50%;
  font-size: 13px;
  transition: background-color 280ms linear, border-color 280ms linear, color 280ms linear;
}
#foot .nav button:disabled { opacity: 0.3; }
/* 顶部与底部控件分别跟随自己所处的底色 */
body.top-light #hud button {
  background: rgba(255, 253, 248, 0.78);
  border-color: rgba(28, 26, 25, 0.16);
  color: var(--red);
}
body.bot-light #foot .num { color: rgba(28, 26, 25, 0.7); text-shadow: none; }
body.bot-light #foot .track { background: rgba(28, 26, 25, 0.14); }
body.bot-light #foot .nav button {
  background: rgba(255, 253, 248, 0.8);
  border-color: rgba(28, 26, 25, 0.16);
  color: var(--ink);
}

#hint {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(var(--safe-b) + 66px);
  z-index: 49;
  text-align: center;
  color: rgba(255, 253, 248, 0.75);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  animation: hintFloat 2.4s ease-in-out infinite;
  pointer-events: none;
  transition: opacity 400ms linear, color 280ms linear;
}
body.bot-light #hint { color: rgba(28, 26, 25, 0.5); }
#hint.gone { opacity: 0; }
@keyframes hintFloat { 0%, 100% { transform: translateY(0); opacity: 0.55; } 50% { transform: translateY(-6px); opacity: 1; } }

/* ==========================================================================
   大图查看
   ========================================================================== */

#lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(10, 8, 7, 0.96);
  display: none;
  touch-action: none;
}
#lightbox.on { display: block; }
#lightbox .frame { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; }
#lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform: scale(0.96);
  opacity: 0;
  transition: transform 420ms var(--ease), opacity 320ms linear;
}
#lightbox.on img { transform: none; opacity: 1; }
#lightbox .close {
  position: absolute;
  top: calc(var(--safe-t) + 14px);
  right: 16px;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 253, 248, 0.3);
  color: var(--white);
  font-size: 17px;
  z-index: 2;
}
#lightbox .count {
  position: absolute;
  left: 0; right: 0;
  bottom: calc(var(--safe-b) + 22px);
  text-align: center;
  color: rgba(255, 253, 248, 0.72);
  font-family: var(--f-num);
  font-size: 12px;
  letter-spacing: 0.3em;
}
#lightbox .arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  display: grid; place-items: center;
  color: var(--white);
  font-size: 20px;
  opacity: 0.6;
  z-index: 2;
}
#lightbox .arrow.prev { left: 8px; }
#lightbox .arrow.next { right: 8px; }

/* ==========================================================================
   开屏信封
   ========================================================================== */

#gate {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--white);
  background: rgba(20, 16, 14, 0.42);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  transition: opacity 640ms var(--ease), visibility 640ms;
}
#gate.off { opacity: 0; visibility: hidden; }
#gate .box { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 0 32px; }
#gate .hint { font-family: var(--f-display); font-size: clamp(14px, 4vw, 16px); letter-spacing: 0.4em; text-indent: 0.4em; opacity: 0.85; }
#gate .seal {
  width: clamp(96px, 26vw, 118px);
  height: clamp(96px, 26vw, 118px);
  border: 1px solid rgba(255, 253, 248, 0.55);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--f-display);
  font-size: clamp(20px, 5.6vw, 24px);
  letter-spacing: 0.1em;
  line-height: 1.5;
  padding: 0 14px;
  background: rgba(158, 43, 37, 0.55);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  animation: sealPulse 2.6s ease-in-out infinite;
}
@keyframes sealPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.045); } }
#gate .sub { font-size: 11px; letter-spacing: 0.34em; text-indent: 0.34em; opacity: 0.66; }

/* ==========================================================================
   Toast
   ========================================================================== */

#toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--safe-b) + 96px);
  transform: translate(-50%, 12px);
  z-index: 95;
  padding: 11px 20px;
  background: rgba(20, 16, 14, 0.9);
  color: var(--white);
  font-size: 13px;
  letter-spacing: 0.16em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms linear, transform 260ms var(--ease);
}
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ==========================================================================
   桌面：居中手机宽度
   ========================================================================== */

@media (min-width: 720px) {
  #stage, #strips {
    left: 50%;
    right: auto;
    width: 100%;
    max-width: 460px;
    transform: translateX(-50%);
    box-shadow: 0 0 0 1px rgba(255, 253, 248, 0.08), 0 30px 90px rgba(0, 0, 0, 0.55);
  }
  #gate { left: 50%; right: auto; width: min(460px, 100%); transform: translateX(-50%); }
  #hud { right: max(16px, calc(50% - 214px)); }
  #foot { left: 50%; right: auto; width: min(460px, 100%); transform: translateX(-50%); }
  #lightbox img { max-width: 460px; }
  body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
      radial-gradient(60% 50% at 50% 0%, rgba(158, 43, 37, 0.18), transparent 70%),
      radial-gradient(70% 60% at 50% 100%, rgba(201, 162, 39, 0.1), transparent 70%),
      var(--night);
  }
}

/* 桌面正文加宽屏可读性 */
@media (min-height: 780px) and (min-width: 720px) {
  .info { padding-top: calc(var(--safe-t) + 96px); padding-bottom: calc(var(--safe-b) + 116px); }
}

/* ==========================================================================
   减弱动效
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  /* 只关掉无限循环的装饰动画。
     曾在这里把 .rise 缩到 1ms、把背景缓推关掉 —— 后果：
     ① en-1 屏文字瞬现、en-2/3/4 屏照常淡入，同类屏表现不一；
     ② 克隆体冻在 scale(1.05) 而真屏无缓推，落地弹回。
     转场与入场按用户要求始终播放，保证克隆体与真屏状态一致。 */
  #gate .seal, #hint { animation: none; }
}
