:root {
  --bg: #fff7f9;
  --bg-soft: #ffe9f0;
  --card: #ffffff;
  --pink: #ff6b9d;
  --pink-deep: #e91e63;
  --pink-soft: #ffc1d6;
  --pink-pale: #ffe4ee;
  --ink: #5a3040;
  --muted: #9a6b7c;
  --line: rgba(233, 30, 99, 0.14);
  --shadow: 0 12px 40px rgba(233, 90, 130, 0.12);
  --her: #ff7aa8;
  --me: #ffb3c9;
  /* 外部字体是锦上添花，连不上时整条回退栈要能独立撑住排版 */
  --font-display: "ZCOOL XiaoWei", "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", serif;
  --font-body: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  /* 封面底部要给情侣形象留出的高度，随形象尺寸一起在断点里调 */
  --couple-space: 312px;
  /* 正文滚到底时要停在左右两个小人上方，这里是额外让出的高度。
     桌面端小人在卡片两侧、压不到正文，所以是 0，只在小屏断点里给值 */
  --mascot-space: 0px;
  /* 章节页底部的基础内边距（避开固定的翻页栏） */
  --slide-pad-bottom: 96px;
  /* 左右两个小人的立绘高度 */
  --mascot-h: 150px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  overflow: hidden;
}

body {
  min-height: 100dvh;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 0;
  background: none;
}

/* ---- atmosphere ---- */
.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 50% at 15% 10%, rgba(255, 182, 204, 0.55), transparent 60%),
    radial-gradient(ellipse 60% 45% at 90% 85%, rgba(255, 200, 214, 0.45), transparent 55%),
    linear-gradient(180deg, #fff9fb 0%, #ffeaf2 48%, #fff6f9 100%);
}

.atmosphere__dots {
  position: absolute;
  inset: 0;
  opacity: 0.55;
  background-image:
    radial-gradient(circle at 12% 22%, rgba(255, 140, 175, 0.35) 0 3px, transparent 4px),
    radial-gradient(circle at 78% 18%, rgba(255, 170, 195, 0.4) 0 2px, transparent 3px),
    radial-gradient(circle at 30% 70%, rgba(255, 120, 160, 0.28) 0 2px, transparent 3px),
    radial-gradient(circle at 88% 62%, rgba(255, 150, 180, 0.35) 0 3px, transparent 4px),
    radial-gradient(circle at 52% 40%, rgba(255, 190, 210, 0.4) 0 2px, transparent 3px);
  animation: drift 28s linear infinite;
}

.atmosphere__hearts {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 80%, rgba(255, 107, 157, 0.12) 0 18px, transparent 19px),
    radial-gradient(circle at 70% 30%, rgba(255, 107, 157, 0.1) 0 14px, transparent 15px);
  animation: pulse 7s ease-in-out infinite;
}

@keyframes drift {
  from { transform: translateY(0); }
  to { transform: translateY(-24px); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* 情侣形象靠 translateX(-50%) 居中，动画里必须带上，
   否则 transform 被覆盖，人物会偏到右边、窄屏还会被裁掉 */
@keyframes floaty {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-10px); }
}

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-12px) rotate(2deg); }
}

@keyframes sway {
  0%, 100% { transform: translateY(0) rotate(2deg); }
  50% { transform: translateY(-8px) rotate(-2deg); }
}

@keyframes heartPop {
  0% { transform: translateY(0) scale(0.6); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: translateY(-28px) scale(1.1); opacity: 0; }
}

