/* 島嶼能量心理測驗：展場直式觸控螢幕＋手機共用一份 RWD。
   版面以設計稿 1080×1920 為座標：1 設計像素 = var(--u) = 舞台寬 / 1080。
   舞台寬 ≥ 540px（展場螢幕、平板、桌機、筆電）＝「海報版」，照設計稿位置與斷行擺字；
   更窄（直式手機）＝「流動版」，字有最小字級，自動換行、由上往下排。
   舞台寬至少 540px（螢幕夠寬時）：筆電視窗矮，照 9:16 算會比 540 窄而掉進流動版，結果卡照片被切（10/20 回報） */

@font-face {
  font-family: "IslandTC";
  src: url("../assets/fonts/NotoSansTC-subset.woff") format("woff");
  font-weight: 100 900;
  font-display: block;
}
/* 英文設計稿用 Myriad Pro（商用授權）；網頁用字形相近的 Source Sans 3（SIL OFL，授權檔在 assets/fonts/） */
@font-face {
  font-family: "IslandEN";
  src: url("../assets/fonts/SourceSans3-subset.woff") format("woff");
  font-weight: 200 900;
  font-display: block;
}

:root {
  --bg: #6d8531;
  --frame: #566720;
  --deep: #46541a;
  --btn: #9cc452;
  --yellow: #ffe400;
  --letter: #fff000;
  --ink: #231815;
  --shade: rgba(28, 34, 8, 0.55);
  --font: "IslandTC", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --font-en: "Futura", "Century Gothic", "Avenir Next", "IslandTC", sans-serif;
  --font-latin: "IslandEN", "Source Sans 3", "Myriad Pro", "Segoe UI", "IslandTC", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--deep); }
