/* 你像歷史上的誰？ v1 — 米白紙、墨黑字、一個朱紅印章色；中文 Noto Serif TC、英文 Noto Serif（同一家族的襯線字） */
:root {
  --paper: #f3ecdf;
  --paper-2: #ebe2d1;
  --ink: #1d1a16;
  --muted: #696053;
  --line: #cdbfa6;
  --line-strong: #8c7f6a; /* 對比 ≥ 3:1（中格虛線框，v1.1 A3） */
  --red: #b3302a;
  --font: "Noto Serif TC", "Noto Serif", "Songti TC", "PMingLiU", serif; /* 中文版裡的希臘文、拉丁擴充字元用 Noto Serif 顯示（v1.1 A6） */
  --font-latin: "Noto Serif", Georgia, "Times New Roman", serif;
  --gutter: 20px;
}
html[lang="en"] { --font: var(--font-latin); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.75;
  overflow-x: hidden;
  overflow-x: clip;
}
h1, h2, h3, p, ul, ol, figure, blockquote { margin: 0; padding: 0; }
ul, ol { list-style: none; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }

.page { max-width: 640px; margin: 0 auto; padding: 0 var(--gutter); min-height: 100vh; min-height: 100dvh; }
.screen { padding: 20px 0 56px; }
.noscript { padding: 40px 0; text-align: center; }

:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
.q-text:focus, .r-name:focus, .cover-title:focus, .too-few-title:focus, .interlude-title:focus { outline: none; } /* 程式移過去的焦點不畫框；按鈕的鍵盤焦點仍有 :focus-visible */

/* ── 按鈕 ── */
.btn {
  display: inline-block;
  min-height: 48px;
  padding: 10px 28px;
  border: 1px solid var(--ink);
  border-radius: 0;
  font-weight: 600;
  letter-spacing: 0.12em;
  cursor: pointer;
  background: transparent;
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--red); border-color: var(--red); }
.btn-line:hover { background: var(--ink); color: var(--paper); }
.link {
  background: none; border: 0; padding: 6px 0; cursor: pointer;
  color: var(--ink); text-decoration: underline; text-underline-offset: 4px;
  text-decoration-color: var(--line);
}
.link:hover { color: var(--red); text-decoration-color: var(--red); }

/* ── 印章（朱紅方塊、紙色字） ── */
.seal {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--red); color: var(--paper); font-weight: 900; line-height: 1;
}

/* ════════ 封面 ════════ */
.cover-frame {
  position: relative;
  margin-top: 4vh;
  min-height: min(70vh, 640px);
  border: 1px solid var(--ink);
  padding: 8px;
}
.cover-frame::before {
  content: ""; position: absolute; inset: 6px; border: 1px solid var(--ink); pointer-events: none;
}
.cover-main {
  position: relative;
  min-height: inherit;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 64px 28px;
}
.cover-side {
  position: absolute; top: 18px; left: 16px;
  writing-mode: vertical-rl; letter-spacing: 0.25em;
  color: var(--muted); font-size: 12px; line-height: 1;
}
@media (min-width: 600px) {
  .cover-main { padding: 72px 56px; }
  .cover-side { top: 26px; left: 22px; font-size: 14px; letter-spacing: 0.3em; }
}
.kicker { color: var(--muted); letter-spacing: 0.4em; font-size: 15px; }
.cover-title { font-weight: 900; font-size: clamp(34px, 10.5vw, 60px); line-height: 1.3; margin: 18px 0 20px; letter-spacing: 0.04em; }
.title-line { display: block; }
.rule { width: 64px; height: 0; border-top: 1px solid var(--ink); margin-bottom: 20px; }
.cover-lead { font-size: 18px; margin-bottom: 36px; letter-spacing: 0.2em; }
.cover-last { margin-top: 26px; font-size: 15px; color: var(--muted); }
.seal-cover { position: absolute; left: 22px; bottom: 22px; width: 52px; height: 52px; font-size: 28px; transform: rotate(-4deg); }