/* ---- characters ---- */
.mascots {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

/* 形象图是抠干净的竖版立绘，按高度定尺寸，容器宽度由图片自己撑（贴合人物轮廓，
   气泡和爱心才不会飘在人物旁边的空白里） */
.mascot {
  position: absolute;
  transition: opacity 0.5s var(--ease), transform 0.6s var(--ease);
  filter: drop-shadow(0 10px 18px rgba(233, 90, 130, 0.18));
}

.mascot img {
  height: var(--mascot-h);
  width: auto;
  display: block;
  user-select: none;
}

.mascot--boy {
  left: max(8px, 2vw);
  bottom: 88px;
  animation: bob 4.2s ease-in-out infinite;
}

.mascot--girl {
  right: max(8px, 2vw);
  bottom: 88px;
  animation: sway 4.6s ease-in-out infinite;
}

/* 气泡朝屏幕内侧展开：人物贴在左右边缘，居中的气泡会被 .mascots 的 overflow 裁掉 */
.mascot__bubble {
  position: absolute;
  top: -8px;
  background: #fff;
  color: var(--pink-deep);
  border: 1px solid var(--pink-soft);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  box-shadow: var(--shadow);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.mascot--boy .mascot__bubble { left: 0; }
.mascot--girl .mascot__bubble { right: 0; }
.mascot--boy .mascot__heart { right: -10px; }
.mascot--girl .mascot__heart { left: -10px; }

.mascot.is-talking .mascot__bubble {
  opacity: 1;
}

/* 立绘抠图后容器贴合人物，爱心改成飘在人物内侧的空白处，
   不再压在头发上，也不和头顶的气泡叠在一起 */
.mascot__heart {
  position: absolute;
  top: 26%;
  width: 14px;
  height: 14px;
  background: var(--pink);
  transform: rotate(45deg);
  opacity: 0;
}

.mascot__heart::before,
.mascot__heart::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  background: var(--pink);
  border-radius: 50%;
}

.mascot__heart::before { left: -7px; top: 0; }
.mascot__heart::after { left: 0; top: -7px; }

.mascot.is-happy .mascot__heart {
  animation: heartPop 1.8s ease-in-out infinite;
}

.mascot-couple {
  position: absolute;
  left: 50%;
  bottom: 96px;
  width: min(420px, 70vw);
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.5s var(--ease);
  animation: floaty 5s ease-in-out infinite;
  filter: drop-shadow(0 12px 24px rgba(233, 90, 130, 0.16));
}

.mascot-couple img {
  width: 100%;
  height: auto;
  display: block;
}

body[data-scene="cover"] .mascot--boy,
body[data-scene="cover"] .mascot--girl {
  opacity: 0;
  pointer-events: none;
}

body[data-scene="cover"] .mascot-couple {
  opacity: 1;
}

body[data-scene="letter"] .mascot--boy,
body[data-scene="letter"] .mascot--girl {
  opacity: 1;
}

body[data-scene="letter"] .mascot--boy { left: 8%; bottom: 120px; }
body[data-scene="letter"] .mascot--girl { right: 8%; bottom: 120px; }

/* 小屏上人物形象和桌面端一样留在最前面展示（不再退到卡片后面当背景）。
   为了不压住正文，改成给章节页底部多留一段 --mascot-space 的滚动空间：
   内容滑到底时，屏幕下方就是左右两个小人 + 中间的留白 */
@media (max-width: 900px) {
  .mascot {
    bottom: calc(72px + env(safe-area-inset-bottom));
  }

  .mascot--boy { left: 4px; }
  .mascot--girl { right: 4px; }

  .mascot__bubble {
    font-size: 10px;
    padding: 3px 8px;
  }

  .mascot-couple {
    width: min(240px, 58vw);
    bottom: calc(72px + env(safe-area-inset-bottom));
  }

  body[data-scene="letter"] .mascot--boy {
    left: 4px;
    bottom: calc(72px + env(safe-area-inset-bottom));
  }

  body[data-scene="letter"] .mascot--girl {
    right: 4px;
    bottom: calc(72px + env(safe-area-inset-bottom));
  }
}

/* ---- chrome ---- */
.chrome {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 18px calc(14px + env(safe-area-inset-top));
  pointer-events: none;
  /* 页面内容会从顶栏下方滚过，加一层渐变把文字挡住，否则标题和进度条会跟正文糊在一起 */
  background: linear-gradient(to bottom, rgba(255, 247, 249, 0.96) 40%, rgba(255, 247, 249, 0));
}

.chrome > * { pointer-events: auto; }

.icon-btn {
  border: 1px solid var(--pink-soft);
  border-radius: 999px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  letter-spacing: 0.08em;
  font-size: 13px;
  color: var(--pink-deep);
  box-shadow: var(--shadow);
}

.icon-btn[aria-pressed="true"] {
  background: var(--pink);
  color: #fff;
  border-color: var(--pink);
}

.progress {
  height: 6px;
  background: rgba(255, 193, 214, 0.55);
  border-radius: 999px;
  overflow: hidden;
}

.progress__bar {
  height: 100%;
  width: 10%;
  background: linear-gradient(90deg, #ff8fb8, #ff5f95, #ffb3c9);
  transition: width 0.45s var(--ease);
}

.page-indicator {
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--muted);
  min-width: 4.5em;
  text-align: right;
  background: rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  padding: 6px 10px;
}

/* ---- slides ---- */
.deck {
  position: relative;
  z-index: 1;
  height: 100dvh;
  outline: none;
}

.slide {
  position: absolute;
  inset: 0;
  /* flex + 内层 margin:auto：内容不满一屏时居中，超过一屏时从顶部开始且不会被裁掉
     （grid place-items:center / flex align-items:center 在溢出时会切掉顶部） */
  display: flex;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: calc(66px + env(safe-area-inset-top)) 24px calc(var(--slide-pad-bottom) + env(safe-area-inset-bottom));
  opacity: 0;
  visibility: hidden;
  transform: translateY(18px);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease), visibility 0.55s;
}

