/* 2026 台北市長選舉 網路聲量調查 — 紙本筆記本風格的選舉報導版面
   mobile first；純灰階（沒有任何彩色），只有淺色版面 */

:root {
  color-scheme: light;

  --paper: #F6F6F6;
  --paper-2: #FFFFFF;
  --paper-3: #ECECEC;
  --ink: #161616;
  --ink-2: #5E5E5E;
  --hairline: rgba(22, 22, 22, .10);
  --rule: rgba(22, 22, 22, .05);
  --accent: #161616; /* 純灰階：強調色就是墨色，靠粗細、底線與標籤來區分，不靠顏色 */
  --marker: rgba(22, 22, 22, .12);
  --btn: #161616;
  --btn-ink: #FFFFFF;
  --shadow: 0 1px 0 rgba(22, 22, 22, .04), 0 18px 36px -22px rgba(22, 22, 22, .28);

  /* 衍生 token */
  --bar-bg: rgba(246, 246, 246, .86);
  --line: rgba(22, 22, 22, .50); /* 可操作元件（選項卡、核取方塊）的邊框 */
  --dot-b: #9A9A9A;

  /* 候選人識別色，依 candidate id（src/config.js 的 CANDIDATES）對應，永遠跟著人走，不跟排名或畫面順序。
     已知有競選色或黨色者就用該顏色，其餘的選不互相衝突的顏色；無黨籍用灰色。
     1 郭璽 紫 · 2 沈伯洋 橘 · 3 蕭文乾 洋紅 · 4 唐新民 棕 · 5 蔣萬安 藍 · 6 林志成 灰（無黨籍）。
     只用在長條、折線、色塊等「非文字」標記；絕不拿來當文字色，也不在上面放白字（橘與灰對比不足 4.5:1）。
     版面本身（紙、墨、按鈕、強調色）維持純灰階。 */
  --c1: #8E44C9;
  --c2: #F07A1A;
  --c3: #D63A7A;
  --c4: #8B5A2B;
  --c5: #1E63D6;
  --c6: #7A7A7A;

  --radius: 16px;
  /* 只用系統字型，不載入任何外部字型（避免把訪客 IP 送給第三方） */
  --font: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
}

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

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

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

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.muted { color: var(--ink-2); }
.small { font-size: .875rem; }

/* 無障礙：焦點環一律使用強調色 */
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: absolute; left: 16px; top: -64px; z-index: 100;
  padding: 10px 18px; border-radius: 999px;
  background: var(--btn); color: var(--btn-ink); font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 10px; }

/* ------------------------------------------------------------ 共用元件 */

/* 編號眉標 */
.eyebrow {
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--accent);
  line-height: 1.5;
}

/* 螢光筆畫線 */
.mk {
  background: linear-gradient(transparent 60%, var(--marker) 60%, var(--marker) 92%, transparent 92%);
  padding: 0 .06em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* 筆記本橫線 */
.ruled {
  background-image: linear-gradient(to bottom, transparent 31px, var(--rule) 31px);
  background-size: 100% 32px;
  background-position: 0 6px;
}

.card {
  background-color: var(--paper-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 18px;
}

/* 膠囊按鈕 */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 30px;
  border: 0; border-radius: 999px;
  background: var(--btn); color: var(--btn-ink);
  font-size: 1.0625rem; font-weight: 700; letter-spacing: .04em; line-height: 1;
  text-decoration: none; white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 18px -12px rgba(22, 22, 22, .45); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn-sm { min-height: 40px; padding: 0 20px; font-size: .9375rem; }
.btn-block { width: 100%; }
/* 次要按鈕：外框膠囊，純灰階 */
.btn-outline { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn-outline:hover { background: var(--paper-3); box-shadow: inset 0 0 0 1.5px var(--ink); transform: none; }
.btn-outline:active { background: var(--paper-3); }
.btn:disabled {
  background: var(--paper-3); color: var(--ink-2);
  box-shadow: inset 0 0 0 1px var(--hairline);
  cursor: not-allowed; transform: none;
}

/* 次要文字連結：強調色底線，結尾帶箭頭 */
.link-arrow {
  color: var(--ink); font-weight: 700; text-decoration: underline;
  text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 6px;
  transition: text-decoration-thickness .12s ease;
}
.link-arrow:hover { text-decoration-thickness: 4px; }

/* ------------------------------------------------------------ 頂部導覽列 */

.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--bar-bg);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--hairline);
}
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--ink); text-decoration: none; font-weight: 900; font-size: 1rem; letter-spacing: .02em;
  min-height: 44px;
}
.brand-mark { flex: none; }
.topnav { display: none; gap: 28px; }
.topnav a {
  color: var(--ink-2); text-decoration: none; font-weight: 700; font-size: .9375rem;
  padding: 8px 2px; transition: color .12s ease;
}
.topnav a:hover { color: var(--ink); }

