/* 動一下｜私人教練
 *
 * 視覺方向：軟圓角、白卡片浮在暖米白上、明亮但不刺眼的糖果色、圓潤的大數字。
 * 介面負責讓人想打開，她說的話負責兇。這個反差是刻意的。
 *
 * 例外：劇情播放器維持暗場。那是獎勵，要跟日常畫面有儀式感的區隔。
 */

:root {
  color-scheme: light;

  /* 底 */
  --paper: #FDF6EC;
  --paper-2: #F6EDE1;
  --card: #FFFFFF;

  /* 字 */
  --ink: #33403C;
  --ink-2: #5F6D68;
  --ink-3: #78857F;

  /* 糖果色 */
  --sun: #FFB03B;
  --sun-soft: #FFEBCE;
  --coral: #FF8A80;
  --coral-soft: #FFE2DF;
  --mint: #3FC3B6;
  --mint-soft: #D6F4F0;
  --sky: #5FB3DE;
  --sky-soft: #DAEEF9;
  --grape: #A98CE0;
  --grape-soft: #EBE2FA;
  --leaf: #5FC46E;
  --danger: #F0685E;

  /* 形狀 */
  --r-xl: 32px;
  --r-lg: 24px;
  --r: 18px;
  --r-sm: 13px;

  --shadow-sm: 0 3px 10px rgba(51, 64, 60, .05);
  --shadow: 0 8px 22px rgba(51, 64, 60, .07);
  --shadow-lg: 0 16px 38px rgba(51, 64, 60, .11);

  --ease: cubic-bezier(0.34, 1.36, 0.44, 1);

  font-family: "Noto Sans TC", "PingFang TC", system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
}

/* 深色不是把亮版反過來，是換一組暖的暗色，可愛感要留著 */
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #26232B;
  --paper-2: #2F2B35;
  --card: #363140;
  --ink: #F2ECE4;
  --ink-2: #B3AAB8;
  --ink-3: #9A90A0;
  --sun-soft: #4A3B28;
  --coral-soft: #4A302E;
  --mint-soft: #23403E;
  --sky-soft: #263C48;
  --grape-soft: #362D4A;
  --shadow-sm: 0 3px 10px rgba(0, 0, 0, .22);
  --shadow: 0 8px 22px rgba(0, 0, 0, .30);
  --shadow-lg: 0 16px 38px rgba(0, 0, 0, .42);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #26232B;
    --paper-2: #2F2B35;
    --card: #363140;
    --ink: #F2ECE4;
    --ink-2: #B3AAB8;
    --ink-3: #9A90A0;
    --sun-soft: #4A3B28;
    --coral-soft: #4A302E;
    --mint-soft: #23403E;
    --sky-soft: #263C48;
    --grape-soft: #362D4A;
    --shadow-sm: 0 3px 10px rgba(0, 0, 0, .22);
    --shadow: 0 8px 22px rgba(0, 0, 0, .30);
    --shadow-lg: 0 16px 38px rgba(0, 0, 0, .42);
  }
}

* { box-sizing: border-box; }

html { background: var(--paper); }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

button:focus-visible, input:focus-visible, a:focus-visible {
  outline: 3px solid var(--sun);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  width: min(100%, 760px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: env(safe-area-inset-top) 18px calc(104px + env(safe-area-inset-bottom));
}

/* ---------- 頂部 ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 4px 18px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--ink-2);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .04em;
}

h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-weight: 900; text-wrap: balance; letter-spacing: -.01em; }

h1 { margin-bottom: 0; font-size: clamp(1.75rem, 7vw, 2.3rem); line-height: 1.1; }
h2 { font-size: clamp(1.4rem, 5.6vw, 1.9rem); line-height: 1.3; }
h3 { font-size: 1.2rem; }

.install-button {
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--sun);
  color: #fff;
  font-size: .84rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.install-button:active { transform: scale(.96); }

.screen { display: none; }
.screen.is-active { display: block; animation: screen-in .45s var(--ease) both; }

@keyframes screen-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 運動中：她也在做 ---------- */
/* 用現有的動作圖輪播，配一句短話。素材一張都沒新增，
   但主觀上會覺得「今天是跟她一起練的」。 */
.together {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 4px 0 10px;
  padding: 10px 12px;
  border-radius: var(--r-lg);
  background: var(--sun-soft);
}
.together[hidden] { display: none !important; }
.together-sprite {
  flex: none;
  width: 76px;
  height: 76px;
  border-radius: 14px;
  background-image: var(--action-image);
  background-size: cover;
  background-position: 50% 18%;
  transition: opacity .35s var(--ease);
}
.together-sprite.is-fading { opacity: 0; }
.together-line {
  margin: 0;
  color: var(--ink-2);
  font-size: .9rem;
  line-height: 1.6;
}

/* ---------- 今天她剛剛在幹嘛 ---------- */
/* 圖卡下面的一行圖說。
   本來疊在照片上，但照片內容每天都不一樣，字會壓到她身上而且讀不到，
   所以移出來。這一行是靜靜的，不要做成通知。 */
.today-state {
  margin: 10px 4px 0;
  color: var(--ink-3);
  font-size: .82rem;
  line-height: 1.6;
}
.today-state[hidden] { display: none !important; }

/* 空鏡。她剛走留下的東西——是襯托那句話的，不要搶戲，所以壓扁成一條。 */
.today-shot {
  margin: 8px 4px 0;
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  aspect-ratio: 16 / 7;
}
.today-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.today-shot[hidden] { display: none !important; }

/* ---------- 她記得的事 ---------- */
/* 一句一張紙的感覺，不要做成通知列表。這是他的東西，不是系統紀錄。 */
.remember-list { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.remember-list li {
  padding: 14px 16px;
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--shadow);
  border-left: 3px solid var(--grape);
}
.remember-list p { margin: 0; color: var(--ink); font-size: .95rem; line-height: 1.7; white-space: pre-line; }
.remember-list small { display: block; margin-top: 8px; color: var(--ink-3); font-size: .8rem; }

/* ---------- 隔天早上她留的話 ---------- */
/* 用她的口氣，不是系統通知——所以不給圖示、不給邊框，只用一張紙的感覺。 */
.morning-note {
  margin-top: 12px;
  padding: 16px 16px 12px;
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--shadow);
  border-left: 3px solid var(--sun);
}
.morning-note[hidden] { display: none !important; }
.morning-text {
  margin: 6px 0 12px;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.75;
  white-space: pre-line;
}
.morning-close {
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--sun-soft);
  color: var(--ink-2);
  font: inherit;
  font-size: .9rem;
  cursor: pointer;
}
.morning-close:active { transform: scale(.98); }

/* ---------- 教練卡 ---------- */

.coach-stage {
  position: relative;
  isolation: isolate;
  min-height: 330px;
  overflow: hidden;
  border-radius: var(--r-xl);
  background: var(--sun-soft);
  box-shadow: var(--shadow-lg);
}

.sun-disc {
  position: absolute;
  z-index: 0;
  top: -70px;
  right: -50px;
  width: 230px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--sun);
  opacity: .5;
}

.coach-portrait {
  position: absolute;
  z-index: 1;
  inset: 0 auto 0 0;
  width: 70%;
  height: 100%;
  object-fit: cover;
  /* 裁切點與景別由 shots.js 每天換一顆鏡頭。同一張素材，不同剪法。 */
  object-position: var(--shot-pos, 52% 24%);
  mask-image: linear-gradient(90deg, #000 74%, transparent 100%);
  animation: coach-arrive .8s var(--ease) both, breathe 5.5s ease-in-out 1s infinite;
}

@keyframes coach-arrive {
  from { opacity: 0; transform: translateX(-16px) scale(1.03); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}
/* 呼吸要疊在今天那顆鏡頭的景別上。
   如果這裡寫死 scale(1)，換鏡頭的 zoom 會被動畫每 5.5 秒蓋掉一次，
   畫面就會自己抽動。 */
@keyframes breathe {
  0%, 100% { transform: scale(var(--shot-zoom, 1)); }
  50% { transform: scale(calc(var(--shot-zoom, 1) * 1.014)); }
}

.coach-copy {
  position: absolute;
  z-index: 2;
  right: 14px;
  bottom: 16px;
  width: 51%;
  padding: 17px 16px;
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--shadow);
}

.coach-mode {
  display: inline-block;
  margin-bottom: 9px;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--coral-soft);
  color: var(--coral);
  font-size: .68rem;
  font-weight: 800;
}

.coach-line {
  margin-bottom: 12px;
  font-size: clamp(.9rem, 3.6vw, 1rem);
  font-weight: 700;
  line-height: 1.65;
}

.voice-button[hidden] { display: none; }
.voice-button {
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--mint-soft);
  color: var(--mint);
  font-size: .78rem;
  font-weight: 800;
  cursor: pointer;
}
.voice-button:active { transform: scale(.95); }
/* 這句還沒錄的時候：換成安靜的灰，讓人一眼知道不是按壞了 */
.voice-button.is-mute {
  background: var(--paper-2);
  color: var(--ink-2);
}

/* ---------- 三個狀態小卡 ---------- */

.status-ribbon {
  display: grid;
  grid-template-columns: .8fr 1.5fr 1fr;
  gap: 9px;
  margin: 14px 0 0;
}

.status-ribbon div {
  min-width: 0;
  padding: 14px 10px 15px;
  border-radius: var(--r);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.status-ribbon span, .status-ribbon strong { display: block; }
.status-ribbon span { color: var(--ink-2); font-size: .68rem; font-weight: 700; }
.status-ribbon strong {
  margin-top: 4px;
  font-size: .86rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.status-ribbon div:first-child strong { font-family: Nunito, sans-serif; font-size: 1.5rem; color: var(--sun); line-height: 1.1; }
.status-ribbon div:nth-child(2) strong { color: var(--coral); }
.status-ribbon div:last-child strong { font-family: Nunito, sans-serif; font-size: 1.12rem; color: var(--mint); }

/* ---------- 線索卡 ---------- */

/* 太久沒把她的記憶帶走。
   ⚠ 刻意**不用紅色、不用驚嘆號、不用警告的形狀**——
   用的是跟線索卡同一個家族的軟圓角卡片，只是換成溫暖的沙色。
   這不是系統錯誤，是她的世界觀的一部分：掉的是她記得的事。
   做成紅色警示會把整個畫面的溫度打掉。 */
.memory-warn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 76px;
  margin: 0 0 18px;
  padding: 14px 18px;
  border: 0;
  border-radius: var(--r-lg);
  background: var(--sun-soft);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .18s var(--ease);
}
.memory-warn:active { transform: scale(.985); }
.memory-warn[hidden] { display: none !important; }
.memory-warn-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 44px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--sun);
  color: #fff;
  font-size: 1.3rem;
}
.memory-warn > span:last-child { flex: 1; min-width: 0; }
.memory-warn strong { display: block; font-size: .95rem; font-weight: 800; line-height: 1.5; }
.memory-warn small { display: block; margin-top: 4px; color: var(--ink-2); font-size: .78rem; }

.mystery-lure {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 80px;
  margin: 12px 0 26px;
  padding: 15px 18px;
  border: 0;
  border-radius: var(--r-lg);
  background: var(--grape-soft);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .18s var(--ease);
}
.mystery-lure:active { transform: scale(.985); }