/* 手機：封面雙線框撐滿螢幕高度（扣掉上下外距） */
@media (max-width: 599px) {
  #screen-cover { padding: 16px 0; }
  .cover-frame { margin-top: 0; min-height: calc(100vh - 32px); min-height: calc(100svh - 32px); display: flex; }
  .cover-main { flex: 1; min-height: 0; }
}

/* ════════ 題目 ════════ */
#screen-quiz { max-width: 640px; margin: 0 auto; }
.quiz-top { display: flex; justify-content: space-between; align-items: center; min-height: 44px; }
.progress-text { color: var(--muted); letter-spacing: 0.1em; font-size: 15px; }
.back { font-size: 15px; letter-spacing: 0.08em; }
.bar { height: 3px; background: var(--line); margin: 6px 0 36px; }
.bar-fill { display: block; height: 100%; background: var(--red); transition: width .2s; }
.q-text { font-size: clamp(24px, 6.6vw, 32px); font-weight: 600; line-height: 1.55; margin-bottom: 32px; }
/* 換題動畫：淡入＋滑動 0.2 秒 */
.enter-next { animation: slide-next .16s ease-out both; }
.enter-prev { animation: slide-prev .16s ease-out both; }
@keyframes slide-next { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
@keyframes slide-prev { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
/* 結果揭曉：名字出現 */
.reveal { animation: reveal .45s ease-out both; }
@keyframes reveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ════════ 結果 ════════ */
.result-grid { display: block; }
.r-note { display: inline-block; border: 1px solid var(--red); color: var(--red); padding: 0 12px; font-size: 14px; letter-spacing: 0.1em; margin-bottom: 14px; }
.r-lead { color: var(--muted); letter-spacing: 0.3em; font-size: 15px; margin-top: 8px; }
.r-name { font-size: clamp(56px, 20vw, 92px); font-weight: 900; line-height: 1.15; letter-spacing: 0.04em; }
.r-era { color: var(--muted); letter-spacing: 0.12em; font-size: 15px; margin-top: 6px; }
.r-note-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 10px; }
.r-note-row .r-note { margin-bottom: 0; }
.r-summary { margin-top: 12px; font-size: 16px; line-height: 1.8; color: var(--ink); }
.r-skipped { margin: 0 0 32px; font-size: 14px; color: var(--muted); } /* r-fig 下方留 40px，印章只突出約 25px，不會重疊 */
.r-tagline { margin-top: 12px; font-size: 19px; font-weight: 600; line-height: 1.6; text-wrap: balance; }
.r-fig { position: relative; margin: 24px 0 40px; width: 100%; max-width: 440px; }
.portrait {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 1 / 1; width: 100%;
  border: 2px solid var(--ink); background: var(--paper-2); overflow: hidden;
}
.portrait img { display: block; width: 100%; height: 100%; object-fit: cover; }
.portrait-ph { font-size: 96px; font-weight: 900; color: var(--line); }
.seal-sim { position: absolute; right: -10px; bottom: -22px; width: 92px; height: 92px; gap: 6px; transform: rotate(-3deg); }
.seal-sub { font-size: 13px; font-weight: 600; letter-spacing: 0.1em; }
.seal-num { font-size: 30px; }

.r-sec { margin-bottom: 40px; }
.r-sec-title {
  display: flex; align-items: center; gap: 14px;
  font-size: 16px; font-weight: 600; letter-spacing: 0.3em; margin-bottom: 18px;
}
.r-sec-title::after { content: ""; flex: 1 0 32px; border-top: 1px solid var(--ink); } /* v1.5（Gemini）：標題換行時橫線至少留 32px，不會被擠掉 */

.likes { display: grid; gap: 22px; }
.likes li { display: grid; grid-template-columns: 2em 1fr; gap: 4px; }
.like-no { color: var(--red); font-weight: 900; font-size: 22px; line-height: 1.5; }
.like-you { font-weight: 600; }
.like-he { color: var(--ink); margin-top: 2px; }
.who {
  display: inline-block; margin-right: 8px; padding: 0 6px; font-size: 13px; line-height: 1.5;
  border: 1px solid var(--line); color: var(--muted); font-weight: 400; vertical-align: 1px;
}
.like-you .who { border-color: var(--red); color: var(--red); }

.caution { border-left: 3px solid var(--red); padding: 4px 0 4px 16px; }
.quote { margin-bottom: 40px; padding: 18px 20px; background: var(--paper-2); }
.quote blockquote { margin: 0; }
.quote-text { font-size: 20px; font-weight: 600; line-height: 1.7; }
.quote-orig { margin-top: 8px; font-size: 14px; line-height: 1.6; color: var(--muted); font-style: italic; }
.quote-note { margin-top: 6px; font-size: 13px; line-height: 1.6; color: var(--muted); }
.quote figcaption { margin-top: 8px; color: var(--muted); font-size: 14px; }

.axes { display: grid; gap: 20px; }
.axis-ends { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; font-size: 15px; }
.axis-lean { color: var(--muted); font-weight: 400; font-size: 13px; }
.track { position: relative; height: 10px; margin-top: 6px; background: var(--paper-2); border: 1px solid var(--line-strong); }
.track-mid { position: absolute; left: 50%; top: -4px; bottom: -4px; border-left: 1px solid var(--ink); }
.track-fill { position: absolute; top: 0; bottom: 0; background: var(--red); }

.second { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; border: 1px solid var(--ink); padding: 16px; }
/* 名字和契合度用 flex 排：契合度折到下一行時不會多出縮排（v1.2 第 5 條） */
.second-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; font-size: 22px; font-weight: 900; }
.second-sim { color: var(--red); font-size: 18px; white-space: nowrap; }
.second-tie { color: var(--red); font-size: 14px; }
.second-tag { color: var(--muted); font-size: 15px; line-height: 1.6; }
.second-tag[hidden] { display: none; }

