/* fx-tw.css：母網「全台人口點陣圖」的版面（只有母網首頁載入）。
   圖沒載成功時（沒有 .has-tw／.is-live）版面跟原本一模一樣。 */
.tw-live { --tw-dim: #6f8b90; --tw-dot: var(--cream, #F3F0E7); --tw-hot: var(--teal, #19B9A8); --tw-ring: var(--gold, #CF9D3F); --tw-label: var(--muted-dark, #BECECD); position: relative; margin: var(--space-6, 48px) auto 0; max-width: 340px; color: var(--paper, #FAF8F2); }
.tw-live:not(.is-live) { display: none; }
.tw-map { width: 100%; }
/* 資料還沒到：先用跟圖一樣比例的空框佔位，到了再畫，版面不會跳 */
.tw-live.is-loading::before { content: ''; display: block; aspect-ratio: 257 / 350; }
.tw-map canvas { display: block; width: 100%; height: auto; cursor: crosshair; touch-action: pan-y; }
.tw-map canvas:focus-visible { outline: 2px solid var(--tw-ring); outline-offset: 4px; }
.tw-read { margin-top: var(--space-3, 24px); color: var(--paper, #FAF8F2); font-size: var(--text-sm, .9375rem); line-height: 1.6; }
.tw-read p { margin: 0; color: inherit; }
.dark .tw-read p.tw-place { color: var(--paper, #FAF8F2); font: 700 1.25rem/1.4 var(--font-title, serif); }
.dark .tw-read p.tw-pop { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; margin-top: 6px; color: var(--muted-dark, #BECECD); }
.tw-num { font: 600 2.5rem/1.15 var(--font-number, sans-serif); font-variant-numeric: tabular-nums; color: var(--tw-ring); }
.tw-unit { color: var(--paper, #FAF8F2); }
.tw-pre { flex: 0 0 100%; font-size: var(--text-xs, .875rem); }
.dark .tw-read p.tw-coord { margin-top: 4px; font: 400 var(--text-xs, .875rem)/1.6 var(--font-number, sans-serif); letter-spacing: .04em; color: var(--muted-dark, #BECECD); font-variant-numeric: tabular-nums; }
.tw-radius { display: inline-flex; margin-top: var(--space-2, 16px); border: 1px solid var(--line-dark, #F3F0E72E); border-radius: var(--radius, 4px); }
.tw-radius button { appearance: none; min-height: 36px; padding: 6px 12px; border: 0; background: transparent; color: var(--muted-dark, #BECECD); font: 500 var(--text-xs, .875rem)/1.4 var(--font-body, sans-serif); cursor: pointer; }
.tw-radius button + button { border-left: 1px solid var(--line-dark, #F3F0E72E); }
.tw-radius button[aria-pressed="true"] { background: var(--tw-hot); color: var(--ink, #0B1C24); }
.tw-radius button:focus-visible { outline: 2px solid var(--tw-ring); outline-offset: 2px; }
.dark p.tw-note { margin: var(--space-2, 16px) 0 0; font-size: 12px; line-height: 1.7; color: var(--muted-dark, #BECECD); }
@media (hover: hover) and (pointer: fine) {
  .tw-radius button:not([aria-pressed="true"]):hover { color: var(--paper, #FAF8F2); background: var(--navy-2, #102A33); }
}
@media (max-width: 1023px) {
  .tw-radius button { min-height: 44px; padding: 10px 16px; }
}
/* 桌機：左邊標題與六個數字（改兩欄三列），右邊這張圖；讀數疊在圖左下角的海面上 */
@media (min-width: 1024px) {
  .stats.has-tw > .wrap { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); column-gap: var(--space-8, 64px); align-items: start; }
  .stats.has-tw > .wrap > * { grid-column: 1; }
  .stats.has-tw > .wrap > .tw-live { grid-column: 2; grid-row: 1 / span 3; align-self: center; margin: 0 0 0 auto; width: 100%; max-width: 548px; }
  .stats.has-tw .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats.has-tw .stats-grid > div:nth-child(3n + 1) { padding-left: var(--space-4, 32px); border-left: 1px solid var(--line-dark, #F3F0E72E); }
  .stats.has-tw .stats-grid > div:nth-child(odd) { padding-left: 0; border: 0; }
  /* 圖的大小同時看欄寬與視窗高：不超出右欄，矮螢幕（筆電 768 高）也能一眼看到整張圖 */
  .tw-map { width: min(100%, calc(min(600px, 100svh - 200px) * 257 / 350)); aspect-ratio: 257 / 350; margin-left: auto; }
  .tw-map canvas { height: 100%; }
}
/* 夠寬的桌機：讀數疊在圖左下角的海面上；1024～1199 欄位窄，讀數排在圖下面 */
@media (min-width: 1200px) {
  .stats.has-tw > .wrap > .tw-live { padding-left: 96px; }
  .tw-read { position: absolute; left: 0; bottom: 64px; width: 236px; margin: 0; }
}
@media print {
  .tw-radius, .tw-note { display: none; }
}