.mystery-lock {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 46px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--grape);
  color: #fff;
  font-size: 1.4rem;
}

.mystery-lure > span:last-child { flex: 1; min-width: 0; }
.mystery-lure small, .mystery-lure strong { display: block; }
.mystery-lure small { color: var(--ink-2); font-size: .7rem; font-weight: 700; }
.mystery-lure strong { margin-top: 3px; font-size: .95rem; font-weight: 800; line-height: 1.45; }

.lure-meter, .bond-meter {
  display: block;
  height: 6px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, .6);
}
.lure-meter i, .bond-meter i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--grape);
  transition: width .7s var(--ease);
}

/* ---------- 標題列 ---------- */

.choice-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 4px;
}
.choice-heading h2, .choice-heading h3 { margin-bottom: 0; }
.choice-heading > p {
  margin-bottom: 4px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--coral-soft);
  color: var(--coral);
  font-size: .74rem;
  font-weight: 800;
  white-space: nowrap;
}

/* ---------- 方案卡 ---------- */

.workout-choices { display: grid; gap: 12px; margin-top: 16px; }

.workout-card {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 96px;
  padding: 16px 18px;
  border: 0;
  border-radius: var(--r-lg);
  color: var(--ink);
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: left;
  cursor: pointer;
  transition: transform .18s var(--ease), box-shadow .22s var(--ease);
}
.workout-card:active { transform: scale(.975); box-shadow: var(--shadow-sm); }

.workout-card .workout-letter {
  display: grid;
  place-items: center;
  width: 54px;
  aspect-ratio: 1;
  border-radius: var(--r);
  background: var(--choice-color);
  color: #fff;
  font-family: Nunito, sans-serif;
  font-size: 1.5rem;
  font-weight: 900;
}
.workout-card small, .workout-card strong { display: block; }
.workout-card small { color: var(--ink-2); font-size: .72rem; font-weight: 700; }
.workout-card strong { margin: 3px 0; font-size: 1.12rem; font-weight: 900; }
.workout-card > span > span { display: block; color: var(--ink-2); font-size: .78rem; }
.workout-card .workout-arrow { color: var(--choice-color); font-size: 1.7rem; font-weight: 700; }

/* ---------- 安全提醒 ---------- */

.safety-note {
  display: grid;
  gap: 5px;
  margin: 26px 0 8px;
  padding: 17px 19px;
  border-radius: var(--r-lg);
  background: var(--sun-soft);
  color: var(--ink-2);
  font-size: .8rem;
  line-height: 1.65;
}
.safety-note strong { color: var(--ink); font-weight: 800; }

/* ---------- 段落開頭 ---------- */

.section-intro { padding: 20px 4px 14px; }
.section-intro h2 { max-width: 17ch; margin-bottom: 12px; }
.section-intro > p:last-child { max-width: 36rem; color: var(--ink-2); line-height: 1.8; font-size: .92rem; }

/* ---------- 默契頁的教練圖 ---------- */

.bond-portrait {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-xl);
  background: var(--mint-soft);
  box-shadow: var(--shadow);
}
.action-sprite {
  aspect-ratio: 1;
  background-image: var(--action-image);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  transition: opacity .25s var(--ease);
}
.action-wave { --action-image: url("/public/coach/base/wave.webp"); }
.action-strict { --action-image: url("/public/assets/coach-strict.webp"); }
.action-highfive { --action-image: url("/public/coach/base/highfive.webp"); }
.action-dance { --action-image: url("/public/assets/coach-dance.webp"); }
.action-tease { --action-image: url("/public/coach/base/tease.webp"); }
.action-concern { --action-image: url("/public/assets/coach-concern.webp"); }

.bond-caption {
  position: absolute;
  right: 16px;
  bottom: 16px;
  padding: 14px 17px;
  border-radius: var(--r);
  background: var(--card);
  box-shadow: var(--shadow);
}
.bond-caption small, .bond-caption strong { display: block; }
.bond-caption small { color: var(--ink-2); font-size: .68rem; font-weight: 700; }
.bond-caption strong { margin-top: 2px; font-size: 1rem; font-weight: 900; color: var(--coral); }
.bond-meter { width: 112px; background: var(--paper-2); }
.bond-meter i { background: var(--coral); }

/* ---------- 語氣選擇 ---------- */

.mode-picker { margin-top: 26px; }
.mode-picker > p:first-child { font-weight: 800; margin-bottom: 10px; }
.mode-picker > div { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.mode-picker button {
  min-height: 50px;
  border: 0;
  border-radius: var(--r);
  background: var(--card);
  color: var(--ink-2);
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .16s var(--ease);
}
.mode-picker button:active { transform: scale(.96); }
.mode-picker button.is-selected { background: var(--mint); color: #fff; box-shadow: var(--shadow); }
.mode-help {
  min-height: 46px;
  margin-top: 14px;
  padding: 13px 16px;
  border-radius: var(--r);
  background: var(--paper-2);
  color: var(--ink-2);
  font-size: .82rem;
  line-height: 1.6;
}

/* ---------- 故事列表 ---------- */

.locked-scenes { margin-top: 34px; }
.scene-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 68%;
  gap: 12px;
  margin: 16px -18px 0;
  padding: 4px 18px 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.scene-strip::-webkit-scrollbar { display: none; }

.scene-card {
  display: flex;
  flex-direction: column;
  min-height: 158px;
  padding: 18px;
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  scroll-snap-align: start;
  cursor: pointer;
  transition: transform .18s var(--ease);
}
.scene-card:active { transform: scale(.975); }
.scene-card.is-locked { background: var(--paper-2); box-shadow: none; cursor: default; }
.scene-card span { display: block; font-size: 1.5rem; color: var(--sun); }
.scene-card.is-locked span { color: var(--ink-3); }
.scene-card strong { display: block; margin-top: auto; font-size: .95rem; font-weight: 800; line-height: 1.45; }
.scene-card small { display: block; margin-top: 5px; color: var(--ink-2); font-size: .75rem; }

/* ---------- 身體狀況 ---------- */

.body-profile {
  margin: 32px 0 8px;
  padding: 6px 18px 10px;
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.body-profile .check-row {
  padding: 2px 0;
  border-bottom: 1px solid var(--paper-2);
  font-size: .9rem;
}
.body-profile .check-row:last-child { border-bottom: 0; }

/* ---------- 紀錄頁 ---------- */

.record-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 16px 0 22px;
}
.record-summary div {
  padding: 20px 8px;
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.record-summary strong, .record-summary span { display: block; }
.record-summary strong {
  font-family: Nunito, sans-serif;
  font-size: 1.85rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.record-summary div:nth-child(1) strong { color: var(--sky); }
.record-summary div:nth-child(2) strong { color: var(--leaf); }
.record-summary div:nth-child(3) strong { color: var(--sun); }
.record-summary span { margin-top: 4px; color: var(--ink-2); font-size: .7rem; font-weight: 700; }

.backup-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.backup-row .secondary-action {
  min-height: 50px;
  border: 0;
  border-radius: var(--r);
  background: var(--card);
  color: var(--mint);
  font-weight: 800;
  box-shadow: var(--shadow-sm);
}

/* 讀回備份讀錯了才會出現。平常不佔位置——這不是常態按鈕，是後悔藥。 */
.undo-import {
  min-height: 50px;
  margin: 0 0 12px;
  border-radius: var(--r);
  background: var(--card);
  color: var(--warn, #c2410c);
  font-weight: 800;
  box-shadow: var(--shadow-sm);
}
.undo-import[hidden] { display: none !important; }

.backup-note {
  margin: 0 4px 26px;
  color: var(--ink-2);
  font-size: .78rem;
  line-height: 1.65;
  transition: color .3s var(--ease);
}
.backup-note.is-flash { color: var(--leaf); font-weight: 800; }

.history-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.history-list li {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 14px;
  align-items: center;
  min-height: 78px;
  padding: 14px 18px;
  border-radius: var(--r);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform .16s var(--ease);
}
.history-list li:active { transform: scale(.985); }
.history-date {
  font-family: Nunito, sans-serif;
  color: var(--sky);
  font-size: .82rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.history-list strong, .history-list span { display: block; }
.history-list li > strong:last-child {
  font-family: Nunito, sans-serif;
  font-size: 1.05rem;
  font-weight: 900;
}
.history-list span { color: var(--ink-2); font-size: .76rem; }
.history-list li > span:nth-child(2) > strong { font-size: .95rem; font-weight: 800; margin-bottom: 2px; color: var(--ink); }

.empty-record {
  display: block !important;
  padding: 34px 22px !important;
  color: var(--ink-2);
  line-height: 1.8;
  font-size: .88rem;
  cursor: default !important;
  background: var(--paper-2) !important;
  box-shadow: none !important;
}

/* ---------- 底部導覽 ---------- */

.bottom-nav {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  width: min(calc(100% - 26px), 460px);
  padding: 8px;
  border: 0;
  border-radius: var(--r-xl);
  background: var(--card);
  box-shadow: var(--shadow-lg);
  transform: translateX(-50%);
}
.bottom-nav button {
  display: grid;
  place-items: center;
  gap: 2px;
  min-height: 54px;
  border: 0;
  border-radius: var(--r);
  background: transparent;
  color: var(--ink-3);
  font-size: .72rem;
  font-weight: 800;
  cursor: pointer;
  transition: background .24s var(--ease), color .24s var(--ease);
}
.bottom-nav button span { font-size: 1.15rem; }
.bottom-nav button.is-active { background: var(--sun-soft); color: var(--sun); }
.bottom-nav button:nth-child(2).is-active { background: var(--coral-soft); color: var(--coral); }
.bottom-nav button:nth-child(3).is-active { background: var(--mint-soft); color: var(--mint); }

/* ---------- 進行中計時列 ---------- */

.running-bar[hidden] { display: none; }

.running-bar {
  position: fixed;
  z-index: 25;
  left: 50%;
  bottom: calc(90px + max(12px, env(safe-area-inset-bottom)));
  display: flex;
  align-items: center;
  gap: 11px;
  width: min(calc(100% - 26px), 460px);
  min-height: 58px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--r-lg);
  color: #fff;
  background: var(--mint);
  box-shadow: var(--shadow-lg);
  font-size: .86rem;
  font-weight: 800;
  cursor: pointer;
  transform: translateX(-50%);
  animation: bar-in .36s var(--ease) both;
}
@keyframes bar-in {
  from { opacity: 0; transform: translate(-50%, 16px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
.running-dot {
  width: 10px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff;
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .4; transform: scale(.8); } }
.running-bar strong {
  margin-left: auto;
  font-family: Nunito, sans-serif;
  font-size: 1.25rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.running-back { opacity: .78; font-size: .74rem; font-weight: 800; }
.running-bar.is-paused { background: var(--ink-2); }
.running-bar.is-paused .running-dot { animation: none; opacity: .6; }

/* ---------- 底部面板 ---------- */

.sheet-backdrop {
  position: fixed;
  z-index: 30;
  inset: 0;
  background: rgba(51, 64, 60, .42);
  backdrop-filter: blur(4px);
}
.bottom-sheet {
  position: fixed;
  z-index: 40;
  right: 0; bottom: 0; left: 0;
  max-height: 92dvh;
  padding: 16px 22px calc(26px + env(safe-area-inset-bottom));
  overflow-y: auto;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  background: var(--paper);
  box-shadow: 0 -18px 46px rgba(51, 64, 60, .18);
  transform: translateY(104%);
  transition: transform .44s var(--ease);
}
.bottom-sheet.is-open { transform: translateY(0); }
.sheet-handle {
  width: 46px; height: 5px;
  margin: 0 auto 14px;
  border-radius: 99px;
  background: var(--ink-3);
  opacity: .45;
}
.sheet-close {
  position: absolute;
  top: 16px; right: 18px;
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--card);
  color: var(--ink-2);
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.bottom-sheet h2 { margin-bottom: 10px; }
.bottom-sheet > p:not(.eyebrow) { color: var(--ink-2); line-height: 1.75; font-size: .92rem; }

.plan-timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(78px, 1fr));
  gap: 9px;
  margin: 20px 0;
}
.plan-step {
  min-height: 86px;
  padding: 14px 12px;
  border-radius: var(--r);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.plan-step small, .plan-step strong { display: block; }
.plan-step small { color: var(--ink-2); font-size: .68rem; font-weight: 700; }
.plan-step strong { margin-top: 6px; font-size: .86rem; font-weight: 800; line-height: 1.4; }

.video-links { display: grid; gap: 10px; margin: 16px 0; }
.video-link {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 13px;
  align-items: center;
  min-height: 66px;
  padding: 11px 15px;
  border-radius: var(--r);
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}
.video-link::before {
  content: "▶";
  display: grid;
  place-items: center;
  width: 40px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--coral);
  color: #fff;
  font-size: .8rem;
  padding-left: 3px;
}
.video-link strong, .video-link small { display: block; }
.video-link strong { font-size: .95rem; font-weight: 800; }
.video-link small { margin-top: 2px; color: var(--ink-2); font-size: .76rem; }

.timer-display {
  margin: 24px 0 18px;
  font-family: Nunito, sans-serif;
  font-size: clamp(4rem, 20vw, 6.5rem);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  text-align: center;
  line-height: 1;
}
.timer-actions { display: grid; gap: 10px; }

.primary-action, .secondary-action {
  width: 100%;
  min-height: 58px;
  border: 0;
  border-radius: var(--r-lg);
  font-weight: 900;
  font-size: 1rem;
  cursor: pointer;
  transition: transform .16s var(--ease);
}
.primary-action { background: var(--mint); color: #fff; box-shadow: var(--shadow); }
.secondary-action { background: transparent; color: var(--ink-2); }
.primary-action:active, .secondary-action:active { transform: scale(.975); }

#reportForm { display: grid; gap: 18px; }
#reportForm > label:not(.check-row) {
  display: grid;
  gap: 10px;
  font-weight: 800;
  font-size: .92rem;
}
#reportForm input[type="number"] {
  min-height: 56px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--r);
  background: var(--card);
  color: var(--ink);
  font-family: Nunito, sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
}
/* 原生滑桿的未填滿段是深灰的，在米白底上太重，整條自己畫 */
#reportForm input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--coral) var(--fill, 50%), var(--paper-2) var(--fill, 50%));
  cursor: pointer;
}
#reportForm input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px; height: 28px;
  border: 4px solid #fff;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: var(--shadow);
  cursor: pointer;
}
#reportForm input[type="range"]::-moz-range-thumb {
  width: 22px; height: 22px;
  border: 4px solid #fff;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: var(--shadow);
  cursor: pointer;
}
#rpeOutput { color: var(--coral); font-weight: 800; }

.check-row {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 52px;
  font-weight: 700;
  font-size: .92rem;
}
.check-row input { width: 26px; height: 26px; accent-color: var(--mint); flex-shrink: 0; }
.warning-row { color: var(--danger); }
.warning-row input { accent-color: var(--danger); }

/* ---------- 完成畫面 ---------- */

.event-reveal {
  position: fixed;
  z-index: 60;
  inset: 0;
  /* 內容會長（對話＋默契理由＋解鎖），所以整個畫面要能捲 */
  display: grid;
  grid-template-rows: auto auto;
  align-content: start;
  overflow-y: auto;
  background: var(--paper);
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s var(--ease);
}
.event-reveal.is-open { opacity: 1; pointer-events: auto; }
.event-visual {
  position: relative;
  overflow: hidden;
  height: 40dvh;
  margin: 14px 14px 0;
  border-radius: var(--r-xl);
  background: var(--sun-soft);
}
/* .action-sprite 本身是正方形的，在這裡要撐滿容器，不然右邊會留白 */
.event-visual .action-sprite {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  background-size: cover;
  background-position: center 14%;
}
.event-copy { padding: 22px 24px calc(24px + env(safe-area-inset-bottom)); }
.event-copy .eyebrow { color: var(--sun); font-weight: 800; }
.event-copy h2 { margin-bottom: 10px; font-size: clamp(1.5rem, 6vw, 2rem); }
.event-copy p:not(.eyebrow) { color: var(--ink-2); line-height: 1.75; font-size: .92rem; }

.bond-reasons { margin: 16px 0 20px; padding: 0; list-style: none; display: grid; gap: 8px; }
.bond-reasons li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 15px;
  border-radius: var(--r-sm);
  background: var(--coral-soft);
  font-size: .84rem;
}
.bond-reasons span { color: var(--ink); font-weight: 600; }
.bond-reasons strong { flex-shrink: 0; color: var(--coral); font-size: .8rem; font-weight: 900; white-space: nowrap; }