/* ── v1.5 稀有度與全站統計 ──
 * 傳說：雙框朱紅印（最大）；超稀有：朱紅印；稀有：朱紅細框；少見、常見、熱門：只有字。不用發光、漸層。 */
.r-stat { min-height: 30px; margin-top: 12px; } /* 等 API 時先留位置，數字到了不跳版 */
.r-stat[data-state="off"] { min-height: 0; margin-top: 0; }
.r-stat-main { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 15px; line-height: 1.6; }
.r-stat-line { color: var(--ink); }
.r-stat-est {
  display: inline-block; margin-left: 8px; padding: 0 6px; font-size: 12px; line-height: 1.6;
  border: 1px dashed var(--line-strong); color: var(--muted); vertical-align: 1px; letter-spacing: 0.1em;
}
.r-stat-sub { margin-top: 4px; font-size: 14px; color: var(--muted); line-height: 1.6; display: flex; flex-wrap: wrap; column-gap: 0; }
.r-stat-part { white-space: nowrap; } /* v1.5.2：排名、人數各自不拆行 */
html[lang="en"] .r-stat-part { white-space: normal; } /* 英文排名句比較長，照字斷行 */
.rarity { display: inline-block; font-size: 14px; line-height: 1.5; letter-spacing: 0.15em; white-space: nowrap; color: var(--muted); font-weight: 600; }
html[lang="en"] .rarity { letter-spacing: 0.04em; }
.rarity-rare { color: var(--red); border: 1px solid var(--red); padding: 1px 8px; }
.rarity-ultra, .rarity-legendary {
  position: relative; background: var(--red); color: var(--paper); font-weight: 900;
  padding: 4px 10px; transform: rotate(-2deg);
}
.rarity-ultra::after, .rarity-legendary::after { content: ""; position: absolute; inset: 3px; border: 1px solid var(--paper); pointer-events: none; }
.rarity-legendary { font-size: 18px; padding: 8px 14px; letter-spacing: 0.3em; }
html[lang="en"] .rarity-legendary { letter-spacing: 0.08em; }
.rarity-legendary::before { content: ""; position: absolute; inset: 6px; border: 1px solid var(--paper); pointer-events: none; } /* 雙框 */
.rarity-common, .rarity-popular, .rarity-uncommon { color: var(--ink); }
.rarity-uncommon { border: 1px solid var(--ink); padding: 1px 8px; } /* v1.5.1：少見用墨色細框（稀有是朱紅細框） */
.rarity-sm.rarity-uncommon { padding: 0 7px; }
.rarity-sm { font-size: 13px; transform: none; }
.rarity-sm.rarity-ultra, .rarity-sm.rarity-legendary { padding: 1px 8px; letter-spacing: 0.15em; }
.rarity-sm.rarity-legendary::before { inset: 5px 4px; display: none; }
.rarity-sm.rarity-rare { padding: 0 7px; }
.second-rarity:empty { display: none; }
.second-name .rarity { font-size: 13px; align-self: center; }
.cover-played { margin-top: 18px; font-size: 14px; color: var(--muted); letter-spacing: 0.1em; }
.cover-played[hidden] { display: none; }
.type-name.type-none { color: var(--ink); font-size: 20px; }
.interlude-type.interlude-notype { font-size: clamp(20px, 6vw, 28px); color: var(--ink); border: 1px dashed var(--line-strong); transform: none; }
.caution-note { margin: -6px 0 10px; font-size: 13px; color: var(--muted); }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.actions .btn { flex: 1 1 140px; padding-left: 16px; padding-right: 16px; }

