/* 保養品黑科技｜順著水，讓保養啟動。 */

@font-face {
  font-family: "Akimia Serif";
  src: url("assets/fonts/serif.woff2") format("woff2"),
       url("assets/fonts/serif.otf") format("opentype");
  font-weight: 200 900;
  font-display: swap;
}
@font-face {
  font-family: "Akimia Sans";
  src: url("assets/fonts/sans.woff2") format("woff2"),
       url("assets/fonts/sans.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --ivory: #f5f3ed;
  --ink: #252a22;
  --ink-soft: #5d6258;
  --line: rgba(37, 42, 34, 0.16);
  --night: #1c1f1a;
  --serif: "Akimia Serif", "Noto Serif TC", "Songti TC", serif;
  --sans: "Akimia Sans", "Noto Sans TC", "PingFang TC", "Heiti TC", system-ui, sans-serif;
  --top-h: 60px;
  --dock-h: 72px;
  --hit: 44px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

button { font: inherit; color: inherit; }
p, h1, h2, ol { margin: 0; }
ol { padding: 0; list-style: none; }

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 12px; top: -60px;
  z-index: 50;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--ivory);
  text-decoration: none;
  font-size: 14px;
}
.skip-link:focus { top: calc(8px + var(--safe-t)); }

.noscript { padding: 32px 24px; font-size: 16px; line-height: 1.7; }

/* ---------- 主框架 ---------- */
.app {
  --bg: var(--ivory);
  --fg: var(--ink);
  --fg-soft: var(--ink-soft);
  --rule: var(--line);
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "top" "stage" "dock";
  height: 100vh;
  height: 100dvh;
  padding-left: var(--safe-l);
  padding-right: var(--safe-r);
  background: var(--bg);
  color: var(--fg);
  transition: background-color 0.5s var(--ease), color 0.5s var(--ease);
}
.app[data-theme="dark"] {
  --bg: var(--night);
  --fg: #ecebe4;
  --fg-soft: rgba(236, 235, 228, 0.62);
  --rule: rgba(236, 235, 228, 0.16);
}

.rail { display: none; }

/* ---------- 頂欄 ---------- */
.topbar {
  grid-area: top;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: calc(var(--top-h) + var(--safe-t));
  padding: var(--safe-t) 8px 0 18px;
  border-bottom: 1px solid var(--rule);
}

.brand, .rail__brand {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.16em;
  white-space: nowrap;
}