/* ---------- 劇情播放器（刻意維持暗場）---------- */

.story-stage {
  position: fixed;
  z-index: 70;
  inset: 0;
  display: grid;
  /* 人物區吃滿，對話框浮在上面，這樣才有「她站在那裡跟你講話」的感覺 */
  grid-template-rows: minmax(0, 1fr) auto;
  background: #241F2A;
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s var(--ease);
}
.story-stage.is-open { opacity: 1; pointer-events: auto; }

.story-visual {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 70% 20%, rgba(255, 176, 59, .30) 0 42%, transparent 72%),
    linear-gradient(165deg, #3A3244, #241F2A);
}
/* 背景層：同一張圖放大＋模糊＋壓暗，讓人物浮出來 */
.story-bg {
  position: absolute;
  inset: -8%;
  background-image: var(--story-image);
  background-size: cover;
  background-position: center 30%;
  filter: blur(26px) brightness(.48) saturate(.85);
  opacity: 0;
  transform: scale(1.06);
  transition: opacity .7s var(--ease);
}
.story-visual.has-image .story-bg { opacity: 1; }

/* 人物層：完整看得到人，邊緣淡出融進背景，加上很輕的呼吸晃動 */
.story-char {
  position: absolute;
  inset: 0;
  background-image: var(--story-image);
  /* 蓋滿畫面、錨在偏上，臉才不會被對話框切掉，底下也不會空一塊 */
  background-size: cover;
  background-position: 50% 12%;
  background-repeat: no-repeat;
  opacity: 0;
  transform-origin: 50% 92%;
}
/* 底部壓一層暗，讓她跟對話框接得順。
   本來用 mask 做，但這個瀏覽器會把整層弄不見，改用蓋一層漸層最穩。 */
.story-char::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 34%;
  background: linear-gradient(180deg, transparent, rgba(29, 25, 34, .78) 70%, #1D1922 100%);
}
.story-visual.has-image .story-char {
  /* 進場 → 呼吸 → 再疊一層很慢的緩推。
     2026-09-07 使用者：「畫面微動～配音～～這樣很棒」。
     原本只有呼吸（起伏 1.2%、六秒一次），看久了整段還是靜的。
     加一層二十秒推近 6% 的緩推之後，整段對話鏡頭一直在走，
     像一顆很慢的推軌，而不是一張會抖的照片。

     ⚠ 呼吸走 `transform`，緩推走獨立的 `scale` 屬性——**不能兩個都寫 transform**，
     後面那個會把前面整個蓋掉（呼吸就不見了）。分開寫，瀏覽器會把
     scale 屬性和 transform 相乘，兩層效果才疊得起來。 */
  animation: story-in .9s var(--ease) both,
             story-push 20s ease-out .9s forwards,
             story-breathe 6s ease-in-out .9s infinite;
}
.story-visual.has-image .story-placeholder { opacity: 0; }

/* 分鏡換圖時保留上一顆鏡頭，等新圖進場後才淡出；不額外動到人物五官。 */
.story-image-bridge {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background-size: cover;
  background-position: 50% 12%;
  background-repeat: no-repeat;
  opacity: 1;
  transition: opacity .9s var(--ease);
}
.story-image-bridge.is-leaving { opacity: 0; }
.story-image-bridge::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 34%;
  background: linear-gradient(180deg, transparent, rgba(29, 25, 34, .78) 70%, #1D1922 100%);
}