/* ════════ 寬螢幕 ════════ */
@media (min-width: 768px) {
  .page { max-width: 720px; }
  .screen { padding-top: 40px; }
  body { font-size: 18px; }
}
@media (min-width: 1000px) {
  .page { max-width: 1080px; }
  .cover-frame { max-width: 720px; margin-left: auto; margin-right: auto; }
  .result-grid { display: grid; grid-template-columns: 400px 1fr; gap: 64px; align-items: start; }
  .r-head { position: sticky; top: 32px; }
  .r-name { font-size: 84px; }
  .r-fig { max-width: 400px; }
}

@media (prefers-reduced-motion: reduce) {
  .enter-next, .enter-prev, .reveal { animation: none; }
  .bar-fill, .btn, .cell .stamp { transition: none; }
}

/* 複製／存圖狀態 */
.r-status { min-height: 1.6em; margin-top: 12px; font-size: 15px; color: var(--muted); }
.r-extra { margin-top: 8px; }
.r-extra .btn { width: 100%; }
.copy-box { width: 100%; padding: 10px 12px; font: inherit; font-size: 15px; color: var(--ink); background: var(--paper-2); border: 1px solid var(--line-strong); border-radius: 0; resize: vertical; }

/* 手機存圖預覽（長按存）：原生 dialog */
.preview { width: min(420px, calc(100vw - 32px)); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); padding: 0; border: 0; background: var(--paper); color: var(--ink); }
.preview::backdrop { background: rgba(29, 26, 22, 0.82); }
.preview-box { padding: 16px; text-align: center; }
.preview-box img { display: block; width: auto; max-width: 100%; height: auto; max-height: calc(100vh - 180px); max-height: calc(100dvh - 180px); margin: 0 auto; -webkit-touch-callout: default; }
.preview-hint { margin: 12px 0; font-weight: 600; }
.preview-hint span { display: block; }
.preview-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.preview-actions .btn { flex: 1 1 96px; padding-left: 8px; padding-right: 8px; }
.preview-status { min-height: 1.4em; margin-top: 8px; font-size: 14px; color: var(--muted); }

.r-feedback { margin-top: 4px; }
.too-few { padding: 15vh 0 40px; }
.too-few-title { font-size: clamp(22px, 6vw, 30px); font-weight: 900; line-height: 1.5; margin-bottom: 28px; }