.topbar__title {
  flex: 1;
  min-width: 0;
  font-size: 10.5px;
  letter-spacing: 0.24em;
  color: var(--fg-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-left: 14px;
  border-left: 1px solid var(--rule);
}

.actions {
  display: flex;
  gap: 2px;
  margin-left: auto;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: var(--hit);
  min-height: var(--hit);
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  letter-spacing: 0.08em;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.2s var(--ease);
}
.icon-btn:hover { background: color-mix(in srgb, currentColor 8%, transparent); }
.icon-btn svg, .nav-btn svg {
  width: 20px; height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.icon-btn--close { padding: 0; width: var(--hit); }

/* ---------- 舞台與相簿軌道 ---------- */
.stage {
  grid-area: stage;
  position: relative;
  min-height: 0;
  min-width: 0;
  outline: none;
}

.track {
  display: flex;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.track::-webkit-scrollbar { display: none; }

.slide {
  --accent: var(--ivory);
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  min-width: 0;
  display: grid;
  /* 單一格子最小值歸零：不讓圖片的自然比例把列高撐出舞台 */
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  place-items: center;
  padding: 12px 14px;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  background: var(--accent);
  background: color-mix(in srgb, var(--accent) 60%, var(--ivory));
  overflow: hidden;
}

.slide__figure {
  position: relative;
  margin: 0;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}
/* 主圖永遠完整：contain、不裁切、不拉伸；保留長按存圖。
   絕對定位讓圖片盒子等於 figure，不會用自然尺寸反向撐大版面 */
.slide__img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
  object-position: center;
}

/* ---------- 播放按鈕 ---------- */
.play {
  position: absolute;
  left: 50%; top: 50%;
  width: 68px; height: 68px;
  margin: -34px 0 0 -34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.75);
  background: rgba(28, 31, 26, 0.42);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: #fff;
  transition: transform 0.3s var(--ease), background-color 0.3s var(--ease);
}
.play svg { width: 24px; height: 24px; fill: currentColor; margin-left: 3px; }

/* ---------- 開場 ---------- */
.slide--opening {
  background: var(--night);
  color: #ecebe4;
  padding: 16px 20px;
}
.opening {
  width: 100%;
  max-width: 560px;
  min-width: 0;
  min-height: 0;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 18px;
}
.opening__kicker {
  font-size: 10.5px;
  letter-spacing: 0.32em;
  color: rgba(236, 235, 228, 0.6);
}
.opening__head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.opening__screen {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 1px solid rgba(236, 235, 228, 0.18);
  background: #111;
  cursor: pointer;
  overflow: hidden;
}
.opening__still {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.92;
  transition: opacity 0.4s var(--ease);
}
.opening__screen:hover .opening__still { opacity: 1; }
.opening__screen:hover .play,
.film:hover .play { transform: scale(1.06); background: rgba(28, 31, 26, 0.6); }
/* 展名與主題比作品片名大；片名留在下方 meta 與影片本身 */
.opening__title {
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(30px, 9vw, 46px);
  letter-spacing: 0.14em;
  margin-right: -0.14em;
  line-height: 1.25;
}
.opening__subtitle {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(16px, 4.6vw, 22px);
  letter-spacing: 0.12em;
  margin-right: -0.12em;
  line-height: 1.5;
}
.opening__intro {
  font-size: 12.5px;
  letter-spacing: 0.16em;
  color: rgba(236, 235, 228, 0.62);
}
.opening__meta {
  display: flex;
  gap: 14px;
  font-size: 12px;
  letter-spacing: 0.16em;
  color: rgba(236, 235, 228, 0.66);
}
.opening__meta span + span { padding-left: 14px; border-left: 1px solid rgba(236, 235, 228, 0.24); }
.opening__hint {
  margin-top: 6px;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: rgba(236, 235, 228, 0.5);
}
.opening__hint::after {
  content: "";
  display: inline-block;
  width: 28px;
  height: 1px;
  margin-left: 10px;
  vertical-align: middle;
  background: currentColor;
  animation: nudge 2.4s var(--ease) infinite;
}
@keyframes nudge {
  0%, 60%, 100% { transform: translateX(0); }
  30% { transform: translateX(6px); }
}

/* ---------- 概念影片入口 ---------- */
.film {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.film__poster {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.film__tag {
  position: absolute;
  left: 50%;
  top: calc(50% + 48px);
  transform: translateX(-50%);
  padding: 6px 12px;
  font-size: 12px;
  letter-spacing: 0.14em;
  white-space: nowrap;
  color: #fff;
  background: rgba(28, 31, 26, 0.42);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border-radius: 999px;
}

/* ---------- 策展頁：9:16 HTML 海報 ----------
   frame 是尺寸容器，卡片取「寬 ≤ 框寬、高 ≤ 框高」的最大 9:16；
   卡片本身是 inline-size 容器，內文一律用 cqw，任何螢幕比例都一致，不捲動、不裁切。 */
.editorial {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  justify-items: center;
}
.editorial__frame {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  place-items: center;
  container-type: size;
}
.editorial__card {
  container-type: inline-size;
  width: min(100%, 50vh);
  width: min(100cqw, 100cqh * 9 / 16);
  aspect-ratio: 9 / 16;
  background: var(--ivory);
  color: var(--ink);
  outline: 1px solid var(--line);
  overflow: hidden;
}
.editorial__inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 8cqw 7cqw 6.5cqw;
}
.editorial__top {
  display: flex;
  flex-direction: column;
  gap: 1cqw;
  padding-bottom: 3.5cqw;
  border-bottom: 1px solid var(--line);
  font-size: 2.9cqw;
  letter-spacing: 0.2em;
  line-height: 1.4;
  color: var(--ink-soft);
}
.editorial__eyebrow { color: var(--ink); font-weight: 500; }
.editorial__heading {
  margin-top: 7cqw;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 10.4cqw;
  line-height: 1.24;
  letter-spacing: 0.04em;
  white-space: pre-line;
}
.editorial__dek {
  margin-top: 3.5cqw;
  font-size: 4cqw;
  line-height: 1.55;
  letter-spacing: 0.06em;
}
/* 圖形吃剩下的高度，文字永遠優先完整 */
.editorial__motif {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  margin: 4cqw 0;
  object-fit: contain;
}
.editorial__body {
  font-size: 3.4cqw;
  line-height: 1.75;
  letter-spacing: 0.02em;
  white-space: pre-line;
  color: var(--ink-soft);
}
.editorial__steps {
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3cqw;
  margin-top: 5cqw;
  padding-top: 3.2cqw;
  border-top: 1px solid var(--line);
  font-size: 3cqw;
  line-height: 1.5;
  letter-spacing: 0.04em;
}
.editorial__steps li { counter-increment: step; }
.editorial__steps li::before {
  content: "0" counter(step);
  display: block;
  font-size: 2.4cqw;
  letter-spacing: 0.16em;
  color: var(--ink-soft);
}
.editorial__footnote {
  margin-top: 4cqw;
  font-size: 2.6cqw;
  line-height: 1.6;
  color: var(--ink-soft);
}
/* 資料來源：卡片外的安靜註腳，只在一般瀏覽顯示 */
.editorial__source {
  padding-top: 4px;
  font-size: 11.5px;
  letter-spacing: 0.04em;
}
.editorial__source a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  color: var(--ink-soft);
  text-underline-offset: 3px;
}

/* ---------- 底部導覽 ---------- */
.dock {
  grid-area: dock;
  position: relative;
  display: grid;
  grid-template-columns: var(--hit) minmax(0, 1fr) var(--hit);
  align-items: center;
  gap: 8px;
  min-height: calc(var(--dock-h) + var(--safe-b));
  padding: 0 8px var(--safe-b);
  border-top: 1px solid var(--rule);
}
.dock__progress {
  position: absolute;
  left: 0; right: 0; top: -1px;
  height: 1px;
  overflow: hidden;
}
.dock__progress span {
  display: block;
  height: 100%;
  background: var(--fg);
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 0.4s var(--ease);
}

.nav-btn {
  width: var(--hit);
  height: var(--hit);
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.2s var(--ease), border-color 0.2s var(--ease);
}
.nav-btn:hover:not(:disabled) { border-color: currentColor; }
.nav-btn:disabled { opacity: 0.28; cursor: default; }

.dock__meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
/* 章節歸屬：頂欄放不下章節時（窄手機、橫向）才在底欄顯示 */
.dock__chapter {
  display: none;
  max-width: 100%;
  font-size: 10.5px;
  line-height: 1.3;
  letter-spacing: 0.14em;
  color: var(--fg-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dock__title {
  max-width: 100%;
  display: flex;
  gap: 6px;
  font-size: 14px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  overflow: hidden;
}
#dock-collection { font-family: var(--serif); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
#dock-label, .dock__sep { color: var(--fg-soft); }

.dock__row {
  max-width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  column-gap: 4px;
}
.dots { display: flex; flex-wrap: wrap; justify-content: center; }
/* 熱區 44×44，視覺仍是 6px 小點 */
.dot {
  position: relative;
  flex: none;
  width: var(--hit);
  height: var(--hit);
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.dot::before {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 6px; height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  border: 1px solid var(--fg);
  opacity: 0.45;
  transition: transform 0.25s var(--ease), opacity 0.25s var(--ease), background-color 0.25s var(--ease);
}
.dot--film::before { border-radius: 1px; }
.dot--editorial::before { width: 10px; height: 3px; margin: -1.5px 0 0 -5px; border-radius: 0; }
.dot[aria-current]::before { background: var(--fg); opacity: 1; transform: scale(1.35); }
.dot:focus-visible { outline-offset: -8px; }
.dock__count {
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--fg-soft);
  font-variant-numeric: tabular-nums;
}

/* ---------- 展示／截圖模式 ---------- */
.app.is-presenting {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  grid-template-areas: "stage";
  padding: 0;
}
.app.is-presenting .topbar,
.app.is-presenting .dock,
.app.is-presenting .rail { display: none; }
.app.is-presenting .slide {
  padding: var(--safe-t) var(--safe-r) var(--safe-b) var(--safe-l);
  background: var(--accent);
}
.app.is-presenting .slide--opening { background: var(--night); }
.app.is-presenting .editorial__source { display: none; }
.app.is-presenting .stage { cursor: zoom-out; }

.present-hint {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--safe-b));
  z-index: 20;
  transform: translate(-50%, 8px);
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(28, 31, 26, 0.78);
  color: #f5f3ed;
  font-size: 13px;
  letter-spacing: 0.1em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
.present-hint.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 對話框共用 ---------- */
dialog {
  color: var(--ink);
  font-family: var(--sans);
}
dialog::backdrop {
  background: rgba(28, 31, 26, 0.48);
}

.sheet {
  width: min(100%, 520px);
  max-width: 100%;
  max-height: min(86dvh, 760px);
  margin: auto auto 0;
  padding: 0 0 calc(16px + var(--safe-b));
  border: 0;
  border-top: 1px solid var(--line);
  background: var(--ivory);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.sheet[open] { animation: rise 0.32s var(--ease); }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }

.sheet__head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 10px 14px 22px;
  background: var(--ivory);
  border-bottom: 1px solid var(--line);
}
.sheet__kicker, .player__kicker {
  font-size: 10.5px;
  letter-spacing: 0.3em;
  color: var(--ink-soft);
}
.sheet__title {
  margin-top: 4px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: 0.1em;
}

/* 索引 */
.index-list { padding: 4px 0; }
.index-item {
  padding: 12px 18px 14px;
  border-bottom: 1px solid var(--line);
}
.index-item__main {
  width: 100%;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 6px 4px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.index-item__thumb {
  width: 56px;
  aspect-ratio: 941 / 1672;
  object-fit: contain;
  background: #e9e6dd;
  outline: 1px solid var(--line);
}
.index-item__thumb.is-film { object-fit: cover; background: var(--night); }
.index-item__thumb--editorial {
  display: grid;
  place-items: center;
  padding: 5px;
  background: var(--ivory);
}
.index-item__thumb--editorial img { display: block; width: 100%; height: auto; }
.index-chapter {
  padding: 18px 22px 2px;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--ink-soft);
}
.index-item__text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.index-item__num { font-size: 10.5px; letter-spacing: 0.22em; color: var(--ink-soft); }
.index-item__title { font-family: var(--serif); font-weight: 600; font-size: 18px; letter-spacing: 0.06em; }
.index-item__desc { font-size: 13px; color: var(--ink-soft); line-height: 1.5; }
.index-item__meta { font-size: 11.5px; letter-spacing: 0.1em; color: var(--ink-soft); }
.index-item[aria-current] .index-item__title::after {
  content: "目前";
  margin-left: 10px;
  padding: 1px 7px;
  font-family: var(--sans);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.1em;
  vertical-align: 3px;
  border: 1px solid currentColor;
  border-radius: 999px;
}
.index-item__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  padding-left: 74px;
}
.chip {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  cursor: pointer;
  position: relative;
}
/* 視覺 36px，熱區補到 44px */
.chip::after { content: ""; position: absolute; inset: -4px 0; }
.chip[aria-current] { background: var(--ink); border-color: var(--ink); color: var(--ivory); }