@keyframes story-in { from { opacity: 0; transform: scale(1.05) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
/* 呼吸：非常小的起伏，看得出來活著但不會晃到分心 */
@keyframes story-breathe {
  0%, 100% { transform: scale(1) translateY(0); }
  50%      { transform: scale(1.012) translateY(-5px); }
}
/* 很慢的推軌。20 秒推近 6%，推完停在那裡不彈回來（forwards）——
   彈回去會被一眼看出是循環動畫，那就破功了。
   用 scale 屬性而不是 transform，理由見上面 .story-char 的註解。 */
@keyframes story-push {
  from { scale: 1; }
  to   { scale: 1.06; }
}
@media (prefers-reduced-motion: reduce) {
  .story-visual.has-image .story-char { animation: none; opacity: 1; }
  .story-bg, .story-placeholder { transition: none; }
}

.story-placeholder {
  position: relative;
  z-index: 1;
  max-width: min(100%, 30ch);
  padding: 0 28px;
  text-align: center;
  transition: opacity .3s var(--ease);
}
.story-placeholder .eyebrow { color: var(--sun); font-weight: 800; }
.story-placeholder h2 {
  margin: 0;
  color: #F6F0E8;
  font-size: clamp(1.7rem, 8vw, 2.5rem);
  line-height: 1.3;
}
.story-placeholder h2::after {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  border-radius: 99px;
  margin: 22px auto 0;
  background: var(--sun);
}

/* 戀愛遊戲的對話框：壓低、半透明、浮在畫面上，人才看得完整 */
.story-dialogue {
  position: relative;
  min-height: 30dvh;
  padding: 30px 24px calc(26px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(29, 25, 34, .82) 0%, rgba(29, 25, 34, .96) 22%, #1D1922 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid rgba(255, 176, 59, .22);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  margin-top: -34px;
  cursor: pointer;
}
/* 名牌像掛在框上，跟遊戲一樣 */
.story-who {
  display: inline-block;
  margin: 0 0 12px;
  padding: 5px 15px;
  background: linear-gradient(135deg, var(--sun), #FF9A2E);
  border-radius: 999px;
  color: #2A2118;
  font-size: .92rem;
  font-weight: 900;
  letter-spacing: .04em;
  box-shadow: 0 4px 14px rgba(255, 176, 59, .3);
}
.story-text {
  margin: 0;
  max-width: 34rem;
  color: #F6F0E8;
  font-size: clamp(1.02rem, 4.4vw, 1.18rem);
  font-weight: 500;
  line-height: 1.85;
  animation: line-in .3s var(--ease) both;
}
.story-text.is-narration { color: #A79FAF; font-style: italic; font-size: clamp(.94rem, 4vw, 1.05rem); }
@keyframes line-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.story-hint {
  margin: 20px 0 0;
  color: #6E6578;
  font-size: .74rem;
  letter-spacing: .1em;
  animation: blink 2.2s ease-in-out infinite;
}
@keyframes blink { 0%, 100% { opacity: .85; } 50% { opacity: .3; } }

.story-choices[hidden] { display: none; }
.story-choices { display: grid; gap: 10px; margin-top: 20px; }
.story-choices button {
  min-height: 58px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--r);
  color: #241F2A;
  background: var(--sun);
  font-size: .96rem;
  font-weight: 900;
  text-align: left;
  cursor: pointer;
  transition: transform .16s var(--ease);
}
.story-choices button:nth-child(2) { background: #F6F0E8; }
.story-choices button:active { transform: scale(.975); }

.story-skip {
  position: absolute;
  z-index: 2;
  top: max(16px, env(safe-area-inset-top));
  right: 18px;
  min-height: 44px;
  padding: 0 17px;
  border: 0;
  border-radius: 999px;
  color: #241F2A;
  background: rgba(246, 240, 232, .9);
  font-size: .76rem;
  font-weight: 800;
  cursor: pointer;
}

/* ---------- 開場問診 ---------- */

.intake {
  position: fixed;
  z-index: 80;
  inset: 0;
  overflow-y: auto;
  background: var(--paper);
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s var(--ease);
}
.intake.is-open { opacity: 1; pointer-events: auto; }
.intake-inner {
  width: min(100%, 520px);
  margin: 0 auto;
  padding: max(48px, env(safe-area-inset-top)) 24px calc(40px + env(safe-area-inset-bottom));
}
.intake-inner .eyebrow { color: var(--sun); font-weight: 800; }
.intake-inner h2 { margin-bottom: 14px; max-width: 16ch; }
.intake-lead { margin-bottom: 24px; color: var(--ink-2); line-height: 1.8; font-size: .92rem; }
.intake .check-row {
  padding: 4px 18px;
  margin-bottom: 9px;
  border-radius: var(--r);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  font-size: .94rem;
}
.intake-sub { margin: 28px 0 12px; font-weight: 800; }
.intake-gap { display: grid; gap: 9px; margin-bottom: 30px; }
.intake-gap button {
  min-height: 56px;
  border: 0;
  border-radius: var(--r);
  color: var(--ink-2);
  background: var(--card);
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .16s var(--ease);
}
.intake-gap button:active { transform: scale(.98); }
.intake-gap button.is-selected { background: var(--mint); color: #fff; box-shadow: var(--shadow); }
.intake-foot { margin: 16px 0 0; color: var(--ink-3); font-size: .76rem; text-align: center; }

/* ---------- 完成畫面的日常對話 ---------- */

.event-chat[hidden] { display: none; }
.event-chat {
  display: grid;
  gap: 9px;
  margin: 18px 0 4px;
}
.event-chat p {
  margin: 0;
  padding: 14px 17px;
  border-radius: var(--r-lg) var(--r-lg) var(--r-lg) 6px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  font-size: .92rem;
  font-weight: 600;
  line-height: 1.7;
  justify-self: start;
  max-width: 92%;
  animation: chat-in .5s var(--ease) both;
}
@keyframes chat-in {
  from { opacity: 0; transform: translateY(10px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- 她的樣子（收藏冊）---------- */

.outfit-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 62%;
  gap: 11px;
  margin: 16px -18px 0;
  padding: 4px 18px 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.outfit-strip::-webkit-scrollbar { display: none; }

.outfit-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 5px;
  min-height: 128px;
  padding: 17px;
  border: 0;
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  text-align: left;
  scroll-snap-align: start;
  cursor: pointer;
  transition: transform .18s var(--ease);
}
.outfit-card:active { transform: scale(.975); }
.outfit-card strong { font-size: .98rem; font-weight: 900; }
.outfit-card small { color: var(--ink-2); font-size: .76rem; line-height: 1.5; }

.outfit-card.is-locked {
  background: var(--paper-2);
  box-shadow: none;
  cursor: default;
}
.outfit-card.is-locked strong { color: var(--ink-3); }

.outfit-card.is-current { background: var(--sun-soft); }
.outfit-now {
  position: absolute;
  top: 13px;
  right: 13px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--sun);
  color: #fff;
  font-size: .64rem;
  font-weight: 800;
}

/* 解鎖新造型時，在完成畫面最上面那一條 */
.bond-reasons .unlock-row {
  background: var(--sun-soft);
  padding: 14px 16px;
  align-items: flex-start;
}
.bond-reasons .unlock-row b { display: block; font-size: .95rem; font-weight: 900; margin-bottom: 3px; }
.bond-reasons .unlock-row span { line-height: 1.55; }
.bond-reasons .unlock-row strong { color: var(--sun); }

/* ---------- 響應式 ---------- */

@media (min-width: 560px) {
  .workout-choices { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 760px) {
  .app-shell { padding-inline: 28px; }
  .coach-stage { min-height: 440px; }
  .coach-copy { width: 44%; right: 26px; bottom: 26px; }
  .bottom-sheet { left: 50%; width: min(620px, 100%); transform: translate(-50%, 104%); }
  .bottom-sheet.is-open { transform: translate(-50%, 0); }
  .event-reveal { grid-template-columns: 1.15fr .85fr; grid-template-rows: 1fr; align-content: stretch; }
  .event-visual { height: auto; margin: 14px 0 14px 14px; }
  .event-copy { align-self: center; padding: 44px; }
  .story-stage { grid-template-rows: none; grid-template-columns: 1.15fr .85fr; }
  .story-dialogue { min-height: 100dvh; display: grid; align-content: center; padding: 44px 40px; margin-top: 0; border-radius: 0; }
  .running-bar { bottom: calc(96px + max(12px, env(safe-area-inset-bottom))); }
}

@media (max-width: 370px) {
  .app-shell { padding-inline: 13px; }
  .coach-stage { min-height: 300px; }
  .coach-copy { right: 10px; bottom: 12px; width: 54%; padding: 15px 13px; }
  .workout-card { grid-template-columns: 48px 1fr auto; gap: 11px; padding: 14px 15px; }
  .workout-card .workout-letter { width: 48px; font-size: 1.3rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- 朋友一起走 ---------- */

/* 運動完收到的那一張。慢一點浮出來，讓它是最後的驚喜。 */
.event-walk {
  margin: 18px 0 4px;
  text-align: center;
  animation: walk-arrive .9s var(--ease) .5s both;
}
.walk-eyebrow {
  margin: 0 0 10px;
  color: var(--ink-2);
  font-size: .8rem;
  letter-spacing: .08em;
}
.walk-shot {
  width: min(100%, 240px);
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
}
/* 稀有的那幾張加一圈暖光，不寫「稀有」兩個字——讓他自己感覺到 */
.walk-shot.is-rare {
  box-shadow: 0 0 0 3px var(--sun), var(--shadow-lg);
}
@keyframes walk-arrive {
  from { opacity: 0; transform: translateY(14px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* 相簿 */
/* 收集卡還沒拿到任何一張時的那句話。跟片刻簿一樣的調子。 */
.scene-empty {
  margin: 4px 0 0;
  color: var(--ink-3);
  font-size: .9rem;
  line-height: 1.6;
}
.walk-empty {
  margin: 4px 0 0;
  color: var(--ink-3);
  font-size: .9rem;
}
.walk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.walk-cell {
  padding: 0;
  border: 0;
  background: none;
  border-radius: var(--r-sm);
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 2 / 3;
  box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease);
}
.walk-cell:active { transform: scale(.96); }
.walk-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* 放大看 */
.walk-viewer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(20, 17, 24, .92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s var(--ease);
}
.walk-viewer.is-open { opacity: 1; pointer-events: auto; }
.walk-viewer img {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
}
.walk-viewer-close {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top));
  right: 16px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  color: #F6F0E8;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

/* 會動的那種是最高等級的獎勵，要一眼看出跟別張不一樣。
   是去背的真人照，所以襯一層很淡的暖底，再加一圈會呼吸的光。 */
.walk-shot.is-animated {
  aspect-ratio: 1 / 1;
  object-fit: contain;
  padding: 4%;
  background: radial-gradient(circle at 50% 56%, var(--sun-soft) 0 64%, transparent 86%);
  box-shadow: none;
  animation: walk-glow 2.6s ease-in-out infinite;
}
@keyframes walk-glow {
  0%, 100% { filter: drop-shadow(0 6px 16px rgba(255, 176, 59, .32)); }
  50%      { filter: drop-shadow(0 8px 26px rgba(255, 176, 59, .58)); }
}
@media (prefers-reduced-motion: reduce) {
  .walk-shot.is-animated { animation: none; }
}

/* 相簿裡會動的那幾張：襯暖色底，跟一般照片一眼分得出來 */
.walk-cell.is-animated {
  background: radial-gradient(circle at 50% 60%, var(--sun-soft) 0 62%, var(--card) 100%);
  box-shadow: 0 0 0 2px var(--sun), var(--shadow-sm);
}
.walk-cell.is-animated img { object-fit: contain; }
/* 放大看會動的那張：暖光圈要罩住整個人，不能只罩上半身 */
.walk-viewer img.is-animated {
  width: min(86vw, 460px);
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  padding: 6%;
  background: radial-gradient(circle at 50% 52%, var(--sun-soft) 0 66%, transparent 88%);
}

/* 她講話的那幾句要看得出「是她在說」，不是系統訊息。
   之前只有純文字泡泡，使用者反映「沒有對話，有點失落」——其實有，只是看不出來。 */
.chat-who {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
  animation: chat-in .4s var(--ease) both;
}
.chat-face {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 52% 18%;
  background: var(--sun-soft);
  box-shadow: 0 0 0 2px var(--card), var(--shadow-sm);
}
.chat-who span {
  color: var(--coral);
  font-size: .84rem;
  font-weight: 900;
  letter-spacing: .03em;
}
.chat-lines { display: grid; gap: 9px; }

/* ---------- 月曆 ---------- */
/* 有動的打勾，今天圈起來。沒動的日子不做任何負面標記——不製造罪惡感。 */

.cal {
  margin: 16px 0 22px;
  padding: 18px 16px 16px;
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
}
.cal-head h3 {
  margin: 0;
  flex: 1;
  text-align: center;
  font-size: 1.02rem;
  line-height: 1.3;
}
.cal-head h3 small {
  display: block;
  margin-top: 3px;
  color: var(--ink-2);
  font-size: .72rem;
  font-weight: 700;
}
.cal-nav {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: 0;
  border-radius: 50%;
  background: var(--paper-2);
  color: var(--ink-2);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: transform .16s var(--ease);
}
.cal-nav:active { transform: scale(.9); }

.cal-week,
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-week {
  margin-bottom: 6px;
}
.cal-week span {
  text-align: center;
  color: var(--ink-3);
  font-size: .68rem;
  font-weight: 800;
}

.cal-day {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 11px;
  color: var(--ink-3);
  font-size: .76rem;
  font-weight: 700;
}
.cal-day.is-blank { visibility: hidden; }
.cal-day i { font-style: normal; }
.cal-day b {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  line-height: 1;
}

/* 有動的那天 */
.cal-day.is-done {
  background: var(--mint-soft);
  color: transparent;          /* 日期讓位給勾勾 */
}
.cal-day.is-done b { color: var(--mint); }

/* 回報不舒服那天——不是失敗，是她要你休息 */
.cal-day.is-rest {
  background: var(--grape-soft);
  color: transparent;
}
.cal-day.is-rest b { color: var(--grape); font-size: .9rem; }

/* 今天 */
.cal-day.is-today {
  outline: 2px solid var(--sun);
  outline-offset: -2px;
  color: var(--sun);
}
.cal-day.is-today.is-done,
.cal-day.is-today.is-rest { color: transparent; }

/* 配色選擇。預設跟著手機，但這支的視覺是為米白做的，
   手機設深色的人要能自己改回來。 */
.theme-row {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--paper-2);
}
.theme-row > p {
  margin: 0 0 9px;
  color: var(--ink-2);
  font-size: .82rem;
  font-weight: 700;
}
.theme-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}
.theme-picker button {
  min-height: 42px;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--paper-2);
  color: var(--ink-2);
  font-size: .84rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform .16s var(--ease);
}
.theme-picker button:active { transform: scale(.96); }
.theme-picker button.is-selected {
  background: var(--sun);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

/* 回報表單的就地提示。要在表單裡看得到，不能丟到別頁去。 */
.form-warn[hidden] { display: none; }
.form-warn {
  margin: 0 0 12px;
  padding: 12px 15px;
  border-radius: var(--r-sm);
  background: var(--coral-soft);
  color: var(--danger);
  font-size: .88rem;
  font-weight: 700;
  line-height: 1.6;
  animation: line-in .25s var(--ease) both;
}

/* =====================================================================
   2026-09-24 改版：四頁、學校、她交代的小事、讓 App 活起來
   ===================================================================== */

/* ---------- 底下四頁 ---------- */
.bottom-nav { grid-template-columns: repeat(4, 1fr); }
.bottom-nav button:nth-child(2).is-active { background: var(--sky-soft); color: var(--sky); }
.bottom-nav button:nth-child(3).is-active { background: var(--coral-soft); color: var(--coral); }
.bottom-nav button:nth-child(4).is-active { background: var(--mint-soft); color: var(--mint); }

/* ---------- 時段的光 ----------
   首頁那一塊跟著真實時間換光。清晨偏冷、傍晚偏暖、深夜只剩一盞燈，
   太陽那顆圓到了晚上變成月亮。改的是一層很薄的濾色，不動她本人的圖。 */
.coach-stage::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  transition: background 2s ease;
}
.coach-stage[data-light="dawn"]::after {
  background: linear-gradient(180deg, rgba(118, 150, 205, .20), rgba(118, 150, 205, 0) 62%);
}
.coach-stage[data-light="dusk"]::after {
  background: linear-gradient(200deg, rgba(255, 146, 64, .22), rgba(255, 146, 64, 0) 58%);
}
.coach-stage[data-light="evening"]::after {
  background: linear-gradient(200deg, rgba(255, 120, 70, .14), rgba(40, 30, 60, .12) 90%);
}
.coach-stage[data-light="night"]::after {
  background:
    radial-gradient(circle at 28% 16%, rgba(255, 214, 150, .16), rgba(255, 214, 150, 0) 42%),
    linear-gradient(180deg, rgba(22, 20, 44, .30), rgba(22, 20, 44, .10));
}
.coach-stage[data-light="night"] .sun-disc,
.coach-stage[data-light="dawn"] .sun-disc { background: #F3E6C4; opacity: .38; }
.coach-stage[data-light="night"] .sun-disc { box-shadow: 0 0 60px 10px rgba(243, 230, 196, .35); }

/* 她開口換一句的時候，淡出淡入，不要硬跳 */
.coach-line { transition: opacity .26s ease; }
.coach-line.is-changing { opacity: 0; }

/* ---------- 她交代的一件小事 ----------
   跟早上的留言同一種紙，但顏色換成薄荷——那是她在管你，不是她在等你。 */
.habit-card {
  margin-top: 12px;
  padding: 16px 16px 14px;
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--shadow);
  border-left: 3px solid var(--mint);
}
.habit-card[hidden] { display: none !important; }
.habit-card .eyebrow { color: var(--mint); }
.habit-title { margin: 6px 0 4px; font-size: 1.05rem; font-weight: 900; line-height: 1.5; }
.habit-small { margin: 0 0 12px; color: var(--ink-2); font-size: .9rem; line-height: 1.7; }
.habit-reply { margin: 6px 0 2px; color: var(--ink); font-size: .98rem; line-height: 1.75; }
.habit-reply::before { content: "她："; color: var(--ink-3); font-weight: 700; }
.habit-small[hidden], .habit-reply[hidden], .habit-done[hidden] { display: none !important; }
.habit-done {
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: var(--mint);
  color: #fff;
  font: inherit;
  font-size: .92rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform .18s var(--ease);
}
.habit-done:active { transform: scale(.96); }
.habit-card.is-done { border-left-color: var(--mint-soft); }

/* ---------- 首頁：學校的小提示 ---------- */
.school-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  margin-top: 12px;
  padding: 10px 16px;
  border: 0;
  border-radius: var(--r-lg);
  background: var(--sky-soft);
  color: var(--ink);
  font: inherit;
  font-size: .9rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  animation: chip-glow 3.2s ease-in-out infinite;
}
.school-chip[hidden] { display: none !important; }
.school-chip-mark { color: var(--sky); font-size: 1.1rem; }
@keyframes chip-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(95, 179, 222, 0); }
  50% { box-shadow: 0 0 0 5px rgba(95, 179, 222, .18); }
}

/* ---------- 學校 ---------- */
.school-intro h2 { max-width: 13em; }
.sticker-bank {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 4px 12px;
  margin: 4px 0 18px;
  padding: 14px 18px;
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.sticker-bank-mark {
  display: grid;
  place-items: center;
  width: 38px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--sun);
  color: #fff;
  font-size: 1.05rem;
  transform: rotate(-8deg);
  grid-row: span 2;
}
.sticker-bank > span:nth-child(2) { font-weight: 800; }
.sticker-bank strong {
  font-family: Nunito, sans-serif;
  font-size: 1.7rem;
  line-height: 1;
  color: var(--sun);
  grid-row: span 2;
}
.sticker-bank small { color: var(--ink-3); font-size: .74rem; line-height: 1.5; }

.school-list { display: grid; gap: 14px; }
.place-card {
  overflow: hidden;
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--shadow);
}
/* 地方的空鏡。圖還沒生好時，底下那層像一張泛黃的舊照片，不會開天窗。 */
.place-shot {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  padding: 0;
  background-image:
    var(--place-image),
    linear-gradient(160deg, #E9DCC6, #CBB89A);
  background-size: cover;
  background-position: center;
  cursor: pointer;
}
.place-card.is-next .place-shot {
  cursor: default;
  filter: grayscale(1) blur(3px) contrast(.8) brightness(1.08);
  opacity: .72;
}
.place-copy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  padding: 14px 16px 16px;
}
.place-copy strong { font-size: 1.05rem; font-weight: 900; }
.place-copy small { flex: 1 1 60%; color: var(--ink-3); font-size: .8rem; }
.place-remember, .place-go {
  flex: 1 1 100%;
  min-height: 46px;
  margin-top: 8px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: .92rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform .18s var(--ease), opacity .2s ease;
}
.place-remember { background: var(--sun); color: #fff; }
.place-go { background: var(--coral-soft); color: var(--coral); }
.place-remember:disabled, .place-go:disabled {
  background: var(--paper-2);
  color: var(--ink-3);
  cursor: default;
}
.place-remember:not(:disabled):active, .place-go:not(:disabled):active { transform: scale(.97); }
.school-more { margin: 16px 4px 0; color: var(--ink-3); font-size: .85rem; line-height: 1.7; }
.school-more[hidden] { display: none !important; }

/* 運動完那一頁的貼紙那一行 */
.bond-reasons .sticker-row { background: var(--sun-soft); }
.bond-reasons .sticker-row strong { color: var(--sun); }

/* ---------- 第一次想起一個地方 ----------
   畫面從模糊的黑白慢慢顯影成彩色，像沖洗一張舊底片。
   ⚠ 動畫要整串重寫一次——只寫新的那個會把進場、緩推、呼吸全部蓋掉。 */
.story-visual.is-remembering.has-image .story-char {
  animation: story-in .9s var(--ease) both,
             story-push 20s ease-out .9s forwards,
             story-breathe 6s ease-in-out .9s infinite,
             remember-in 5s ease-out both;
}
@keyframes remember-in {
  0% { filter: grayscale(1) sepia(.35) blur(8px) contrast(.75) brightness(1.18); }
  45% { filter: grayscale(.7) sepia(.3) blur(3px) contrast(.85) brightness(1.08); }
  100% { filter: none; }
}

@media (prefers-reduced-motion: reduce) {
  .school-chip { animation: none; }
  .story-visual.is-remembering.has-image .story-char { animation: none; opacity: 1; }
  .coach-line { transition: none; }
}

/* 改版第一天她補發貼紙的那一句 */
.sticker-gift {
  margin: -8px 4px 18px;
  color: var(--ink-2);
  font-size: .9rem;
  line-height: 1.7;
}
.sticker-gift[hidden] { display: none !important; }

/* =====================================================================
   2026-09-24 第二輪：首頁大改——她就是整個畫面
   使用者：「怎麼落落長」「我其實現在運動都是直接按回報而已」
           「我希望是雅婷本身再更立體化～陪伴感～」「點選的驚喜感」
   ===================================================================== */

.topbar { padding: 16px 4px 12px; }

/* 右上角的貼紙口袋。拿到貼紙會跳一下。 */
.sticker-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--sun-soft);
  color: var(--sun);
  font-family: Nunito, "Noto Sans TC", sans-serif;
  font-size: 1rem;
  font-weight: 900;
  cursor: pointer;
}
.sticker-pill span { font-size: 1.05rem; transform: rotate(-10deg); }
.sticker-pill.is-bump { animation: pill-bump .6s var(--ease); }
@keyframes pill-bump {
  0% { transform: scale(1); }
  35% { transform: scale(1.22) rotate(-4deg); }
  100% { transform: scale(1); }
}
.sticker-fly {
  position: fixed;
  z-index: 99;
  margin: -18px 0 0 -14px;
  color: var(--sun);
  font-size: 30px;
  line-height: 1;
  text-shadow: 0 2px 10px rgba(255, 176, 59, .55);
  pointer-events: none;
  transition: transform .85s cubic-bezier(.45, -0.35, .55, 1), opacity .85s ease-in;
}

/* ---------- 她 ---------- */
.coach-stage {
  height: clamp(440px, 68svh, 620px);
  min-height: 0;
  margin-top: 2px;
  background: #2B2530;
  --dx: 0;
  --dy: 0;
}
.sun-disc { display: none; }

/* 景深：同一張圖放大模糊墊在最後面，跟她反方向動 */
.her-bg {
  position: absolute;
  z-index: 0;
  inset: -8%;
  background-image: var(--her-image);
  background-size: cover;
  background-position: center 22%;
  filter: blur(26px) brightness(.62) saturate(.9);
  translate: calc(var(--dx) * 10px) calc(var(--dy) * 7px);
  transition: translate .9s ease-out;
}

.coach-portrait {
  inset: 0;
  width: 100%;
  height: 100%;
  object-position: var(--shot-pos, 48% 20%);
  mask-image: linear-gradient(180deg, #000 55%, rgba(0, 0, 0, .55) 80%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, #000 55%, rgba(0, 0, 0, .55) 80%, transparent 100%);
  translate: calc(var(--dx) * -12px) calc(var(--dy) * -8px);
  transition: translate .6s ease-out;
}
/* 碰她一下：輕輕彈一下。用獨立的 scale 屬性，不蓋掉呼吸（呼吸走 transform）。 */
.coach-portrait.is-reacting {
  animation: react-pop .5s var(--ease), breathe 5.5s ease-in-out .5s infinite;
}
@keyframes react-pop {
  0% { scale: 1; }
  40% { scale: 1.03; }
  100% { scale: 1; }
}

/* 一層很淡的光，比她動得更多，像鏡頭前面的光暈 */
.her-glow {
  position: absolute;
  z-index: 1;
  inset: -10%;
  pointer-events: none;
  background: radial-gradient(circle at 78% 12%, rgba(255, 214, 160, .30), rgba(255, 214, 160, 0) 38%);
  mix-blend-mode: screen;
  translate: calc(var(--dx) * -24px) calc(var(--dy) * -14px);
  transition: translate .5s ease-out;
  /* 動的是窗邊的光，不是她的臉；避免照片被循環動畫拉出 AI 感。 */
  animation: window-light 18s ease-in-out infinite alternate;
}
@keyframes window-light {
  from { transform: translate3d(-8px, 0, 0) scale(.98); }
  to { transform: translate3d(10px, 5px, 0) scale(1.06); }
}
.coach-stage[data-light="dusk"] .her-glow {
  background: radial-gradient(circle at 78% 12%, rgba(255, 190, 126, .37), rgba(255, 190, 126, 0) 42%);
}
.coach-stage[data-light="night"] .her-glow { opacity: .48; }

/* 她剛剛在幹嘛：像字幕一樣貼在畫面上方 */
.coach-stage .today-state {
  position: absolute;
  z-index: 3;
  top: 14px;
  left: 14px;
  max-width: calc(100% - 28px);
  margin: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(20, 16, 26, .38);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, .92);
  font-size: .78rem;
  line-height: 1.5;
  pointer-events: none;
}

/* 整塊畫面都能碰 */
.her-touch {
  position: absolute;
  z-index: 2;
  inset: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.her-touch:focus-visible { outline: 3px solid var(--sun); outline-offset: -6px; border-radius: inherit; }
.her-ripple {
  position: absolute;
  z-index: 3;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border: 2px solid rgba(255, 255, 255, .85);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}
.her-ripple.is-on { animation: ripple .7s ease-out; }
@keyframes ripple {
  0% { opacity: .9; transform: scale(1); }
  100% { opacity: 0; transform: scale(5.5); }
}

/* 她的話：一個半透明的對話框，浮在她前面 */
.her-bubble {
  position: absolute;
  z-index: 4;
  left: 12px;
  right: 12px;
  bottom: 12px;
  padding: 14px 16px 12px;
  border-radius: 22px;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px rgba(20, 16, 26, .22);
  translate: calc(var(--dx) * 6px) calc(var(--dy) * 4px);
  transition: translate .5s ease-out;
}
.her-bubble .coach-mode { margin-bottom: 6px; }
.her-bubble .coach-line { margin-bottom: 8px; font-size: 1.02rem; line-height: 1.7; white-space: pre-line; }
.bubble-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bubble-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  min-height: 44px;
  margin: 0;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--sky-soft);
  color: var(--ink);
  font: inherit;
  font-size: .8rem;
  font-weight: 700;
  text-align: left;
  box-shadow: none;
  cursor: pointer;
}
.bubble-link[hidden] { display: none !important; }
.bubble-link.memory-warn { background: var(--sun-soft); }
.bubble-link.memory-warn strong { font-size: .8rem; font-weight: 700; line-height: 1.4; }
.bubble-link .memory-warn-icon { width: auto; aspect-ratio: auto; background: none; color: var(--sun); font-size: 1rem; }
.bubble-link.school-chip { animation: chip-glow 3.2s ease-in-out infinite; }

/* 早上她留的話：放在對話框裡面，看過才輪到平常那句 */
.her-bubble .morning-note {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}
.her-bubble .morning-note .eyebrow { color: var(--sun); }
.her-bubble .morning-text { margin: 2px 0 10px; font-size: 1.02rem; font-weight: 700; }
.her-bubble .morning-note:not([hidden]) + .bubble-line { display: none; }

/* ---------- 一顆按鈕：我動完了 ---------- */
.today-actions { display: grid; gap: 2px; margin-top: 14px; }
.report-now {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 72px;
  padding: 12px 20px;
  border: 0;
  border-radius: 24px;
  background: var(--ink);
  color: var(--paper);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: transform .16s var(--ease);
}
.report-now:active { transform: scale(.975); }
.report-now-mark {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 46px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--sun);
  color: #fff;
  font-size: 1.3rem;
  font-weight: 900;
}
.report-now strong { display: block; font-size: 1.15rem; font-weight: 900; }
.report-now small { display: block; margin-top: 2px; opacity: .7; font-size: .8rem; }
.plan-link {
  min-height: 44px;
  border: 0;
  background: none;
  color: var(--ink-2);
  font: inherit;
  font-size: .86rem;
  font-weight: 700;
  cursor: pointer;
}

/* 今日小約定：目標是讓第一步可選、可見，不把缺席做成警告。 */
.daily-pact {
  margin-top: 10px;
  padding: 17px 18px 15px;
  border: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
  border-radius: 22px;
  background: color-mix(in srgb, var(--paper) 88%, white);
  box-shadow: 0 10px 28px rgba(48, 54, 47, .045);
}
.pact-heading, .pact-week { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pact-eyebrow { margin: 0 0 2px; color: var(--mint); font-size: .67rem; font-weight: 900; letter-spacing: .11em; }
.pact-heading h3 { margin: 0; font-family: var(--serif); font-size: 1.04rem; line-height: 1.4; }
.pact-status { flex-shrink: 0; color: var(--ink-2); font-size: .72rem; font-weight: 800; }
.daily-pact.is-done .pact-status { color: var(--mint); }
.pact-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 14px; }
.pact-choices button {
  min-height: 44px;
  border: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
  border-radius: 13px;
  background: white;
  color: var(--ink-2);
  font: inherit;
  font-size: .81rem;
  font-weight: 800;
  cursor: pointer;
  transition: background .16s var(--ease), transform .16s var(--ease), color .16s var(--ease);
}
.pact-choices button:active { transform: scale(.97); }
.pact-choices button.is-selected { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.pact-choices button:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.pact-note { min-height: 1.5em; margin: 10px 0 0; color: var(--ink-2); font-size: .79rem; line-height: 1.5; }
.pact-week { margin-top: 11px; padding-top: 10px; border-top: 1px dashed color-mix(in srgb, var(--ink) 16%, transparent); color: var(--ink-2); font-size: .73rem; font-weight: 700; }
.pact-week-marks { display: inline-flex; flex-shrink: 0; gap: 5px; }
.pact-week-marks i { width: 11px; height: 11px; border: 1px solid var(--mint); border-radius: 50%; }
.pact-week-marks i.is-done { background: var(--mint); }
.event-pact { margin: 8px 0 0; padding: 10px 12px; border-left: 3px solid var(--sun); border-radius: 0 9px 9px 0; background: color-mix(in srgb, var(--sun) 10%, var(--paper)); font-family: var(--serif); font-size: .94rem; line-height: 1.6; }
.event-pact[hidden] { display: none; }

/* 她交代的小事：一行就好 */
.habit-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 16px; }
.habit-copy { flex: 1; min-width: 0; }
.habit-card .eyebrow { margin-bottom: 2px; }
.habit-title { margin: 0; font-size: .98rem; }
.habit-small { margin: 2px 0 0; font-size: .82rem; }
.habit-reply { margin: 2px 0 0; font-size: .9rem; }
.habit-done { flex-shrink: 0; padding: 0 16px; }

.status-ribbon { margin-top: 12px; }

/* 回報面板：分鐘數一按就填 */
.minute-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: -8px; }
.minute-chips button {
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--ink-2);
  font: inherit;
  font-size: .88rem;
  font-weight: 800;
  cursor: pointer;
}
.minute-chips button.is-selected { background: var(--sun-soft); color: var(--sun); }

