/* 生活工具樞紐頁（/weather、/invoice）：直接答案 → 資料表 → 工具 → 歷史 → 相關新聞 → 問答 → 來源 */
.hub {
  --hub-bg: #F5F7FA; --hub-panel: #ffffff; --hub-line: #E4E7EC; --hub-text: #1a1a2e; --hub-text-2: #555770; --hub-text-3: #6b6e82;
  --hub-accent: #00326e; --hub-accent-soft: #E8EEF7; --hub-hl: #C62828; --hub-gold: #B7791F; --hub-ok: #2E7D32; --hub-warn-bg: #FFF4E5; --hub-warn: #8A5300;
  --hub-radius: 14px;
  background: var(--hub-bg); color: var(--hub-text); padding: 20px 0 48px;
}
[data-theme="night"] .hub {
  --hub-bg: #0f1220; --hub-panel: #171b2c; --hub-line: #2a2f45; --hub-text: #e6e8f0; --hub-text-2: #b4b7c9; --hub-text-3: #9a9db2;
  --hub-accent: #7cb6ff; --hub-accent-soft: rgba(124,182,255,0.12); --hub-hl: #FF8A80; --hub-gold: #F3C46B; --hub-ok: #81C784; --hub-warn-bg: rgba(255,183,77,0.12); --hub-warn: #FFCC80;
}
.hub .container { display: grid; gap: 16px; }
.hub a { color: var(--hub-accent); }
.hub-crumb { font-size: 13px; color: var(--hub-text-3); display: flex; gap: 6px; flex-wrap: wrap; }
.hub-crumb a { color: var(--hub-text-3); text-decoration: none; }
.hub-crumb a:hover { color: var(--hub-accent); }
.hub-head h1 { margin: 0 0 6px; font-size: 1.75rem; font-weight: 900; line-height: 1.25; text-wrap: balance; }
.hub-head .hub-sub { margin: 0; color: var(--hub-text-2); font-size: 0.95rem; }

/* 直接答案：AI 與 Google 摘要優先引用的一句話 */
.hub-answer { background: var(--hub-panel); border: 1px solid var(--hub-line); border-left: 4px solid var(--hub-accent); border-radius: var(--hub-radius); padding: 16px 18px; font-size: 1.05rem; line-height: 1.75; font-weight: 600; margin: 0; }
.hub-stale { background: var(--hub-warn-bg); color: var(--hub-warn); border-radius: 10px; padding: 10px 14px; font-size: 0.9rem; }

.hub-panel { background: var(--hub-panel); border: 1px solid var(--hub-line); border-radius: var(--hub-radius); padding: 18px; min-width: 0; }
.hub-panel h2 { margin: 0 0 12px; font-size: 1.15rem; font-weight: 800; }
.hub-panel h2 small { font-weight: 600; color: var(--hub-text-3); font-size: 0.8rem; margin-left: 6px; }
.hub-note { margin: 10px 0 0; font-size: 0.85rem; color: var(--hub-text-3); line-height: 1.6; }

/* 資料表 */
.hub-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.hub-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.hub-table th, .hub-table td { padding: 10px 8px; border-bottom: 1px solid var(--hub-line); text-align: left; vertical-align: top; }
.hub-table th, .hub-table td.num, .hub-table td:first-child { white-space: nowrap; }
.hub-table th { font-size: 0.8rem; color: var(--hub-text-3); font-weight: 700; letter-spacing: 0.04em; }
.hub-table tr:last-child td { border-bottom: 0; }
.hub-table td.num { text-align: right; }
.hub-table a { text-decoration: none; font-weight: 700; }
.hub-table tr.is-mine td { background: var(--hub-accent-soft); }

/* 發票號碼 */
.inv-numbers { display: grid; gap: 10px; }
.inv-row { display: grid; grid-template-columns: 92px 1fr; gap: 12px; align-items: baseline; padding: 10px 0; border-bottom: 1px dashed var(--hub-line); }
.inv-row:last-child { border-bottom: 0; }
.inv-row .k { font-weight: 800; }
.inv-row .k small { display: block; font-weight: 600; color: var(--hub-text-3); font-size: 0.78rem; }
.inv-row .v { display: flex; flex-wrap: wrap; gap: 6px 14px; font-family: "SF Mono", Menlo, Consolas, "Roboto Mono", monospace; font-size: 1.6rem; font-weight: 800; letter-spacing: 0.06em; color: var(--hub-hl); font-variant-numeric: tabular-nums; }
.inv-row .v .tail { text-decoration: underline; text-decoration-color: var(--hub-gold); text-decoration-thickness: 3px; text-underline-offset: 5px; }
.inv-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 0.9rem; color: var(--hub-text-2); margin-top: 6px; }
.inv-meta b { color: var(--hub-text); }
.inv-badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; background: var(--hub-accent-soft); color: var(--hub-accent); }
.inv-badge.is-expired { background: var(--hub-warn-bg); color: var(--hub-warn); }

