/* 2026 台北市長選舉 網路聲量調查 2.0 — 純灰階紙本風格，只有淺色版面，只用系統字型 */
:root {
  color-scheme: light;
  --paper: #F6F6F6;
  --paper-2: #FFFFFF;
  --paper-3: #ECECEC;
  --ink: #161616;
  --ink-2: #5E5E5E;
  --hairline: rgba(22, 22, 22, .10);
  --line: rgba(22, 22, 22, .50);
  --btn: #161616;
  --btn-ink: #FFFFFF;
  /* 候選人識別色：只用在長條 / 色塊等非文字標記，不當文字色，上面也不放白字 */
  --c0: #C9C9C9;
  --c2: #F07A1A;  /* 沈伯洋 */
  --c5: #1E63D6;  /* 蔣萬安 */
  --ko: #1FA39A;  /* 柯文哲（假設情境） */
  --g1: #3A3A3A;
  --g2: #8C8C8C;
  --g3: #C9C9C9;
  --g4: #E2E2E2;
  --radius: 14px;
  --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 { margin: 0; }
ol, ul { padding: 0; list-style: none; }
button, select { font: inherit; color: inherit; }
.col { width: 100%; max-width: 520px; margin: 0 auto; padding: 0 16px; }
main { padding-top: 24px; padding-bottom: 56px; }
.muted { color: var(--ink-2); }
.small { font-size: .875rem; }
.center { text-align: center; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 6px; }

.top { border-bottom: 1px solid var(--hairline); background: rgba(246,246,246,.9); }
.top .col { min-height: 48px; display: flex; align-items: center; font-size: .9375rem; }

h1 { font-size: 1.875rem; font-weight: 900; line-height: 1.3; margin-top: 24px; text-wrap: balance; }
h2 { font-size: 1.375rem; font-weight: 900; line-height: 1.45; margin: 20px 0 16px; text-wrap: balance; }
h3 { font-size: 1rem; font-weight: 900; margin: 28px 0 10px; }
.lead { margin-top: 12px; font-size: 1.125rem; font-weight: 700; }
.stamp {
  display: inline-block; margin: 14px 0 22px; 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;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 28px; border: 0; border-radius: 999px;
  background: var(--btn); color: var(--btn-ink);
  font-size: 1.0625rem; font-weight: 700; letter-spacing: .04em; text-decoration: none;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.btn-block { width: 100%; }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: .9375rem; letter-spacing: 0; }
.btn-outline { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn:disabled { background: var(--paper-3); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--hairline); cursor: not-allowed; }

/* 題目頁 */
.qhead { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.back { background: none; border: 0; padding: 8px 0; font-weight: 700; cursor: pointer; }
.progress { height: 4px; background: var(--paper-3); border-radius: 999px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--ink); transition: width .2s ease; }
.note { margin: -8px 0 14px; }
.opts { display: grid; gap: 10px; }
.opt {
  display: block; width: 100%; min-height: 56px; padding: 10px 16px; text-align: left;
  border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--paper-2);
  font-weight: 700; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.opt:active { transform: scale(.985); }
.opt[aria-checked="true"] { border-color: var(--ink); background: var(--paper-3); box-shadow: inset 0 0 0 1px var(--ink); }

/* 最後一步 */
.consent { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; background: var(--paper-2); border: 1.5px solid var(--line); border-radius: var(--radius); cursor: pointer; }
.consent input { width: 22px; height: 22px; margin: 3px 0 0; flex: none; accent-color: var(--ink); }
.terms { margin: 12px 0 20px; font-size: .9375rem; }
.terms summary { cursor: pointer; font-weight: 700; padding: 6px 0; }
.terms ol { list-style: decimal; padding-left: 1.4em; display: grid; gap: 6px; margin: 6px 0 10px; }
.ts-box.is-shown { margin-bottom: 12px; }
.msg { min-height: 1.7em; margin-top: 10px; font-weight: 700; text-align: center; }

/* 結果 */
.thanks { margin-top: 8px; font-size: 1.25rem; font-weight: 900; }
.share { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 22px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; border: 1.5px solid var(--ink); border-radius: 999px; overflow: hidden; }
.seg button { min-height: 44px; border: 0; background: transparent; font-weight: 700; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--btn-ink); }
.bar-row { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 2px 10px; margin-bottom: 10px; font-size: .9375rem; }
.bar-row .track { grid-column: 1 / -1; grid-row: 2; }
.bar-row .pct { grid-column: 2; grid-row: 1; }
.track { height: 10px; border-radius: 999px; background: var(--paper-3); overflow: hidden; }
.track i { display: block; height: 100%; border-radius: 999px; background: var(--col, var(--g2)); }
.pct { text-align: right; font-weight: 700; }
.stack { display: flex; gap: 2px; height: 12px; border-radius: 999px; overflow: hidden; background: var(--paper-3); }
.stack i { display: block; height: 100%; background: var(--col, var(--g2)); }
.legend { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 6px; font-size: .875rem; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.chip { width: 10px; height: 10px; border-radius: 3px; background: var(--col, var(--g2)); flex: none; }
.grp { margin-bottom: 16px; }
.grp-h { display: flex; justify-content: space-between; font-size: .9375rem; font-weight: 700; margin-bottom: 6px; }
.grp-h span { color: var(--ink-2); font-weight: 400; }
.sup { color: var(--ink-2); font-size: .875rem; }
.selects { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.selects label { display: grid; gap: 4px; font-size: .8125rem; color: var(--ink-2); font-weight: 700; }
select { min-height: 44px; padding: 0 10px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--paper-2); color: var(--ink); }
.disc { margin-top: 40px; padding-top: 4px; border-top: 1px solid var(--hairline); font-size: .875rem; }
.disc .stamp { margin: 14px 0 10px; }
.disc dl { display: grid; grid-template-columns: 6em 1fr; gap: 4px 10px; margin-bottom: 10px; }
.disc dt { color: var(--ink-2); }