@media (prefers-reduced-motion: reduce) {
  .her-bg, .coach-portrait, .her-glow, .her-bubble { translate: none; transition: none; }
  .her-glow { animation: none; }
  .story-image-bridge { transition: none; }
  .coach-portrait.is-reacting { animation: none; }
  .her-ripple.is-on, .sticker-pill.is-bump { animation: none; }
  .bubble-link.school-chip { animation: none; }
}

/* 她被碰了開口時，早上的留言先讓位 */
.her-bubble.is-talking .morning-note { display: none !important; }
.her-bubble.is-talking .bubble-line { display: block !important; }

/* =====================================================================
   2026-09-24 第三輪：質感——像一部關於她的電影，不是一排按鈕
   使用者：「app 整體要開始提升質感～不要再是點點按鈕～我想要互動感～更細緻專業」
   ===================================================================== */

:root { --serif: "Noto Serif TC", "Songti TC", "PMingLiU", serif; }

/* ---------- 她說的話用明體 ----------
   像電影字幕、像手寫的信。介面的字留黑體——一眼分得出「她在講話」和「按鈕」。 */
.coach-line,
.morning-text,
.habit-reply,
.story-text,
.event-chat .chat-lines p,
.remember-list p,
.together-line,
.sticker-gift,
.her-bubble .morning-text {
  font-family: var(--serif);
  letter-spacing: .02em;
}
.her-bubble .coach-line { font-weight: 700; font-size: 1.08rem; line-height: 1.75; }
.story-text:not(.is-narration) { font-weight: 700; }
.story-text.is-narration { font-family: "Noto Sans TC", sans-serif; }