/* 改答模式：重新計算結果 */
.recalc { width: 100%; margin: 4px 0 8px; }

/* ── 語言切換（封面、結果頁右上角） ── */
.lang-switch { display: inline-flex; border: 1px solid var(--line-strong); background: var(--paper); }
.lang-btn {
  min-height: 44px; min-width: 52px; padding: 4px 12px; border: 0; border-radius: 0;
  background: transparent; color: var(--muted); font-size: 14px; letter-spacing: 0.06em; cursor: pointer;
}
.lang-btn:lang(zh-Hant) { font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif; }
.lang-btn:lang(en) { font-family: var(--font-latin); }
.lang-btn + .lang-btn { border-left: 1px solid var(--line-strong); }
.lang-btn:hover { color: var(--ink); background: var(--paper-2); }
.lang-btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.cover-frame > .lang-switch { position: absolute; top: 16px; right: 16px; z-index: 1; }
.r-toolbar { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.too-few .r-toolbar { margin-top: -10vh; margin-bottom: 10vh; }

/* 載入中 */
.loading { padding: 20vh 0; text-align: center; color: var(--muted); letter-spacing: 0.1em; }

/* ── 英文版：拉丁字不用中文的大字距，長名字縮小可換行 ── */
html[lang="en"] body { line-height: 1.65; }
html[lang="en"] .btn,
html[lang="en"] .kicker,
html[lang="en"] .cover-lead,
html[lang="en"] .progress-text,
html[lang="en"] .back,
html[lang="en"] .r-lead,
html[lang="en"] .r-era,
html[lang="en"] .r-note,
html[lang="en"] .seal-sub,
html[lang="en"] .loading { letter-spacing: 0.02em; }
html[lang="en"] .r-sec-title { letter-spacing: 0.08em; }
html[lang="en"] .kicker { letter-spacing: 0.12em; text-transform: uppercase; font-size: 13px; }
html[lang="en"] .cover-title { font-size: clamp(28px, 8.4vw, 56px); letter-spacing: 0; line-height: 1.15; }
html[lang="en"] .title-line { white-space: nowrap; }
html[lang="en"] .cover-lead { text-wrap: balance; }
html[lang="en"] .r-name { font-size: clamp(40px, 12vw, 64px); letter-spacing: 0; line-height: 1.1; overflow-wrap: break-word; }
html[lang="en"] .seal-cover { font-family: "Noto Serif TC", "Songti TC", serif; }
html[lang="en"] .seal-sub { font-size: 12px; }
@media (min-width: 1000px) { html[lang="en"] .r-name { font-size: 60px; } }
.quote-orig:lang(zh-Hant) { font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif; font-style: normal; }

/* ── 七格量表：方形印框，越靠兩端越大；選到的那格蓋上朱紅印。左半墨色框、右半朱紅框、中間虛線 ── */
.likert { margin-top: 8px; container-type: inline-size; }
/* 七格平分實際可用寬度（不設最小寬，放大 125% 也不會擠出題卡）；印框最多佔格子寬的 92%（v1.2 第 2 條） */
.likert-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; align-items: center; container-type: inline-size; }
.cell {
  min-width: 0; display: flex; align-items: center; justify-content: center;
  min-height: 80px; padding: 0; border: 0; border-radius: 0; background: transparent; cursor: pointer;
}
.cell .stamp {
  display: block; aspect-ratio: 1 / 1; max-width: 92%; border: 2px solid var(--ink); background: transparent;
  transition: background-color .12s, transform .12s;
}
.cell-pos .stamp { border-color: var(--red); }
.cell-mid .stamp { border: 2px dashed var(--line-strong); }
/* 印框大小跟著這一列的實際寬度（cqw）走，放大或窄螢幕時四種大小的比例不變；不支援 cqw 的舊瀏覽器用前一行 */
.cell-3 .stamp { width: clamp(38px, 11.4vw, 66px); width: min(66px, 13cqw); }
.cell-2 .stamp { width: clamp(32px, 9.6vw, 55px); width: min(55px, 10.8cqw); }
.cell-1 .stamp { width: clamp(27px, 8vw, 45px); width: min(45px, 8.9cqw); }
.cell-0 .stamp { width: clamp(22px, 6.6vw, 37px); width: min(37px, 7.3cqw); }
.cell:hover .stamp { background: var(--paper-2); }
.cell.chosen .stamp {
  background: var(--red); border-color: var(--red); transform: rotate(-4deg);
  box-shadow: inset 0 0 0 3px var(--red), inset 0 0 0 4px var(--paper); /* 印章內框 */
}
.cell:focus-visible { outline-offset: -2px; }
.likert-ends { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; margin-top: 4px; font-size: clamp(11px, 3.3vw, 14px); font-size: clamp(9px, 3.9cqw, 14px); line-height: 1.25; }
.end { padding: 0 2px; text-align: center; white-space: pre-line; overflow-wrap: normal; word-break: keep-all; }
.end-neg { color: var(--ink); }
.end-mid { color: var(--muted); }
.end-pos { color: var(--red); }
.end.chosen { font-weight: 700; }
/* 字級跟著題卡寬度（cqw）走：放大 125% 時一格的字也放得下；舊瀏覽器用前一個寫法 */
html[lang="en"] .likert-ends { font-size: clamp(9.5px, 2.9vw, 13px); font-size: clamp(7.5px, 3.25cqw, 13px); letter-spacing: -0.02em; }
html[lang="en"] .end { padding: 0 1px; }
.q-card .q-text { min-height: 3.2em; }