/* 封面不用留：那一页显示的是中间的情侣形象，靠 --couple-space 单独让位 */
.slide:not([data-chapter="cover"]) {
  padding-bottom: calc(var(--slide-pad-bottom) + var(--mascot-space) + env(safe-area-inset-bottom));
}

.slide.is-active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.slide.is-exit {
  opacity: 0;
  transform: translateY(-14px);
}

.slide__inner {
  width: min(720px, 100%);
  min-width: 0;
  margin: auto;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 193, 214, 0.7);
  border-radius: 28px;
  padding: 28px 26px 30px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.slide__inner--wide { width: min(920px, 100%); }
.slide__inner--song { width: min(760px, 100%); }
.slide__inner--cover {
  text-align: center;
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,236,244,0.88));
  padding-bottom: 36px;
  /* 封面的情侣形象浮在卡片之上，卡片必须让出这块高度，否则会压住「开始回顾」按钮 */
  margin-bottom: var(--couple-space);
}
.slide__inner--letter { width: min(640px, 100%); }

.brand {
  font-family: var(--font-display);
  font-size: clamp(3rem, 11vw, 5.2rem);
  line-height: 1;
  margin: 0 0 10px;
  letter-spacing: 0.08em;
  color: var(--pink-deep);
}

.cover-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4.5vw, 2.2rem);
  font-weight: 400;
  margin: 0 0 10px;
  letter-spacing: 0.16em;
  color: var(--ink);
}

.cover-sub,
.cover-range {
  margin: 0;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.cover-range {
  margin-top: 16px;
  display: inline-block;
  background: var(--pink-pale);
  color: var(--pink-deep);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.92rem;
}

.cta {
  margin-top: 28px;
  padding: 14px 34px;
  border-radius: 999px;
  border: 0;
  background: linear-gradient(135deg, #ff7aa8, #ff4f8b);
  color: #fff;
  letter-spacing: 0.2em;
  box-shadow: 0 10px 24px rgba(255, 79, 139, 0.28);
  transition: transform 0.25s var(--ease), box-shadow 0.25s ease;
}

.cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(255, 79, 139, 0.34);
}

.kicker {
  margin: 0 0 10px;
  color: var(--pink);
  letter-spacing: 0.2em;
  font-size: 0.78rem;
}

.title {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4.8vw, 2.4rem);
  font-weight: 400;
  margin: 0 0 10px;
  letter-spacing: 0.06em;
  color: var(--pink-deep);
}

.lead {
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.75;
  font-size: 1.02rem;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.stat {
  padding: 18px 10px;
  text-align: center;
  background: var(--pink-pale);
  border-radius: 18px;
}

.stat__num {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5.5vw, 2.7rem);
  color: var(--pink-deep);
  line-height: 1.1;
}

.stat__label {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.88rem;
  letter-spacing: 0.06em;
}

.chart {
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  gap: 6px;
  align-items: end;
  height: 170px;
  padding-top: 12px;
}

.chart__col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: 100%;
  justify-content: flex-end;
}

.chart__bar {
  width: 100%;
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, #ff9fbf, #ff5f95);
  transform-origin: bottom;
  transform: scaleY(0);
  transition: transform 0.8s var(--ease);
}

.slide.is-active .chart__bar { transform: scaleY(1); }

.chart__label {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}

.balance { display: grid; gap: 16px; }

.balance__side {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.balance__pct {
  font-family: var(--font-display);
  font-size: 2.3rem;
  color: var(--pink-deep);
}

.balance__name { letter-spacing: 0.14em; }
.balance__count { color: var(--muted); font-size: 0.9rem; }

.balance__bar {
  display: flex;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--pink-pale);
}

.balance__fill {
  height: 100%;
  width: 0;
  transition: width 1s var(--ease);
}