/* ---------- 底片顆粒 ----------
   整支 App 蓋一層很淡的顆粒。靜態的，不會閃；點得穿，不擋任何按鈕。 */
body::after {
  content: "";
  position: fixed;
  z-index: 200;
  inset: 0;
  pointer-events: none;
  opacity: .07;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .5  0 0 0 0 .5  0 0 0 0 .5  0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---------- 換頁像剪接：溶接，不彈跳 ---------- */
.screen.is-active { animation: dissolve .55s cubic-bezier(.22, 1, .36, 1) both; }
@keyframes dissolve {
  from { opacity: 0; filter: blur(6px); transform: translateY(8px); }
  to { opacity: 1; filter: blur(0); transform: none; }
}

/* ---------- 劇情：上下遮幅 ----------
   打開時兩條黑邊從上下滑進來，像進了電影院。 */
.story-stage::before,
.story-stage::after {
  content: "";
  position: fixed;
  z-index: 3;
  left: 0;
  right: 0;
  height: 0;
  background: #0E0C11;
  pointer-events: none;
  transition: height .7s cubic-bezier(.22, 1, .36, 1) .1s;
}
.story-stage::before { top: 0; }
.story-stage::after { bottom: 0; }
.story-stage.is-open::before { height: max(22px, 3.2svh); }
.story-stage.is-open::after { height: max(10px, 1.2svh); }

/* ---------- 長按她：陪她待一下 ----------
   畫面慢慢靠近她、四周暗下來、光暈收掉。放開後慢慢退回。 */
.coach-stage::before {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 35%, transparent 38%, rgba(12, 10, 16, .55) 100%);
  opacity: 0;
  transition: opacity 1.1s ease;
}
.coach-stage.is-close::before { opacity: 1; }
.coach-stage .coach-portrait { transition: translate .6s ease-out, scale 1.4s cubic-bezier(.22, 1, .36, 1); }
.coach-stage.is-close .coach-portrait { scale: 1.06; }
.coach-stage.is-close .her-glow { opacity: 0; transition: opacity 1s ease; }
.coach-stage.is-close .today-state { opacity: 0; transition: opacity .6s ease; }

