/* ==========================================================================
   一百天 · 奶油小熊皮肤
   --------------------------------------------------------------------------
   设计语言：
   · 奶油底 + 奶茶棕 + 腮红粉，全部大圆角
   · 「贴纸感」= 粗描边 + 柔和投影 + 轻微旋转
   · 小熊是原创造型（圆头/豆豆眼/奶油口鼻），不复制任何版权角色

   结构：令牌 → 基础 → 导航 → 封面 → 序 → 章节 → 合照 → 时间轴
        → 胶片 → 她 → 信 → 页脚 → 灯箱 → 动效 → 响应式
   ========================================================================== */

/* ── 令牌 ─────────────────────────────────────────────────────────────── */
:root {
  --cream:      #fff8ee;   /* 奶油底 */
  --milk:       #fffdf9;   /* 牛奶白（卡片） */
  --sand:       #fdf0e0;   /* 浅沙 */
  --blush:      #fbe0da;   /* 腮红 */
  --blush-deep: #f2b8ac;   /* 深腮红 */
  --butter:     #fdf0c4;   /* 黄油 */
  --mint:       #dcefe2;   /* 薄荷 */

  --cocoa:      #5b4033;   /* 可可（正文） */
  --cocoa-soft: #8a6a55;   /* 淡可可 */
  --cocoa-faint:#b49b88;   /* 更淡 */
  --brown:      #b98055;   /* 小熊棕 */
  --brown-dark: #96603c;   /* 深棕 */

  --line:       rgba(91, 64, 51, .14);
  --line-2:     rgba(91, 64, 51, .26);

  --choco:      #4a3129;   /* 巧克力块（深色章节） */

  --font-title: "YouYuan", "幼圆", "Microsoft YaHei", "PingFang SC", sans-serif;
  --font-body:  "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --font-num:   "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;

  --wrap: 1140px;
  --r-lg: 30px;
  --r-md: 22px;
  --r-sm: 14px;

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --shadow-card: 0 18px 42px -20px rgba(122, 82, 52, .34);
  --shadow-soft: 0 10px 24px -14px rgba(122, 82, 52, .30);

  /* 爪印：用 CSS mask 复用，颜色随 --paw-color 变 */
  --paw: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'><g fill='%23000'><ellipse cx='20' cy='26' rx='9' ry='7'/><circle cx='9' cy='15' r='4.2'/><circle cx='17' cy='9.5' r='4.2'/><circle cx='25' cy='9.5' r='4.2'/><circle cx='33' cy='15' r='4.2'/></g></svg>");
}

/* ── 可替换的小熊图位 ─────────────────────────────────────────────────
   放了 assets/img/bear-*.png 就换成图片；没放就显示内置 SVG。
   尺寸沿用原图位的类，所以换图不会破版。                                */
.bear-photo {
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}
.cover__inner > .bear-photo--peek {
  position: absolute;
  top: -58px; left: 50%;
  width: 108px; height: 126px;
  transform: translateX(-50%);
  filter: drop-shadow(0 10px 14px rgba(122, 82, 52, .22));
  animation: bearBob 4.5s ease-in-out infinite;
  z-index: 5;
}
.chapter__head > .bear-photo--sticker {
  position: absolute;
  right: 0; top: -.2rem;
  width: 72px; height: 84px;
  transform: rotate(8deg);
  filter: drop-shadow(0 6px 10px rgba(122, 82, 52, .16));
}
.toc__mark > .bear-photo--face { width: 30px; height: 30px; }

/* 封蜡换成图片时：图片盖住整个按钮，小熊耳朵和数字让位 */
.seal.has-photo > span,
.seal.has-photo > em { opacity: 0; }
.seal-photo {
  position: absolute;
  inset: -14%;
  width: 128%; height: 128%;
  object-fit: contain;
  pointer-events: none;
  z-index: 3;
}

@media (max-width: 720px) {
  .chapter__head > .bear-photo--sticker { width: 50px; height: 58px; top: 0; }
}
@media (max-width: 560px) {
  .cover__inner > .bear-photo--peek { width: 84px; height: 100px; top: -46px; }
}

/* ── 飘落的花瓣 ───────────────────────────────────────────────────────
   canvas 固定在视口，压在内容之下（z-index 1），不挡点击。            */
.petal-layer {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  display: block;
}

/* ── 环境暖光：缓慢漂移的两团光，像下午的太阳 ───────────────────────── */
.ambient {
  position: fixed; inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.ambient::before, .ambient::after {
  content: "";
  position: absolute;
  width: 70vmax; height: 70vmax;
  border-radius: 50%;
  filter: blur(40px);
}
.ambient::before {
  top: -26vmax; left: -18vmax;
  background: radial-gradient(circle, rgba(255, 230, 178, .38), transparent 60%);
  animation: drift1 26s ease-in-out infinite;
}
.ambient::after {
  bottom: -30vmax; right: -20vmax;
  background: radial-gradient(circle, rgba(251, 224, 218, .34), transparent 60%);
  animation: drift2 32s ease-in-out infinite;
}
@keyframes drift1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(6vw, 5vh) scale(1.1); }
}
@keyframes drift2 {
  0%, 100% { transform: translate(0, 0) scale(1.05); }
  50%      { transform: translate(-5vw, -4vh) scale(.95); }
}

/* ── 暖光转场：点导航 / 换章节时，一团光从点击处晕开 ────────────────── */
.warmlight {
  position: fixed; inset: 0;
  z-index: 190;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at var(--wx, 50%) var(--wy, 50%),
    rgba(255, 234, 194, .95) 0%,
    rgba(255, 214, 160, .55) 24%,
    rgba(255, 205, 150, .18) 44%,
    transparent 66%);
  transition: opacity .38s ease;
  mix-blend-mode: screen;
}
.warmlight.is-on { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .ambient::before, .ambient::after { animation: none; }
  .warmlight { display: none; }
}

/* 封面卡片：帘幕拉开时轻轻浮上来 */
.cover__inner { transition: opacity .9s var(--ease-out), transform .9s var(--ease-out); }
html.is-loading .cover__inner { opacity: 0; transform: translateY(16px) scale(.985); }

/* ── 基础 ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
figure { margin: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background-color: var(--cream);
  /* 波点为主，暖光只做顶部一圈很淡的晕 */
  background-image:
    radial-gradient(120% 55% at 50% -12%, rgba(253, 240, 196, .55), transparent 62%),
    radial-gradient(rgba(185, 128, 85, .13) 1.4px, transparent 1.5px);
  background-size: 100% 100%, 26px 26px;
  background-attachment: fixed, fixed;
  color: var(--cocoa);
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.95;
  letter-spacing: .01em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
a { color: inherit; }
::selection { background: var(--blush-deep); color: #fff; }

.wrap {
  width: min(100% - 8vw, var(--wrap));
  margin-inline: auto;
  position: relative;
  z-index: 3;
}

/* 小图标通用 */
.ico { width: 1em; height: 1em; display: inline-block; vertical-align: -.12em; }

/* 阅读进度条：小熊棕渐层 */
.scrollbar { position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 60; }
.scrollbar i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--blush-deep), var(--brown));
  border-radius: 0 4px 4px 0;
  transition: width .08s linear;
}

