/* 介面樣式：奕數咖學酒吧風（黑、灰、白＋電光藍；不加框線、膠囊標籤、陰影；字級只有三層）。
   圖解與數學式的樣式另放 css/fig.css，日後檢討簡報可以單獨帶走。 */
:root {
  --ink: #1D1D1F; --text: #6E6E73; --sub: #86868B; --off: #C7C7CC;
  --blue: #0071E3; --blue-hover: #0077ED;
  --bg-alt: #F5F5F7; --bg: #FFFFFF; --line: #D2D2D7; --divider: #E8E8ED;
  --brand: #1e293b;
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  /* 三層字級：大標、內文、輔助（手機） */
  --fs-title: 28px; --fs-body: 17px; --fs-sub: 14px;
  --pad-card: 24px;
}
@media (min-width: 700px) { :root { --fs-title: 36px; --pad-card: 36px; } }
@media (min-width: 1200px) { :root { --fs-title: 48px; --fs-body: 19px; --pad-card: 44px; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg-alt); color: var(--ink); font-family: var(--font); font-size: var(--fs-body); line-height: 1.55; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }

/* 導覽列 */
.top { position: sticky; top: 0; z-index: 5; height: 60px; display: flex; align-items: center; gap: 16px; padding: 0 20px;
  background: rgba(255, 255, 255, .8); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); }
.brand { font-weight: 700; color: var(--ink); text-decoration: none; }
.tag { font-size: var(--fs-sub); color: var(--sub); }
main { max-width: 868px; margin: 0 auto; padding: 24px 16px 56px; }
.foot { max-width: 868px; margin: 0 auto; padding: 8px 24px 40px; font-size: var(--fs-sub); color: var(--sub); }

/* 卡片：白卡放在淺灰底上，不加框線與陰影 */
.card { background: var(--bg); border-radius: 28px; padding: var(--pad-card); margin-bottom: 16px; }
.eyebrow { font-weight: 600; color: var(--text); }
.title { font-size: var(--fs-title); font-weight: 700; line-height: 1.15; letter-spacing: -0.01em; margin: 4px 0 12px; }
.lead { color: var(--text); }
.note { font-size: var(--fs-sub); color: var(--sub); }
.note.end { margin-left: auto; white-space: nowrap; }

.field { margin-top: 24px; }
.lab { display: block; font-size: var(--fs-sub); color: var(--sub); margin-bottom: 8px; }
.row { display: flex; gap: 8px 24px; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }

/* 篩選選項：選項卡樣式，選中用深一階的灰加右側小記號 */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 0; background: var(--bg-alt); border-radius: 14px; padding: 10px 16px; min-height: 44px; display: inline-flex; align-items: center; gap: 8px; }
.chip:hover { background: var(--divider); }
.chip small { font-size: var(--fs-sub); color: var(--sub); }
.chip[aria-pressed="true"] { background: var(--divider); font-weight: 600; }
.chip[aria-pressed="true"]::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ink); }
.chip:disabled { color: var(--off); cursor: default; background: var(--bg-alt); }

