/* SPDX-License-Identifier: Apache-2.0 · Copyright 2026 azelon.ai */
:root {
  --bg: #0b0f14;
  --surface: #11171e;
  --surface-2: #161e27;
  --line: #222c38;
  --line-2: #2c3846;
  --text: #e6ebf0;
  --muted: #8d9aa8;
  --faint: #5f6b78;
  --red: #ff5a4e;
  --amber: #ffb547;
  --yellow: #f2d64b;
  --cyan: #4fd1e8;
  --violet: #b294ff;
  --green: #5fd38d;
  --cwa: #ff5a4e;
  --jtwc: #4fd1e8;
  --hko: #b294ff;
  --radius: 10px;
  --font: 'Archivo', 'Noto Sans TC', system-ui, sans-serif;
  --zh: 'Noto Sans TC', 'Archivo', sans-serif;
  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: 0.9375rem;
  --text-lg: 1.125rem;
  --text-xl: 1.5rem;
  --text-2xl: 2rem;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; -webkit-font-smoothing: antialiased; }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }
.num, .kpi-v, td, .city-d, .fk-v { font-variant-numeric: tabular-nums lining-nums; }

.shell { max-width: 1560px; margin: 0 auto; padding: 16px 20px 32px; }

/* top bar */
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.brand { display: flex; gap: 12px; align-items: center; min-width: 0; }
.eye { width: 36px; height: 36px; color: var(--red); flex: none; animation: spin 6s linear infinite; }
@keyframes spin { to { transform: rotate(-360deg); } }
@media (prefers-reduced-motion: reduce) { .eye { animation: none; } .live i { animation: none !important; } }
h1 { margin: 0; font-size: var(--text-xl); font-weight: 750; font-stretch: 85%; letter-spacing: -0.01em; line-height: 1.1; }
h1 .zh { font-family: var(--zh); font-weight: 700; color: var(--red); margin-left: 4px; }
h1 .tag { font-size: var(--text-xs); font-weight: 600; color: var(--muted); border: 1px solid var(--line-2); border-radius: 4px; padding: 2px 6px; vertical-align: middle; margin-left: 6px; font-stretch: 100%; letter-spacing: 0.04em; }
.sub { margin: 4px 0 0; color: var(--muted); font-size: var(--text-sm); }
.status { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.live { display: inline-flex; align-items: center; gap: 8px; font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.live.ok { color: var(--green); border-color: rgba(95, 211, 141, .35); }
.live.ok i { background: var(--green); animation: pulse 1.8s ease-out infinite; }
.live.stale { color: var(--amber); border-color: rgba(255, 181, 71, .4); }
.live.stale i { background: var(--amber); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(95, 211, 141, .6); } 100% { box-shadow: 0 0 0 9px rgba(95, 211, 141, 0); } }
.meta { color: var(--muted); font-size: var(--text-sm); }
.btn { background: var(--surface-2); color: var(--text); border: 1px solid var(--line-2); border-radius: 6px; padding: 6px 12px; font-size: var(--text-sm); font-weight: 600; cursor: pointer; }
.btn:hover { border-color: var(--muted); }
.btn:focus-visible, .seg button:focus-visible, .toggles input:focus-visible + .sw { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* ribbon */
.ribbon { margin: 14px 0; display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; background: linear-gradient(90deg, rgba(255, 90, 78, .16), rgba(255, 90, 78, .04)); border: 1px solid rgba(255, 90, 78, .35); border-left: 4px solid var(--red); border-radius: var(--radius); padding: 10px 16px; }
.ribbon-k { font-size: var(--text-xs); font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--red); white-space: nowrap; }
.ribbon-v { font-size: var(--text-sm); line-height: 1.5; }
.ribbon-v .chip { display: inline-block; background: rgba(255, 90, 78, .18); color: #ffd2cd; border-radius: 4px; padding: 1px 7px; margin: 2px 4px 2px 0; font-weight: 600; font-size: var(--text-xs); }
.ribbon-v .chip.sea { background: rgba(79, 209, 232, .14); color: #c4f1fa; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; min-height: 92px; }
.kpi-k { font-size: var(--text-xs); color: var(--muted); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.kpi-v { font-size: var(--text-2xl); font-weight: 750; font-stretch: 85%; margin-top: 4px; line-height: 1.05; }
.kpi-v small { font-size: var(--text-sm); font-weight: 600; color: var(--muted); margin-left: 3px; font-stretch: 100%; }
.kpi-s { font-size: var(--text-xs); color: var(--muted); margin-top: 4px; }
.kpi.hot .kpi-v { color: var(--red); }
.kpi.warm .kpi-v { color: var(--amber); }

/* grid */
.grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(320px, 1fr); gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; min-width: 0; }
.card-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
h2 { margin: 0; font-size: var(--text-base); font-weight: 700; letter-spacing: 0.01em; }
h3.mini { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 14px 0 6px; }
.hint { font-size: var(--text-xs); color: var(--faint); }
.foot { font-size: var(--text-xs); color: var(--faint); margin: 10px 0 0; line-height: 1.5; }
.side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.map-card { display: flex; flex-direction: column; }
#map { flex: 1; min-height: 560px; border-radius: 8px; background: #0a0e12; border: 1px solid var(--line); }
.toggles { display: flex; gap: 12px; flex-wrap: wrap; font-size: var(--text-xs); color: var(--muted); }
.toggles label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; user-select: none; }
.toggles input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sw { width: 18px; height: 4px; border-radius: 2px; display: inline-block; opacity: .35; transition: opacity .15s; }
.toggles input:checked + .sw { opacity: 1; }
.sw-cwa { background: var(--cwa); } .sw-jtwc { background: var(--jtwc); } .sw-hko { background: var(--hko); }
.sw-cone { background: rgba(255, 90, 78, .5); height: 10px; } .sw-wind { background: var(--amber); height: 10px; border-radius: 50%; width: 10px; }

/* cities */
.cities { display: flex; flex-direction: column; gap: 10px; }
.city { border: 1px solid var(--line); background: var(--surface-2); border-radius: 8px; padding: 10px 12px; display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; }
.city-n { font-weight: 700; font-size: var(--text-base); }
.city-n span { font-family: var(--zh); color: var(--muted); font-weight: 500; margin-left: 6px; font-size: var(--text-sm); }
.city-lvl { font-size: var(--text-xs); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: 4px; align-self: start; }
.lvl-high { background: rgba(255, 90, 78, .18); color: var(--red); }
.lvl-mod { background: rgba(255, 181, 71, .16); color: var(--amber); }
.lvl-low { background: rgba(95, 211, 141, .14); color: var(--green); }
.city-d { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 6px; }
.city-d div { font-size: var(--text-xs); color: var(--muted); }
.city-d b { display: block; color: var(--text); font-size: var(--text-lg); font-weight: 700; font-stretch: 90%; }
.city-w { grid-column: 1 / -1; font-size: var(--text-xs); color: var(--muted); margin-top: 4px; }
.city-w.land { color: #ffd2cd; }

.chart-wrap { position: relative; height: 210px; }

/* bulletins */
.bulletins { grid-column: 1 / 2; }
.bul-list { display: flex; flex-direction: column; gap: 10px; }
.bul { border: 1px solid var(--line); border-left: 3px solid var(--amber); border-radius: 8px; padding: 10px 12px; background: var(--surface-2); }
.bul.ty { border-left-color: var(--red); }
.bul.rain { border-left-color: var(--cyan); }
.bul-h { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.bul-t { font-weight: 700; font-size: var(--text-sm); }
.bul-t .zh { font-family: var(--zh); color: var(--muted); font-weight: 500; margin-left: 6px; }
.bul-time { font-size: var(--text-xs); color: var(--muted); }
.bul-b { margin-top: 6px; font-size: var(--text-sm); line-height: 1.6; color: #c9d2db; white-space: pre-line; max-height: 13.5em; overflow: auto; overscroll-behavior: contain; }
.bul-b.zh { font-family: var(--zh); }
.bul-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.bul-tags span { font-size: 11px; padding: 1px 7px; border-radius: 4px; font-weight: 600; font-family: var(--zh); }
.t-or { background: rgba(255, 181, 71, .16); color: var(--amber); }
.t-ye { background: rgba(242, 214, 75, .12); color: var(--yellow); }
.t-red { background: rgba(255, 90, 78, .16); color: var(--red); }

/* segmented */
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 6px; overflow: hidden; }
.seg button { background: transparent; color: var(--muted); border: 0; padding: 5px 10px; font-size: var(--text-xs); font-weight: 600; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button.on { background: var(--surface-2); color: var(--text); }

/* flights */
.flight-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.fk { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.fk-v { font-size: var(--text-xl); font-weight: 750; font-stretch: 85%; color: var(--amber); }
.fk-k { font-size: var(--text-xs); color: var(--muted); line-height: 1.35; }
.facts { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 7px; }
.facts li { font-size: var(--text-sm); line-height: 1.45; padding-left: 14px; position: relative; color: #c9d2db; }
.facts li::before { content: ''; position: absolute; left: 0; top: .55em; width: 6px; height: 6px; border-radius: 1px; background: var(--amber); }
.facts li.d23::before { background: var(--red); }
.facts .when { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .04em; margin-right: 4px; }
.facts a { font-size: var(--text-xs); }

/* news */
.news { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; max-height: 470px; overflow: auto; overscroll-behavior: contain; }
.news.compact { max-height: 210px; }
.news li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.news li:last-child { border-bottom: 0; }
.news a { color: var(--text); font-size: var(--text-sm); line-height: 1.45; display: block; }
.news a:hover { color: var(--cyan); text-decoration: none; }
.news .nm { font-size: var(--text-xs); color: var(--faint); margin-top: 2px; }
.news .nm b { color: var(--muted); font-weight: 600; }
.news .empty { color: var(--muted); font-size: var(--text-sm); }

/* imagery */
.agencies { grid-column: 1 / -1; }
.imagery img { width: 100%; aspect-ratio: 1 / 1; max-height: 440px; object-fit: contain; background: #000; border-radius: 8px; border: 1px solid var(--line); display: block; }

/* table */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
th { text-align: left; font-size: var(--text-xs); color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding: 6px 8px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
td { padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }

.sources { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); font-size: var(--text-xs); color: var(--muted); line-height: 1.7; }
.sources p { margin: 0 0 4px; }
.disclaimer { color: var(--faint); }

/* skeleton */
.skeleton { background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; }
.skeleton.tall { height: 160px; }
.skeleton.line { height: 34px; margin-bottom: 8px; border: 0; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* leaflet */
.leaflet-container { font-family: var(--font); background: #0a0e12; }
.leaflet-popup-content-wrapper, .leaflet-tooltip { background: #131a22; color: var(--text); border: 1px solid var(--line-2); border-radius: 6px; box-shadow: 0 6px 20px rgba(0, 0, 0, .5); }
.leaflet-popup-tip { background: #131a22; }
.leaflet-tooltip { font-size: 12px; padding: 4px 8px; }
.leaflet-tooltip-top:before { border-top-color: var(--line-2); }
.leaflet-control-attribution { background: rgba(11, 15, 20, .75) !important; color: var(--faint) !important; }
.leaflet-control-attribution a { color: var(--muted) !important; }
.leaflet-bar a { background: #131a22; color: var(--text); border-bottom-color: var(--line-2); }
.city-label { background: transparent; border: 0; box-shadow: none; color: #fff; font-weight: 700; font-size: 12px; text-shadow: 0 1px 3px #000, 0 0 6px #000; }
.city-label:before { display: none; }
.storm-icon { color: var(--red); }

@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid { grid-template-columns: 1fr; }
  .bulletins { grid-column: auto; }
  #map { min-height: 460px; }
}
@media (max-width: 640px) {
  .shell { padding: 12px 12px 24px; }
  h1 { font-size: 1.25rem; }
  h1 .tag { display: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-v { font-size: 1.6rem; }
  .ribbon { grid-template-columns: 1fr; gap: 6px; }
  #map { min-height: 380px; }
  .flight-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fk-v { font-size: 1.25rem; }
  .status { width: 100%; justify-content: space-between; }
}

.news .orig { font-size: var(--text-xs); color: var(--faint); margin-top: 2px; line-height: 1.4; font-family: var(--zh); }
.mt { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--cyan); border: 1px solid rgba(79, 209, 232, .35); border-radius: 4px; padding: 0 5px; margin-right: 4px; }
.made-by { color: var(--text); margin-top: 6px !important; }
.made-by b { color: var(--text); }