/* 對獎工具 */
.inv-check { display: grid; gap: 12px; }
.inv-check-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.inv-check-form select, .inv-check-form input { flex: 1 1 150px; min-width: 0; font-size: 1.15rem; padding: 10px 12px; border: 1px solid var(--hub-line); border-radius: 10px; background: var(--hub-bg); color: var(--hub-text); }
.inv-check-form input { font-family: "SF Mono", Menlo, Consolas, monospace; letter-spacing: 0.12em; font-variant-numeric: tabular-nums; }
.inv-check-form input::placeholder { letter-spacing: 0; font-size: 1rem; }
.inv-check-form input:focus, .inv-check-form select:focus { outline: 2px solid var(--hub-accent); outline-offset: 1px; }
.inv-result { min-height: 1.6em; font-size: 1.05rem; font-weight: 800; }
.inv-result.is-win { color: var(--hub-ok); }
.inv-result.is-maybe { color: var(--hub-gold); }
.inv-result.is-lose { color: var(--hub-text-2); font-weight: 600; }

/* 歷期／縣市清單 */
.hub-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.hub-chips a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--hub-line); background: var(--hub-panel); color: var(--hub-text); text-decoration: none; font-size: 0.9rem; font-weight: 600; }
.hub-chips a:hover, .hub-chips a.cur { border-color: var(--hub-accent); color: var(--hub-accent); }