/* ── 兩段中間的過場 ── */
.interlude {
  position: relative;
  min-height: calc(100vh - 76px); min-height: calc(100svh - 76px);
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 56px 0 10vh; padding-bottom: 10svh; text-align: center;
}
.interlude .r-toolbar { position: absolute; top: 0; right: 0; margin: 0; }
.interlude .actions { width: 100%; }

.interlude-title { font-size: 16px; font-weight: 600; letter-spacing: 0.3em; color: var(--muted); }
.interlude-lead { margin-top: 28px; font-size: 16px; }
.interlude-type {
  display: inline-block; margin: 14px 0 26px; padding: 12px 22px;
  border: 2px solid var(--red); color: var(--red); font-size: clamp(26px, 8vw, 40px); font-weight: 900; line-height: 1.3;
  transform: rotate(-2deg);
}
.interlude-next { margin-bottom: 32px; }
.interlude .actions { justify-content: center; max-width: 420px; margin: 0 auto; }
html[lang="en"] .interlude-title { letter-spacing: 0.08em; }

/* ── 結果頁：你的類型＋同群名人 ── */
.type-card { border: 1px solid var(--ink); padding: 16px; }
.type-name { font-size: 24px; font-weight: 900; color: var(--red); line-height: 1.4; }
.type-sub { margin-top: 10px; font-size: 14px; color: var(--muted); }
.roster { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.roster-name, .roster-link { display: inline-block; padding: 4px 10px; font-size: 15px; line-height: 1.5; border: 1px solid var(--line); }
.roster-link { min-height: 36px; background: transparent; border-color: var(--ink); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); }
.roster-link:hover { background: var(--ink); color: var(--paper); }

/* 題目頁：題目＋七格整組放在畫面中間偏上（約 40% 高度），下面不留一大片空白 */
.q-stage {
  min-height: calc(100vh - 150px); min-height: calc(100svh - 150px);
  display: flex; flex-direction: column; justify-content: center;
  padding-bottom: 16vh; padding-bottom: 16svh;
}
.q-stage .q-text { min-height: 0; }

