/* 關於、隱私權政策等靜態頁：與主畫面相同的字體與配色，不靠 JavaScript */
:root {
  --font-sans: 'PingFang TC', 'Noto Sans TC', 'Microsoft JhengHei', system-ui, sans-serif;
  /* 與 src/styles.css 相同的色票：白底、墨黑字；連結用墨黑，紅色只留給首頁的少數重點 */
  --paper: #ffffff;
  --surface: #ffffff;
  --ink: #111111;
  --ink-2: #3c3c41;
  --muted: #6b6b70;
  --line: #e4e4e7;
  --accent: #222222;
  --action: #222222;
  --radius: 6px;
}
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}
.site-header {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  height: 56px;
  padding: 0 1.5rem;
  border-top: 3px solid var(--accent);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  white-space: nowrap;
}
.brand { margin: 0; font-size: 1rem; font-weight: 700; line-height: 1; }
.home-link { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--ink); text-decoration: none; }
.brand-en { color: var(--muted); font-size: 0.875rem; font-weight: 500; margin-left: 0.25rem; }
.roc-flag { flex: none; border: 1px solid var(--line); border-radius: 2px; }
.guide-link { color: var(--ink-2); font-size: 0.875rem; font-weight: 600; }
/* 頁首右側：「引導版」開關與政治結構。沒有 JavaScript 時不顯示切換鈕（theme.js 會寫上 data-theme） */
.header-actions { display: flex; align-items: center; gap: 0.75rem; }
header:not(.site-header) { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; max-width: 720px; margin: 0 auto; padding: 0.75rem 1rem 0; }
.theme-toggle { display: none; }
html[data-theme] .theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-2);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.6;
  cursor: pointer;
}
/* 開關本體：關＝灰底、圓鈕在左；開＝墨色底、圓鈕滑到右 */
.theme-switch {
  position: relative;
  width: 30px;
  height: 18px;
  border-radius: 999px;
  background: var(--line);
  transition: background 150ms;
}
.theme-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: transform 150ms;
}
.theme-toggle[aria-pressed='true'] .theme-switch { background: var(--ink); }
.theme-toggle[aria-pressed='true'] .theme-switch::after { transform: translateX(12px); }
.theme-toggle:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
/* 「開始問答」只在遊戲版顯示（site-pages-game.css） */
.quiz-start-row { display: none; }
@media (max-width: 640px) {
  .brand-en { display: none; }
  .header-actions { gap: 0.5rem; }
}
.breadcrumb { max-width: 720px; margin: 0 auto; padding: 0.5rem 1rem 0; font-size: 0.875rem; }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.breadcrumb li + li::before { content: '›'; margin-right: 0.5rem; color: var(--muted); }
.breadcrumb [aria-current='page'] { font-weight: 600; }
main.text-page { max-width: 720px; margin: 0 auto; padding: 0 1rem 2rem; }
.site-footer {
  margin-top: 0;
  padding: 1rem 1.5rem 2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8125rem;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 1rem; }