/* 分享 */
.share__subject {
  padding: 16px 22px 4px;
  font-size: 14px;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
}
.share__actions {
  display: grid;
  gap: 8px;
  padding: 10px 18px 4px;
}
.share-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-height: 56px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s var(--ease);
}
.share-btn:hover { border-color: var(--ink); }
.share-btn__label { font-size: 15px; letter-spacing: 0.08em; }
.share-btn__hint {
  max-width: 100%;
  font-size: 12px;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.share__note, .share__status {
  padding: 8px 22px 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink-soft);
}
.share__status:empty { display: none; }
.share__status { color: var(--ink); }
.share__manual {
  display: grid;
  gap: 6px;
  padding: 10px 22px 0;
  font-size: 12px;
  color: var(--ink-soft);
}
.share__manual[hidden] { display: none; }
.share__manual input {
  width: 100%;
  min-height: var(--hit);
  padding: 0 12px;
  border: 1px solid var(--line);
  background: #fff;
  font: 14px var(--sans);
  color: var(--ink);
}

/* 影片播放器 */
.player {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  padding: var(--safe-t) var(--safe-r) var(--safe-b) var(--safe-l);
  border: 0;
  background: #0f110e;
  color: #ecebe4;
  display: none;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.player[open] { display: grid; }
.player::backdrop { background: #0f110e; }
.player__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 8px 10px 20px;
}
.player__kicker { color: rgba(236, 235, 228, 0.55); }
.player__title {
  margin-top: 4px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: 0.1em;
}
.icon-btn--light { color: #ecebe4; border: 1px solid rgba(236, 235, 228, 0.3); }
.player__frame {
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 0 0 12px;
}
.player video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}
.player__fallback {
  padding: 12px 20px 20px;
  font-size: 14px;
  line-height: 1.6;
  color: #ecebe4;
}
.player__fallback[hidden] { display: none; }
.player__fallback a { color: #fff; text-underline-offset: 3px; }

/* ---------- 小高度手機（如 375×667）：更精簡 ---------- */
@media (max-height: 700px) {
  :root { --top-h: 52px; --dock-h: 62px; }
  .slide { padding: 8px 10px; }
  .opening { gap: 12px; }
  .dock__title { font-size: 13px; }
  /* 點仍是 44×44 熱區，只讓上下各 6px 疊進留白，底欄維持精簡、不壓縮主圖 */
  .dock__row { margin: -6px 0; }
}

@media (max-width: 430px) {
  .topbar__title { display: none; }
  .dock__chapter { display: block; }
  .icon-btn { padding: 0 8px; gap: 4px; font-size: 12.5px; }
}

@media (max-width: 359px) {
  /* 只在視覺上隱藏，保留按鈕的無障礙名稱 */
  .icon-btn__text {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .topbar .icon-btn { padding: 0; width: var(--hit); }
}

/* ---------- 手機橫向：控制移到右側欄，主圖用滿高度 ---------- */
@media (orientation: landscape) and (max-height: 520px) {
  .app {
    grid-template-columns: minmax(0, 1fr) minmax(200px, 30%);
    grid-template-rows: minmax(0, 1fr) auto;
    grid-template-areas: "stage top" "stage dock";
  }
  .topbar {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 6px;
    min-height: 0;
    padding: calc(10px + var(--safe-t)) 10px 0 14px;
    border-bottom: 0;
    border-left: 1px solid var(--rule);
  }
  .topbar .brand { padding: 4px 0 6px; }
  .topbar__title { display: none; }
  .dock__chapter { display: block; }
  .actions { margin-left: 0; flex-wrap: wrap; }
  /* 控制欄窄：概念名＋小圓點＋頁碼獨立一列（可換行），上一張／下一張放下一列 */
  .dock {
    min-height: 0;
    grid-template-columns: var(--hit) minmax(0, 1fr) var(--hit);
    grid-template-areas: "meta meta meta" "prev . next";
    row-gap: 6px;
    padding: 8px 10px calc(10px + var(--safe-b)) 14px;
    border-top: 0;
    border-left: 1px solid var(--rule);
  }
  .dock__meta { grid-area: meta; }
  .dock__row { margin: -6px 0 0; }
  #btn-prev { grid-area: prev; }
  #btn-next { grid-area: next; }
  .dock__progress { left: 14px; right: 10px; top: 0; }
  .slide { padding: 6px 10px; }
  .opening { flex-direction: column; gap: 8px; max-width: none; }
  .opening__screen { width: auto; height: 46vh; height: 46dvh; }
  .opening__head { gap: 4px; }
  .opening__title { font-size: 24px; }
  .opening__subtitle { font-size: 15px; }
  .opening__intro, .opening__hint { display: none; }
  .sheet { max-height: 92dvh; }
}

/* ---------- 桌機：左側展覽目錄，中央一張直式畫面 ---------- */
@media (min-width: 1024px) and (min-height: 560px) {
  :root { --top-h: 68px; --dock-h: 84px; }
  .app {
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas: "rail top" "rail stage" "rail dock";
  }
  .rail {
    grid-area: rail;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 30px 0 24px;
    border-right: 1px solid var(--rule);
    overflow-y: auto;
  }
  .rail__brand { padding: 0 28px; font-size: 20px; }
  .rail__kicker {
    padding: 8px 28px 22px;
    font-family: var(--serif);
    font-size: 15px;
    letter-spacing: 0.18em;
    color: var(--fg-soft);
    border-bottom: 1px solid var(--rule);
  }
  .rail__list { flex: 1; padding: 10px 0; }
  .rail__chapter {
    padding: 14px 28px 2px;
    font-size: 10.5px;
    letter-spacing: 0.2em;
    color: var(--fg-soft);
  }
  .rail__item { padding: 2px 18px 6px; }
  .rail__link {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    min-height: var(--hit);
    padding: 8px 10px;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
    opacity: 0.62;
    transition: opacity 0.2s var(--ease);
  }
  .rail__link:hover, .rail__item[aria-current] .rail__link { opacity: 1; }
  .rail__text { display: flex; flex-direction: column; gap: 2px; }
  .rail__title { font-family: var(--serif); font-weight: 600; font-size: 16px; letter-spacing: 0.06em; }
  .rail__en { font-size: 10px; letter-spacing: 0.24em; color: var(--fg-soft); }
  .rail__chips {
    display: none;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 0 6px 10px;
  }
  .rail__item[aria-current] .rail__chips { display: flex; }
  .rail .chip { min-height: 32px; color: var(--fg); border-color: var(--rule); }
  .rail .chip::after { inset: -6px 0; }
  .rail .chip[aria-current] { background: var(--fg); border-color: var(--fg); color: var(--bg); }
  .rail__note {
    padding: 16px 28px 0;
    font-size: 11.5px;
    line-height: 1.7;
    color: var(--fg-soft);
    border-top: 1px solid var(--rule);
  }

  .topbar { padding-left: 32px; padding-right: 24px; }
  .topbar .brand { display: none; }
  .topbar__title { padding-left: 0; border-left: 0; font-size: 11px; }
  #btn-index { display: none; }

  .slide {
    padding: 24px 32px;
    background: transparent;
  }
  /* 高度跟著舞台、寬度由比例推算；舞台太窄時 max-width 收住，圖片仍在框內 contain */
  .slide__figure {
    width: auto;
    max-width: 100%;
    aspect-ratio: 941 / 1672;
    background: var(--accent);
    outline: 1px solid var(--rule);
  }
  .film {
    width: auto;
    max-width: 100%;
    aspect-ratio: 9 / 16;
    background: var(--accent);
    outline: 1px solid var(--rule);
  }
  .dock {
    grid-template-columns: var(--hit) minmax(0, 360px) var(--hit);
    justify-content: center;
    gap: 24px;
  }
  .app.is-presenting .slide { padding: 0; }
  .app.is-presenting .slide__figure,
  .app.is-presenting .film { outline: 0; }
  .sheet { margin: auto; border: 1px solid var(--line); }
  .player__frame { padding: 0 32px 32px; }
}

/* ---------- 減少動態 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