/* 一週預報 */
.wx-week { display: grid; grid-template-columns: repeat(7, minmax(84px, 1fr)); gap: 8px; overflow-x: auto; }
.wx-day { border: 1px solid var(--hub-line); border-radius: 12px; padding: 10px 6px; text-align: center; display: grid; gap: 4px; font-variant-numeric: tabular-nums; }
.wx-day .d { font-size: 0.8rem; color: var(--hub-text-3); font-weight: 700; }
.wx-day .i { font-size: 1.6rem; line-height: 1.2; }
.wx-day .w { font-size: 0.78rem; color: var(--hub-text-2); min-height: 2.4em; }
.wx-day .t { font-weight: 800; }
.wx-day .p { font-size: 0.8rem; color: var(--hub-accent); font-weight: 700; }
.wx-now { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.wx-now .big { font-size: 3rem; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }

/* 相關新聞 */
.hub-news { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.hub-news a { display: grid; grid-template-columns: 96px 1fr; gap: 10px; text-decoration: none; color: var(--hub-text); align-items: start; }
.hub-news img { width: 96px; height: 64px; object-fit: cover; border-radius: 8px; background: var(--hub-line); }
.hub-news .t { font-weight: 700; font-size: 0.92rem; line-height: 1.45; }
.hub-news .m { font-size: 0.78rem; color: var(--hub-text-3); margin-top: 4px; }

/* 常見問題 */
.hub-faq { display: grid; gap: 4px; }
.hub-faq details { border-bottom: 1px solid var(--hub-line); padding: 10px 0; }
.hub-faq details:last-child { border-bottom: 0; }
.hub-faq summary { cursor: pointer; font-weight: 700; list-style: none; }
.hub-faq summary::-webkit-details-marker { display: none; }
.hub-faq summary::before { content: "＋"; color: var(--hub-accent); margin-right: 6px; }
.hub-faq details[open] summary::before { content: "－"; }
.hub-faq p { margin: 8px 0 0; color: var(--hub-text-2); line-height: 1.75; }

/* 來源 */
.hub-source { font-size: 0.85rem; color: var(--hub-text-3); line-height: 1.7; }

/* 台灣縣市天氣地圖 */
.hub { --wx-t1: #4F8FD6; --wx-t2: #7FC0E8; --wx-t3: #A8D8A0; --wx-t4: #F6D365; --wx-t5: #F4A259; --wx-t6: #E4572E; --wx-na: #D5D9E2; --wx-stroke: #ffffff; --wx-label: #1a1a2e; --wx-mine: #00326e; }
[data-theme="night"] .hub { --wx-t1: #2F6DB5; --wx-t2: #3C8DBC; --wx-t3: #5E9E6E; --wx-t4: #C9A43B; --wx-t5: #C97A3A; --wx-t6: #B8432A; --wx-na: #2a2f45; --wx-stroke: #0f1220; --wx-label: #ffffff; --wx-mine: #f3d58f; }
.wx-map-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px; align-items: start; }
.wx-map { margin: 0; display: grid; gap: 8px; }
.wx-map svg { width: 100%; max-width: 420px; height: auto; display: block; margin: 0 auto; }
.wx-county path { stroke: var(--wx-stroke); stroke-width: 0.8; stroke-linejoin: round; transition: opacity 0.15s; }
.wx-county:hover path, .wx-county:focus path { opacity: 0.8; }
.wx-county .wx-dot { stroke: var(--wx-stroke); stroke-width: 1.5; }
.wx-county.t1 .wx-dot { fill: var(--wx-t1); } .wx-county.t2 .wx-dot { fill: var(--wx-t2); } .wx-county.t3 .wx-dot { fill: var(--wx-t3); } .wx-county.t4 .wx-dot { fill: var(--wx-t4); } .wx-county.t5 .wx-dot { fill: var(--wx-t5); } .wx-county.t6 .wx-dot { fill: var(--wx-t6); } .wx-county.tna .wx-dot { fill: var(--wx-na); }
.wx-county.is-mine .wx-dot { stroke: var(--wx-mine); stroke-width: 2.2; }
.wx-county.t1 path { fill: var(--wx-t1); } .wx-county.t2 path { fill: var(--wx-t2); } .wx-county.t3 path { fill: var(--wx-t3); }
.wx-county.t4 path { fill: var(--wx-t4); } .wx-county.t5 path { fill: var(--wx-t5); } .wx-county.t6 path { fill: var(--wx-t6); } .wx-county.tna path { fill: var(--wx-na); }
.wx-county.is-mine path { stroke: var(--wx-mine); stroke-width: 2.2; }
.wx-labels text .nm { font-size: 7.5px; font-weight: 700; }
.wx-labels text { font-size: 9px; font-weight: 800; fill: var(--wx-label); text-anchor: middle; dominant-baseline: middle; pointer-events: none; paint-order: stroke; stroke: var(--wx-stroke); stroke-width: 2px; font-variant-numeric: tabular-nums; }
.wx-inset { fill: none; stroke: var(--hub-line); stroke-dasharray: 3 3; }
.wx-inset-label { font-size: 8px; fill: var(--hub-text-3); }
.wx-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 12px; font-size: 0.78rem; color: var(--hub-text-2); }
.wx-legend span { display: inline-flex; align-items: center; gap: 4px; }
.wx-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.wx-legend i.t1 { background: var(--wx-t1); } .wx-legend i.t2 { background: var(--wx-t2); } .wx-legend i.t3 { background: var(--wx-t3); } .wx-legend i.t4 { background: var(--wx-t4); } .wx-legend i.t5 { background: var(--wx-t5); } .wx-legend i.t6 { background: var(--wx-t6); }
.wx-mine-card { display: grid; gap: 6px; padding: 16px; border-radius: var(--hub-radius); border: 1px solid var(--hub-line); background: var(--hub-accent-soft); }
.wx-mine-card[hidden] { display: none; }
.wx-mine-card .k { font-size: 0.85rem; font-weight: 700; color: var(--hub-text-2); }
.wx-mine-card .v { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.wx-mine-card .v b { font-size: 2.4rem; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.wx-pick-hint { margin: 0; font-size: 0.95rem; color: var(--hub-text-2); }
.hub .city-pin-btn { margin-top: 8px; }
@media (max-width: 760px) { .wx-map-wrap { grid-template-columns: 1fr; } }

@media (max-width: 600px) {
  .hub-head h1 { font-size: 1.45rem; }
  .inv-row { grid-template-columns: 70px 1fr; }
  .inv-row .v { font-size: 1.35rem; }
  .wx-now .big { font-size: 2.4rem; }
  .hub-table th, .hub-table td { padding: 9px 6px; font-size: 0.9rem; }
}