/* ------------------------------------------------------------ 首屏 */

main { display: block; }
section[id], footer[id] { scroll-margin-top: 68px; }

.hero { display: grid; gap: 36px; padding-top: 36px; padding-bottom: 48px; }

.hero h1 {
  margin-top: 14px;
  font-size: clamp(2.125rem, 1.35rem + 3.6vw, 3.5rem);
  font-weight: 900; line-height: 1.22; letter-spacing: .01em;
  text-wrap: balance;
}
.hero-sub { margin-top: 14px; font-size: 1.25rem; font-weight: 700; }
.hero-note { margin-top: 8px; max-width: 34em; color: var(--ink-2); font-size: .875rem; line-height: 1.75; }
.hero-lead { margin-top: 14px; max-width: 34em; color: var(--ink-2); }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; margin-top: 26px; }
.dots { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 26px; font-size: .9375rem; font-weight: 700; }
.dots li { display: inline-flex; align-items: center; gap: 8px; }
.d { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.d-a { background: var(--accent); }
.d-b { background: var(--dot-b); }
.d-c { background: var(--ink-2); }

/* 帳本卡片 */
.ledger { padding: 22px 18px 24px; }

.tl { padding-bottom: 6px; }
.tl-rail {
  position: relative;
  margin: 34px 22px 0;
  height: 56px;
  border-top: 3px dotted var(--ink-2);
}
.tl-done {
  position: absolute; left: 0; top: -3px; width: var(--now);
  border-top: 3px solid var(--ink);
}
.tl-now {
  position: absolute; left: var(--now); top: -35px;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  transform: translateX(-50%);
  color: var(--ink);
}
.tl-now b { padding: 1px 8px; border-radius: 999px; background: var(--ink); color: var(--btn-ink); font-size: .6875rem; line-height: 1.35; letter-spacing: .08em; }
.tl-now i { display: block; width: 11px; height: 8px; background: var(--ink); clip-path: polygon(0 0, 100% 0, 50% 100%); }
.tick { position: absolute; top: 0; left: var(--p); width: 0; }
.tick .tdot {
  position: absolute; left: 0; top: -1.5px;
  width: 11px; height: 11px; border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--paper-2); border: 2px solid var(--ink-2);
}
.tick.is-past .tdot { background: var(--ink); border-color: var(--ink); }
.tick .txt {
  position: absolute; left: 0; top: 14px;
  display: flex; flex-direction: column; align-items: center;
  transform: translateX(-50%);
  white-space: nowrap; line-height: 1.35;
}
.tick .date { font-size: .75rem; font-weight: 700; }
.tick .lbl { font-size: .75rem; color: var(--ink-2); }
.tick.first .txt { align-items: flex-start; transform: none; left: -6px; }
.tick.last .txt { align-items: flex-end; transform: translateX(-100%); left: 6px; }