/* 按鈕：每個畫面最多一顆藍色實心鈕；其餘是藍字連結 */
.btn { border: 0; background: var(--blue); color: #fff; border-radius: 980px; padding: 11px 24px; min-height: 44px; }
.btn:hover { background: var(--blue-hover); }
.btn:disabled { background: var(--off); cursor: default; }
.btn.ghost { background: none; color: var(--blue); padding: 11px 0; border-radius: 0; }
.btn.ghost:hover { background: none; text-decoration: underline; }
.btn.ghost:disabled { color: var(--off); text-decoration: none; }
.input { border: 0; background: var(--bg-alt); border-radius: 14px; padding: 11px 16px; min-height: 44px; min-width: 0; flex: 1 1 160px; max-width: 280px; }
.input:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
.input.area { display: block; width: 100%; max-width: none; resize: vertical; line-height: 1.55; }

/* 題號方格 */
.dots { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }
.dotbtn { width: 44px; height: 44px; border: 0; border-radius: 12px; background: var(--bg); font-size: var(--fs-sub); color: var(--text); }
.dotbtn.done { background: var(--divider); color: var(--ink); font-weight: 600; }
.dotbtn.cur { background: var(--blue); color: #fff; font-weight: 600; }

/* 題目 */
.qhead { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 16px; font-size: var(--fs-sub); color: var(--sub); margin-bottom: 12px; }
.qhead .row { gap: 4px 16px; }
.badge { font-size: var(--fs-sub); color: var(--sub); }
.badge.ok, .badge.bad { color: var(--ink); font-weight: 600; }
.stem { line-height: 1.7; }
.stem p { margin: 8px 0; }
.figwrap { text-align: center; margin: 20px 0 8px; }

.choices { display: grid; gap: 8px; margin-top: 24px; }
.choice { display: flex; gap: 12px; align-items: baseline; text-align: left; width: 100%; border: 0; background: var(--bg-alt); border-radius: 14px; padding: 13px 16px; min-height: 48px; }
.choice:hover:not(:disabled) { background: var(--divider); }
.choice .k { font-size: var(--fs-sub); font-weight: 600; color: var(--sub); flex: none; }
.choice[aria-pressed="true"] { background: var(--divider); }
.choice[aria-pressed="true"]::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); margin-left: auto; align-self: center; flex: none; }
.choice:disabled { cursor: default; color: var(--ink); opacity: 1; }
.choice.is-right { color: var(--blue); font-weight: 600; }
.choice.is-right .k, .choice.is-right .note { color: var(--blue); }
.choice.is-wrong { background: var(--divider); }

.hints { margin-top: 20px; }
.hint { background: var(--bg-alt); border-radius: 14px; padding: 12px 16px; margin-bottom: 8px; color: var(--text); }
.talk { margin: 12px 0; display: grid; gap: 6px; }
.talk p { margin: 0; }
.talk b { font-size: var(--fs-sub); font-weight: 600; color: var(--sub); margin-right: 12px; }
.material { background: var(--bg-alt); border-radius: 20px; padding: 20px 24px; margin-bottom: 24px; }
.material > b { display: block; font-size: var(--fs-sub); font-weight: 600; color: var(--sub); margin-bottom: 6px; }
.material audio { width: 100%; margin-top: 8px; }
.box { display: inline-block; background: var(--bg); border-radius: 10px; padding: 6px 14px; margin: 2px 0; font-weight: 600; }

/* 結果與回顧 */
.score { font-size: 48px; font-weight: 700; line-height: 1.1; letter-spacing: -0.01em; margin: 4px 0 8px; }
.score small { font-size: var(--fs-body); font-weight: 400; color: var(--text); letter-spacing: 0; }
.diag, .mine { margin-top: 16px; background: var(--bg-alt); border-radius: 14px; padding: 12px 16px; color: var(--text); }
.diag b, .mine b { display: block; font-size: var(--fs-sub); font-weight: 600; color: var(--sub); }
.mine.ref { color: var(--blue); font-weight: 600; }
.mine ul { margin: 4px 0 0; padding-left: 22px; }
.takeaway { margin-top: 20px; color: var(--text); }
.takeaway b { display: block; font-size: var(--fs-sub); font-weight: 600; color: var(--sub); }