.balance__fill--her { background: linear-gradient(90deg, #ff8fb8, #ff5f95); }
.balance__fill--me { background: linear-gradient(90deg, #ffc2d6, #ff9fbf); }

.footnote {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.7;
}

.hour-chart {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 3px;
  align-items: end;
  height: 130px;
}

.hour-chart__bar {
  border-radius: 4px 4px 1px 1px;
  background: rgba(255, 143, 184, 0.35);
  height: 8%;
  transition: height 0.8s var(--ease), background 0.3s ease;
}

.hour-chart__bar.is-peak {
  background: linear-gradient(180deg, #ffb3c9, #ff5f95);
}

.habit-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.habit {
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--pink-pale);
  border: 1px solid rgba(255, 193, 214, 0.8);
}

.habit__value {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--pink-deep);
  margin-bottom: 4px;
}

.habit__label {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.photo-mosaic {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 72px;
  gap: 8px;
  max-height: 42vh;
  overflow: hidden;
}

.photo-mosaic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 0.7s var(--ease), transform 1.2s var(--ease);
  border-radius: 14px;
  background: #fff;
}

.photo-mosaic img[data-kind="emoji"] {
  object-fit: contain;
  padding: 6px;
  background: #fff;
  image-rendering: auto;
}

.slide.is-active .photo-mosaic img.is-in {
  opacity: 1;
  transform: scale(1);
}

.photo-mosaic img:nth-child(3n) { grid-row: span 2; }

.quotes {
  display: grid;
  gap: 12px;
  max-height: 48vh;
  overflow: auto;
  padding-right: 4px;
}

.quote {
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--pink-pale);
  border-left: 3px solid var(--pink);
}

.quote__meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.quote__text {
  margin: 0;
  line-height: 1.7;
  font-size: 1.02rem;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
}

.timeline li {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 14px;
  align-items: start;
}

.timeline__date {
  color: var(--pink);
  letter-spacing: 0.04em;
  font-size: 0.92rem;
  padding-top: 2px;
}

.timeline__body h3 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--pink-deep);
}

.timeline__body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.letter { margin-top: 4px; }

.letter p {
  margin: 0 0 1em;
  line-height: 1.9;
  color: var(--ink);
  font-size: 1.05rem;
}

.letter-end {
  margin-top: 22px;
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: 0.1em;
  color: var(--pink-deep);
}

/* ---- 歌曲页 ---- */
.player {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 20px;
  background: var(--pink-pale);
  border: 1px solid rgba(255, 193, 214, 0.8);
}

.player__play {
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff7aa8, #ff4f8b);
  box-shadow: 0 8px 20px rgba(255, 79, 139, 0.3);
  display: grid;
  place-items: center;
  transition: transform 0.2s var(--ease);
}

.player__play:hover { transform: scale(1.05); }

/* 三角形播放图标；播放中切换成两根竖条 */
.player__icon {
  display: block;
  width: 0;
  height: 0;
  margin-left: 4px;
  border-style: solid;
  border-width: 9px 0 9px 15px;
  border-color: transparent transparent transparent #fff;
}

.player__play.is-playing .player__icon {
  width: 14px;
  height: 18px;
  margin-left: 0;
  border: 0;
  background: linear-gradient(to right, #fff 0 5px, transparent 5px 9px, #fff 9px 14px);
}

.player__body {
  flex: 1;
  min-width: 0;
}

.player__name {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player__name strong {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.15rem;
  color: var(--pink-deep);
}

.player__name span {
  color: var(--muted);
  font-size: 0.82rem;
}

.player__seek {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 22px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}

.player__seek::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--pink) 0 var(--played, 0%), rgba(255, 193, 214, 0.85) var(--played, 0%) 100%);
}

.player__seek::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--pink) 0 var(--played, 0%), rgba(255, 193, 214, 0.85) var(--played, 0%) 100%);
}

.player__seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -5px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--pink);
  box-shadow: 0 2px 6px rgba(233, 90, 130, 0.3);
}

.player__seek::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--pink);
}

.player__time {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.player__hint {
  margin: 10px 2px 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.6;
}

.lyrics {
  margin-top: 22px;
  display: grid;
  gap: 20px;
}

.lyric-block {
  padding-left: 14px;
  border-left: 2px solid var(--pink-soft);
}

.lyric-block--note { border-left-color: rgba(255, 193, 214, 0.5); }

.lyric-block__tag {
  margin: 0 0 8px;
  font-size: 0.74rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  color: var(--pink);
}

.lyric-block__note {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.7;
}

.lyric-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 6px;
  line-height: 1.85;
  font-size: 1.02rem;
}