/* ── 字级 ─────────────────────────────────────────────────────────────── */
.kicker {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .2em;
  color: var(--brown);
  margin: 0 0 1em;
  display: flex;
  align-items: center;
  gap: .6em;
}
.kicker i {
  font-style: normal;
  background: var(--blush);
  color: #b26a5c;
  border-radius: 999px;
  padding: .18em .7em;
  font-size: 11px;
  letter-spacing: .1em;
}
.kicker--light { color: #f6e3cf; }
.kicker--light i { background: rgba(255, 248, 238, .16); color: #ffe9d2; }

.display {
  font-family: var(--font-title);
  font-weight: 400;
  font-size: clamp(28px, 4.1vw, 46px);
  line-height: 1.45;
  letter-spacing: .01em;
  margin: 0 0 .55em;
  color: var(--cocoa);
  text-wrap: balance;
  max-width: 22em;
}
.display--light { color: #fff4e6; }

.prose p {
  margin: 0 0 1.4em;
  color: var(--cocoa-soft);
  font-size: 16.5px;
  line-height: 2.15;
}
.prose p:last-child { margin-bottom: 0; }
.prose p + p { text-indent: 2em; }

.signature {
  font-family: var(--font-title);
  font-size: 15px;
  color: var(--cocoa-faint);
  margin: 2em 0 0;
}
.signature--right { text-align: right; }

/* 入场动画：外层统一节流 */
[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 1s var(--ease-out), transform 1s var(--ease-out);
}
[data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ── 导航：悬浮胶囊 ───────────────────────────────────────────────────── */
.toc {
  position: fixed; z-index: 50;
  top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  gap: 2rem;
  padding: 1rem clamp(1.2rem, 4vw, 2.6rem);
  pointer-events: none;
  transition: padding .45s var(--ease-out);
}
.toc__mark {
  pointer-events: auto;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: .45em;
  min-height: 44px;
  padding: .3em 1.1em .3em .4em;
  background: var(--milk);
  border: 2px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
  font-family: var(--font-title);
  font-size: 14px;
  color: var(--cocoa);
  letter-spacing: .06em;
  white-space: nowrap;
  transition: transform .4s var(--ease-out), box-shadow .4s;
}
.toc__mark span { color: var(--blush-deep); }
.toc__mark svg { width: 34px; height: 34px; flex: 0 0 auto; }
.toc__mark:hover { transform: translateY(-2px) rotate(-2deg); box-shadow: var(--shadow-card); }

.toc__list {
  pointer-events: auto;
  display: flex; gap: .35rem;
  list-style: none; margin: 0; padding: .35rem;
  background: rgba(255, 253, 249, .86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 2px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
}
.toc__list a {
  display: inline-block;
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--cocoa-soft);
  padding: .5em .85em;
  border-radius: 999px;
  transition: background .35s, color .35s;
  white-space: nowrap;
}
.toc__list a i {
  font-style: normal;
  font-size: 10px;
  opacity: .55;
  margin-right: .35em;
}
.toc__list a:hover { background: var(--sand); color: var(--cocoa); }
.toc__list a.is-active { background: var(--blush); color: #a9574a; }
.toc__list a.is-active i { opacity: .9; }

/* 深色章节时导航反色 */
.toc.on-dark .toc__mark {
  background: rgba(255, 248, 238, .16);
  border-color: rgba(255, 248, 238, .28);
  color: #fff4e6;
  box-shadow: 0 10px 24px -14px rgba(0, 0, 0, .5);
}
.toc.on-dark .toc__mark span { color: #ffd9c9; }
.toc.on-dark .toc__list { background: rgba(74, 49, 41, .72); border-color: rgba(255, 248, 238, .22); }
.toc.on-dark .toc__list a { color: rgba(255, 244, 230, .72); }
.toc.on-dark .toc__list a:hover { background: rgba(255, 248, 238, .14); color: #fff; }
.toc.on-dark .toc__list a.is-active { background: rgba(255, 248, 238, .22); color: #fff; }

/* ── 封面 ─────────────────────────────────────────────────────────────── */
.cover {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(5.5rem, 10vh, 8rem) 1.4rem clamp(4rem, 8vh, 6rem);
  overflow: hidden;
}

/* 背景：大圆奶油光斑 + 飘浮小爱心 */
.cover__glow {
  position: absolute;
  width: min(86vw, 820px); aspect-ratio: 1;
  left: 50%; top: 44%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(251, 224, 218, .85), rgba(253, 240, 196, .5) 46%, transparent 70%);
  filter: blur(30px);
  pointer-events: none;
  animation: breathe 9s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { opacity: .8; transform: translate(-50%, -50%) scale(1); }
  50%      { opacity: 1;  transform: translate(-50%, -50%) scale(1.06); }
}

.cover__inner {
  position: relative; z-index: 4;
  width: min(100%, 620px);
  background: var(--milk);
  border: 3px solid #f3e2ce;
  border-radius: 40px;
  padding: clamp(2.6rem, 5vw, 3.6rem) clamp(1.4rem, 4vw, 2.8rem) clamp(2.2rem, 4vw, 3rem);
  text-align: center;
  box-shadow:
    0 26px 60px -28px rgba(122, 82, 52, .45),
    inset 0 -6px 0 rgba(253, 240, 224, .9);
}

/* 探头的小熊：压在卡片上沿 */
.cover__bear {
  position: absolute;
  top: -58px; left: 50%;
  transform: translateX(-50%);
  width: 108px; height: 126px;
  filter: drop-shadow(0 10px 14px rgba(122, 82, 52, .22));
  pointer-events: none;
  animation: bearBob 4.5s ease-in-out infinite;
  z-index: 5;
}
@keyframes bearBob {
  0%, 100% { transform: translateX(-50%) translateY(0) rotate(-1.5deg); }
  50%      { transform: translateX(-50%) translateY(-7px) rotate(1.5deg); }
}

.cover__kicker {
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .24em;
  color: var(--cocoa-faint);
  margin: 0 0 clamp(.9rem, 2vh, 1.4rem);
}

.cover__title {
  margin: 0;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: .25em;
  line-height: 1;
}
.cover__num {
  font-family: var(--font-num);
  font-weight: 800;
  font-size: clamp(88px, min(20vw, 21vh), 168px);
  line-height: .86;
  letter-spacing: -.03em;
  color: var(--brown-dark);
  font-variant-numeric: tabular-nums;
  /* 只留一道很轻的下沉阴影，不要褐色光晕 */
  text-shadow: 0 3px 0 rgba(246, 226, 200, .9);
  will-change: transform, opacity;
}
.cover__unit {
  font-family: var(--font-title);
  font-size: clamp(18px, 2.6vw, 26px);
  color: var(--cocoa-soft);
}
.cover__not {
  font-family: var(--font-num);
  font-size: clamp(12px, 1.4vw, 15px);
  font-weight: 700;
  color: var(--cocoa-faint);
  align-self: flex-end;
  padding-bottom: clamp(.5rem, 1.6vw, 1.1rem);
}

.cover__line {
  font-family: var(--font-title);
  font-size: clamp(14px, 1.7vw, 17px);
  letter-spacing: .16em;
  color: var(--cocoa-soft);
  margin: clamp(.9rem, 2.2vh, 1.5rem) 0 0;
}

/* 进度条：小熊爪印在走 */
.cover__meter {
  width: min(80%, 360px);
  height: 8px;
  margin: clamp(1.2rem, 3vh, 1.9rem) auto 0;
  background: #f6ece0;
  border-radius: 999px;
  position: relative;
  overflow: visible;
}
.cover__meter i {
  position: absolute; inset: 0 auto 0 0;
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--blush-deep), var(--brown));
  border-radius: 999px;
  transition: width 1.4s var(--ease-out);
}
.cover__meter i::after {
  content: "";
  position: absolute; right: -9px; top: 50%;
  width: 20px; height: 20px;
  transform: translateY(-50%);
  background-color: var(--brown);
  -webkit-mask: var(--paw) center / contain no-repeat;
  mask: var(--paw) center / contain no-repeat;
}

.cover__count { margin-top: clamp(1.5rem, 3.4vh, 2.2rem); }
.cover__countLabel {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2em;
  color: var(--cocoa-faint);
  margin: 0 0 .8rem;
}
.cover__cells {
  display: flex; justify-content: center; align-items: flex-start;
  gap: clamp(.5rem, 2vw, 1.2rem);
}
.cover__cell {
  background: var(--sand);
  border-radius: var(--r-sm);
  padding: .55em .2em .45em;
  min-width: 3.6em;
  border: 1.5px solid #f2e3d1;
}
.cover__cell b {
  display: block;
  font-family: var(--font-num);
  font-size: clamp(20px, min(4.2vw, 3.6vh), 30px);
  font-weight: 800;
  line-height: 1.1;
  color: var(--brown-dark);
  font-variant-numeric: tabular-nums;
}
.cover__cell span {
  display: block;
  font-family: var(--font-body);
  font-size: 9.5px;
  color: var(--cocoa-faint);
  margin-top: .2em;
}

.cover__epigraph {
  font-family: var(--font-title);
  font-size: 13.5px;
  line-height: 2;
  color: var(--cocoa-faint);
  margin: clamp(1.3rem, 3vh, 2rem) 0 0;
}

.cover__scroll {
  position: absolute;
  bottom: clamp(1rem, 2.6vh, 1.8rem);
  left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 10px; letter-spacing: .22em; font-weight: 700;
  color: var(--cocoa-faint);
  z-index: 4;
  padding: .6rem 1rem 0;
}
.cover__scroll i {
  display: block; width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--milk);
  border: 2px solid var(--line);
  position: relative;
}
.cover__scroll i::after {
  content: "";
  position: absolute; left: 50%; top: 46%;
  width: 7px; height: 7px;
  border-right: 2px solid var(--brown);
  border-bottom: 2px solid var(--brown);
  transform: translate(-50%, -50%) rotate(45deg);
  animation: nudge 1.9s ease-in-out infinite;
}
@keyframes nudge {
  0%, 100% { transform: translate(-50%, -60%) rotate(45deg); }
  50%      { transform: translate(-50%, -30%) rotate(45deg); }
}

/* ── 序 ───────────────────────────────────────────────────────────────── */
.prologue { padding: clamp(4.5rem, 10vw, 8rem) 0; }
.prologue__grid {
  display: grid;
  grid-template-columns: minmax(120px, 190px) 1fr;
  gap: clamp(1.8rem, 5vw, 4rem);
  align-items: start;
}
.prologue__aside { position: sticky; top: 6.4rem; }
.prologue__date {
  font-family: var(--font-num);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--cocoa-faint);
  background: var(--milk);
  border: 2px solid var(--line);
  border-radius: var(--r-sm);
  padding: .6em .9em;
  margin: 0;
  display: inline-block;
  transform: rotate(-2deg);
}
.prologue__body {
  background: var(--milk);
  border: 2px solid #f3e2ce;
  border-radius: var(--r-lg);
  padding: clamp(1.8rem, 4vw, 3rem);
  box-shadow: var(--shadow-card);
  max-width: 64ch;
}

/* ── 章节 ─────────────────────────────────────────────────────────────── */
.chapter { padding: clamp(4.5rem, 10vw, 8rem) 0; position: relative; }

.chapter__head {
  max-width: 64ch;
  margin-bottom: clamp(2.4rem, 6vw, 4rem);
  position: relative;
  /* 让容器贴着文字宽度，小熊才能紧贴标题右上角 */
  width: fit-content;
  padding-right: 84px;
}
/* 章节小熊：像一枚贴纸压在标题右上角 */
.chapter__head .sec-bear {
  position: absolute;
  right: 0;
  top: -.2rem;
  width: 72px; height: 84px;
  opacity: .96;
  transform: rotate(8deg);
  pointer-events: none;
  filter: drop-shadow(0 6px 10px rgba(122, 82, 52, .16));
}
.chapter__head { padding-right: 90px; }
.chapter__head .display { max-width: none; }

@media (max-width: 720px) {
  .chapter__head { padding-right: 60px; }
  .chapter__head .sec-bear { width: 50px; height: 58px; top: 0; }
}

.chapter__lead {
  font-family: var(--font-title);
  font-size: clamp(14px, 1.7vw, 16px);
  color: var(--cocoa-faint);
  margin: -.1em 0 0;
  line-height: 1.9;
}
.chapter__lead--light { color: rgba(255, 244, 230, .72); }

/* 标题下的爪印虚线 */
.chapter__rule {
  display: block;
  width: 0; height: 12px;
  margin-top: clamp(1.2rem, 2.6vw, 1.8rem);
  background-image: radial-gradient(circle, var(--blush-deep) 2.6px, transparent 2.8px);
  background-size: 18px 12px;
  background-repeat: repeat-x;
  transition: width 1.2s var(--ease-out) .15s;
}
.rv-rule.is-in .chapter__rule { width: min(280px, 60%); }

/* ── 01 合照：贴纸照片墙 ─────────────────────────────────────────────── */
.wall {
  /* 瀑布流：每张照片按自己的高度自然堆叠，横竖混排不会互相拉扯 */
  columns: 3;
  column-gap: clamp(.7rem, 1.4vw, 1.2rem);
  max-width: 1040px;
  margin-inline: auto;
  perspective: 1400px;
}

.polaroid {
  position: relative;
  background: #fff;
  padding: 12px 12px 0;
  border-radius: 20px;
  border: 2px solid #f4e6d5;
  box-shadow:
    0 2px 0 #fff inset,
    0 16px 30px -18px rgba(122, 82, 52, .42);
  transform:
    rotate(var(--tilt, 0deg))
    perspective(900px)
    rotateX(var(--my, 0deg))
    rotateY(var(--mx, 0deg));
  transition: transform .6s var(--ease-out), box-shadow .6s var(--ease-out);
  cursor: zoom-in;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  margin: 0 0 clamp(1rem, 2vw, 1.6rem);
  display: block;
  width: 100%;
}

/* 每张略微斜一点，像手贴上去的 */
.polaroid:nth-child(3n+1) { --tilt: -1.5deg; }
.polaroid:nth-child(3n+2) { --tilt: 1.1deg; }
.polaroid:nth-child(3n)   { --tilt: -.6deg; }

.polaroid:hover {
  transform: rotate(0) translateY(-7px) scale(1.02);
  box-shadow: 0 24px 40px -20px rgba(122, 82, 52, .5);
  z-index: 5;
}

/* 9 张时用接近方形，一屏能看到两排 */
.polaroid__frame {
  position: relative;
  overflow: hidden;
  background: var(--sand);
  border-radius: 14px;
  aspect-ratio: var(--ar, 1);
}
.polaroid__frame img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 1s var(--ease-out);
}
.polaroid:hover .polaroid__frame img { transform: scale(1.04); }

.polaroid__cap {
  padding: 10px 4px 14px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .7rem;
}
.polaroid__cap p {
  margin: 0;
  font-family: var(--font-title);
  font-size: 13.5px;
  color: var(--cocoa-soft);
  line-height: 1.5;
}
.polaroid__cap span {
  font-family: var(--font-num);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--cocoa-faint);
  white-space: nowrap;
  background: var(--sand);
  border-radius: 999px;
  padding: .15em .6em;
}

/* 照片角上的胶带 → 换成粉色小贴纸 */
.polaroid::before {
  content: "";
  position: absolute;
  top: -10px; left: 50%;
  width: 46px; height: 22px;
  transform: translateX(-50%) rotate(-4deg);
  background: var(--blush);
  border-radius: 6px;
  opacity: .95;
  box-shadow: 0 2px 6px rgba(122, 82, 52, .12);
  pointer-events: none;
}
/* 占位符 */
.ph { position: absolute; inset: 0; }
.ph img { width: 100%; height: 100%; object-fit: cover; }
.ph.is-empty { background: var(--sand); }

.placeholder[hidden] { display: none !important; }
.placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: .5em;
  background:
    repeating-linear-gradient(45deg, rgba(185, 128, 85, .06) 0 9px, transparent 9px 18px),
    var(--sand);
  color: var(--cocoa-faint);
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: .16em;
  text-align: center;
  padding: 1rem;
}
.placeholder b {
  font-family: var(--font-num);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--brown);
}
.placeholder i {
  display: block;
  width: 22px; height: 16px;
  background-color: var(--blush-deep);
  opacity: .7;
  -webkit-mask: var(--paw) center / contain no-repeat;
  mask: var(--paw) center / contain no-repeat;
}

