:root {
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  color-scheme: dark;
  --bg: #10161c; --surface: #19222c; --ink: #edf3f7; --muted: #b0bdc9;
  --line: #334250; --accent: #8edbc9; --danger: #ffb38d;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--tg-theme-bg-color, var(--bg)); color: var(--tg-theme-text-color, var(--ink)); font-size: 14px; line-height: 1.6; }
main { max-width: 580px; margin: auto; padding: calc(20px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom)); }
header, .section-head, .row-head, .quota-head, .account { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.eyebrow { font-size: 11px; letter-spacing: .1em; font-weight: 700; color: var(--tg-theme-hint-color, var(--muted)); }
.badge { font-size: 11px; border: 1px solid var(--line); border-radius: 20px; padding: 2px 8px; white-space: nowrap; }
.heading { margin: 23px 0 19px; }
h1 { font-size: 26px; line-height: 1.25; letter-spacing: -.035em; margin: 0 0 6px; }
#dashboard-date { margin: 0; color: var(--tg-theme-hint-color, var(--muted)); font-size: 13px; font-variant-numeric: tabular-nums; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; min-height: 44px; border: 1px solid var(--line); }
button:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
button:disabled { opacity: .55; cursor: default; }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--tg-theme-secondary-bg-color, var(--surface)); }
.tabs button { background: transparent; border: 0; border-radius: 6px; color: var(--tg-theme-hint-color, var(--muted)); font-weight: 600; }
.tabs button[aria-selected="true"] { background: var(--tg-theme-bg-color, var(--bg)); color: var(--accent); box-shadow: inset 0 0 0 1px var(--line); }
.message { font-size: 12px; padding: 14px 0; color: var(--tg-theme-hint-color, var(--muted)); }
.message.error, .warning { color: var(--danger); }
.data-section { border-top: 1px solid var(--line); padding: 16px 0 8px; }
.data-section + .data-section { margin-top: 15px; }
h2 { font-size: 15px; margin: 0; letter-spacing: -.01em; font-weight: 650; }
h3, h4 { font-size: 14px; margin: 0; font-weight: 650; }
p { margin: 5px 0; overflow-wrap: anywhere; }
h3, h4, .account span { overflow-wrap: anywhere; }
.section-head { margin-bottom: 7px; align-items: baseline; }
.section-state, .empty, .note { font-size: 12px; }
.section-state, .empty { padding: 8px 0; }
.muted, .freshness, .note { color: var(--tg-theme-hint-color, var(--muted)); }
.muted { font-size: 12px; }
.freshness { font-size: 11px; font-variant-numeric: tabular-nums; }
.source-warning, .warning { font-size: 12px; }
.weather-row, .event-row, .task-row { padding: 12px 0 4px; }
.weather-row + .weather-row, .event-row + .event-row, .task-row + .task-row { border-top: 1px solid var(--line); margin-top: 7px; }
.weather-row h3 { display: inline-flex; align-items: center; gap: 10px; }
.weather-icon { display: inline-block; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; font-size: 30px; line-height: 1.25; }
.temperature { font-size: 22px; line-height: 1.2; letter-spacing: -.035em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.source-link { color: var(--tg-theme-link-color, var(--accent)); display: inline-flex; align-items: center; min-height: 44px; font-size: 12px; text-decoration-thickness: 1px; text-underline-offset: 3px; overflow-wrap: anywhere; }
.event-time { color: var(--accent); font-size: 12px; font-variant-numeric: tabular-nums; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 15px 0 10px; }
.chip { background: transparent; color: var(--tg-theme-hint-color, var(--muted)); border-radius: 22px; padding: 7px 12px; font-size: 12px; }
.chip[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); background: var(--tg-theme-secondary-bg-color, var(--surface)); }
.group-heading { color: var(--tg-theme-hint-color, var(--muted)); font-size: 12px; margin: 20px 0 0; }
.account { font-size: 13px; margin: 16px 0 6px; }
.account span:last-child { color: var(--tg-theme-hint-color, var(--muted)); }
.quota { padding: 19px 0; border-bottom: 1px solid var(--line); }
.quota-head { align-items: baseline; }
.number { font-size: 32px; line-height: 1.2; font-weight: 650; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.number small { font-size: 12px; font-weight: 400; color: var(--tg-theme-hint-color, var(--muted)); margin-left: 3px; }
.meter { height: 6px; margin: 12px 0 9px; background: var(--line); border-radius: 4px; overflow: hidden; }
.fill { height: 100%; background: var(--accent); }
.low .fill { background: var(--danger); }
.refresh { margin-top: 22px; width: 100%; min-height: 48px; border: 0; border-radius: 9px; padding: 12px 16px; font-weight: 650; background: var(--tg-theme-button-color, var(--accent)); color: var(--tg-theme-button-text-color, #11251f); }
footer { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 12px; font-size: 11px; color: var(--tg-theme-hint-color, var(--muted)); }
#updated { font-variant-numeric: tabular-nums; }
/* Weather is a visual card, not a paragraph of forecast text. */
.weather-card { padding: 18px; margin: 15px 0; border: 1px solid var(--line); border-radius: 18px; background: var(--tg-theme-secondary-bg-color, var(--surface)); }
.weather-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.weather-card-top h3 { font-size: 20px; font-weight: 700; }
.forecast-chip { color: var(--tg-theme-hint-color, var(--muted)); font-size: 12px; font-variant-numeric: tabular-nums; }
.weather-overview { display: flex; align-items: center; gap: 18px; margin: 10px 0 18px; min-height: 100px; }
.weather-art { display: block; width: 104px; height: 104px; flex: 0 0 104px; object-fit: contain; }
.condition-name { margin: 0 0 4px; font-size: 22px; font-weight: 650; line-height: 1.35; }
.condition-subtitle { margin: 0; font-size: 12px; color: var(--tg-theme-hint-color, var(--muted)); }
.weather-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.weather-metric { min-width: 0; }
.metric-label { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--tg-theme-hint-color, var(--muted)); white-space: nowrap; }
.metric-label img { display: block; flex-shrink: 0; }
.metric-number { display: flex; gap: 3px; align-items: baseline; margin-top: 8px; font-variant-numeric: tabular-nums; }
.metric-number strong { font-size: 34px; line-height: 1.2; letter-spacing: -.04em; font-weight: 650; }
.metric-number span { font-size: 14px; color: var(--tg-theme-hint-color, var(--muted)); }
.rain-scale { height: 4px; margin: 17px 0; background: var(--line); border-radius: 4px; overflow: hidden; }
.rain-scale-fill { height: 100%; background: #76b9ed; border-radius: 4px; }
.weather-details { border-top: 1px solid var(--line); padding-top: 2px; }
.weather-details summary { min-height: 44px; display: list-item; align-content: center; cursor: pointer; color: var(--tg-theme-link-color, var(--accent)); font-size: 13px; }
.forecast-original { font-size: 14px; line-height: 1.9; margin: 8px 0 12px; }
.weather-details .freshness { line-height: 1.8; }
@media (max-width: 360px) { .weather-card { padding: 14px; } .weather-metrics { gap: 6px; } .metric-label { gap: 3px; font-size: 11px; } .metric-label img { width: 16px; height: 16px; } .metric-number strong { font-size: 30px; } .weather-art { width: 88px; height: 88px; flex-basis: 88px; } }
@media (max-width: 340px) { main { padding-left: 14px; padding-right: 14px; } .temperature { font-size: 20px; } .section-head { gap: 6px; } }
@media (prefers-color-scheme: light) {
  :root { color-scheme: light; --bg: #f5f7f8; --surface: #eaf0f1; --ink: #17232b; --muted: #54636c; --line: #cbd7dc; --accent: #226c5a; --danger: #a64218; }
  .refresh { color: var(--tg-theme-button-text-color, #fff); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