/* v1.1 A3：窄手機（≤ 359px）收左右留白；換題動畫不把頁面撐寬 */
#screen-quiz { overflow-x: clip; }
@media (max-width: 359px) {
  :root { --gutter: 12px; }
  .likert-row, .likert-ends { gap: 1px; }
  .q-text { font-size: 22px; }
}
/* v1.1 A6：外文原文用拉丁字型（含希臘文）；日文用日文字型。斜體只給拉丁字母的原文 */
.quote-orig { font-family: var(--font-latin), "Noto Serif TC", serif; font-style: normal; }
.quote-orig:lang(en), .quote-orig:lang(fr), .quote-orig:lang(frm), .quote-orig:lang(de), .quote-orig:lang(it),
.quote-orig:lang(es), .quote-orig:lang(la), .quote-orig:lang(nl), .quote-orig:lang(pra),
.quote-orig:lang(sv), .quote-orig:lang(ota-Latn), .quote-orig:lang(akk-Latn), .quote-orig:lang(hit-Latn),
.quote-orig:lang(cs), .quote-orig:lang(az), .quote-orig:lang(non), .quote-orig:lang(dum), .quote-orig:lang(da), .quote-orig:lang(no),
.quote-orig:lang(xng-Latn), .quote-orig:lang(fro), .quote-orig:lang(vec), .quote-orig:lang(pl),
.quote-orig:lang(nci-Latn), .quote-orig:lang(chg-Latn), .quote-orig:lang(enm) { font-style: italic; } /* v1.5（Gemini）補 sv 和三種拉丁轉寫；v1.6 第四批補 cs、az、non、dum、da、no；v1.7 第五批補 xng-Latn、fro、vec、pl；v1.8 第六批補 nci-Latn、chg-Latn、enm */
.quote-orig:lang(zh), .quote-orig:lang(lzh) { font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif; }
.quote-orig:lang(ja), .quote-orig:lang(ojp) { font-family: "Noto Serif JP", "Noto Serif TC", serif; font-style: normal; } /* ojp：上代日語（v1.5 補） */
/* v1.1 C3：類型區的說明 */
.type-note { margin-top: 6px; font-size: 14px; line-height: 1.6; color: var(--muted); }
/* v1.1 A5：載入中也有退路 */
.loading button { margin-top: 12px; }

/* v1.1 C2：總結移到肖像下面後，和下一段之間留白 */
.r-head .r-summary { margin-bottom: 40px; }

/* ── v1.3.1 修正（Gemini 文字與體驗審查）── */
/* 名言的詩句換行：資料裡的換行照原樣顯示 */
.quote-text, .quote-orig { white-space: pre-line; }
/* 葡萄牙文原文也用斜體，和其他拉丁字母語言一致 */
.quote-orig:lang(pt) { font-style: italic; }
/* 中文長譯名：每段（「·」之後、括號前）不拆開，換行只發生在段與段之間；超過 6 個字縮小字級 */
.name-part { display: inline-block; }
.r-name-long { font-size: clamp(36px, 11vw, 64px); }
/* v1.5（Gemini）：英文名字一個字一塊，只在字與字之間換行（字級由 app.js fitName 調） */
.name-word { display: inline-block; white-space: nowrap; }
html[lang="en"] .r-name-fit { overflow-wrap: normal; }
@media (min-width: 1000px) { .r-name-long { font-size: 64px; } }
/* 英文封面：窄螢幕換行時藏起中點 */
.lead-part { white-space: nowrap; }
@media (max-width: 400px) { .lead-sep { display: none; } .lead-part { display: block; } }
/* 手機橫放（高度很矮）：過場頁壓縮上下留白，「繼續」按鈕留在畫面裡 */
@media (max-height: 440px) {
  .interlude { min-height: 0; justify-content: flex-start; padding: 52px 0 12px; }
  .interlude-lead { margin-top: 8px; }
  .interlude-type { margin: 6px 0 10px; padding: 6px 16px; font-size: 24px; }
  .interlude-next { margin-bottom: 12px; }
}
/* 啟動資料載不到時的錯誤畫面 */
.boot-fail { padding: 20vh 16px; text-align: center; }
.boot-fail p { margin-bottom: 20px; }