/* 圖解播放器：白卡上用淺灰底 */
.player { margin-top: 20px; background: var(--bg-alt); border-radius: 24px; overflow: hidden; }
.player .stage { padding: 24px 16px 8px; text-align: center; min-height: 150px; display: flex; align-items: center; justify-content: center; }
.player .say { padding: 8px 24px 4px; min-height: 76px; }
.player .say .n { display: block; font-size: var(--fs-sub); color: var(--sub); }
.player .ctl { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 20px 16px; }
.player .pips { display: flex; gap: 6px; }
.pip { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.pip.on { background: var(--ink); }
.arrow { width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(210, 210, 215, .64); font-size: 20px; line-height: 1; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; padding: 0 0 2px; transition: opacity .2s; }
.arrow:hover { background: var(--line); }
.arrow:disabled { opacity: .35; cursor: default; }

/* ===== 新流程的版面（2026-11-23）：首頁兩個入口、題目頁左右分欄、選題面板 ===== */
body.wide main { max-width: 1180px; }
.navhost { flex: 1; display: flex; align-items: center; justify-content: flex-end; gap: 12px; min-width: 0; position: relative; }
.navmid { position: absolute; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; }
.navbtn { border: 0; background: var(--bg-alt); border-radius: 980px; padding: 8px 16px; min-height: 36px; font-weight: 600; white-space: nowrap; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; }
.navbtn:disabled { color: var(--text); cursor: default; }
.navright { display: flex; align-items: center; gap: 12px; }
.panel { position: absolute; top: 52px; left: 50%; transform: translateX(-50%); width: min(480px, calc(100vw - 16px)); background: var(--bg); border-radius: 20px; padding: 20px; box-shadow: 0 12px 40px rgba(0, 0, 0, .14); z-index: 6; }
.grid44 { display: grid; grid-template-columns: repeat(auto-fill, 44px); gap: 8px; margin-top: 12px; }
.grid44 button { width: 44px; height: 44px; border: 0; border-radius: 12px; background: var(--bg-alt); font-size: var(--fs-sub); color: var(--text); }
.grid44 .done { background: var(--divider); color: var(--ink); font-weight: 600; }
.grid44 .bad { background: var(--divider); color: var(--ink); font-weight: 600; text-decoration: underline; }
.grid44 .cur { background: var(--blue); color: #fff; font-weight: 600; }

.hero { padding: 32px 8px 24px; }
.block { margin-top: 40px; }
.h2 { font-size: calc(var(--fs-title) * .7); font-weight: 700; letter-spacing: -0.01em; margin: 2px 0 16px; }
.h3 { font-size: var(--fs-body); font-weight: 600; color: var(--text); margin: 24px 0 8px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.tile { border: 0; background: var(--bg); border-radius: 28px; padding: 28px; text-align: left; display: grid; gap: 4px; }
.tile:hover .link, .urow:hover span:first-child { text-decoration: underline; }
.tile .big { font-size: 40px; font-weight: 700; line-height: 1.1; }
.tile .big small { font-size: var(--fs-body); font-weight: 400; color: var(--text); }
.link { color: var(--blue); margin-top: 8px; }
.rows { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.urow { border: 0; background: var(--bg); border-radius: 20px; padding: 16px 20px; text-align: left; display: grid; gap: 2px; }
.urow:disabled { color: var(--off); cursor: default; }
.urow:disabled .note { color: var(--off); }

.qpage { display: grid; gap: 16px; align-items: start; }
@media (min-width: 900px) { .qpage { grid-template-columns: 1fr 1fr; gap: 32px; } .qpage.revealed { grid-template-columns: 5fr 7fr; } }
.qleft { padding: 12px 8px; min-width: 0; }
.qright { margin: 0; min-width: 0; }
.actions { margin-top: 24px; }
.answer { font-size: var(--fs-title); font-weight: 700; color: var(--blue); line-height: 1.2; letter-spacing: -0.01em; margin: 4px 0 8px; }
.answer.long { font-size: calc(var(--fs-title) * .6); }
.choices.compact { gap: 6px; margin-top: 20px; }
.choices.compact .choice { padding: 8px 14px; min-height: 0; font-size: var(--fs-sub); }
.official { margin-top: 20px; color: var(--text); }
.official > b { display: block; font-size: var(--fs-sub); font-weight: 600; color: var(--sub); }
.official p { margin: 0; }
.bars { display: grid; gap: 4px; margin-top: 6px; max-width: 360px; }
.bar { display: grid; grid-template-columns: 20px 1fr 56px; align-items: center; gap: 8px; font-size: var(--fs-sub); color: var(--sub); }
.bar i { display: block; height: 8px; border-radius: 4px; background: var(--off); min-width: 2px; }
.bar em { font-style: normal; text-align: right; }
.bar.right { color: var(--blue); font-weight: 600; }
.bar.right i { background: var(--blue); }
.check { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; cursor: pointer; }
.check input { width: 18px; height: 18px; flex: none; accent-color: var(--blue); transform: translateY(3px); }
@media (max-width: 699px) { .navmid { position: static; transform: none; } .navhost { justify-content: space-between; } .brand { display: none; } .hero { padding-top: 16px; } }

/* 自訂範圍頁：選項放在淺灰底上，改用白底才看得出是按鈕 */
.hero .chip { background: var(--bg); }
.hero .chip:hover, .hero .chip[aria-pressed="true"] { background: var(--divider); }
.hero .chip:disabled { background: var(--bg); }

/* 選中的選項改成黑底白字，和沒選的差別更明顯（酒吧風：目前選中為黑底白字） */
.chip[aria-pressed="true"], .hero .chip[aria-pressed="true"] { background: var(--ink); color: #fff; font-weight: 600; }
.chip[aria-pressed="true"]::after { display: none; }
.chip[aria-pressed="true"] small { color: rgba(255, 255, 255, .7); }
.presets { margin-top: 24px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.presets .tile { padding: 20px 24px; border-radius: 20px; }
.presets .tile .h3 { margin: 0; color: var(--ink); }
.presets .tile.picked { background: var(--ink); }
.presets .tile.picked .h3, .presets .tile.picked .note { color: #fff; }
.presets .tile:disabled { cursor: default; }
.presets .tile:disabled .h3, .presets .tile:disabled .note { color: var(--off); }
.adjust { margin-top: 12px; }
.adjust .chip { background: var(--bg-alt); }
.adjust .field:first-of-type { margin-top: 12px; }

/* 首頁：第一個畫面就看得到三個入口，各區塊左緣對齊 */
body.home main { max-width: 1040px; }
.hero { padding: 20px 0 8px; }
body.home .hero .title { margin-bottom: 8px; }
.entry { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-top: 28px; }
.entry .tile { padding: 24px 28px; border-radius: 24px; align-content: start; }
.entry .tile .h3 { margin: 0; color: var(--ink); font-size: calc(var(--fs-body) * 1.25); font-weight: 700; }
.block { margin-top: 48px; scroll-margin-top: 76px; }

/* 點圖放大 */
.figwrap svg, .stage svg { cursor: zoom-in; }
.zoom { position: fixed; inset: 0; z-index: 50; background: #fff; overflow: auto; padding: 16px; cursor: zoom-out; }
.zoom svg { display: block; width: max(100%, 900px); max-width: none; height: auto; margin: 0 auto; }
.zoom .note { text-align: center; margin: 0 0 8px; }

/* 審題頁 */
.rvdiag { display: block; margin-top: 4px; font-size: var(--fs-sub); color: #6E6E73; }

/* 手機：圖解的上一步、下一步按鈕放大到好按的大小；審題頁的註記欄和上面留一點距離 */
@media (max-width: 699px) { .arrow { width: 44px; height: 44px; } }
.qright .lab[for="rvnote"] { display: block; margin-top: 20px; }

/* 圖上標籤底下墊的小方塊（防字壓線）：顏色跟著所在位置的底色，看起來不像白框（2026-12-01 老師審 114 年第 17 題） */
.plate { fill: var(--bg-alt); }
.card .plate, .zoom .plate { fill: var(--bg); }
.card .player .plate { fill: var(--bg-alt); }

/* 分數線加粗：KaTeX 預設 0.04em 偏細（2026-12-01 老師審類似題 115-MAT-010-V1） */
.katex .mfrac .frac-line { border-bottom-width: 0.085em !important; }