body {
  font-family: var(--font);
  font-synthesis: none;
  color: #fff;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  font-kerning: normal;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { display: block; max-width: none; }
[hidden] { display: none !important; }

.stage {
  position: relative;
  margin: 0 auto;
  width: max(min(100vw, 56.25dvh), min(100vw, 540px));
  min-height: 100dvh;
  container: stage / inline-size;
  overflow: hidden;
}

.screen {
  --u: calc(100cqi / 1080);
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.screen.enter { animation: screen-in 0.45s ease-out both; }
@keyframes screen-in { from { opacity: 0; } to { opacity: 1; } }

/* 文字行：海報版每行一塊、不自動換行（照設計稿斷行）；流動版接成一段讓瀏覽器換行 */
.ln { display: inline; }
.pill { border-radius: 999px; }

/* ---------- 封面 ---------- */
.cover {
  background: #576c27 center top / cover no-repeat;
  padding: 0 6.5cqi 4cqi;
}
/* 手機版標題也放在設計稿的高度（底圖上的雲、山線才對得上） */
.cover-title { width: calc(var(--w, 780) * var(--u)); margin-top: calc(var(--y, 540) * var(--u)); }
.lang {
  position: absolute; top: 4cqi; right: 4cqi;
  display: flex; align-items: center; gap: 0.35em;
  font-size: max(15px, 3.5cqi); font-weight: 700; line-height: 1;
  padding: 0.35em 0.6em; border-radius: 999px; background: rgba(40, 50, 12, 0.35);
}
.lang button { padding: 0.15em 0.1em; opacity: 0.55; }
.lang button[aria-pressed="true"] { opacity: 1; }
.lang-sep { width: 2px; height: 1em; background: #fff; }
.cover-body {
  margin-top: 5cqi; font-weight: 350;
  font-size: max(15px, 3.32cqi);
  line-height: 1.6;
  text-align: justify;
}
.cover-body p { margin: 0 0 0.6em; }
.cover-closing {
  margin: 5cqi 0 0; text-align: center; font-weight: 700;
  font-size: max(17px, 4.55cqi); line-height: 1.45;
}
.start {
  margin-top: 6cqi; width: 75.4cqi; min-height: 52px; height: 10.3cqi;
  background: #fff; color: var(--bg); font-weight: 900; font-size: max(19px, 4.75cqi);
  letter-spacing: 0.04em;
}
.cover-logos {
  margin-top: auto; width: 61cqi; padding-top: 6cqi;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.en-pending { display: none !important; }

/* ---------- 題目頁 ---------- */
.question { background: var(--bg); padding: 0 5cqi; }
.q-top { position: absolute; left: 0; top: 0; width: 100%; pointer-events: none; }
/* 手機版題號與題幹起點照設計稿高度：上方的雲是白色，題幹太高會白字疊白雲 */
.q-title { margin: calc(var(--y, 100) * var(--u)) 0 0; position: relative; z-index: 1; }
.q-title img { width: calc(var(--w, 475) * var(--u)); margin: 0 auto; }
.q-title-text { display: none; }
.q-stem {
  position: relative; z-index: 1; width: 100%;
  margin: calc((var(--y, 412) - var(--tb, 323)) * var(--u)) 0 0; font-weight: 700; font-size: max(19px, 4.52cqi); line-height: 1.45;
}
.q-stem.center { text-align: center; }
.q-opts { list-style: none; margin: 6cqi 0 0; padding: 0; width: 100%; display: flex; flex-direction: column; gap: max(10px, 2.3cqi); }
.opt {
  width: 100%; min-height: max(64px, 14.35cqi);
  display: flex; align-items: center; gap: max(10px, 2.4cqi);
  padding: 2cqi max(14px, 3.7cqi);
  border: 2px solid #fff; border-radius: 999px; text-align: left;
  transition: background-color 0.15s, transform 0.15s;
}
.opt:active, .opt.picked { background: rgba(255, 255, 255, 0.18); transform: scale(0.985); }
.opt .letter {
  flex: none; width: max(36px, 8.33cqi); height: max(36px, 8.33cqi); border-radius: 50%;
  background: var(--letter); color: var(--ink); font-weight: 900; font-size: max(22px, 5.6cqi);
  display: grid; place-items: center; line-height: 1;
}
.opt .txt { font-weight: 350; font-size: max(16px, 3.4cqi); line-height: 1.45; }
.q-spacer { flex: 1 0 4cqi; }
.q-bottom { width: 100cqi; margin: 0 -5cqi; pointer-events: none; }

/* ---------- 過場 ---------- */
.transition { background: #5a6e28 center / cover no-repeat; justify-content: center; }
.t-mark { position: relative; width: 39cqi; height: 39cqi; margin-top: -10cqi; }
.t-rays, .t-bear { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.t-rays { width: 100%; }
.t-bear { width: 65.4%; }
.t-text { margin: 22cqi 0 0; font-size: max(24px, 6.1cqi); font-weight: 900; letter-spacing: 0.06em; }
.t-text .dot { display: inline-block; }
.playing .t-rays { animation: rays 2.6s ease-out both; }
.playing .t-bear { animation: bear 2.6s ease-out both; }
.playing .t-text { animation: rise 0.7s 0.25s ease-out both; }
.playing .t-text .dot { animation: dot 0.9s infinite; }
.playing .t-text .dot:nth-child(2) { animation-delay: 0.15s; }
.playing .t-text .dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes rays {
  0% { transform: translate(-50%, -50%) scale(0.6) rotate(-40deg); opacity: 0; }
  25% { opacity: 1; }
  60% { transform: translate(-50%, -50%) scale(1.08) rotate(6deg); }
  100% { transform: translate(-50%, -50%) scale(1) rotate(0deg); }
}
@keyframes bear {
  0% { transform: translate(-50%, -50%) scale(0.3); opacity: 0; }
  22% { transform: translate(-50%, -50%) scale(1.12); opacity: 1; }
  34% { transform: translate(-50%, -50%) scale(0.96); }
  44% { transform: translate(-50%, -50%) scale(1); }
  62% { transform: translate(-50%, -54%) scale(1); }
  76% { transform: translate(-50%, -50%) scale(1); }
  88% { transform: translate(-50%, -53%) scale(1); }
  100% { transform: translate(-50%, -50%) scale(1); }
}
@keyframes rise { from { transform: translateY(1em); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes dot { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }

/* ---------- 結果頁 ---------- */
.result { background: var(--frame); align-items: stretch; padding-bottom: 6cqi; }
.r-hero { position: relative; overflow: hidden; }
.r-hero img { width: 100%; }
.r-card {
  margin: 0 4.35cqi; padding: 0 5cqi 6cqi; background: var(--bg); text-align: center;
  box-shadow: 0 0 1.5cqi var(--shade); clip-path: inset(0 -3cqi -3cqi -3cqi);
}
.r-card > p { margin: 0; }
.r-title { margin: 0; font-weight: 700; font-size: max(28px, 7.2cqi); line-height: 1.25; text-shadow: 0.35cqi 0.35cqi 0.5cqi rgba(30, 38, 10, 0.85); }
.r-title .ln, .cover-closing .ln { display: block; }  /* 手機版也照設計稿斷行（短，放得下） */
.r-en { font-family: var(--font-en); font-weight: 500; font-size: max(14px, 3.15cqi); margin-top: 1.2cqi !important; }
.r-tagline { color: var(--yellow); font-size: max(15px, 3.15cqi); line-height: 1.4; margin-top: 3cqi !important; }
.r-now { font-weight: 250; font-size: max(17px, 4.05cqi); margin-top: 6cqi !important; }
.r-need { font-weight: 450; font-size: max(20px, 5.1cqi); line-height: 1.35; margin-top: 1cqi !important; }
.r-body { font-weight: 250; font-size: max(15px, 3.07cqi); line-height: 1.6; margin-top: 5cqi !important; text-align: justify; }
.label { color: var(--yellow); font-weight: 700; }
.label::before, .label::after {
  content: ""; display: inline-block; width: max(2px, 0.3cqi); height: 1.05em; background: var(--yellow);
  vertical-align: -0.15em; margin: 0 0.45em;
}
.r-keywords { margin: 0; padding: 4cqi 5cqi; font-size: max(15px, 3.15cqi); line-height: 1.5; }
.r-keywords .label { font-size: 1.08em; margin-right: 0.5em; }
.r-keywords .kw { font-weight: 350; font-feature-settings: "halt"; }  /* 間隔點「•」收成半格，與設計稿同 */
.r-keywords .k { white-space: nowrap; }
/* 手機版：關鍵字換行時對齊第一個關鍵字，不鑽到標籤下面 */
.r-keywords { display: flex; align-items: baseline; }
.r-keywords .label { flex: none; }
.r-keywords .kw { flex: 1 1 auto; min-width: 0; }
.result .hb { font-feature-settings: "halt"; }  /* 結果卡的括號是半格 */
.r-lower {
  position: relative; margin: 0 4.35cqi; padding: 4.5cqi 5cqi 5.5cqi; background: var(--bg);
  box-shadow: 0 0 1.5cqi var(--shade); clip-path: inset(0 -3cqi -3cqi -3cqi);
  display: grid; grid-template-columns: 1fr auto; column-gap: 4cqi; align-items: start;
}
.r-lower > p { margin: 0; }
.r-feat-label { grid-column: 1; font-size: max(16px, 3.3cqi); }
.r-features { grid-column: 1; margin-top: 1.5cqi !important; font-weight: 250; font-size: max(14px, 2.6cqi); line-height: 1.55; text-align: justify; }
.r-info-label { grid-column: 2; grid-row: 1; font-size: max(16px, 3.3cqi); }
.r-qr { grid-column: 2; grid-row: 2; margin-top: 1.5cqi; display: block; width: max(96px, 14.5cqi); background: #fff; }
.r-qr svg { display: block; width: 100%; height: auto; }
.r-buttons { display: flex; justify-content: space-between; gap: 3cqi; margin: 6cqi 4.35cqi 0; }
.r-buttons .pill {
  flex: 1; min-height: 48px; height: 7.6cqi; background: var(--btn); color: #fff;
  font-weight: 500; font-size: max(16px, 3.7cqi); letter-spacing: 0.04em;
  transition: filter 0.15s, transform 0.15s;
}
.r-buttons .pill:active { filter: brightness(0.92); transform: scale(0.97); }
.r-buttons .pill .count { font-variant-numeric: tabular-nums; margin-left: 0.3em; opacity: 0.85; }

/* ---------- 對話框（QR、閒置提醒、存圖、分享） ---------- */
.modal {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center;
  background: rgba(10, 14, 3, 0.72); padding: 16px;
  animation: screen-in 0.25s ease-out both;
}
.sheet {
  --u: calc(min(100vw, 56.25dvh) / 1080);
  width: min(92vw, 760px, max(320px, calc(820 * var(--u))));
  max-height: 92dvh; overflow: auto;
  background: var(--bg); color: #fff; border-radius: 28px; padding: 28px 24px 24px;
  text-align: center; box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
}
.sheet-title { margin: 0 0 16px; font-size: clamp(18px, 2.4vw + 10px, 34px); line-height: 1.4; font-weight: 700; }
.sheet-body { font-size: clamp(15px, 1.6vw + 8px, 24px); line-height: 1.6; }
.sheet-body p { margin: 0 0 12px; }
.sheet-body .qr-big { width: min(70vw, 56dvh, 460px); margin: 8px auto 12px; background: #fff; padding: 14px; border-radius: 18px; }
.sheet-body .qr-big svg { display: block; width: 100%; height: auto; }
.sheet-body .hint { color: var(--yellow); font-weight: 700; font-size: 1.1em; }
.sheet-body .save-img { width: 100%; max-width: 420px; margin: 0 auto 12px; border-radius: 10px; -webkit-touch-callout: default; user-select: auto; }
.sheet-body .url { font-size: 0.8em; opacity: 0.8; word-break: break-all; }
.sheet-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 18px; }
.sheet-actions .pill, .sheet-actions a.pill {
  min-height: 48px; padding: 0 1.4em; display: inline-flex; align-items: center; justify-content: center; white-space: nowrap;
  background: var(--btn); color: #fff; font-weight: 700; font-size: clamp(16px, 1.4vw + 9px, 26px); text-decoration: none;
}
.sheet-actions .pill.ghost { background: transparent; border: 2px solid #fff; }
.sheet-actions .pill.fb { background: #1877f2; }
.sheet-actions .pill.line { background: #06c755; }
.sheet-actions .count { font-variant-numeric: tabular-nums; }
/* 展場直式大螢幕：對話框照舞台比例放大，站著看得清楚、手指好按 */
.kiosk .sheet { width: calc(880 * var(--u)); padding: calc(52 * var(--u)) calc(48 * var(--u)) calc(48 * var(--u)); border-radius: calc(44 * var(--u)); }
.kiosk .sheet-title { font-size: calc(48 * var(--u)); margin-bottom: calc(24 * var(--u)); }
.kiosk .sheet-body { font-size: calc(34 * var(--u)); }
.kiosk .sheet-body .qr-big { width: calc(540 * var(--u)); padding: calc(22 * var(--u)); border-radius: calc(26 * var(--u)); }
.kiosk .sheet-actions { gap: calc(24 * var(--u)); margin-top: calc(32 * var(--u)); }
.kiosk .sheet-actions .pill { font-size: calc(38 * var(--u)); min-height: calc(100 * var(--u)); padding: 0 1.2em; }
/* 完成人次統計（工作人員用） */
.modal[data-kind="stats"] .sheet { width: min(96vw, 820px); text-align: left; }
.kiosk .modal[data-kind="stats"] .sheet { width: calc(1000 * var(--u)); }
/* 統計表比螢幕長時只有表格在卡片裡捲，按鈕固定在卡片底部，不必捲到底才能關閉；展場版四顆鈕排一排 */
.modal[data-kind="stats"] .sheet { display: flex; flex-direction: column; overflow: hidden; }
.modal[data-kind="stats"] .sheet-body { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.modal[data-kind="stats"] .sheet-title, .modal[data-kind="stats"] .sheet-actions { flex: none; }
.kiosk .modal[data-kind="stats"] .sheet-actions { gap: calc(20 * var(--u)); }
.kiosk .modal[data-kind="stats"] .sheet-actions .pill { font-size: calc(32 * var(--u)); min-height: calc(88 * var(--u)); padding: 0 0.9em; }
.st-total { font-size: 1.25em; font-weight: 700; color: var(--yellow); }
.st-note { font-size: 0.8em; opacity: 0.85; }
.sheet-body table.st { width: 100%; border-collapse: collapse; margin: 0 0 16px; font-size: 0.85em; font-variant-numeric: tabular-nums; }
.st th, .st td { padding: 4px 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.25); text-align: right; }
.st th:first-child, .st .l { text-align: left; }
.st th { color: var(--yellow); font-weight: 700; }
.toast {
  position: fixed; left: 50%; bottom: 8dvh; transform: translateX(-50%); z-index: 60;
  background: rgba(20, 26, 6, 0.9); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 16px;
  animation: screen-in 0.2s ease-out both;
}

/* ---------- 內部審閱（?review） ---------- */
.review {
  position: fixed; left: 8px; bottom: 8px; z-index: 70; max-width: min(94vw, 520px);
  background: rgba(0, 0, 0, 0.78); color: #fff; font: 13px/1.5 ui-monospace, Menlo, monospace;
  padding: 8px 10px; border-radius: 8px; white-space: pre-wrap;
}
.review a { color: #ffe400; margin-right: 0.6em; }

/* ---------- 展場模式：不能選字、不能長按選單、不能縮放 ---------- */
.kiosk, .kiosk * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.kiosk { touch-action: manipulation; overscroll-behavior: none; }
.kiosk .stage { cursor: default; }

/* ---------- 海報版：舞台夠寬時照設計稿座標擺 ---------- */
@container stage (min-width: 540px) {
  .screen { display: block; min-height: 0; height: calc(1920 * var(--u)); padding: 0; }
  .ln { display: block; white-space: nowrap; }
  .abs { position: absolute; left: calc(var(--x) * var(--u)); top: calc(var(--y) * var(--u)); }

  /* 封面 */
  .cover { background-size: 100% 100%; }
  .cover-title { position: absolute; left: calc(var(--x) * var(--u)); top: calc(var(--y) * var(--u)); width: calc(var(--w) * var(--u)); margin: 0; }
  .lang {
    top: calc((var(--cy) - 0.5 * var(--fs) - 11.5) * var(--u)); right: calc((var(--r) - 11) * var(--u));
    font-size: calc(var(--fs) * var(--u)); background: none; padding: calc(9 * var(--u)) calc(11 * var(--u)); gap: calc(13 * var(--u));
  }
  .lang-sep { width: calc(3 * var(--u)); height: calc(42 * var(--u)); }
  .cover-body {
    position: absolute; margin: 0; left: calc(var(--x) * var(--u)); top: calc(var(--y) * var(--u));
    font-size: calc(var(--fs) * var(--u)); line-height: calc(var(--lh) * var(--u)); text-align: left;
  }
  .cover-body p { margin: 0 0 calc(var(--pg) * var(--u)); }
  .cover-closing {
    position: absolute; margin: 0; left: 0; right: 0; top: calc(var(--y) * var(--u));
    font-size: calc(var(--fs) * var(--u)); line-height: calc(var(--lh) * var(--u));
  }
  .start {
    position: absolute; margin: 0; min-height: 0;
    left: calc(var(--x) * var(--u)); top: calc(var(--y) * var(--u));
    width: calc(var(--w) * var(--u)); height: calc(var(--h) * var(--u)); font-size: calc(var(--fs) * var(--u));
  }
  .cover-logos {
    position: absolute; margin: 0; padding: 0; left: calc(var(--x) * var(--u)); top: calc(var(--y) * var(--u));
    width: calc(var(--w) * var(--u)); -webkit-mask-image: none; mask-image: none;
  }

  /* 題目頁 */
  .q-title { position: absolute; margin: 0; left: calc(var(--x) * var(--u)); top: calc(var(--y) * var(--u)); }
  .q-title img { width: calc(var(--w) * var(--u)); margin: 0; }
  .q-stem {
    position: absolute; margin: 0; left: calc(var(--x) * var(--u)); top: calc(var(--y) * var(--u)); width: auto;
    font-size: calc(var(--fs) * var(--u)); line-height: calc(var(--lh) * var(--u));
  }
  .q-stem.center { left: 0; right: 0; }
  .q-opts { position: absolute; margin: 0; left: 0; top: 0; width: 100%; display: block; }
  .opt {
    position: absolute; min-height: 0; padding: 0; gap: 0;
    left: calc(136 * var(--u)); top: calc(var(--y) * var(--u));
    width: calc(807 * var(--u)); height: calc(var(--h) * var(--u)); border-width: calc(2 * var(--u));
  }
  .opt .letter {
    position: absolute; left: calc(38 * var(--u)); top: 50%; transform: translateY(-50%);
    width: calc(90 * var(--u)); height: calc(90 * var(--u)); font-size: calc(60 * var(--u));
  }
  .opt .txt {
    position: absolute; left: calc(var(--tx) * var(--u)); top: 50%; transform: translateY(-50%);
    font-size: calc(var(--fs) * var(--u)); line-height: calc(var(--lh) * var(--u));
  }
  .q-spacer { display: none; }
  .q-bottom { position: absolute; left: 0; top: calc(1362 * var(--u)); width: 100%; margin: 0; }

  /* 過場 */
  .transition { background-size: 100% 100%; }
  .t-mark { position: absolute; margin: 0; width: calc(var(--d) * var(--u)); height: calc(var(--d) * var(--u));
    left: calc((var(--cx) - var(--d) / 2) * var(--u)); top: calc((var(--cy) - var(--d) / 2) * var(--u)); }
  .t-bear { width: calc(var(--bd) / var(--d) * 100%); }
  .t-text { position: absolute; margin: 0; left: 0; right: 0; text-align: center;
    top: calc((var(--cy) - var(--fs) * 0.62) * var(--u)); font-size: calc(var(--fs) * var(--u)); line-height: 1.24; letter-spacing: 0; }

  /* 結果頁 */
  .result { padding: 0; }
  .r-hero { position: absolute; left: 0; top: 0; width: 100%; height: calc(1292 * var(--u)); }
  .r-hero img { width: 100%; }
  .r-card { position: static; margin: 0; padding: 0; background: none; box-shadow: none; clip-path: none; }
  .r-card > *, .r-lower > * { position: absolute; margin: 0 !important; }
  .blk { top: calc(var(--y) * var(--u)); font-size: calc(var(--fs) * var(--u)); line-height: calc(var(--lh) * var(--u)); }
  .blk.left { left: calc(var(--x) * var(--u)); text-align: left; }
  .blk.center { left: 0; width: 100%; text-align: center; }
  .blk.center .ln, .cover-closing .ln, .q-stem.center .ln { transform: translateX(calc(var(--dx, 0) * var(--u))); }
  /* 設計稿的段落是左右對齊：非末行撐到框寬（框寬 jw 由建置從原圖量出） */
  .jw { width: calc(var(--jw) * var(--u)) !important; }
  .jw .ln.j { text-align: justify; text-align-last: justify; }
  .r-title { text-shadow: calc(5 * var(--u)) calc(5 * var(--u)) calc(4 * var(--u)) rgba(30, 38, 10, 0.85); }
  /* 標籤列「｜標籤｜關鍵字」：直線粗細、高度、間距與字級都由建置從 13 張卡量出（--lfs 等設在 #result 上），
     以左邊那條直線的位置（--x）與直線中線（--cy）定位 */
  .r-keywords {
    position: absolute; margin: 0; padding: 0; left: calc(var(--x) * var(--u)); top: calc((var(--cy) - 25) * var(--u));
    height: calc(50 * var(--u)); display: flex; align-items: center; white-space: nowrap; line-height: 1;
  }
  .r-keywords .label, .r-lower .label { display: inline-flex; align-items: center; font-size: calc(var(--lfs) * var(--u)); line-height: 1; white-space: nowrap; margin: 0; }
  .label::before, .label::after { width: max(1px, calc(var(--bw) * var(--u))); height: calc(var(--bh) * var(--u)); margin: 0; vertical-align: baseline; }
  .label::before { margin-right: calc(var(--gi) * var(--u)); }
  .label::after { margin-left: calc(var(--go) * var(--u)); }
  .r-keywords .kw { font-size: calc(var(--kfs) * var(--u)); margin-left: calc(var(--gk) * var(--u)); letter-spacing: 0; }
  .r-lower {
    position: absolute; margin: 0; padding: 0; display: block;
    left: calc(var(--x0) * var(--u)); top: calc(var(--y0) * var(--u));
    width: calc((var(--x1) - var(--x0)) * var(--u)); height: calc((var(--y1) - var(--y0)) * var(--u));
    box-shadow: 0 0 calc(18 * var(--u)) var(--shade); clip-path: inset(0 calc(-30 * var(--u)) calc(-30 * var(--u)) calc(-30 * var(--u)));
  }
  .r-lower .label { height: calc(50 * var(--u)); top: calc((var(--cy) - 25 - var(--y0)) * var(--u)); left: calc((var(--x) - var(--x0)) * var(--u)); }
  .r-features.blk { top: calc((var(--y) - var(--y0)) * var(--u)); left: calc((var(--x) - var(--x0)) * var(--u)); }
  .r-qr { left: calc((var(--qx) - var(--x0)) * var(--u)); top: calc((var(--qy) - var(--y0)) * var(--u)); width: calc(var(--qs) * var(--u)); }
  .r-buttons { position: absolute; margin: 0; left: 0; top: 0; width: 100%; height: 0; display: block; }
  .r-buttons .pill {
    position: absolute; min-height: 0; left: calc(var(--x) * var(--u)); top: calc(var(--y) * var(--u));
    width: calc(var(--w) * var(--u)); height: calc(var(--h) * var(--u)); font-size: calc(var(--bfs, 40) * var(--u)); letter-spacing: 0;
  }
}

/* 分享圖：只留卡片、關鍵字與下半卡，不含按鈕 */
.capture .stage { width: 100vw; }
.capture .result { height: calc(1772 * var(--u)) !important; }
.capture .r-buttons, .capture .review { display: none !important; }

/* Open Graph 預覽圖 1200×630 */
.og .stage { width: 100vw; min-height: 100vh; }
.og-card { position: fixed; inset: 0; display: grid; grid-template-columns: 560px 1fr; background: var(--frame); color: #fff; font-family: var(--font); }
.og-card .pic { background: var(--bg) center top / cover no-repeat; }
.og-card .txt { padding: 54px 56px; display: flex; flex-direction: column; gap: 14px; justify-content: center; }
.og-card .e { color: var(--yellow); font-weight: 700; font-size: 30px; }
.og-card .t { font-weight: 900; font-size: 64px; line-height: 1.15; text-shadow: 4px 4px 4px rgba(30, 38, 10, 0.8); }
.og-card .n { font-size: 30px; line-height: 1.5; }
.og-card .k { font-size: 24px; opacity: 0.9; }
.og-card .q { margin-top: 10px; font-size: 26px; font-weight: 700; color: var(--yellow); }

.no-anim *, .no-anim *::before, .no-anim *::after { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  .playing .t-rays, .playing .t-bear, .playing .t-text { animation-duration: 0.01s !important; }
  .screen.enter { animation: none; }
}

/* ---------- 流動版的結果卡上半：只露出照片區，底部淡出接到卡片 ---------- */
.r-hero {
  height: calc(var(--cut, 620) * var(--u));
  background: linear-gradient(90deg, var(--frame) 4.35%, var(--bg) 4.35% 95.65%, var(--frame) 95.65%);
}
.r-hero img { -webkit-mask-image: linear-gradient(#000 86%, transparent); mask-image: linear-gradient(#000 86%, transparent); }

@container stage (min-width: 540px) {
  .r-hero { height: calc(var(--hh, 1292) * var(--u)); background: none; }
  .r-hero img { -webkit-mask-image: none; mask-image: none; }
}

/* 設計稿的標點只佔半格（封面、題目頁一直是；結果卡第 4 稿起也全部半形），用 OpenType halt 重現 */
.cover-body, .cover-closing, .q-stem, .opt .txt, .result .blk, .r-features { font-feature-settings: "halt"; }
/* 「？」不在字型的 halt 範圍內，設計稿卻排成半格：左右各收 1/4 字 */
.cover-body .hq, .cover-closing .hq, .q-stem .hq, .opt .txt .hq, .result .hq { margin: 0 -0.25em; }

/* ---------- 流動版（手機）的斷行：短句照詞與標點斷，段落避免末行只剩一兩個字 ---------- */
/* 題目與選項只有兩三行：用 balance（pretty 不把中文末行的兩個字當孤字，實測三種手機寬度共 40 處末行只剩一兩個字） */
.r-title, .r-tagline, .r-need, .q-stem, .opt .txt { text-wrap: balance; line-break: strict; }
.cover-body p, .r-body, .r-features { text-wrap: pretty; }

/* ---------- 流動版的結果卡上半（照片區）：整張照片縮到螢幕寬，標題照設計稿位置疊上去 ---------- */
.r-hero.on { height: calc(var(--ib) * var(--u)); background: none; }
.r-hero.on img { -webkit-mask-image: none; mask-image: none; }
.r-hero.on .blk {
  position: absolute; margin: 0 !important; top: calc(var(--y) * var(--u));
  font-size: calc(var(--fs) * var(--u)); line-height: calc(var(--lh) * var(--u));
}
.r-hero.on .blk.center { left: 0; width: 100%; text-align: center; }
.r-hero.on .blk.left { left: calc(var(--x) * var(--u)); text-align: left; }
.r-hero.on .ln { display: block; white-space: nowrap; }
.r-hero.on .blk.center .ln { transform: translateX(calc(var(--dx, 0) * var(--u))); }
.r-hero.on .r-title { text-shadow: calc(5 * var(--u)) calc(5 * var(--u)) calc(4 * var(--u)) rgba(30, 38, 10, 0.85); }
/* 其餘的字接在標題下方、疊在照片區的空白處：卡片的底色從照片區下緣才開始（::before），兩側小照片用浮動的輪廓讓字繞開 */
.r-card.over {
  position: relative; z-index: 1; isolation: isolate; display: flow-root;
  margin-top: calc(var(--ov) * var(--u) * -1); padding-top: 0;
  background: none; box-shadow: none; clip-path: none;
}
.r-card.over::before {
  content: ""; position: absolute; z-index: -1; left: 0; right: 0; bottom: 0; top: calc(var(--ov) * var(--u) - 2px);  /* 多蓋 2px，免得小數像素露出外框色細線 */
  background: var(--bg); box-shadow: 0 0 1.5cqi var(--shade); clip-path: inset(1px -3cqi -3cqi -3cqi);  /* 上緣裁進 1px，陰影才不會漏成一條線 */
}
.r-fl { float: left; display: block; }
.r-fl.r { float: right; }

/* ---------- 英文 ---------- */
.en body, .en .stage, .en .modal { font-family: var(--font-latin); }
.latin { font-feature-settings: normal; letter-spacing: 0; }
.en .lang { font-family: var(--font); }
.en .cover-body { font-weight: 400; text-align: left; }
.en .cover-body b { font-weight: 700; }
.en .start { font-weight: 700; letter-spacing: 0; }
.en .q-stem { font-weight: 700; }
.en .opt .txt { font-weight: 600; }
.en .t-text { font-weight: 700; letter-spacing: 0; }
.en-card .r-title { font-weight: 700; }
.en-card .r-en { font-family: inherit; font-weight: 700; font-size: max(16px, 3.6cqi); }
.en-card .r-tagline { font-weight: 600; }
.en-card .r-now { font-weight: 400; }
.en-card .r-need { font-weight: 700; }
.en-card .r-body, .en-card .r-features, .en-card .kw { font-weight: 400; }
.en-card .r-body, .en-card .r-features { text-align: left; }
.en .r-buttons .pill { font-weight: 700; }
.en-card .r-keywords .label { white-space: nowrap; }
@container stage (min-width: 540px) {
  /* 英文關鍵字兩行，照設計稿位置放在標籤右邊（--kx、--ky＝標籤列的原點） */
  .en-card .r-keywords .kw.blk {
    position: absolute; margin: 0; font-size: calc(var(--fs) * var(--u)); line-height: calc(var(--lh) * var(--u));
    left: calc((var(--x) - var(--kx)) * var(--u)); top: calc((var(--y) - var(--ky)) * var(--u)); text-align: left;
  }
  .en .cover-body b { font-weight: 700; }
}