.lyric-line__role {
  flex: none;
  width: 1.9em;
  text-align: center;
  border-radius: 999px;
  padding: 1px 0;
  font-size: 0.68rem;
  line-height: 1.5;
  background: var(--pink-pale);
  color: var(--pink-deep);
}

.lyric-line__role[data-role="女"] { background: #ffe0ec; color: #e0447c; }
.lyric-line__role[data-role="男"] { background: #e8effb; color: #4a6fa5; }
.lyric-line__role[data-role="合"] { background: #fdeede; color: #b2743a; }

.lyric-line__text { flex: 1; }

.nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(255, 247, 249, 0.95), transparent);
}

.nav__btn {
  min-width: 108px;
  padding: 12px 18px;
  border: 1px solid var(--pink-soft);
  border-radius: 999px;
  background: #fff;
  color: var(--pink-deep);
  letter-spacing: 0.12em;
  font-size: 0.92rem;
  box-shadow: var(--shadow);
}

.nav__btn--primary {
  border-color: transparent;
  background: linear-gradient(135deg, #ff7aa8, #ff4f8b);
  color: #fff;
}

.nav__btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.slide.is-active .reveal {
  opacity: 1;
  transform: none;
}

.slide.is-active .delay-1 { transition-delay: 0.08s; }
.slide.is-active .delay-2 { transition-delay: 0.16s; }
.slide.is-active .delay-3 { transition-delay: 0.26s; }
.slide.is-active .delay-4 { transition-delay: 0.36s; }

/* 小屏上情侣形象也小一圈，封面留白跟着收 */
@media (max-width: 900px) {
  :root {
    --couple-space: 190px;
    --mascot-h: 104px;
    /* 小人立绘高度 + 头顶气泡 + 一段留白，正文滚到底就停在它们上方 */
    --mascot-space: 124px;
  }
}

@media (max-width: 720px) {
  :root {
    --couple-space: 178px;
    --slide-pad-bottom: 88px;
  }

  .slide {
    padding-top: calc(60px + env(safe-area-inset-top));
    padding-left: 14px;
    padding-right: 14px;
  }

  .slide__inner { padding: 22px 16px 24px; border-radius: 22px; }

  .chrome { padding: 10px 12px; gap: 8px; }
  .icon-btn { padding: 7px 11px; font-size: 12px; }
  .page-indicator { font-size: 11px; padding: 5px 8px; min-width: 4em; }

  .lead { margin-bottom: 18px; font-size: 0.96rem; }

  .stat-row { grid-template-columns: 1fr; }
  .stat { padding: 14px 10px; }

  .habit-grid { grid-template-columns: 1fr; }

  /* 原先用 max-height 裁掉溢出内容，小屏上就变成「看不全」；
     现在整页可以滚动，直接放开高度限制 */
  .photo-mosaic {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 82px;
    max-height: none;
    overflow: visible;
    /* 三列下 nth-child(3n) 的高图会留下空格子，dense 让后面的小图回填 */
    grid-auto-flow: row dense;
  }

  .quotes {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .timeline li { grid-template-columns: 1fr; gap: 4px; }

  .chart { gap: 2px; height: 150px; }
  .chart__label { font-size: 9px; }
  /* 15 个「N月」在窄屏挤成一团，只留数字 */
  .chart__label-unit { display: none; }

  .hour-chart { gap: 2px; height: 116px; }

  .balance__pct { font-size: 1.9rem; }

  .letter p { font-size: 1rem; }

  .player { gap: 12px; padding: 14px; }
  .player__play { width: 50px; height: 50px; }
  .lyric-line { font-size: 0.98rem; }

  .nav { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
  .nav__btn { min-width: 92px; padding: 11px 14px; font-size: 0.88rem; }
}

/* 极窄屏（iPhone SE 一类）再收一档，保证卡片里的正文不贴边 */
@media (max-width: 380px) {
  .slide { padding-left: 10px; padding-right: 10px; }
  .slide__inner { padding: 18px 14px 20px; }
  .photo-mosaic { grid-auto-rows: 70px; gap: 6px; }
  .nav__btn { min-width: 84px; letter-spacing: 0.06em; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