/* ---------- 紀錄：場記表 ---------- */
.slate-head,
.history-list .take {
  display: grid;
  grid-template-columns: 38px 50px minmax(0, 1fr) 44px 52px;
  gap: 8px;
  align-items: center;
}
.slate-head {
  margin: 22px 0 0;
  padding: 10px 14px;
  border-radius: 14px 14px 0 0;
  background: #1F1C24;
  color: #9D958B;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .12em;
}
.history-list { gap: 0; }
.history-list .take {
  min-height: 60px;
  padding: 10px 14px;
  border-radius: 0;
  background: #26222B;
  color: #EDE6DA;
  box-shadow: none;
  border-top: 1px dashed #3A3540;
}
.history-list .take:last-child { border-radius: 0 0 14px 14px; }
.history-list .take:active { transform: none; background: #2E2934; }
.take-no, .take-date, .take-len {
  font-family: Nunito, sans-serif;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}
.take-no { color: #F2C46B; font-size: .95rem; }
.take-date { color: #B7AEA3; font-size: .8rem; }
.take-what strong { display: block; color: #EDE6DA; font-size: .9rem; font-weight: 800; }
.take-what small { display: block; color: #9D958B; font-size: .72rem; margin-top: 1px; }
/* ⚠ 原本的 .history-list span 會把字壓成灰色小字，這裡要用更具體的寫法蓋回來 */
.history-list .take > span { color: #EDE6DA; font-size: inherit; }
.history-list .take > .take-no { color: #F2C46B; font-size: .95rem; }
.history-list .take > .take-date { color: #B7AEA3; font-size: .8rem; }
.history-list .take > .take-stamp { font-size: .72rem; }
.history-list .take > .take-stamp.is-ok { color: #8FD5B6; }
.history-list .take > .take-stamp.is-keep { color: #F2C46B; }
.history-list .take > .take-stamp.is-rest { color: #FF9A90; }
.history-list .take .take-what small { color: #9D958B; }
.take-len { color: #EDE6DA; font-size: .95rem; text-align: right; }
.take-stamp {
  justify-self: end;
  padding: 3px 8px;
  border: 1.5px solid currentColor;
  border-radius: 6px;
  font-size: .72rem;
  font-weight: 900;
  transform: rotate(-6deg);
}
.take-stamp.is-ok { color: #8FD5B6; }
.take-stamp.is-keep { color: #F2C46B; }
.take-stamp.is-rest { color: #FF9A90; }
.history-list .empty-record {
  display: block;
  padding: 18px;
  border-radius: 0 0 14px 14px;
  background: #26222B;
  color: #B7AEA3;
  font-family: var(--serif);
}

/* ---------- 學校：泛黃的聯絡簿 ---------- */
.screen[data-screen="school"] {
  --ruled: color-mix(in srgb, var(--sky) 16%, transparent);
  margin: 0 -18px;
  padding: 0 18px 40px;
  background:
    linear-gradient(90deg, transparent 30px, color-mix(in srgb, var(--coral) 35%, transparent) 30px 31px, transparent 31px),
    repeating-linear-gradient(180deg, transparent 0 31px, var(--ruled) 31px 32px),
    color-mix(in srgb, var(--paper) 88%, #E9D9B6);
}
.school-intro h2, .school-intro p { font-family: var(--serif); }
.place-card {
  position: relative;
  border-radius: 4px;
  padding: 10px 10px 0;
  background: var(--card);
  box-shadow: 0 1px 2px rgba(60, 40, 20, .12), 0 12px 26px rgba(60, 40, 20, .12);
  transform: rotate(-.8deg);
}
.place-card:nth-child(even) { transform: rotate(.7deg); }
.place-card::before {
  content: "";
  position: absolute;
  z-index: 2;
  top: -9px;
  left: 50%;
  width: 84px;
  height: 22px;
  margin-left: -42px;
  background: color-mix(in srgb, #F3E3B5 78%, transparent);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
  transform: rotate(-2deg);
}
.place-card .place-shot { border-radius: 2px; }
.place-copy strong { font-family: var(--serif); font-size: 1.12rem; }

/* ---------- 她：劇情與收集卡像拍立得 ---------- */
.scene-card {
  border-radius: 4px;
  padding: 14px 14px 18px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 10px 22px rgba(0, 0, 0, .08);
}
.scene-card strong { font-family: var(--serif); }
.remember-list li { border-left: 0; border-radius: 4px; background: color-mix(in srgb, var(--card) 92%, #F3E3B5); }

@media (prefers-reduced-motion: reduce) {
  .screen.is-active { animation: none; }
  .story-stage::before, .story-stage::after { transition: none; }
  .coach-stage .coach-portrait, .coach-stage::before { transition: none; }
}

/* 底下四頁：自己畫的線條圖示（日出、校舍、拍立得、場記板），不用符號 */
.bottom-nav .nav-icon { width: 24px; height: 24px; transition: transform .3s cubic-bezier(.22, 1, .36, 1); }
.bottom-nav button.is-active .nav-icon { transform: translateY(-1px) scale(1.08); stroke-width: 2; }
.bottom-nav button { font-size: .7rem; letter-spacing: .04em; }

/* 運動完那一頁：大標題和她的話也是明體，像一場戲的最後一句字幕 */
.event-copy h2 { font-family: var(--serif); font-weight: 900; letter-spacing: .02em; }
.event-copy .eyebrow { letter-spacing: .12em; }
.event-chat .chat-lines p { font-weight: 700; }
#closeEvent { background: var(--ink); color: var(--paper); letter-spacing: .08em; }

/* =====================================================================
   聯絡簿（2026-09-24）：國小那種。淡綠方格紙、印好的「每日一句」、
   功課自己抄、老師看過用紅色印泥蓋一個「閱」。
   使用者：「一周的行事曆感覺也挺好的～有種心靈小語的感覺～每日小任務」
   ===================================================================== */
.book {
  --book-grid: color-mix(in srgb, var(--mint) 9%, transparent);
  --book-rule: color-mix(in srgb, var(--mint) 38%, transparent);
  --book-red: #C4473D;          /* 印泥紅。不用 coral——coral 太可愛，印泥是暗的 */
  position: relative;
  margin-top: 14px;
  padding: 12px 16px 16px;
  border-radius: 6px;
  background-color: color-mix(in srgb, var(--card) 94%, var(--mint));
  background-image:
    linear-gradient(var(--book-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--book-grid) 1px, transparent 1px);
  background-size: 14px 14px;
  box-shadow: 0 1px 2px rgba(51, 64, 60, .10), 0 10px 24px rgba(51, 64, 60, .07);
}
:root[data-theme="dark"] .book { --book-red: #E27A6E; }

/* 表頭：印好的那一行，雙線底 */
.book-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 6px;
  border-bottom: 3px double var(--book-rule);
}
.book-name {
  margin: 0;
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: .32em;
}
.book-range {
  margin: 0;
  color: var(--ink-3);
  font-family: Nunito, sans-serif;
  font-size: .8rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* 這一週：七格，像表格 */
.book-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin: 0;
  padding: 0;
  list-style: none;
  border-bottom: 1px solid var(--book-rule);
}
.book-week li + li { border-left: 1px solid var(--book-rule); }
.book-day {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 3px;
  width: 100%;
  min-height: 76px;
  padding: 8px 0 6px;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.book-day:disabled { cursor: default; }
.book-day.is-future > * { opacity: .32; }
.bd-w { color: var(--ink-3); font-size: .66rem; font-weight: 700; }
.bd-d {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-family: Nunito, sans-serif;
  font-size: 1rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  transition: background .2s, color .2s;
}
.book-day.is-today .bd-d { background: var(--ink); color: var(--paper); }
.book-day.is-viewing:not(.is-today) .bd-d { box-shadow: inset 0 0 0 1.5px var(--ink); }
.bd-marks { display: flex; align-items: center; gap: 5px; height: 10px; }
/* 動了：一顆太陽色的點。說不舒服那天是空心的——有來，但在休息 */
.m-move { width: 7px; height: 7px; border-radius: 50%; background: var(--sun); }
.m-move.is-rest { background: transparent; box-shadow: inset 0 0 0 1.5px var(--sun); }
/* 功課做了：一個小勾 */
.m-task {
  width: 4px;
  height: 8px;
  margin-top: -3px;
  border: solid var(--mint);
  border-width: 0 2px 2px 0;
  transform: rotate(40deg);
}
.bd-tag { color: var(--book-red); font-size: .6rem; font-weight: 800; letter-spacing: .04em; line-height: 1; }

/* 閱。紅色印泥，邊緣不整齊（index.html 裡那個 #inkStamp 濾鏡） */
.bd-stamp {
  position: absolute;
  top: 40px;
  left: 50%;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-left: -17px;
  border: 2px solid var(--book-red);
  border-radius: 50%;
  color: var(--book-red);
  font-family: var(--serif);
  font-size: .98rem;
  font-weight: 900;
  opacity: .8;
  transform: rotate(-14deg);
  filter: url(#inkStamp);
  pointer-events: none;
}
:root:not([data-theme="dark"]) .bd-stamp { mix-blend-mode: multiply; }
/* 蓋了章，底下的點和勾就不用再畫——章就是兩件都做了 */
.book-day:has(.bd-stamp) .bd-marks { visibility: hidden; }
.bd-stamp.is-new { animation: stamp-down .55s cubic-bezier(.16, 1, .3, 1) .45s both; }
@keyframes stamp-down {
  0% { opacity: 0; transform: rotate(-14deg) scale(1.9); }
  55% { opacity: .92; transform: rotate(-14deg) scale(.93); }
  100% { opacity: .8; transform: rotate(-14deg) scale(1); }
}

/* 每日一句：印在聯絡簿上的，不是她講的 */
.book-date {
  margin: 12px 0 0;
  color: var(--ink-3);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .08em;
}
.book-date[hidden] { display: none; }
.book-saying {
  margin: 12px 0 0;
  font-family: var(--serif);
  font-size: 1.04rem;
  font-weight: 700;
  line-height: 1.7;
  letter-spacing: .03em;
  text-wrap: balance;
}
.book-saying::before,
.book-label {
  display: block;
  margin: 0 0 2px;
  color: var(--ink-3);
  font-family: "Noto Sans TC", sans-serif;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .22em;
}
.book-saying::before { content: "每日一句"; }
.book-date:not([hidden]) + .book-saying { margin-top: 4px; }

/* 今日功課：左邊是功課，右邊是按鈕 */
.book-task {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 12px;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--book-rule);
}
.book-task[hidden] { display: none; }
.book-task > p { grid-column: 1; }
.book-label { grid-column: 1 / -1; color: var(--mint); }
.book-task-title { margin: 0; font-size: 1rem; font-weight: 900; line-height: 1.5; }
.book-task-small { margin: 2px 0 0; color: var(--ink-2); font-size: .82rem; line-height: 1.6; }
.book-task.is-done .book-task-title::before { content: "✓ "; color: var(--mint); }
/* 她蓋完章用紅筆回的那一句 */
.book-reply {
  margin: 4px 0 0;
  color: var(--book-red);
  font-family: var(--serif);
  font-size: .96rem;
  font-weight: 700;
  line-height: 1.7;
}
.book-task-small[hidden], .book-reply[hidden], .book-task-actions[hidden] { display: none !important; }
.book-task-actions {
  grid-column: 2;
  grid-row: 2 / span 3;
  display: grid;
  justify-items: center;
}
.book-done {
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--mint);
  color: #fff;
  font: inherit;
  font-size: .9rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform .18s var(--ease);
}
.book-done:active { transform: scale(.95); }
.book-swap {
  min-height: 44px;
  padding: 0 8px;
  border: 0;
  background: none;
  color: var(--ink-3);
  font: inherit;
  font-size: .76rem;
  font-weight: 700;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  cursor: pointer;
}
.book-task.is-flipping .book-task-title,
.book-task.is-flipping .book-task-small { animation: book-flip .4s cubic-bezier(.22, 1, .36, 1) both; }
.book-task.is-flipping .book-task-small { animation-delay: .06s; }
@keyframes book-flip {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* 點了別天：那天有做的事。沒做的不寫 */
.book-past {
  margin: 10px 0 0;
  color: var(--ink-2);
  font-size: .86rem;
  line-height: 1.7;
  white-space: pre-line;
}

/* 她加的一行（habits.js）：像老師在聯絡簿上用紅筆補一行 */
.book .habit-card {
  margin-top: 12px;
  padding: 12px 0 0;
  border: 0;
  border-top: 1px dashed var(--book-rule);
  border-radius: 0;
  background: none;
  box-shadow: none;
}
.book .habit-card .eyebrow { color: var(--book-red); letter-spacing: .22em; font-size: .66rem; }
.book .habit-title { font-family: var(--serif); color: var(--book-red); }
.book .habit-reply::before { content: none; }
.book .habit-reply { color: var(--book-red); }

/* 收工：右下角，像老師的簽名 */
.book-wrap {
  margin: 12px 0 0;
  color: var(--book-red);
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: .06em;
  text-align: right;
  animation: book-flip .5s cubic-bezier(.22, 1, .36, 1) .9s both;
}

@media (prefers-reduced-motion: reduce) {
  .bd-stamp.is-new, .book-wrap, .book-task.is-flipping .book-task-title, .book-task.is-flipping .book-task-small { animation: none; }
}

/* ---------- 學校：講給她聽過的地方，角落貼一張她的照片（2026-09-24 晚） ----------
   空鏡是你記得的學校；那張小照片是現在的她。點照片重看那一段。 */
.place-photo {
  position: absolute;
  z-index: 3;
  top: 26px;
  right: 18px;
  width: 30%;
  max-width: 116px;
  aspect-ratio: 3 / 4;
  padding: 5px 5px 16px;
  border: 0;
  border-radius: 2px;
  background: #FBF8F2;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .18), 0 8px 18px rgba(40, 25, 10, .22);
  transform: rotate(4deg);
  cursor: pointer;
  transition: transform .25s cubic-bezier(.22, 1, .36, 1);
}
.place-photo::after {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  background: var(--photo) center 20% / cover, linear-gradient(160deg, #E9DCC6, #CBB89A);
}
.place-card:nth-child(even) .place-photo { transform: rotate(-3deg); }
.place-photo:active { transform: rotate(0deg) scale(1.04); }

/* ---------- 學校地圖（2026-09-24 晚）：蠟筆畫的，想起來的有顏色，其他蓋著霧 ---------- */
.school-map {
  margin: 14px 0 18px;
  padding: 8px 6px 4px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--card) 70%, transparent);
  box-shadow: 0 1px 2px rgba(60, 40, 20, .10), 0 8px 20px rgba(60, 40, 20, .08);
  transform: rotate(-.4deg);
}
.school-map-svg { display: block; width: 100%; height: auto; overflow: visible; }
.school-map-svg * { vector-effect: non-scaling-stroke; }
.school-map-svg .m-road { stroke: var(--ink-3); stroke-width: 1.2; stroke-dasharray: 6 5; fill: none; }
.school-map-svg .m-roof { fill: none; stroke: var(--ink-2); stroke-width: 1.6; stroke-linejoin: round; }
.map-spot { cursor: pointer; transition: opacity .4s ease; -webkit-tap-highlight-color: transparent; }
.map-spot:focus { outline: none; }
.map-spot:focus-visible .m-draw { filter: drop-shadow(0 0 3px var(--sun)); }
.map-spot .m-draw * { stroke: var(--ink-2); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.map-spot.is-open .m-track { stroke: #D9786B; stroke-width: 9; }
.map-spot.is-open .m-grass { fill: #B7D59A; stroke: #8EB36F; }
.map-spot.is-open .m-tree { fill: #9CC57F; }
.map-spot.is-open .m-trunk { stroke: #8A6A4A; stroke-width: 3; }
.map-spot.is-open .m-gate { stroke: #5F86B8; stroke-width: 2.4; }
.map-spot.is-open .m-gate-bars { stroke: #5F86B8; }
.map-spot.is-open .m-stage { fill: #E8D3A8; }
.map-spot.is-open .m-floor { fill: #F4E6C8; }
.map-spot.is-open[data-map="music"] .m-floor { fill: #F2D9D2; }
.map-spot.is-open .m-note { stroke: #C4473D; }
.map-spot.is-open .m-drop { fill: #8EC5E6; stroke: #5FA3CF; }
.map-spot.is-open .m-stairs { fill: #D9C29A; }
/* 下一個想得起來的：虛線，輕輕在呼吸 */
.map-spot.is-next .m-draw * { stroke-dasharray: 4 4; stroke: var(--ink-3); }
.map-spot.is-next { animation: map-breathe 2.6s ease-in-out infinite; }
@keyframes map-breathe { 50% { opacity: .55; } }
/* 還想不起來的：蓋著霧 */
.map-spot.is-fog { cursor: default; opacity: .16; filter: blur(2.2px); }
.m-label {
  fill: var(--ink);
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 700;
  text-anchor: middle;
  paint-order: stroke;
  stroke: color-mix(in srgb, var(--card) 85%, transparent);
  stroke-width: 3px;
}
.map-spot.is-next .m-label { fill: var(--ink-3); }
.m-her { fill: var(--coral); }
.map-spot.is-open:active .m-draw { transform: translateY(1px); }
/* 從地圖點過來的那張卡片：亮一下 */
.place-card.is-called { animation: card-called 1.1s cubic-bezier(.22, 1, .36, 1); }
@keyframes card-called {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--sun) 70%, transparent), 0 12px 26px rgba(60, 40, 20, .12); }
  40% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--sun) 35%, transparent), 0 12px 26px rgba(60, 40, 20, .12); }
  100% { box-shadow: 0 0 0 0 transparent, 0 12px 26px rgba(60, 40, 20, .12); }
}
@media (prefers-reduced-motion: reduce) {
  .map-spot.is-next, .place-card.is-called { animation: none; }
}

/* 講給她聽：跟「跟她一起去」分開，用太陽色 */
.place-go.place-tell { background: var(--sun-soft); color: color-mix(in srgb, var(--sun) 62%, var(--ink)); }
.place-go.place-tell:disabled { background: var(--paper-2); color: var(--ink-3); }

/* 2026-09-28 整合：「本週幾次」小約定和聯絡簿都看得到了，底下這排不再重複一次 */
.status-ribbon { grid-template-columns: .8fr 1.5fr; }
.status-ribbon div:last-child { display: none; }

/* ---------- 「她」那頁的封面（2026-09-28）：三格連拍，點一下換一格 ---------- */
.her-cover {
  position: relative;
  display: block;
  width: 100%;
  margin: 14px 0 18px;
  padding: 10px 10px 80px;
  border: 0;
  border-radius: 4px;
  background: #FBF8F2;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .12), 0 14px 30px rgba(40, 25, 10, .16);
  transform: rotate(-.6deg);
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.her-cover:active { transform: rotate(-.6deg) scale(.99); }
.her-cover-frame {
  position: relative;
  display: block;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 2px;
  background: linear-gradient(160deg, #E9DCC6, #CBB89A);
}
.her-cover-shot {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: 50% 18%;
  opacity: 0;
  transition: opacity .28s ease-out;
}
.her-cover-shot.is-in { opacity: 1; }
.her-cover-caption {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 12px;
  display: grid;
  gap: 4px;
  color: #3A3530;
}
.her-cover-caption small { font-size: .68rem; font-weight: 700; letter-spacing: .14em; color: #8A8178; }
.her-cover-caption strong { font-family: var(--serif); font-size: 1.12rem; font-weight: 900; color: #B5473E; }
.her-cover .bond-meter { width: 100%; height: 4px; background: #EFE7DA; }
.her-cover .bond-meter i { background: #B5473E; }
.her-cover-dots {
  position: absolute;
  top: 18px;
  right: 18px;
  display: flex;
  gap: 5px;
}
.her-cover-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .55);
  box-shadow: 0 0 2px rgba(0, 0, 0, .35);
}
.her-cover-dots i.is-on { background: #fff; }
@media (prefers-reduced-motion: reduce) { .her-cover-shot { transition: none; } }

/* 學校照片換格：輕輕一跳；「重看那一段」是文字連結，不搶按鈕 */
.place-photo.is-flip { animation: photo-flip .32s cubic-bezier(.22, 1, .36, 1); }
@keyframes photo-flip { 40% { transform: rotate(6deg) scale(1.05); } }
.place-replay {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-3);
  font: inherit;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
}
@media (prefers-reduced-motion: reduce) { .place-photo.is-flip { animation: none; } }

/* 片刻簿照片下面那一行旁白（2026-10-01）：像劇情的一格，明體、小、不搶照片 */
.walk-caption {
  max-width: 300px;
  margin: 10px auto 0;
  font-family: var(--serif);
  font-size: .9rem;
  line-height: 1.7;
  text-align: center;
  text-wrap: balance;
}
.walk-viewer .walk-caption { color: #F2ECE4; padding: 0 16px; }

/* 片刻簿連拍：看得出可以點（右下角三個小點），點了輕輕一跳 */
img.is-seq { cursor: pointer; }
img.is-seq.is-flip { animation: photo-flip .3s cubic-bezier(.22, 1, .36, 1); }
.walk-cell:has(img.is-seq)::after {
  content: "•••";
  position: absolute;
  right: 6px;
  bottom: 4px;
  color: #fff;
  font-size: .7rem;
  letter-spacing: 1px;
  text-shadow: 0 0 3px rgba(0, 0, 0, .6);
}
.walk-cell:has(img.is-seq) { position: relative; }