.ledger-total { margin-top: 10px; padding-top: 18px; border-top: 1px solid var(--hairline); }
.ledger-label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; font-size: .9375rem; font-weight: 700; color: var(--ink-2); }
.ledger-sub { color: var(--ink); font-size: .875rem; }
.ledger-number { font-size: clamp(3.25rem, 11vw, 4.5rem); font-weight: 900; line-height: 1.1; letter-spacing: -.01em; }
.ledger-number small { margin-left: 8px; font-size: 1.125rem; font-weight: 700; color: var(--ink-2); letter-spacing: 0; }

/* 「非正式民調」標示：放在每張有票數的卡片裡，截圖時跟著數字一起被截進去 */
.stamp { display: inline-block; margin: 14px 0 0; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-2); font-size: .8125rem; font-weight: 700; line-height: 1.5; }
#results-card .stamp, #trend .stamp { margin: 0 0 12px; }

.mini { display: grid; gap: 4px; margin-top: 12px; }
.mini-row { display: grid; grid-template-columns: 7.4em minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 32px; font-size: .9375rem; }
.mini-name { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 700; white-space: nowrap; }
.mini-bar { display: block; height: 8px; border-radius: 999px; background: var(--paper-3); overflow: hidden; }
.mini-fill { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--c, var(--ink-2)); transition: width .15s ease; }
.mini-val { display: inline-flex; align-items: baseline; justify-content: flex-end; gap: 6px; min-width: 6.2em; white-space: nowrap; }
.mini-pct { font-weight: 700; }
.mini-cnt { color: var(--ink-2); font-size: .8125rem; }
/* 號次徽章：黑底白字的圓，文字對比不會落在候選人顏色上；固定放在色塊與姓名之前 */
.num-badge {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 4px; border-radius: 999px;
  background: var(--ink); color: var(--btn-ink); font-size: .75rem; font-weight: 700; line-height: 1;
}
/* 候選人色塊：只是顏色標記，不含文字 */
.chip { flex: none; display: inline-block; width: 11px; height: 11px; border-radius: 3px; background: var(--c, var(--ink-2)); }

.ledger-closed {
  margin-top: 12px; padding: 22px 0 6px; border-top: 1px solid var(--hairline);
  font-size: 1.75rem; font-weight: 900;
}

/* ------------------------------------------------------------ 區塊版面 */

.band { padding: 44px 0; border-top: 1px solid var(--hairline); }
.band-grid { display: grid; gap: 22px; }
.sec-head h2 { margin-top: 8px; font-size: clamp(1.625rem, 1.2rem + 1.8vw, 2.25rem); font-weight: 900; line-height: 1.3; text-wrap: balance; }
.sec-lead { margin-top: 10px; color: var(--ink-2); font-size: .9375rem; max-width: 26em; }

/* ------------------------------------------------------------ 表單 */

.soft-note {
  position: relative;
  margin: 0 0 18px; padding: 10px 14px 10px 36px;
  background: var(--paper-3); border-radius: 12px;
  font-size: .9375rem; font-weight: 700;
}
.soft-note::before {
  content: ""; position: absolute; left: 15px; top: 50%;
  width: 9px; height: 9px; margin-top: -4.5px; border-radius: 50%; background: var(--accent);
}

fieldset { border: 0; margin: 0 0 26px; padding: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 12px; font-weight: 900; font-size: 1.0625rem; }
.req { margin-left: 6px; font-weight: 400; font-size: .8125rem; color: var(--ink-2); }

.candidate-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.candidate-list > p { grid-column: 1 / -1; }

.cand, .pill {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  min-height: 60px; padding: 10px 14px;
  border: 1.5px solid var(--line); border-radius: 14px;
  background: var(--paper-2);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color .12s ease, background-color .12s ease, transform .12s ease;
}
.cand:hover, .pill:hover { border-color: var(--ink-2); }
.cand:active, .pill:active { transform: scale(.985); }
/* 單選鈕只做視覺隱藏：仍可聚焦、可用鍵盤操作 */
.cand input, .pill input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.cand:has(input:checked), .pill:has(input:checked) {
  border-color: var(--ink);
  background: var(--paper-3);
  box-shadow: inset 0 0 0 1px var(--ink);
}
.cand:has(input:focus-visible), .pill:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 3px; }

