/* 素色主題：淺色純白、深色純黑，中性灰階，彩色只留給政黨 */
:root {
  --bg: #ffffff; --panel: #ffffff; --text: #0a0a0a; --muted: #737373; --faint: #a3a3a3;
  --line: #ebebeb; --hover: #f5f5f5; --bar-bg: #f0f0f0;
  --accent: #0a0a0a; --accent-fg: #ffffff;
  --radius: 24px; --radius-sm: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000; --panel: #0a0a0a; --text: #fafafa; --muted: #8a8a8a; --faint: #5c5c5c;
    --line: #212121; --hover: #141414; --bar-bg: #1c1c1c;
    --accent: #fafafa; --accent-fg: #000000;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.6 ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  -webkit-font-smoothing: antialiased; letter-spacing: .01em;
}
a { color: var(--text); text-underline-offset: 3px; text-decoration-color: var(--faint); }
a:hover { text-decoration-color: var(--text); }

/* 頁首 */
header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(20px); backdrop-filter: saturate(1.4) blur(20px);
  border-bottom: 1px solid var(--line);
  padding: 10px max(16px, calc((100vw - 1400px) / 2 + 16px));
  display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 700; color: var(--text); text-decoration: none; letter-spacing: 0; }
.brand img { border-radius: 50%; }
header .topnav { display: flex; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; }
header .topnav a { text-decoration: none; color: var(--muted); padding: 5px 14px; border-radius: 999px; font-size: 13px; font-weight: 500; transition: background .15s, color .15s; }
header .topnav a:hover { color: var(--text); background: var(--hover); }
header .topnav a.active { background: var(--accent); color: var(--accent-fg); }
#status { margin-left: auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

/* 版面 */
main { max-width: 1400px; margin: 0 auto; padding: 24px 16px; }
.crumbs { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
h1 { font-size: clamp(22px, 3vw, 30px); line-height: 1.25; font-weight: 800; letter-spacing: -.01em; margin: 0 0 8px; }
h2 { font-size: 16px; font-weight: 700; margin: 8px 0 12px; }
.summary { color: var(--muted); margin: 0 0 24px; max-width: 920px; }
.row { display: grid; gap: 16px; margin-bottom: 16px; }
.cols-2 { grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; min-width: 0; }
.panel h2 { font-size: 15px; margin: 0 0 4px; }
.panel .sub { color: var(--muted); font-size: 12px; margin-bottom: 10px; }
.chart { width: 100%; height: 380px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin-bottom: 20px; }
.toolbar label { color: var(--muted); font-size: 13px; display: inline-flex; align-items: center; gap: 8px; }
.toolbar a { font-size: 13px; }
.sub { color: var(--muted); font-size: 12px; }
select {
  font: inherit; font-size: 13px; color: var(--text); background: var(--panel);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 30px 6px 14px; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%; background-size: 5px 5px; background-repeat: no-repeat;
}
select:hover { border-color: var(--faint); }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.kpi .label { color: var(--muted); font-size: 12px; }
.kpi .value { font-size: 30px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.3; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); font-size: 12px; font-variant-numeric: tabular-nums; }

/* 進度條 */
.bar { height: 4px; border-radius: 999px; background: var(--bar-bg); overflow: hidden; margin-top: 10px; }
.bar > div { height: 100%; background: var(--accent); border-radius: 999px; }

/* 縣市卡片 */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; margin-bottom: 16px; }
.card {
  --pc: var(--faint); position: relative; overflow: hidden;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
  transition: border-color .15s, transform .15s;
}
.card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--pc); }
a.card { display: block; color: inherit; text-decoration: none; }
.card:hover { border-color: var(--faint); transform: translateY(-1px); }
.card .top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.card .county { font-weight: 700; font-size: 15px; }
.card .prog { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.card .cand { display: flex; justify-content: space-between; align-items: center; font-variant-numeric: tabular-nums; font-size: 13px; margin-top: 8px; }
.card .cand .p { color: var(--muted); font-size: 12px; }
.card .cand > span:first-child { overflow: hidden; min-width: 0; margin-right: 6px; }
.card .cand > span:last-child { white-space: nowrap; }

/* 表格 */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 13px; }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--hover); }
td.num, th.num { text-align: right; }
tr.win td { font-weight: 700; }
.names { font-size: 13px; }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.hidden { display: none; }
.empty { color: var(--muted); padding: 40px; text-align: center; }

/* 連結區 */
.links { columns: 4 220px; column-gap: 24px; }
.links div { break-inside: avoid; padding: 4px 0; color: var(--muted); font-size: 13px; }
.links a { margin-right: 10px; color: var(--text); }
.arealinks { display: flex; flex-wrap: wrap; gap: 8px; }
.arealinks a { text-decoration: none; font-size: 13px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; }
.arealinks a:hover { background: var(--hover); }
.arealinks a.current { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }

footer { color: var(--muted); font-size: 12px; text-align: center; padding: 24px 16px 48px; line-height: 1.8; }
footer a { color: var(--muted); }

/* 頭像與政黨徽章 */
.av { border-radius: 50%; object-fit: cover; object-position: 50% 20%; border: 2px solid var(--faint); background: var(--bar-bg); flex: none; vertical-align: middle; }
.av-txt { display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; line-height: 1; }
.who { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.who .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb { --pc: #8c919c; display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; line-height: 17px; color: #fff; background: var(--pc); white-space: nowrap; flex: none; vertical-align: middle; }
.pb-mini { padding: 0; width: 18px; height: 18px; justify-content: center; border-radius: 50%; font-size: 10px; }

/* 縣市長候選人大卡 */
.hero { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; margin-bottom: 16px; }
.hc { --pc: var(--faint); position: relative; overflow: hidden; display: flex; gap: 16px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.hc::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--pc); }
.hc.lead { border-color: var(--pc); }
.hc .av { border-width: 3px; }
.hc-body { flex: 1; min-width: 0; }
.hc-name { font-size: 18px; font-weight: 800; margin-bottom: 4px; }
.hc-votes { font-size: 26px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 8px; line-height: 1.2; }
.hc-votes small { font-size: 12px; color: var(--muted); font-weight: 400; }
.hc-pct { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.won { background: var(--accent); color: var(--accent-fg); font-size: 11px; padding: 1px 8px; border-radius: 999px; vertical-align: middle; }

@media (max-width: 600px) {
  .cols-2 { grid-template-columns: 1fr; }
  .chart { height: 320px; }
  .panel { padding: 16px; }
  #status { margin-left: 0; width: 100%; }
  .kpis { gap: 10px; }
  .kpi { padding: 14px 16px; border-radius: 18px; }
  .kpi .value { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
/* 鄉鎮村里 */
h3 { font-size: 14px; margin: 0 0 2px; }
.reps { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.reps table td { padding: 6px 4px; }
table.villages td:nth-child(2) { line-height: 2; }
.vc { display: inline-flex; align-items: center; gap: 4px; margin-right: 14px; color: var(--muted); white-space: nowrap; }
.vc b { font-weight: 600; font-variant-numeric: tabular-nums; }
.vc.lead { color: var(--text); }
.vc.lead b { font-weight: 800; }
.done { font-size: 11px; padding: 1px 8px; border-radius: 999px; background: var(--accent); color: var(--accent-fg); }
/* 公投 */
:root { --agree: #1f8a4c; --disagree: #d1495b; }
.refq .q, .refcard .q { font-size: clamp(16px, 2vw, 20px); font-weight: 700; line-height: 1.5; margin: 4px 0 0; }
.refcard { display: block; color: inherit; text-decoration: none; }
.refcard:hover { border-color: var(--faint); }
.refcard-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.refcard-head h2 { margin: 0; }
.verdict { font-size: 12px; font-weight: 700; padding: 3px 12px; border-radius: 999px; white-space: nowrap; }
.verdict.ok { background: var(--agree); color: #fff; }
.verdict.no { background: var(--bar-bg); color: var(--text); }
.split { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--disagree); margin-top: 16px; }
.split .a { background: var(--agree); }
.split .d { flex: 1; }
.split.sm { height: 6px; margin-top: 0; }
.split-lbl { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.split-legend { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 10px; font-variant-numeric: tabular-nums; }
.split-legend b { font-size: 20px; font-weight: 800; letter-spacing: -.01em; margin: 0 4px; }
.split-legend > div:last-child { text-align: right; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.sw.a { background: var(--agree); } .sw.d { background: var(--disagree); }
.meter { position: relative; height: 6px; border-radius: 999px; background: var(--bar-bg); margin: 10px 0 4px; }
.meter .fill { height: 100%; border-radius: 999px; background: var(--agree); }
.meter .mark { position: absolute; top: -4px; width: 2px; height: 14px; background: var(--text); }

/* 頁首：品牌（長短版）＋膠囊分頁（含圖示） */
.brand-short, .st-short { display: none; }
header .topnav a { display: inline-flex; align-items: center; gap: 6px; }
header .topnav svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
header { flex-wrap: wrap; }
header .topnav { order: 2; }
#status { order: 3; }
@media (max-width: 720px) {
  header { gap: 8px 12px; padding: 8px 12px 10px; padding-top: max(8px, env(safe-area-inset-top)); }
  .brand { font-size: 15px; min-width: 0; order: 1; }
  .brand-long { display: none; }
  .brand-short { display: inline; white-space: nowrap; }
  #status { order: 1; margin-left: auto; width: auto; min-width: 0; font-size: 11px; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #status .st-long { display: none; }
  #status .st-short { display: inline; }
  header .topnav { order: 2; width: 100%; display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; padding: 3px; }
  header .topnav a { flex-direction: column; justify-content: center; gap: 2px; padding: 5px 0 4px; font-size: 11px; text-align: center; -webkit-tap-highlight-color: transparent; }
  header .topnav svg { width: 18px; height: 18px; }
  main { padding-top: 16px; }
}
@media (max-width: 720px) {
  .hero { gap: 10px; }
  .hc { padding: 14px 16px; gap: 14px; }
  .hc .av { width: 60px !important; height: 60px !important; }
  .hc .av-txt { font-size: 26px !important; }
  .hc-name { font-size: 16px; margin-bottom: 2px; }
  .hc-votes { font-size: 22px; margin-top: 4px; }
  .hc .bar { margin-top: 6px; }
}

/* 地圖導覽 */
.map-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.map-head h2 { margin: 0 0 2px; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; }
.seg button { font: inherit; font-size: 13px; border: 0; background: transparent; color: var(--muted); padding: 5px 14px; border-radius: 999px; cursor: pointer; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--accent); color: var(--accent-fg); }
.map-body { display: grid; grid-template-columns: minmax(0, 560px) minmax(280px, 1fr); gap: 24px; align-items: start; }
.map-wrap { position: relative; }
.map { width: 100%; height: 640px; }
.map-info { max-width: 520px; }
.map-back { position: absolute; z-index: 2; right: 0; top: 0; font: inherit; font-size: 13px; padding: 5px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; }
.map-back:hover { background: var(--hover); }
.map-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.map-legend .sw { width: 10px; height: 10px; }
.map-legend .grad { display: inline-block; width: 120px; height: 8px; border-radius: 999px; vertical-align: middle; margin: 0 6px; }
.map-info { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; min-height: 200px; }
.map-info h3 { font-size: 18px; font-weight: 800; margin: 0 0 4px; }
.map-info .mi-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; font-size: 13px; font-variant-numeric: tabular-nums; }
.map-info .mi-row b { font-size: 15px; }
.map-info .mi-sec { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.map-info .mi-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.map-info .mi-links a { text-decoration: none; font-size: 12px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); }
.map-info .mi-links a:hover { background: var(--hover); }
.map-info .mi-links a.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
@media (max-width: 900px) {
  .map-body { grid-template-columns: 1fr; }
  .map-info { max-width: none; }
}
.map-info .mi-towns { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 8px; font-size: 13px; }
.map-info .mi-towns a { text-decoration: none; color: var(--text); }
.map-info .mi-towns a:hover { text-decoration: underline; }

/* 總覽：地圖右側統計 */
.map-body { grid-template-columns: minmax(0, 520px) minmax(0, 1fr); }
.map-info { max-width: none; }
.pp-head h3 { font-size: 20px; font-weight: 800; margin: 0 0 2px; }
.pp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-top: 14px; }
.pp-block { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; }
.pp-label { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pp-label b { font-size: 14px; }
.pbar { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--bar-bg); margin-top: 10px; }
.pbar > div { height: 100%; }
.pbar > div + div { box-shadow: -1px 0 0 var(--panel); }
.pp-parties { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 8px; font-size: 13px; font-variant-numeric: tabular-nums; }
.pp-parties > span { display: inline-flex; align-items: center; gap: 4px; }
.pp-note { margin-top: 4px; font-size: 11px; }
.pp-mayor { margin-top: 12px; }
.pp-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.pp-links a { text-decoration: none; font-size: 12px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); }
.pp-links a:hover { background: var(--hover); }
.pp-links a.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.seg { overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { white-space: nowrap; flex: none; }
@media (max-width: 900px) { .map-body { grid-template-columns: 1fr; } }
.mapnav { display: block; min-width: 0; }
.map-head > div:first-child { min-width: 0; }
.map-head .seg { min-width: 0; }
@media (max-width: 720px) { .map-head .seg { flex: 1 1 100%; } }

/* 表格：欄名、數字、第一欄、狀態不換行 */
th, td.num, tbody td:first-child, .done, .pb, .verdict { white-space: nowrap; }
td.names { min-width: 200px; }
@media (max-width: 600px) {
  table { font-size: 12px; }
  th, td { padding: 8px 6px; }
  /* 村里表改為卡片式：第一行村里與開票狀態，第二行候選人 */
  table.villages thead { display: none; }
  table.villages tbody tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
  table.villages tbody tr:last-child { border-bottom: none; }
  table.villages td { border: none; padding: 0; background: none !important; }
  table.villages td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; line-height: 1.9; }
  table.villages td:nth-child(1) { font-weight: 700; font-size: 14px; }
  .vc { margin-right: 10px; }
}

/* 可點擊的統計卡 */
a.pp-block { display: block; color: inherit; text-decoration: none; transition: border-color .15s, background .15s; }
a.pp-block:hover { border-color: var(--faint); background: var(--hover); }
a.pp-block .pp-label b { white-space: nowrap; }
.pp-mayor a.mi-row { color: inherit; text-decoration: none; }
a.pp-mayor-link { display: block; color: inherit; text-decoration: none; border-radius: var(--radius-sm); }
a.pp-mayor-link:hover { background: var(--hover); }
table.racetable .pbar { margin-top: 0; }
.pp-p { display: inline-flex; align-items: center; gap: 4px; margin-right: 10px; white-space: nowrap; }
.seg-links { gap: 8px; }
.seg-links a { text-decoration: none; font-size: 13px; padding: 5px 14px; border-radius: 999px; border: 1px solid var(--line); }
.seg-links a:hover { background: var(--hover); }
section[id] { scroll-margin-top: 80px; }
@media (max-width: 720px) { section[id] { scroll-margin-top: 130px; } }
@media (max-width: 600px) {
  table.racetable th:nth-child(4), table.racetable td:nth-child(4) { display: none; }
  table.racetable td.names { min-width: 0; line-height: 1.9; }
  .pp-p { margin-right: 6px; }
}

/* 當選章：頭像右下角紅色圓章、名字旁紅色標籤 */
:root { --won: #d4271c; }
.won { display: inline-block; background: var(--won); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .1em; padding: 1px 6px 1px 7px; border-radius: 4px; vertical-align: middle; white-space: nowrap; transform: rotate(-4deg); box-shadow: 0 0 0 1.5px var(--panel), 0 0 0 2.5px var(--won); margin-left: 2px; }
.av-wrap { position: relative; display: inline-flex; flex: none; vertical-align: middle; }
.stamp {
  --s: 40px;
  position: absolute; right: calc(var(--s) * -0.1); bottom: calc(var(--s) * -0.08);
  width: max(18px, calc(var(--s) * 0.56)); height: max(18px, calc(var(--s) * 0.56));
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--panel); color: var(--won);
  border: max(1.5px, calc(var(--s) * 0.04)) solid var(--won);
  box-shadow: inset 0 0 0 max(1px, calc(var(--s) * 0.025)) var(--panel), inset 0 0 0 max(2px, calc(var(--s) * 0.05)) var(--won);
  font-size: max(7px, calc(var(--s) * 0.17)); font-weight: 900; letter-spacing: -.02em; line-height: 1;
  transform: rotate(-14deg); pointer-events: none;
}
.hc .av-wrap { margin-right: 6px; }

/* 手機表格：隱藏次要欄位、名字不折行、多欄表格改為卡片 */
.nowrap { white-space: nowrap; }
.nm1 { white-space: nowrap; }
@media (max-width: 600px) {
  .hide-sm { display: none !important; }
  table.stack thead { display: none; }
  table.stack tbody tr { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 4px 12px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
  table.stack tbody tr:last-child { border-bottom: none; }
  table.stack td { border: none; padding: 0; background: none !important; }
  table.stack tbody td:first-child { font-weight: 700; font-size: 14px; }
  table.stack td[data-label]::before { content: attr(data-label) " "; color: var(--muted); font-size: 11px; font-weight: 400; }
  table.stack.areas td.names { grid-column: 1 / -1; min-width: 0; line-height: 1.9; }
  table.stack.dists td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  table.stack.dists td .bar { width: 72px; margin-left: auto; }
}
@media (max-width: 360px) { .hide-xs { display: none !important; } }

.nm-cell { min-width: 4.5em; word-break: keep-all; }
.show-sm { display: none; }
.split-col { min-width: 120px; }
@media (max-width: 600px) {
  .show-sm { display: inline; }
  .split-col { min-width: 90px; }
  table.stack, table.stack tbody { display: block; width: 100%; }
}
/* 最窄的手機：表格字級與間距再縮，表格內頭像縮小 */
@media (max-width: 360px) {
  table { font-size: 11px; }
  th, td { padding: 7px 4px; }
  td .who .av { width: 26px !important; height: 26px !important; }
  td .who .av-txt { font-size: 12px !important; }
  td .pb { padding: 1px 6px; font-size: 10px; }
}
@media (max-width: 600px) { table.stack tbody td:first-child { white-space: normal; } }