/* ── 02 时间轴：爪印小径 ─────────────────────────────────────────────── */
.timeline {
  list-style: none;
  margin: 0 0 clamp(2.6rem, 6vw, 4rem);
  padding: 0;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 112px; top: .8rem;
  width: 0;
  height: var(--grow, 0%);
  max-height: calc(100% - 1.6rem);
  border-left: 2px dashed rgba(185, 128, 85, .38);
  transition: height .18s linear;
}

.tl {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: clamp(1.2rem, 2.8vw, 2.2rem);
  padding: 0 0 clamp(1.6rem, 3.4vw, 2.4rem);
  position: relative;
}
.tl:last-child { padding-bottom: 0; }

.tl__date { text-align: right; padding-top: .2rem; }
.tl__date b {
  display: block;
  font-family: var(--font-num);
  font-size: 18px;
  font-weight: 800;
  color: var(--brown-dark);
  line-height: 1.25;
  background: var(--milk);
  border: 2px solid #f3e2ce;
  border-radius: 12px;
  padding: .3em .1em;
  font-variant-numeric: tabular-nums;
}
.tl__date span {
  display: block;
  font-family: var(--font-num);
  font-size: 10px;
  font-weight: 600;
  color: var(--cocoa-faint);
  margin-top: .4em;
}