.footer-links a { color: var(--accent); }
.interactive-link {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
}
.district-anchors { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; margin: 1rem 0; }
.county-race { margin: 1rem 0; padding: 0.75rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); }
.county-count { margin-left: 0.5rem; color: var(--muted); font-size: 0.875rem; font-weight: 400; }
.district-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.district-link { display: flex; justify-content: space-between; gap: 0.5rem; }
/* 與可點元素的距離：桌機 ≥150px。手機目標 ≥100px，下限 64px。 */
.ad-gap { min-height: 150px; }
.ad-slot { box-sizing: border-box; max-width: 728px; margin: 0 auto; min-height: 110px; text-align: center; }
.ad-label { margin: 0; color: #666; font-size: 12px; line-height: 20px; }
.ad-slot .adsbygoogle { display: inline-block; width: 728px; height: 90px; }
@media (max-width: 860px) {
  .site-header { position: sticky; top: 0; z-index: 20; height: 48px; padding: 0 1rem; transition: transform 180ms ease; }
  .site-header.is-hidden { transform: translateY(-100%); }
}
@media (max-width: 799px) {
  .ad-gap { min-height: 100px; }
  .ad-slot { min-height: 80px; }
  .ad-slot .adsbygoogle { width: 468px; height: 60px; }
}
@media (max-width: 499px) {
  .ad-slot { min-height: 120px; }
  .ad-slot .adsbygoogle { width: 320px; height: 100px; }
}
@media (prefers-reduced-motion: reduce) {
  .site-header { transition: none; }
}
h1 { font-size: 1.5rem; margin: 1.5rem 0 0.5rem; }
h2 { font-size: 1.125rem; margin: 2rem 0 0.5rem; }
p, li { color: var(--ink-2); }
a { color: var(--accent); overflow-wrap: anywhere; }
.badge { display: inline-block; padding: 0 0.4rem; border-radius: 4px; font-size: 0.8125rem; border: 1px solid var(--line); background: var(--surface); }
footer p { color: var(--muted); }

/* 人物、選舉、縣市靜態頁（civiclear export static 產出） */
.kicker { margin: 1.5rem 0 0; color: var(--muted); font-size: 0.8125rem; }
.kicker + h1 { margin-top: 0; }
.lead { font-size: 1.0625rem; color: var(--ink); }
h3 { font-size: 1rem; margin: 1.25rem 0 0.25rem; }
.muted { color: var(--muted); }
.statement { margin-bottom: 0.75rem; }
.statement p { margin: 0.25rem 0; }
.meta { font-size: 0.8125rem; }
.source { display: inline-block; margin-right: 0.5rem; font-size: 0.8125rem; color: var(--muted); }
.source a { color: var(--muted); }
/* 與 src/styles.css 的 source-badge-* 相同：小字加圓點、不用色塊。實心點＝政府資料，空心點＝其他來源 */
.source .badge,
.badge[class*='badge-'] {
  padding: 0;
  margin-right: 0.5rem;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--ink-2);
  font-weight: 600;
  white-space: nowrap;
}
.source .badge::before,
.badge[class*='badge-']::before {
  content: '';
  display: inline-block;
  width: 0.6em;
  height: 0.6em;
  margin-right: 5px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  vertical-align: 0.02em;
}
.badge-gov { color: var(--ink); }
.badge-gov::before { background: currentColor; }
.no-records { padding: 0.5rem 1rem; border: 1px dashed var(--line); border-radius: var(--radius); }
.asset-declaration { margin-top: 2rem; margin-bottom: 2rem; }
.asset-lines { margin: 0.5rem 0; padding: 0; list-style: none; }
.asset-lines li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.35rem 0; border-bottom: 1px solid var(--line); }
.interactive { margin-top: 2rem; font-weight: 600; }
.response-time { font-weight: 600; color: var(--ink); }
.mailbox { padding: 0.5rem 1rem; border: 1px dashed var(--line); border-radius: var(--radius); }
.area-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
}
.area-list li { max-width: 100%; min-width: 0; }
.area-list a {
  display: inline-block;
  max-width: 100%;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font-weight: 600;
  overflow-wrap: anywhere;
  text-decoration: none;
}
.residence-group { margin-top: 0.75rem; }
.residence-group summary { cursor: pointer; font-weight: 600; }
.peer-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr));
  align-items: stretch;
  gap: 0.75rem;
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
}
.peer-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
}
.peer-card p { margin: 0.15rem 0; }
.is-missing { color: var(--muted); }
.summary-label { color: var(--muted); font-size: 0.875rem; }
.external-queries a { color: var(--action); }
.query-links { padding-left: 1.25rem; }
.query-note { margin: 0.25rem 0 0.75rem; }
.copy-name-status { margin: 0.25rem 0 0; font-weight: 600; }
.copy-name-status:empty { display: none; }

/* 選票號次：名字前面、粗體 */
.ballot-number { font-weight: 700; white-space: nowrap; }

/* 同選區候選人：只列號次與姓名 */
.peer-list { margin: 0.5rem 0; padding-left: 1.5rem; }
.peer-list li { margin: 0.25rem 0; overflow-wrap: anywhere; }
.lookup-name { font-weight: 600; overflow-wrap: anywhere; }

/* 選舉指南（/guides/）、職位與生活、首頁導讀：本站自寫的白話說明 */
.byline { margin: 0 0 1rem; color: var(--muted); font-size: 0.8125rem; }
.guide h2 { margin-top: 2.25rem; }
.guide ul, .guide ol { padding-left: 1.5rem; }
.guide li + li { margin-top: 0.35rem; }
.cite { color: var(--muted); font-size: 0.8125rem; }
.cite a { color: var(--muted); }
.cite-line { margin-top: 0.25rem; color: var(--muted); font-size: 0.8125rem; }
.cite-line a { color: var(--muted); }
.guide-related, .guide-sources { margin-top: 2rem; padding-top: 0.5rem; border-top: 1px solid var(--line); }
.guide-sources ol { padding-left: 1.5rem; font-size: 0.875rem; }
.guide-sources li { color: var(--muted); }
.guide-list { margin: 1rem 0; padding: 0; list-style: none; }
.guide-list li { padding: 0.75rem 0; border-bottom: 1px solid var(--line); }
.guide-list h2 { margin: 0 0 0.25rem; font-size: 1.0625rem; }
.guide-list p { margin: 0; }
.office-life { margin: 1rem 0; padding: 0.75rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); }
.office-life h2, .office-life h3 { margin-top: 0; }
.office-life ul { padding-left: 1.25rem; }
.guide-more { font-weight: 600; }
.home-intro { margin: 1.5rem 0; }