.cand-name { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 1.0625rem; font-weight: 700; line-height: 1.35; }
.cand .check {
  flex: none; position: relative; width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid var(--line); background: var(--paper-2);
}
.cand input:checked ~ .check { border-color: var(--ink); background: var(--ink); }
.cand input:checked ~ .check::after {
  content: ""; position: absolute; left: 6px; top: 2.5px; width: 5px; height: 9px;
  border: solid var(--btn-ink); border-width: 0 2px 2px 0; transform: rotate(45deg);
}

.pill-group { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pill { justify-content: center; min-height: 52px; border-radius: 999px; font-size: 1.0625rem; font-weight: 700; }

.consent { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; margin-bottom: 8px; }
.consent input {
  appearance: none; -webkit-appearance: none;
  position: relative; width: 24px; height: 24px; margin: 10px 0 0;
  border: 1.5px solid var(--ink-2); border-radius: 7px; background: var(--paper-2);
  cursor: pointer;
  transition: background-color .12s ease, border-color .12s ease;
}
.consent input:checked { background: var(--ink); border-color: var(--ink); }
.consent input:checked::after {
  content: ""; position: absolute; left: 7.5px; top: 3px; width: 6px; height: 11px;
  border: solid var(--btn-ink); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
.consent input:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.consent-text { padding: 8px 0; }
.consent-text label { cursor: pointer; margin-right: 4px; }

.link-btn {
  background: none; border: 0; padding: 6px 0;
  color: var(--accent); font-weight: 700;
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px;
  cursor: pointer;
  text-align: left;
}

.terms {
  margin: 4px 0 18px; padding: 16px 18px 18px;
  background: var(--paper-3); border-radius: 12px;
  font-size: .875rem; line-height: 1.8; color: var(--ink);
}
.terms-h { margin: 0 0 8px; font-size: .9375rem; font-weight: 900; line-height: 1.5; }
.terms-h:not(:first-child) { margin-top: 18px; }
.terms-list { display: grid; gap: 8px; padding-left: 1.7em; list-style: decimal; }
.terms-list li::marker { color: var(--accent); font-weight: 700; }
.terms-data { margin: 0; }

.vote-msg { min-height: 1.6em; margin-top: 14px; font-weight: 700; }
.vote-msg:not(:empty) { padding: 12px 16px; border-radius: 12px; background: var(--paper-3); }
.vote-msg.ok { position: relative; padding-left: 44px; }
.vote-msg.ok::before {
  content: ""; position: absolute; left: 16px; top: 50%;
  width: 18px; height: 18px; margin-top: -9px; border-radius: 50%; background: var(--ink);
}
.vote-msg.ok::after {
  content: ""; position: absolute; left: 22.5px; top: 50%; width: 5px; height: 9px; margin-top: -7px;
  border: solid var(--btn-ink); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.vote-msg.error { padding-left: 24px; background: var(--paper-2); border: 1.5px solid var(--ink); box-shadow: inset 6px 0 0 var(--ink); }
.vote-msg.error::before {
  content: "錯誤"; display: inline-block; margin-right: 10px; padding: 0 9px; border-radius: 999px;
  background: var(--ink); color: var(--btn-ink); font-size: .75rem; font-weight: 700; letter-spacing: .1em; line-height: 1.6;
}

/* 投完票後的「加到行事曆」提醒（不蒐集任何個人資料，只是一個日曆事件） */
.remind { margin-top: 16px; padding: 14px 16px 16px; background: var(--paper); border: 1px solid var(--hairline); border-radius: 12px; }
.remind-after-note { margin: -6px 0 20px; }
.remind-text { margin: 0 0 10px; font-size: .9375rem; font-weight: 700; line-height: 1.5; }
.remind-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ------------------------------------------------------------ 結果 */

.segmented {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px;
  padding: 4px; margin-bottom: 18px;
  background: var(--paper-3); border-radius: 999px;
}
.segmented button {
  min-height: 44px; padding: 0 6px;
  border: 0; border-radius: 999px; background: transparent;
  color: var(--ink-2); font-size: .9375rem; cursor: pointer;
  transition: background-color .12s ease, color .12s ease;
}
.segmented button:hover { color: var(--ink); }
.segmented button[aria-pressed="true"] {
  background: var(--paper-2); color: var(--ink); font-weight: 700;
  box-shadow: 0 0 0 1px var(--hairline), 0 4px 10px -6px rgba(22, 22, 22, .35);
}
.segmented button:focus-visible { outline-offset: 2px; border-radius: 999px; }

.reveal-head { margin-bottom: 14px; }
.reveal-title { font-weight: 900; font-size: 1.25rem; line-height: 1.5; text-wrap: balance; }
.reveal-title .mk { white-space: nowrap; }
.legend-line { margin-top: 6px; font-size: .8125rem; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.key { display: inline-block; width: 22px; height: 8px; border-radius: 999px; }
.key-clean { background: var(--ink-2); }
.key-raw { background: var(--ink-2); opacity: .4; margin-left: 12px; }

.totals {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 0;
  margin-bottom: 18px; color: var(--ink-2); font-size: .9375rem;
}
/* 分隔點掛在前一項的尾端，換行時不會出現在行首 */
.totals > span:not(:last-child)::after { content: "·"; margin: 0 .6em; color: var(--ink-2); }
.totals b { color: var(--ink); font-size: 1.125rem; font-weight: 900; }

.bars { display: flex; flex-direction: column; gap: 20px; }
.bar-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 7px; }
.bar-name { display: inline-flex; align-items: center; gap: 8px; min-width: 0; font-weight: 700; font-size: 1.0625rem; }
.bar-value { white-space: nowrap; }
.bar-value .pct { font-weight: 900; font-size: 1.1875rem; }
.bar-value .cnt { margin-left: 8px; color: var(--ink-2); font-size: .875rem; }
.bar-track { height: 14px; background: var(--paper-3); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: var(--c, var(--ink-2)); border-radius: 999px; transition: width .15s ease; }

/* 公布階段：過濾後（主）與原始（副）並列 */
.bar-row.dual .bar-track { height: auto; background: none; overflow: visible; display: flex; flex-direction: column; gap: 4px; }
.bar-row.dual .bar-main { height: 14px; background: var(--paper-3); border-radius: 999px; overflow: hidden; }
.bar-row.dual .bar-sub { height: 8px; background: var(--paper-3); border-radius: 999px; overflow: hidden; }
.bar-row.dual .bar-sub .bar-fill { opacity: .4; }
.raw-line { margin-top: 5px; font-size: .8125rem; color: var(--ink-2); }

/* 揭露事項：緊貼在結果長條下方，版面像一張橫線表單 */
.disclosure { margin-top: 30px; border-top: 2px solid var(--ink); font-size: .9375rem; line-height: 1.6; }
.disc-title { padding: 10px 0 8px; font-size: .8125rem; font-weight: 700; letter-spacing: .14em; color: var(--ink-2); }
.disclosure dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); border-top: 1px solid var(--hairline); }
.disclosure dt, .disclosure dd { padding: 9px 0; border-bottom: 1px solid var(--hairline); }
.disclosure dt { padding-right: 18px; color: var(--ink-2); white-space: nowrap; }
.disclosure dd { font-weight: 400; overflow-wrap: anywhere; }
.disclosure .note { padding-top: 12px; font-weight: 700; }

/* ------------------------------------------------------------ 公布後分析 */

.method-note {
  margin-bottom: 30px; padding: 18px 20px 20px;
  background-color: var(--paper);
  border: 1px solid var(--hairline); border-left: 4px solid var(--accent); border-radius: 12px;
}
.method-lead { font-weight: 700; line-height: 1.85; }
.method-h { margin: 16px 0 8px; font-size: .8125rem; font-weight: 700; letter-spacing: .14em; color: var(--ink-2); }
.method-list { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: .9375rem; }
.method-list li { display: inline-flex; align-items: center; gap: 8px; }
.method-list li::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

.rv-section { margin-bottom: 30px; }
.rv-section:last-child { margin-bottom: 0; }
.rv-section h3 { margin-bottom: 10px; font-size: 1.0625rem; font-weight: 900; }
.rv-section p.small { margin-bottom: 14px; }
.rv-gen { margin-bottom: 24px; }

table.rv { width: 100%; border-collapse: collapse; font-size: .9375rem; }
table.rv th, table.rv td { padding: 9px 8px; border-bottom: 1px solid var(--hairline); text-align: right; }
table.rv th:first-child, table.rv td:first-child { padding-left: 0; text-align: left; }
table.rv th:last-child, table.rv td:last-child { padding-right: 0; }
table.rv th { color: var(--ink-2); font-size: .75rem; font-weight: 700; letter-spacing: .08em; border-bottom: 2px solid var(--ink); }
table.rv td:first-child { overflow-wrap: anywhere; font-weight: 700; }

.rv-bars { display: grid; grid-template-columns: repeat(24, 1fr); align-items: end; gap: 3px; height: 110px; }
.rv-col { display: flex; align-items: flex-end; height: 100%; }
.rv-col .v { width: 100%; background: var(--paper-3); border-radius: 3px 3px 0 0; display: flex; align-items: flex-end; overflow: hidden; }
.rv-col .v i { display: block; width: 100%; background: var(--accent); }
.rv-axis { display: flex; justify-content: space-between; margin-top: 6px; color: var(--ink-2); font-size: .75rem; }

.sig-row { display: grid; grid-template-columns: 1fr auto; gap: 7px 12px; margin-bottom: 16px; font-size: .9375rem; }
.sig-row > span:last-of-type { font-weight: 700; }
.sig-row .bar-track { grid-column: 1 / -1; height: 8px; }
.sig-row .bar-fill { background: var(--accent); }

/* ------------------------------------------------------------ 聲浪（小多圖：每位候選人一張，共用同一個縱軸刻度） */

.trend-sub { margin-bottom: 12px; }
.sm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sm {
  margin: 0; padding: 12px 12px 10px; min-width: 0;
  background: var(--paper-2); border: 1px solid var(--hairline); border-radius: 12px;
}
.sm-name { display: flex; align-items: center; gap: 8px; font-size: 1.0625rem; font-weight: 900; line-height: 1.35; }
.sm-total { margin-top: 2px; color: var(--ink-2); font-size: .8125rem; line-height: 1.5; }
.sm-total b { color: var(--ink); font-size: 1rem; font-weight: 900; }
/* SVG 以 preserveAspectRatio="none" 拉伸，線寬用 non-scaling-stroke 保持固定；文字都放在 HTML，不會被拉歪 */
.sm-svg { display: block; width: 100%; height: 56px; margin-top: 8px; overflow: visible; }
.sm-svg .base { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.sm-svg .area { fill: var(--c, var(--ink)); fill-opacity: .12; stroke: none; }
.sm-svg .line { fill: none; stroke: var(--c, var(--ink)); stroke-width: 1.75; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.sm-axis { display: flex; justify-content: space-between; gap: 6px; margin-top: 5px; color: var(--ink-2); font-size: .6875rem; line-height: 1.3; white-space: nowrap; }
.sm-caption { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 16px; color: var(--ink-2); font-size: .8125rem; line-height: 1.6; }

/* ------------------------------------------------------------ 停止公布通知 */

.notice {
  max-width: 820px;
  padding: 26px 24px 28px;
  background: var(--paper-2);
  border: 1px solid var(--hairline); border-left: 6px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.notice h2 { margin-top: 6px; font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2rem); font-weight: 900; line-height: 1.35; text-wrap: balance; }
.notice p:last-child { margin-top: 12px; font-size: 1.0625rem; }

/* ------------------------------------------------------------ 說明 / 頁尾 */

.about { padding: 48px 0 56px; }
.about-grid { display: grid; gap: 34px; margin-top: 18px; }
.about h3 { margin-bottom: 14px; font-size: 1.25rem; font-weight: 900; }

.schedule { position: relative; display: grid; gap: 18px; padding-left: 26px; }
.schedule::before { content: ""; position: absolute; left: 5px; top: 9px; bottom: 9px; border-left: 3px dotted var(--ink-2); }
.schedule li { position: relative; display: grid; grid-template-columns: 3.4em 1fr; gap: 12px; align-items: baseline; }
.schedule li::before {
  content: ""; position: absolute; left: -26px; top: .55em;
  width: 11px; height: 11px; border-radius: 50%; background: var(--paper); border: 2px solid var(--ink-2);
}
.schedule li:first-child::before { background: var(--accent); border-color: var(--accent); }
.schedule b { font-size: 1.0625rem; font-weight: 900; }
.schedule span { color: var(--ink-2); }
.remind-link {
  margin-left: 10px; color: var(--ink); font-size: .8125rem; font-weight: 700; white-space: nowrap;
  text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px;
  transition: text-decoration-thickness .12s ease;
}
.remind-link:hover { text-decoration-thickness: 3px; }

.about-terms { color: var(--ink-2); font-size: .9375rem; line-height: 1.85; }
.about-terms .terms-h:not(:first-child) { margin-top: 32px; }
.about-terms .terms-list { gap: 10px; }
.disclaimer {
  margin-top: 34px; padding: 20px 22px 22px;
  background: var(--paper-2); border: 1px solid var(--hairline); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.about .disclaimer h3 { margin-bottom: 8px; font-size: 1.0625rem; }
.disclaimer p { color: var(--ink); font-size: .9375rem; line-height: 1.85; }
.fineprint { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--hairline); font-size: .8125rem; color: var(--ink-2); }

/* ------------------------------------------------------------ 響應式 */

@media (max-width: 359px) {
  .candidate-list { grid-template-columns: 1fr; }
  .tl-rail { margin-left: 14px; margin-right: 14px; }
  .tick .date, .tick .lbl { font-size: .6875rem; }
  .mini-row { grid-template-columns: 6.6em minmax(0, 1fr) auto; }
}

@media (max-width: 479px) {
  /* 兩欄的候選人卡片在窄螢幕要同時放得下 號次 + 色塊 + 姓名 + 勾選圈，所以縮小內距與間距，姓名才不會被擠成兩行 */
  .cand { padding: 10px; gap: 8px; }
  .cand-name { gap: 6px; font-size: 1rem; }
  .cand .check { width: 18px; height: 18px; }
  .cand input:checked ~ .check::after { left: 5px; top: 2px; }
  .remind-actions .btn { width: 100%; } /* 窄螢幕：兩顆按鈕上下排列、滿版 */
  .mini-cnt { display: none; }
  .mini-val { min-width: 3.6em; }
  .disclosure dt { padding-right: 14px; }
}

@media (min-width: 720px) {
  .sm-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
}

@media (min-width: 560px) {
  .wrap { padding-left: 24px; padding-right: 24px; }
  .card { padding: 26px 28px; }
  .ledger { padding: 26px 28px 28px; }
  .tl-rail { margin-left: 30px; margin-right: 30px; }
}

@media (min-width: 760px) {
  .topnav { display: flex; }
  .band { padding: 64px 0; }
  .about-grid { grid-template-columns: 1fr 1.2fr; gap: 56px; }
}

@media (min-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 56px; align-items: center; padding-top: 64px; padding-bottom: 80px; }
  .band-grid { grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 56px; align-items: start; }
  .band { padding: 80px 0; }
  .about { padding: 72px 0 80px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