.tl__body {
  position: relative;
  padding-left: clamp(1rem, 2.2vw, 1.6rem);
  background: var(--milk);
  border: 2px solid #f3e2ce;
  border-radius: var(--r-md);
  padding: clamp(1rem, 2.2vw, 1.4rem) clamp(1.1rem, 2.4vw, 1.6rem);
  box-shadow: var(--shadow-soft);
  transition: transform .45s var(--ease-out), box-shadow .45s;
}
.tl__body:hover { transform: translateY(-3px) rotate(-.4deg); box-shadow: var(--shadow-card); }

/* 节点：爪印 */
.tl__body::before {
  content: "";
  position: absolute;
  left: calc(-1 * clamp(1rem, 2.2vw, 1.6rem) - 26px);
  top: 1.1rem;
  width: 20px; height: 20px;
  background-color: var(--blush-deep);
  -webkit-mask: var(--paw) center / contain no-repeat;
  mask: var(--paw) center / contain no-repeat;
  opacity: .85;
}
.tl.is-now .tl__body::before { background-color: var(--brown-dark); opacity: 1; }

.tl__head {
  display: flex; align-items: baseline; gap: .7em;
  flex-wrap: wrap; margin-bottom: .35em;
}
.tl__head h3 {
  font-family: var(--font-title);
  font-size: clamp(17px, 2vw, 20px);
  font-weight: 400;
  margin: 0;
  color: var(--cocoa);
  line-height: 1.5;
}
.tl__tag {
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 700;
  color: #b26a5c;
  background: var(--blush);
  border-radius: 999px;
  padding: .2em .75em;
  white-space: nowrap;
}
.tl__text {
  margin: 0;
  color: var(--cocoa-soft);
  font-size: 15.5px;
  line-height: 1.95;
  max-width: 54ch;
}

/* 统计：四块奶油小牌 */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(.7rem, 1.6vw, 1.1rem);
}
.stats__item {
  background: var(--milk);
  border: 2px solid #f3e2ce;
  border-radius: var(--r-md);
  padding: clamp(1.2rem, 2.8vw, 1.9rem) .8rem;
  text-align: center;
  box-shadow: var(--shadow-soft);
}
.stats__item:nth-child(2) { background: #fff6f3; }
.stats__item:nth-child(3) { background: #fdFAEC; }
.stats__item:nth-child(4) { background: #f4faf6; }
.stats__num {
  font-family: var(--font-num);
  font-weight: 800;
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1;
  color: var(--brown-dark);
  font-variant-numeric: tabular-nums;
}
.stats__num small {
  font-family: var(--font-title);
  font-size: .4em;
  color: var(--cocoa-faint);
  margin-left: .2em;
}
.stats__label {
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .12em;
  color: var(--cocoa-faint);
  margin: .7em 0 0;
}

/* ── 03 她给我拍的：巧克力暗色 ───────────────────────────────────────── */
.chapter--night {
  background:
    radial-gradient(80% 60% at 50% 0%, #5c3d31 0%, var(--choco) 60%, #3d2721 100%);
  color: #fff4e6;
  overflow: hidden;
  border-radius: 48px 48px 0 0;
  margin-top: 0;
}
.chapter--night .display { color: #fff4e6; }
.chapter--night .chapter__lead { color: rgba(255, 244, 230, .68); }
.chapter--night .chapter__rule { background-image: radial-gradient(circle, rgba(251, 224, 218, .6) 2.6px, transparent 2.8px); }

.reel-wrap {
  position: relative;
  z-index: 3;
  margin-top: 1rem;
  padding: clamp(1.8rem, 3.4vw, 2.6rem) 0;
  background:
    repeating-linear-gradient(90deg,
      transparent 0 26px,
      rgba(255, 244, 230, .14) 26px 38px,
      transparent 38px 64px);
  background-size: 100% 8px;
  background-repeat: repeat-x;
  background-position: 0 12%;
}
.reel-wrap::before, .reel-wrap::after {
  content: "";
  position: absolute; left: 0; right: 0; height: 8px;
  background: repeating-linear-gradient(90deg,
    transparent 0 26px,
    rgba(255, 244, 230, .16) 26px 38px,
    transparent 38px 64px);
  pointer-events: none;
}
.reel-wrap::before { top: clamp(.9rem, 1.8vw, 1.3rem); }
.reel-wrap::after  { bottom: clamp(.9rem, 1.8vw, 1.3rem); }

.reel {
  display: flex;
  gap: clamp(.8rem, 1.8vw, 1.3rem);
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  /* 左右留白，让边缘卡片不被切，滚动也更舒服 */
  padding: clamp(1.2rem, 2.4vw, 1.8rem) max(6vw, 40px);
  scrollbar-width: none;
  cursor: grab;
  -webkit-overflow-scrolling: touch;
}
.reel::-webkit-scrollbar { display: none; }
.reel.is-drag { cursor: grabbing; scroll-snap-type: none; scroll-behavior: auto; }
.reel.is-few { justify-content: center; }

.frame {
  flex: 0 0 auto;
  width: clamp(220px, 27vw, 320px);
  scroll-snap-align: center;
  background: #fff;
  padding: 9px 9px 0;
  border-radius: 18px;
  border: 2px solid rgba(255, 244, 230, .22);
  cursor: zoom-in;
  transition: transform .6s var(--ease-out);
}
.frame:hover { transform: translateY(-6px) rotate(-1deg); }

.frame__img {
  position: relative;
  aspect-ratio: var(--ar, 3 / 4);
  max-height: 62vh;
  overflow: hidden;
  background: #6b4a3c;
  border-radius: 12px;
}
.frame__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease-out); }
.frame:hover .frame__img img { transform: scale(1.04); }

.frame__cap {
  padding: .8rem .3rem .95rem;
  display: flex; align-items: baseline; gap: .6em;
}
.frame__no {
  font-family: var(--font-num);
  font-size: 10px;
  font-weight: 800;
  color: var(--blush-deep);
  flex: 0 0 auto;
}
.frame__cap p {
  margin: 0;
  font-family: var(--font-title);
  font-size: 12.5px;
  line-height: 1.6;
  color: rgba(255, 244, 230, .78);
}

.reel__foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.6rem;
  margin-top: 1.2rem;
  z-index: 3;
}
.reel__hint {
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .16em;
  color: rgba(255, 244, 230, .45);
  margin: 0;
}
.reel__nav { display: flex; gap: .5rem; }
.btn-round {
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 2px solid rgba(255, 244, 230, .26);
  background: transparent;
  color: rgba(255, 244, 230, .8);
  font-family: var(--font-num);
  font-size: 15px;
  cursor: pointer;
  transition: background .35s, transform .35s;
}
.btn-round:hover { background: rgba(255, 244, 230, .14); transform: translateY(-2px); }

/* 深色里的占位符 */
.chapter--night .placeholder {
  background:
    repeating-linear-gradient(45deg, rgba(255, 245, 230, .04) 0 9px, transparent 9px 18px),
    #5c3d31;
  color: rgba(255, 244, 230, .4);
}
.chapter--night .placeholder b { color: rgba(255, 244, 230, .55); }
.chapter--night .ph.is-empty { background: #5c3d31; }

/* ── 04 我眼中的她：腮红粉 ───────────────────────────────────────────── */
.chapter--dark {
  background:
    radial-gradient(70% 50% at 15% 5%, #fff2ee 0%, transparent 60%),
    linear-gradient(180deg, #fdeae5 0%, #fbe0da 55%, #fdf3ee 100%);
  color: var(--cocoa);
  overflow: hidden;
  border-radius: 48px;
  margin: clamp(2rem, 5vw, 3.4rem) 0;
}
.chapter--dark .display { color: var(--cocoa); }

.plates { display: grid; gap: clamp(3rem, 7vw, 5.5rem); }

.plate {
  display: grid;
  grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
  gap: clamp(1.6rem, 3.5vw, 3rem);
  align-items: center;
  justify-content: center;
}
.plate:nth-child(even) .plate__fig { order: 2; }
.plate:nth-child(even) { grid-template-columns: minmax(0, 1fr) minmax(0, 420px); }

.plate__fig { position: relative; }
.plate__fig::before {
  content: "";
  position: absolute;
  inset: -12px -12px 12px 12px;
  border: 2px dashed rgba(178, 106, 92, .3);
  border-radius: 26px;
  pointer-events: none;
}
.plate__imgBox {
  position: relative;
  aspect-ratio: var(--ar, 4 / 5);
  max-height: 62vh;
  overflow: hidden;
  background: #f7d9d2;
  border-radius: 24px;
  border: 4px solid #fff;
  box-shadow: var(--shadow-card);
  cursor: zoom-in;
  z-index: 1;
}
.plate__imgBox img { width: 100%; height: 100%; object-fit: cover; object-position: center; transition: transform 1.2s var(--ease-out); }
.plate__imgBox:hover img { transform: scale(1.04); }

.plate__no {
  position: absolute;
  top: -.9rem; left: -.4rem;
  font-family: var(--font-num);
  font-size: clamp(46px, 7vw, 76px);
  font-weight: 800;
  line-height: 1;
  color: #fff;
  -webkit-text-stroke: 2px rgba(178, 106, 92, .45);
  z-index: 2;
  pointer-events: none;
}

.plate__txt {
  max-width: 30ch;
  justify-self: start;
}
.plate__txt h3 {
  font-family: var(--font-title);
  font-size: clamp(20px, 2.6vw, 28px);
  font-weight: 400;
  margin: 0 0 .7em;
  color: var(--cocoa);
}
.plate__txt p {
  margin: 0 0 .4em;
  font-family: var(--font-title);
  font-size: clamp(14px, 1.7vw, 16.5px);
  line-height: 2;
  color: var(--cocoa-soft);
}
.plate__rule {
  width: 40px; height: 10px;
  margin: 1.3rem 0;
  background-image: radial-gradient(circle, var(--blush-deep) 2.4px, transparent 2.6px);
  background-size: 16px 10px;
  background-repeat: repeat-x;
}

/* 小细节列表 */
.details {
  margin-top: clamp(3rem, 6vw, 4.5rem);
  padding-top: clamp(2rem, 4vw, 2.8rem);
  border-top: 2px dashed rgba(178, 106, 92, .28);
}
.details__title {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .22em;
  color: #b26a5c;
  margin: 0 0 1.6rem;
  display: flex; align-items: center; gap: .6em;
}
.details__title::after {
  content: "";
  flex: 1; height: 10px;
  background-image: radial-gradient(circle, rgba(178, 106, 92, .3) 2.2px, transparent 2.4px);
  background-size: 14px 10px;
  background-repeat: repeat-x;
}
.details__list {
  list-style: none; margin: 0; padding: 0;
  columns: 2; column-gap: clamp(1.6rem, 5vw, 3.4rem);
}
.details__list li {
  font-family: var(--font-title);
  font-size: clamp(14px, 1.7vw, 16px);
  color: var(--cocoa-soft);
  background: rgba(255, 253, 249, .72);
  border-radius: 14px;
  padding: .7em .9em .7em 2.4em;
  margin-bottom: .55em;
  position: relative;
  break-inside: avoid;
}
.details__list li::before {
  content: "";
  position: absolute; left: .85em; top: 50%;
  width: 18px; height: 18px;
  transform: translateY(-50%);
  background-color: var(--blush-deep);
  -webkit-mask: var(--paw) center / contain no-repeat;
  mask: var(--paw) center / contain no-repeat;
}

/* ── 05 信 ────────────────────────────────────────────────────────────── */
.chapter--closed { background: transparent; }

.letter {
  max-width: 700px;
  margin: 0 auto;
  background: var(--milk);
  border: 3px solid #f3e2ce;
  border-radius: 32px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}
.letter::before {
  content: "";
  position: absolute; inset: 0;
  background: repeating-linear-gradient(180deg, transparent 0 38px, rgba(185, 128, 85, .07) 38px 39px);
  pointer-events: none;
  opacity: 0;
  transition: opacity 1s .3s;
}
.letter.is-open::before { opacity: 1; }

.letter__cover {
  padding: clamp(2.4rem, 5vw, 3.4rem) 2rem clamp(2rem, 4vw, 2.8rem);
  text-align: center;
  position: relative;
  transition: opacity .8s var(--ease-out), transform .8s var(--ease-out), padding .8s var(--ease-out), max-height .8s;
  max-height: 900px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: clamp(300px, 42vh, 400px);
}
.letter.is-open .letter__cover {
  opacity: 0;
  transform: translateY(-20px) scale(.97);
  max-height: 0;
  padding-block: 0;
  pointer-events: none;
}

.seal-wrap {
  position: relative;
  display: inline-flex;
  justify-content: center;
  margin-inline: auto;
  width: clamp(104px, 15vw, 130px);
}
.seal-ear {
  position: absolute;
  top: -12px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--brown);
  border: 3px solid #fff;
  z-index: 0;
}
.seal-ear--l { left: 2px; }
.seal-ear--r { right: 2px; }

.seal {
  width: clamp(104px, 15vw, 130px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 3px solid #fff;
  cursor: pointer;
  position: relative;
  z-index: 1;
  background: radial-gradient(circle at 34% 28%, #d9885f, var(--brown) 52%, var(--brown-dark) 100%);
  color: #fff8ee;
  display: grid;
  place-content: center;
  gap: .05em;
  box-shadow: 0 12px 24px -12px rgba(122, 82, 52, .7);
  transition: transform .5s var(--ease-out), box-shadow .5s;
}
.seal:hover { transform: translateY(-4px) rotate(-3deg) scale(1.03); }
.seal:active { transform: scale(.97); }
.seal span {
  font-family: var(--font-num);
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 800;
  line-height: 1;
}
.seal em {
  font-style: normal;
  font-family: var(--font-title);
  font-size: 11px;
  letter-spacing: .3em;
  opacity: .9;
  margin-top: .15em;
  padding-left: .3em;
}

.letter__hint {
  font-family: var(--font-title);
  font-size: 13px;
  color: var(--cocoa-faint);
  margin: 2rem 0 0;
  animation: pulseHint 3s ease-in-out infinite;
}
@keyframes pulseHint { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

.letter__body {
  padding: 0 clamp(1.6rem, 5vw, 3.6rem);
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity .9s .2s var(--ease-out), max-height 1.1s var(--ease-out), padding .9s var(--ease-out);
}
.letter.is-open .letter__body {
  opacity: 1;
  max-height: 3000px;
  padding: clamp(2.2rem, 5vw, 3.6rem) clamp(1.6rem, 5vw, 3.6rem) clamp(2.2rem, 5vw, 3.2rem);
}

.letter__greeting {
  font-family: var(--font-title);
  font-size: clamp(16px, 1.9vw, 18px);
  color: var(--cocoa);
  margin: 0 0 1.4em;
}
.prose--letter p { font-size: 16px; line-height: 2.25; color: var(--cocoa-soft); }
.letter__ps {
  font-family: var(--font-title);
  font-size: 13.5px;
  color: var(--cocoa-faint);
  margin: 2em 0 0;
  padding-top: 1.3em;
  border-top: 2px dashed rgba(185, 128, 85, .28);
  text-align: right;
}

/* ── 页脚 ─────────────────────────────────────────────────────────────── */
.foot {
  padding: clamp(3rem, 7vw, 5rem) 0 clamp(2.4rem, 5vw, 3.4rem);
  background: var(--sand);
  border-radius: 48px 48px 0 0;
  margin-top: clamp(2rem, 5vw, 3rem);
}
.foot__grid {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: end;
  gap: clamp(1.2rem, 4vw, 3rem);
}
.foot__big {
  font-family: var(--font-title);
  font-size: clamp(22px, 3.4vw, 34px);
  margin: 0;
  color: var(--cocoa);
  line-height: 1.2;
}
.foot__big b {
  font-family: var(--font-num);
  font-weight: 800;
  font-size: 1.3em;
  color: var(--brown-dark);
  font-variant-numeric: tabular-nums;
}
.foot__meta {
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 600;
  color: var(--cocoa-faint);
  line-height: 2;
  margin: 0;
}
.foot__quote {
  font-family: var(--font-title);
  font-size: 14px;
  color: var(--cocoa-soft);
  margin: 0;
  text-align: right;
}

/* ── 灯箱 ─────────────────────────────────────────────────────────────── */
.lightbox {
  position: fixed; inset: 0;
  z-index: 100;
  background: rgba(61, 39, 33, .9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: clamp(1.2rem, 5vw, 3rem);
  opacity: 0;
  transition: opacity .4s var(--ease-out);
}
.lightbox[hidden] { display: none; }
.lightbox.is-in { opacity: 1; }

.lightbox__fig {
  margin: 0;
  max-width: min(92vw, 1040px);
  display: flex; flex-direction: column; align-items: center;
  gap: 1rem;
  transform: scale(.92);
  opacity: 0;
  transition: transform .55s var(--ease-out), opacity .45s var(--ease-out);
}
.lightbox.is-in .lightbox__fig { transform: none; opacity: 1; }

.lightbox__frame {
  background: #fff;
  padding: clamp(8px, 1.2vw, 12px);
  border-radius: 20px;
  box-shadow: 0 30px 70px -28px rgba(0, 0, 0, .6);
  max-height: 74svh;
  display: flex;
}
.lightbox__frame img {
  max-height: calc(74svh - 24px);
  width: auto;
  object-fit: contain;
  border-radius: 12px;
  position: relative;
  z-index: 1;
}
.lightbox__ph {
  position: absolute;
  inset: 12px;
  width: auto;
  aspect-ratio: 4 / 5;
  max-height: calc(70svh - 24px);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: .7em;
  background: var(--sand);
  border-radius: 12px;
  color: var(--cocoa-faint);
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: .16em;
}
.lightbox__ph b { font-family: var(--font-num); font-size: 14px; letter-spacing: .1em; }
.lightbox__ph i {
  width: 24px; height: 18px;
  background-color: var(--blush-deep);
  opacity: .7;
  -webkit-mask: var(--paw) center / contain no-repeat;
  mask: var(--paw) center / contain no-repeat;
}

.lightbox__fig figcaption {
  font-family: var(--font-title);
  font-size: clamp(13px, 1.7vw, 15.5px);
  color: rgba(255, 244, 230, .9);
  text-align: center;
  line-height: 1.8;
  max-width: 60ch;
}
.lightbox__count {
  position: absolute;
  bottom: clamp(1rem, 2.4vw, 1.6rem);
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  color: rgba(255, 244, 230, .55);
  margin: 0;
}
.lightbox__close {
  position: absolute;
  top: clamp(.7rem, 1.8vw, 1.3rem); right: clamp(.7rem, 1.8vw, 1.3rem);
  width: 44px; height: 44px;
  border: 2px solid rgba(255, 244, 230, .3);
  border-radius: 50%;
  background: rgba(255, 248, 238, .1);
  color: #fff;
  font-size: 20px; line-height: 1;
  cursor: pointer;
  transition: transform .35s, background .35s;
}
.lightbox__close:hover { background: rgba(255, 248, 238, .2); transform: rotate(90deg); }
.lightbox__prev, .lightbox__next {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 50px; height: 50px;
  border: 2px solid rgba(255, 244, 230, .24);
  border-radius: 50%;
  background: rgba(61, 39, 33, .55);
  color: #fff;
  font-family: var(--font-num);
  font-size: 15px;
  cursor: pointer;
  z-index: 2;
  transition: background .35s;
}
.lightbox__prev:hover, .lightbox__next:hover { background: rgba(255, 248, 238, .22); }
.lightbox__prev { left: clamp(.4rem, 1.6vw, 1.4rem); }
.lightbox__next { right: clamp(.4rem, 1.6vw, 1.4rem); }

/* ── 动效层 ───────────────────────────────────────────────────────────── */
.rv-clip {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .9s var(--ease-out), transform 1.05s var(--ease-out);
  transition-delay: var(--d, 0ms);
}
.rv-clip.is-in { opacity: 1; transform: none; }

.rv-img {
  opacity: 0;
  transform: translateY(34px) scale(1.03);
  transition: opacity 1.05s var(--ease-out), transform 1.05s var(--ease-out);
  transition-delay: var(--d, 0ms);
}
.rv-img.is-in { opacity: 1; transform: none; }

.rv-rise {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .9s var(--ease-out), transform .9s var(--ease-out);
  transition-delay: var(--d, 0ms);
}
.rv-rise.is-in { opacity: 1; transform: none; }

/* 拍立得入场：保留各自倾斜角 */
.polaroid[data-reveal] {
  opacity: 0;
  transform: rotate(var(--tilt, 0deg)) translateY(36px) scale(.96);
  transition:
    opacity 1s var(--ease-out),
    transform 1s var(--ease-out),
    box-shadow .6s var(--ease-out);
}
.polaroid[data-reveal].is-in {
  opacity: 1;
  transform: rotate(var(--tilt, 0deg)) translateY(0) scale(1);
}
.polaroid[data-reveal].is-in:hover {
  transform: rotate(0) translateY(-7px) scale(1.02);
}

.tl, .frame, .will-reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .9s var(--ease-out), transform .9s var(--ease-out);
}
.tl.is-in, .frame.is-in, .will-reveal.is-in { opacity: 1; transform: none; }

/* 封蜡碎裂 */
.letter.is-cracking .seal {
  animation: sealCrack .5s cubic-bezier(.36, .07, .19, .97) both;
}
@keyframes sealCrack {
  0%   { transform: scale(1) rotate(0); opacity: 1; filter: blur(0); }
  35%  { transform: scale(1.12) rotate(-7deg); opacity: 1; }
  100% { transform: scale(1.45) rotate(12deg) translateY(20px); opacity: 0; filter: blur(6px); }
}
.letter.is-cracking .letter__hint { opacity: 0; transition: opacity .3s; }

/* 数字滚完的辉光 */
.cover__num.is-counting { opacity: .85; }
.cover__num.is-counted { animation: numGlow 1.6s var(--ease-out) both; }
@keyframes numGlow {
  0%, 100% { text-shadow: 0 3px 0 rgba(246, 226, 200, .9); }
  35%      { text-shadow: 0 3px 0 rgba(246, 226, 200, .9), 0 0 30px rgba(242, 184, 172, .75); }
}

/* 帘幕 */
html.is-loading .cover__inner > *,
html.is-loading .cover__scroll { animation-play-state: paused !important; }

.veil {
  position: fixed; inset: 0;
  z-index: 200;
  pointer-events: none;
  overflow: hidden;
}
.veil__half {
  position: absolute; left: 0; right: 0;
  height: 50.4%;
  background: var(--choco);
  transition: transform 1.15s cubic-bezier(.76, 0, .24, 1);
  will-change: transform;
}
.veil__half--top { top: 0; }
.veil__half--bottom { bottom: 0; }
.veil__half::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(70% 100% at 50% 50%, rgba(242, 184, 172, .18), transparent 70%);
}
.veil.is-out .veil__half--top { transform: translateY(-100%); }
.veil.is-out .veil__half--bottom { transform: translateY(100%); }

.veil__inner {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 1rem;
  color: #fff4e6;
  opacity: 0; transform: translateY(10px);
  transition: opacity .8s var(--ease-out) .1s, transform .8s var(--ease-out) .1s;
}
.veil.is-run .veil__inner { opacity: 1; transform: none; }
.veil.is-out .veil__inner { opacity: 0; transform: translateY(-12px); transition: opacity .45s, transform .45s; }
.veil__mark {
  margin: 0;
  font-family: var(--font-num);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .34em;
  color: rgba(255, 244, 230, .55);
}
.veil__rule {
  width: 0; height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--blush-deep), transparent);
  transition: width 1.2s var(--ease-out) .2s;
}
.veil.is-run .veil__rule { width: min(50vw, 240px); }
.veil__sub {
  margin: 0;
  font-family: var(--font-title);
  font-size: clamp(19px, 3.2vw, 27px);
  letter-spacing: .34em;
  padding-left: .34em;
}

@media (prefers-reduced-motion: reduce) {
  .rv-clip, .rv-img, .rv-rise, .tl, .frame, .will-reveal { opacity: 1 !important; transform: none !important; }
  .chapter__rule { width: min(280px, 60%); }
  .cover__num.is-counted { animation: none; }
  .lightbox__fig { transform: none; opacity: 1; }
  .cover__bear { animation: none; }
}

/* ── 响应式 ───────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .timeline::before { left: 92px; }
  .tl { grid-template-columns: 78px 1fr; }
  .plate { grid-template-columns: 1fr; gap: 1.8rem; }
  .plate:nth-child(even) .plate__fig { order: 0; }
  .plate__txt { max-width: 54ch; }
  .plate__no { left: auto; right: .4rem; top: -.7rem; }
}

@media (max-width: 820px) {
  body { font-size: 16px; }
  .toc__list { display: none; }

  .prologue__grid { grid-template-columns: 1fr; gap: 1.2rem; }
  .prologue__aside { position: static; }

  .wall { columns: 2; column-gap: .7rem; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .details__list { columns: 1; }
  .foot__grid { grid-template-columns: 1fr; gap: 1rem; align-items: start; }
  .foot__quote { text-align: left; }
  .chapter--night { border-radius: 34px 34px 0 0; }
  .chapter--dark { border-radius: 34px; }
  .foot { border-radius: 34px 34px 0 0; }
}

@media (max-width: 560px) {
  .wrap { width: calc(100% - 2.4rem); }
  .cover { padding-top: 4.6rem; padding-bottom: 4rem; }
  .cover__inner { border-radius: 32px; padding-inline: 1.1rem; }
  .cover__bear { width: 84px; height: 100px; top: -46px; }
  .cover__num { font-size: clamp(76px, 22vw, 110px); }
  .cover__cells { gap: .4rem; }
  .cover__cell { min-width: 3.2em; }

  .timeline::before { left: 0; border-left: none; }
  .tl {
    grid-template-columns: 1fr;
    gap: .45rem;
    padding-left: 1.6rem;
    padding-bottom: 1.4rem;
  }
  .tl__date { display: flex; align-items: baseline; gap: .5em; text-align: left; }
  .tl__date b { font-size: 14px; padding: .18em .6em; }
  .tl__date span { margin-top: 0; }
  .tl__body { padding-left: 0; }
  .tl__body::before { left: -1.5rem; top: 1rem; width: 16px; height: 16px; }

  .wall { columns: 2; column-gap: .6rem; }
  .reel { padding-inline: 1.1rem; }
  .frame { width: 74vw; }
  .chapter__head .sec-bear { width: 50px; height: 60px; }

  .letter__cover { padding: 2.8rem 1.2rem; }
  .lightbox__prev, .lightbox__next { width: 40px; height: 40px; }
}

/* ── 打印 ─────────────────────────────────────────────────────────────── */
@media print {
  body { background: #fff; }
  .scrollbar, .toc, .cover__scroll, .lightbox, .reel__nav, .cover__bear { display: none !important; }
  .chapter--night, .chapter--dark { background: #fff !important; color: #000 !important; }
  [data-reveal], .rv-clip, .rv-img, .rv-rise, .tl, .frame { opacity: 1 !important; transform: none !important; }
  .letter__body { opacity: 1 !important; max-height: none !important; }
  .letter__cover { display: none; }
}

/* ── 手机竖屏专项（iPhone 优先）────────────────────────────────────────
   目标：单列、够大的点击区、避开刘海和底部横条、字号更适合竖屏阅读。 */
@media (max-width: 560px) {
  :root { --r-lg: 24px; --r-md: 18px; --r-sm: 12px; }

  /* 手机端大图强制可见，不依赖入场动画 */
  .plate, .plate__imgBox, .plate__imgBox img, .plate__txt, .plate__no {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
  .plate[data-reveal], .plate__imgBox.rv-img, .plate__txt .rv-rise {
    opacity: 1 !important;
    transform: none !important;
  }

  body {
    font-size: 16.5px;
    /* 左右各留一点，但避开安全区 */
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }

  /* 顶部导航：贴住安全区 */
  .toc {
    padding-top: calc(.7rem + env(safe-area-inset-top));
    padding-left: calc(1rem + env(safe-area-inset-left));
    padding-right: calc(1rem + env(safe-area-inset-right));
  }
  .toc__mark { font-size: 13.5px; padding: .28em .9em .28em .38em; }

  /* 封面：卡片吃满宽度，数字略收 */
  .cover { padding: calc(4.4rem + env(safe-area-inset-top)) .9rem 3.4rem; }
  .cover__inner { border-radius: 26px; padding: 2.2rem 1rem 1.8rem; }
  .cover__bear { width: 78px; height: 92px; top: -42px; }
  .cover__num { font-size: clamp(72px, 21vw, 104px); }
  .cover__not { padding-bottom: .5rem; }
  .cover__cells { gap: .35rem; }
  .cover__cell { min-width: 3em; padding: .5em .1em .4em; }
  .cover__cell b { font-size: 21px; }
  .cover__epigraph { font-size: 12.5px; line-height: 1.9; }

  /* 章节：上下留白收紧，标题不压小熊 */
  .chapter { padding: 3.2rem 0; }
  .chapter__head { padding-right: 54px; margin-bottom: 1.8rem; }
  .display { font-size: 27px; line-height: 1.5; }
  .chapter__lead { font-size: 13.5px; line-height: 1.85; }
  .chapter__head .sec-bear,
  .chapter__head > .bear-photo--sticker { width: 46px; height: 54px; }

  /* 序 */
  .prologue__body { padding: 1.4rem 1.1rem; border-radius: 20px; }
  .prose p { font-size: 15.5px; line-height: 2.05; }

  /* 照片墙：一张一行，铺满 */
  .wall { columns: 1; }
  .polaroid { padding: 9px 9px 0; border-radius: 16px; }
  .polaroid__cap { padding: 8px 2px 12px; }
  .polaroid__cap p { font-size: 13px; }

  /* 时间轴：左侧爪印，卡片铺满 */
  .timeline::before { display: none; }
  .tl { grid-template-columns: 1fr; gap: .5rem; padding-left: 0; padding-bottom: 1.1rem; }
  .tl__date { display: flex; align-items: center; gap: .5rem; text-align: left; }
  .tl__date b { font-size: 13.5px; padding: .2em .7em; border-radius: 999px; }
  .tl__date span { margin: 0; font-size: 9.5px; }
  .tl__body { padding: .95rem 1rem; border-radius: 16px; }
  .tl__body::before { left: .55rem; top: -10px; width: 15px; height: 15px; }
  .tl__head h3 { font-size: 17px; }
  .tl__text { font-size: 14.5px; line-height: 1.9; }

  /* 统计：两列，块更高一点好点 */
  .stats { gap: .6rem; }
  .stats__item { padding: 1rem .5rem; border-radius: 16px; }
  .stats__num { font-size: 26px; }

  /* 胶片：卡片几乎全宽，好滑 */
  .chapter--night { border-radius: 26px 26px 0 0; }
  .reel { padding-inline: .9rem; gap: .7rem; }
  .frame { width: 78vw; border-radius: 14px; padding: 8px 8px 0; }
  .frame__cap p { font-size: 12px; }
  .reel__foot { margin-top: .8rem; }
  .reel__hint { font-size: 9.5px; letter-spacing: .1em; }
  .btn-round { width: 44px; height: 44px; }

  /* 我眼中的她：图在上、字在下 */
  .chapter--dark { border-radius: 26px; margin: 1.4rem 0; }
  .plate { gap: 1.1rem; }
  .plate__imgBox { border-radius: 18px; border-width: 3px; }
  .plate__fig::before { inset: -8px -8px 8px 8px; border-radius: 20px; }
  .plate__no { font-size: 44px; right: .2rem; top: -.5rem; }
  .plate__txt h3 { font-size: 19px; }
  .plate__txt p { font-size: 14.5px; line-height: 1.95; }
  .details { margin-top: 2.4rem; padding-top: 1.6rem; }
  .details__list li { font-size: 14px; padding: .6em .8em .6em 2.2em; }

  /* 信 */
  .letter { border-radius: 22px; border-width: 2px; }
  .letter__cover { min-height: 260px; padding: 2rem 1rem 1.6rem; }
  .seal { width: 96px; }
  .seal-wrap { width: 96px; }
  .letter.is-open .letter__body { padding: 1.6rem 1.1rem 1.8rem; }
  .prose--letter p { font-size: 15px; line-height: 2.15; }

  /* 页脚：底部给 home 横条留位置 */
  .foot { border-radius: 26px 26px 0 0; padding-bottom: calc(2rem + env(safe-area-inset-bottom)); }
  .foot__grid { gap: .7rem; }

  /* 灯箱：竖屏时左右按钮下移，别挡住图 */
  .lightbox { padding: .8rem .8rem calc(.8rem + env(safe-area-inset-bottom)); }
  .lightbox__frame img { max-height: 68svh; }
  .lightbox__prev, .lightbox__next { top: auto; bottom: calc(4.2rem + env(safe-area-inset-bottom)); transform: none; }
  .lightbox__close { top: calc(.6rem + env(safe-area-inset-top)); }

  /* 触控：去掉 hover 造成的“粘住”效果 */
  .polaroid:hover { transform: rotate(var(--tilt, 0deg)); }
  .tl__body:hover { transform: none; }
  .frame:hover { transform: none; }
}

/* 横屏矮屏（比如手机横过来）：把封面压扁 */
@media (max-height: 520px) and (orientation: landscape) {
  .cover { padding-top: 3rem; padding-bottom: 1.5rem; }
  .cover__num { font-size: 84px; }
  .cover__epigraph, .cover__scroll { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .petal-layer { display: none !important; }
}
/* 占位框铺在图片下面；图片加载成功后淡出 */
.ph .placeholder { z-index: 0; transition: opacity .45s ease; }
.ph .ph__img {
  position: relative; z-index: 1;
  opacity: 0;
  transition: opacity .5s ease;
}
.ph.is-loaded .ph__img { opacity: 1; }
.ph.is-loaded .placeholder { opacity: 0; }
.ph.is-empty .ph__img { display: none; }
/* 合照板块：9 张要能连贯看到，标题下留白收一点 */
#photos { padding-top: clamp(3.2rem, 6vw, 5rem); }
#photos .chapter__head { margin-bottom: clamp(1.4rem, 3vw, 2.2rem); }
#photos .chapter__rule { margin-top: .9rem; }
.wall { gap: clamp(1.2rem, 2.2vw, 2rem) clamp(.5rem, 1.2vw, 1rem); }

/* ── 密码门 ───────────────────────────────────────────────────────────
   未解锁时锁住滚动，解锁后卡片淡出。                                    */
html.is-locked, html.is-locked body { overflow: hidden; }

.gate {
  position: fixed; inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  padding: 1.2rem;
  background:
    radial-gradient(70% 60% at 50% 20%, #fffdf8 0%, var(--cream) 55%, var(--sand) 100%);
  transition: opacity .6s var(--ease-out), transform .6s var(--ease-out);
}
.gate.is-out { opacity: 0; transform: scale(1.02); pointer-events: none; }

.gate__card {
  width: min(100%, 380px);
  background: var(--milk);
  border: 3px solid #f3e2ce;
  border-radius: 26px;
  padding: 2.6rem 1.6rem 1.8rem;
  text-align: center;
  position: relative;
  box-shadow: 0 26px 60px -28px rgba(122, 82, 52, .45), inset 0 -6px 0 rgba(253, 240, 224, .9);
}
.gate__bear {
  position: absolute;
  top: -40px; left: 50%;
  transform: translateX(-50%);
  width: 76px; height: 76px;
  filter: drop-shadow(0 8px 12px rgba(122, 82, 52, .2));
}
.gate__kicker {
  font-size: 11px; letter-spacing: .3em; color: var(--cocoa-faint);
  margin: .4rem 0 0;
}
.gate__title {
  font-family: var(--font-title);
  font-size: 24px; font-weight: 400;
  color: var(--cocoa);
  margin: .5rem 0 .6rem;
}
.gate__sub {
  font-family: var(--font-title);
  font-size: 13px; line-height: 1.9;
  color: var(--cocoa-faint);
  margin: 0 0 1.4rem;
}
.gate__form { display: flex; gap: .55rem; }
.gate__input {
  flex: 1; min-width: 0;
  font: inherit;
  font-family: var(--font-num);
  letter-spacing: .3em;
  text-align: center;
  color: var(--cocoa);
  background: var(--sand);
  border: 2px solid #efe0cd;
  border-radius: 12px;
  padding: .7em .5em;
}
.gate__input:focus { outline: none; border-color: var(--brown); background: #fffdf8; }
.gate__btn {
  font: inherit;
  font-family: var(--font-title);
  background: var(--brown);
  color: #fff8ee;
  border: none;
  border-radius: 12px;
  padding: .7em 1.2em;
  cursor: pointer;
  transition: transform .25s, background .25s;
}
.gate__btn:hover { transform: translateY(-1px); background: var(--brown-dark); }
.gate__err {
  min-height: 1.4em;
  font-size: 12.5px;
  color: #b26a5c;
  margin: .9rem 0 0;
}
.gate.shake .gate__card { animation: gateShake .4s; }
@keyframes gateShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-7px); }
  75% { transform: translateX(7px); }
}

@media (max-width: 560px) {
  .gate__card { padding: 2.2rem 1.2rem 1.5rem; border-radius: 22px; }
  .gate__title { font-size: 21px; }
}
