/* ============================================================
   蔷琵 CHAMPI · STORM/FILE
   Editorial instrument panel: abyss dark, ion cyan, signal amber
   ============================================================ */

:root {
  --bg: #05090f;
  --bg-2: #071019;
  --panel: rgba(10, 21, 33, 0.72);
  --panel-solid: #0a1521;
  --line: rgba(150, 192, 220, 0.13);
  --line-strong: rgba(150, 192, 220, 0.26);
  --ink: #e8f1f7;
  --ink-2: #a5b8c7;
  --ink-3: #6d8294;
  --cyan: #5ee7ff;
  --amber: #ffb454;
  --rose: #ff4d6d;
  --mint: #5ce0b0;
  --violet: #b79cff;
  --level: #ff3d81;
  --pad: clamp(20px, 4.5vw, 64px);
  --max: 1360px;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "Inter", "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 86px;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(900px 620px at 78% -8%, rgba(94, 231, 255, 0.1), transparent 62%),
    radial-gradient(700px 520px at 4% 26%, rgba(255, 77, 109, 0.06), transparent 60%),
    radial-gradient(800px 700px at 50% 110%, rgba(94, 231, 255, 0.05), transparent 65%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: rgba(94, 231, 255, 0.3);
  color: #fff;
}

img,
svg {
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 200;
  padding: 10px 14px;
  background: var(--cyan);
  color: #04121a;
  font-family: var(--mono);
  font-size: 13px;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 12px;
}

/* film grain + faint grid */
.grain {
  position: fixed;
  inset: 0;
  z-index: 120;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============ HEADER ============ */

.site-head {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 68px;
  padding: 0 var(--pad);
  border-bottom: 1px solid var(--line);
  background: rgba(5, 9, 15, 0.72);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.18em;
}

.brand-mark {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--cyan);
  position: relative;
  box-shadow: 0 0 14px rgba(94, 231, 255, 0.35) inset;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
}

.brand-text span {
  color: var(--cyan);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.2vw, 30px);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--ink-2);
}

.site-nav a {
  position: relative;
  padding: 6px 0;
  transition: color 0.2s ease;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--cyan);
  transition: width 0.25s ease;
}

.site-nav a:hover {
  color: var(--ink);
}

.site-nav a:hover::after {
  width: 100%;
}

.head-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  white-space: nowrap;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-3);
  box-shadow: 0 0 0 0 rgba(94, 231, 255, 0.5);
}

.head-live[data-state="ok"] .live-dot {
  background: var(--cyan);
  animation: livePulse 2.4s ease-out infinite;
}

.head-live[data-state="ok"] {
  color: #9fd8e6;
}

.head-live[data-state="syncing"] .live-dot {
  background: var(--amber);
  animation: livePulse 1.2s ease-out infinite;
}

.head-live[data-state="error"] .live-dot {
  background: var(--rose);
}

.head-live[data-state="error"] {
  color: #e79aa6;
}

/* ============ HERO ============ */

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(330px, 0.82fr);
  gap: clamp(30px, 5vw, 76px);
  align-items: center;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(52px, 7.5vw, 108px) var(--pad) clamp(44px, 6vw, 84px);
  overflow: hidden;
}

.hero-visual {
  position: absolute;
  top: 50%;
  right: 0;
  width: 70%;
  height: 150%;
  transform: translateY(-50%);
  color: var(--cyan);
  opacity: 0.17;
  pointer-events: none;
  z-index: 0;
  -webkit-mask-image: radial-gradient(closest-side, #000 35%, transparent 78%);
  mask-image: radial-gradient(closest-side, #000 35%, transparent 78%);
}

.isobars {
  width: 100%;
  height: 100%;
}

.sweep {
  position: absolute;
  inset: 12% 6%;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    transparent 300deg,
    rgba(94, 231, 255, 0.36) 345deg,
    rgba(94, 231, 255, 0.65) 358deg,
    transparent 360deg
  );
  filter: blur(1px);
  animation: spin 26s linear infinite;
  opacity: 0.5;
}

.hero-main,
.readout {
  position: relative;
  z-index: 1;
}

.kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.kicker-line {
  width: 34px;
  height: 1px;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}

.storm-title {
  display: flex;
  align-items: flex-end;
  gap: clamp(12px, 2vw, 26px);
  flex-wrap: wrap;
  margin: 0;
}

.storm-cn {
  font-family: var(--serif);
  font-size: clamp(76.5px, 11vw, 161px);
  font-weight: 700;
  line-height: 0.88;
  letter-spacing: 0.02em;
  text-shadow: 0 0 60px rgba(94, 231, 255, 0.12);
}

.storm-en {
  padding-bottom: 10px;
  font-family: var(--mono);
  font-size: clamp(12px, 1.15vw, 16px);
  letter-spacing: 0.46em;
  color: var(--cyan);
  white-space: nowrap;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0 20px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border: 1px solid var(--level);
  background: color-mix(in srgb, var(--level) 13%, transparent);
  color: color-mix(in srgb, var(--level) 78%, #fff);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.badge--ghost {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.02);
  color: var(--ink-3);
}

.badge--ghost::before {
  display: none;
}

.lede {
  max-width: 56ch;
  margin: 0 0 26px;
  font-size: clamp(16.5px, 1.15vw, 18.5px);
  line-height: 1.85;
  color: var(--ink-2);
}

.lede b {
  color: var(--ink);
  font-weight: 700;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: var(--ink-3);
}

.hero-meta b {
  color: var(--ink);
  font-weight: 600;
}

/* readout */
.readout {
  position: relative;
  padding: 20px 22px 16px;
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(155deg, rgba(15, 32, 48, 0.92), rgba(7, 14, 22, 0.82));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 30px 80px -40px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(94, 231, 255, 0.04) inset;
}

.readout::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: 42%;
  height: 1px;
  background: linear-gradient(90deg, var(--cyan), transparent);
  box-shadow: 0 0 14px rgba(94, 231, 255, 0.5);
}

.readout::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 10px;
  width: 7px;
  height: 7px;
  border-top: 1px solid var(--line-strong);
  border-right: 1px solid var(--line-strong);
}

.readout-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.readout-label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.24em;
  color: var(--cyan);
}

.readout-head time {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
}

.readout-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.ro {
  padding: 14px 0 12px;
  border-bottom: 1px solid var(--line);
}

.ro:nth-child(odd):not(.ro--wide) {
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

.ro:nth-child(even) {
  padding-right: 14px;
}

.ro--wide {
  grid-column: 1 / -1;
  padding-left: 0 !important;
  border-left: 0 !important;
}

.ro-label {
  display: block;
  margin-bottom: 5px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: var(--ink-3);
}

.ro-value {
  display: block;
  font-family: var(--mono);
  font-size: clamp(22.5px, 2vw, 28.5px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.ro-value--sm {
  font-size: 19px;
}

.ro small {
  display: block;
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--ink-3);
}

.readout-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 13px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--ink-3);
}

.feed {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #8fd8e8;
}

.feed-bar {
  position: relative;
  display: inline-block;
  width: 22px;
  height: 3px;
  background: rgba(94, 231, 255, 0.16);
  overflow: hidden;
}

.feed-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 40%;
  background: var(--cyan);
  animation: feed 1.8s ease-in-out infinite;
}

.countdown b {
  color: var(--ink);
  font-weight: 600;
}

/* ============ TICKER ============ */

.ticker {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(7, 16, 25, 0.58);
  overflow: hidden;
}

.ticker-inner {
  display: flex;
  gap: 0;
  width: max-content;
  min-width: 100%;
  padding: 12px var(--pad);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.13em;
  color: var(--ink-3);
  white-space: nowrap;
}

.ticker-inner span {
  display: inline-flex;
  align-items: center;
}

.ticker-inner span + span::before {
  content: "/";
  margin: 0 18px;
  font-size: 10px;
  color: var(--cyan);
  opacity: 0.55;
  transform: translateY(-1px);
}

.ticker-inner b {
  margin-left: 7px;
  color: var(--ink-2);
  font-weight: 600;
}

/* ============ SECTION FRAME ============ */

.section {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(58px, 8vw, 112px) var(--pad);
}

.section + .section {
  border-top: 1px solid var(--line);
}

.section-head {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) minmax(250px, 380px);
  gap: clamp(16px, 2.4vw, 34px);
  align-items: end;
  margin-bottom: clamp(28px, 4vw, 46px);
}

.sec-num {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-strong);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--cyan);
}

.eyebrow {
  margin: 0 0 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.3em;
  color: var(--ink-3);
  text-transform: uppercase;
}

.section-title h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(34px, 4vw, 53px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: 0.01em;
}

.section-desc {
  margin: 0;
  padding-left: 16px;
  border-left: 1px solid var(--line-strong);
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--ink-2);
}

/* ============ MAP ============ */

.map-shell {
  position: relative;
  border: 1px solid var(--line-strong);
  background: var(--bg-2);
}

.map-toolbar {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 500;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
}

.map-toolbar > * {
  pointer-events: auto;
}

.agency-switch {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  background: rgba(5, 10, 16, 0.84);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.agency-switch::-webkit-scrollbar {
  display: none;
}

.agency-btn {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid transparent;
  background: transparent;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.agency-btn:hover {
  color: var(--ink);
}

.agency-btn[aria-pressed="true"] {
  color: var(--agency-color, var(--cyan));
  border-color: color-mix(in srgb, var(--agency-color, var(--cyan)) 40%, transparent);
  background: color-mix(in srgb, var(--agency-color, var(--cyan)) 12%, transparent);
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  background: rgba(5, 10, 16, 0.84);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
}

.switch input {
  width: 12px;
  height: 12px;
  margin: 0;
  accent-color: var(--cyan);
}

.map {
  height: clamp(400px, 54vw, 610px);
  width: 100%;
  background:
    linear-gradient(rgba(94, 231, 255, 0.04) 1px, transparent 1px) 0 0 / 100% 60px,
    linear-gradient(90deg, rgba(94, 231, 255, 0.04) 1px, transparent 1px) 0 0 / 60px 100%,
    var(--bg-2);
  z-index: 1;
}

.map-noscript {
  margin: 0;
  padding: 16px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--ink-2);
}

.map-legend {
  position: static;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  width: 100%;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  background: rgba(5, 10, 16, 0.82);
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-2);
}

.legend-title {
  color: var(--ink-3);
  letter-spacing: 0.16em;
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.map-legend i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  color: var(--ink-3);
}

.map-legend i[data-level="td"] { color: #8fb3c9; }
.map-legend i[data-level="ts"] { color: #5ce0b0; }
.map-legend i[data-level="sts"] { color: #ffd166; }
.map-legend i[data-level="ty"] { color: #ff9f43; }
.map-legend i[data-level="sty"] { color: #ff6b6b; }
.map-legend i[data-level="super"] { color: #ff3d81; }

.map-credit {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  margin: 0;
  padding: 7px 12px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  background: rgba(5, 10, 16, 0.6);
}

/* leaflet dark skin */
.leaflet-container {
  background: var(--bg-2);
  font-family: var(--sans);
  outline: none;
}

/* 把 Esri 深灰底图压暗，和页面底色融为一体 */
.leaflet-tile-pane {
  filter: brightness(0.66) saturate(0.72) contrast(1.06);
}

.leaflet-control-zoom a {
  background: rgba(10, 22, 34, 0.94) !important;
  color: #cfe3ef !important;
  border-color: var(--line-strong) !important;
}

.leaflet-control-zoom a:hover {
  background: #10283a !important;
}

.leaflet-control-attribution {
  background: rgba(5, 9, 15, 0.78) !important;
  color: #63798b !important;
  font-family: var(--mono);
  font-size: 10px !important;
}

.leaflet-control-attribution a {
  color: #8aa6ba !important;
}

.leaflet-popup-content-wrapper {
  border-radius: 2px;
  border: 1px solid var(--line-strong);
  background: #081422;
  color: var(--ink);
  box-shadow: 0 20px 50px -20px #000;
}

.leaflet-popup-tip {
  background: #081422;
  border: 1px solid var(--line-strong);
}

.leaflet-popup-content {
  margin: 12px 14px;
  font-size: 13px;
  line-height: 1.6;
}

.popup-title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.popup-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.popup-time {
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 11px;
  margin-bottom: 8px;
}

.popup-grid {
  display: grid;
  grid-template-columns: auto auto;
  gap: 2px 14px;
  font-size: 12px;
}

.popup-grid span {
  color: var(--ink-3);
}

.popup-grid b {
  font-family: var(--mono);
  font-weight: 600;
}

/* storm marker */
.storm-marker {
  position: relative;
  color: var(--level);
}

.storm-marker__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid currentColor;
  animation: markerPulse 2.6s ease-out infinite;
}

.storm-marker__core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 3px rgba(5, 9, 15, 0.85), 0 0 20px currentColor;
}

.distance-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: 14px;
  background: var(--line);
  border: 1px solid var(--line);
}

.distance-item {
  padding: 12px 14px;
  background: var(--bg);
}

.distance-item span {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  color: var(--ink-3);
}

.distance-item b {
  display: block;
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

/* ============ PANELS / TABLES ============ */

.panel {
  position: relative;
  margin: 0;
  padding: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(11, 24, 37, 0.66), rgba(6, 13, 21, 0.58));
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-kicker {
  margin: 0 0 4px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--ink-3);
}

.panel-head h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 22.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.panel-tag {
  padding: 3px 8px;
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-3);
  white-space: nowrap;
}

.panel-note,
.panel-side {
  margin: 12px 0 0;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-3);
}

.panel-side {
  margin: 0;
  max-width: 30ch;
  text-align: right;
}

.nowrap {
  white-space: nowrap;
}

.forecast-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.82fr);
  gap: 16px;
}

.chart-wrap {
  position: relative;
  width: 100%;
}

.chart {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart .grid-line {
  stroke: rgba(150, 192, 220, 0.12);
  stroke-width: 1;
}

.chart .axis-line {
  stroke: rgba(150, 192, 220, 0.28);
  stroke-width: 1;
}

.chart .axis-text {
  fill: #6d8294;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.chart .threshold-text {
  fill: rgba(150, 192, 220, 0.5);
  font-family: var(--mono);
  font-size: 9px;
}

.chart .threshold-line {
  stroke: rgba(150, 192, 220, 0.16);
  stroke-dasharray: 2 5;
}

.chart .series-line {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.chart .series-line--forecast {
  stroke-dasharray: 5 5;
  stroke-width: 1.6;
  opacity: 0.9;
}

.chart .series-dot {
  stroke: #05090f;
  stroke-width: 1.5;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  padding-top: 2px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-2);
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.chart-legend i {
  width: 12px;
  height: 2px;
  background: currentColor;
}

.table-scroll {
  max-height: 430px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(94, 231, 255, 0.25) transparent;
}

.table-scroll--tall {
  max-height: 560px;
}

.table-scroll::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.table-scroll::-webkit-scrollbar-thumb {
  background: rgba(94, 231, 255, 0.2);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-strong);
  background: #081320;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  text-align: left;
  white-space: nowrap;
}

.data-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  white-space: nowrap;
}

.data-table tbody tr:hover td {
  background: rgba(94, 231, 255, 0.035);
  color: var(--ink);
}

.data-table .num {
  text-align: right;
  font-family: var(--mono);
}

.data-table .empty {
  padding: 34px 10px;
  text-align: center;
  color: var(--ink-3);
}

.data-table time,
.data-table .mono {
  font-family: var(--mono);
  font-size: 12px;
}

.level-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.level-chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

/* ============ SCIENCE ============ */

.science-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  gap: 16px;
  align-items: start;
}

.structure-panel {
  position: sticky;
  top: 88px;
}

.structure {
  display: block;
  width: 100%;
  height: auto;
}

.structure-grid {
  color: rgba(150, 192, 220, 0.18);
}

.structure-bands {
  transform-origin: 280px 230px;
  animation: bands 60s linear infinite;
}

.structure-labels text {
  font-family: var(--mono);
  letter-spacing: 0.08em;
}

.sci-card {
  position: relative;
  padding: 18px 2px 20px 44px;
  border-top: 1px solid var(--line);
}

.sci-card:first-child {
  border-top: 0;
  padding-top: 0;
}

.sci-card:first-child .sci-index {
  top: 0;
}

.sci-index {
  position: absolute;
  left: 0;
  top: 18px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line-strong);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--cyan);
}

.sci-card h3 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
}

.sci-card p {
  margin: 0 0 10px;
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--ink-2);
}

.sci-list {
  display: grid;
  gap: 6px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.sci-list li {
  display: flex;
  gap: 10px;
  font-size: 13.5px;
  line-height: 1.6;
}

.sci-list b {
  flex: 0 0 84px;
  color: var(--ink);
  font-weight: 600;
}

.sci-list span {
  color: var(--ink-3);
}

.sci-em {
  margin: 10px 0 0 !important;
  padding-left: 12px;
  border-left: 2px solid var(--amber);
  color: #e6c79a !important;
  font-size: 13.5px !important;
}

.scale-panel {
  margin-top: 16px;
}

.intensity-scale {
  position: relative;
  margin: 34px 0 18px;
  padding-top: 4px;
}

.scale-track {
  display: flex;
  height: 12px;
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
}

.scale-seg {
  height: 100%;
  min-width: 2px;
}

.scale-seg + .scale-seg {
  border-left: 1px solid rgba(5, 9, 15, 0.75);
}

.scale-ticks {
  position: relative;
  height: 14px;
  margin-top: 7px;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--ink-3);
}

.scale-ticks span {
  position: absolute;
  top: 0;
}

.scale-marker {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  transition: left 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.scale-marker__pin {
  display: block;
  width: 1px;
  height: 22px;
  background: #fff;
  box-shadow: 0 0 10px #fff;
}

.scale-marker__label {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 6px;
  background: #fff;
  color: #04121a;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.scale-table .dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  vertical-align: 1px;
}

.dot--td { background: #8fb3c9; }
.dot--ts { background: #5ce0b0; }
.dot--sts { background: #ffd166; }
.dot--ty { background: #ff9f43; }
.dot--sty { background: #ff6b6b; }
.dot--super { background: #ff3d81; }

.mini-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: 16px;
  border: 1px solid var(--line);
  background: var(--line);
}

.mini-card {
  padding: 17px 16px;
  background: var(--bg);
}

.mini-card h3 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
}

.mini-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.75;
  color: var(--ink-3);
}

/* ============ TIMELINE ============ */

.timeline-panel {
  padding: 0;
}

.timeline-table th:first-child,
.timeline-table td:first-child {
  padding-left: 20px;
}

.timeline-table th:last-child,
.timeline-table td:last-child {
  padding-right: 20px;
}

/* ============ SAFETY ============ */

.safety-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}

.safety-item {
  position: relative;
  padding: 24px 22px 26px;
  background:
    linear-gradient(165deg, rgba(11, 24, 37, 0.72), rgba(6, 12, 19, 0.85));
}

.safety-num {
  display: block;
  margin-bottom: 24px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--cyan);
}

.safety-item h3 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
}

.safety-item p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--ink-2);
}

/* ============ FOOTER ============ */

.site-foot {
  border-top: 1px solid var(--line-strong);
  background: rgba(4, 8, 13, 0.72);
  padding: clamp(38px, 5vw, 64px) var(--pad) 26px;
}

.foot-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: clamp(24px, 4vw, 56px);
  max-width: var(--max);
  margin: 0 auto;
}

.foot-brand {
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.2em;
  color: var(--cyan);
}

.foot-desc {
  max-width: 38ch;
  margin: 0;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--ink-3);
}

.foot-label {
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  color: var(--ink-2);
}

.foot-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-3);
}

.foot-list a {
  color: #9fd8e6;
  border-bottom: 1px solid rgba(94, 231, 255, 0.25);
}

.foot-list a:hover {
  color: var(--cyan);
}

.foot-warn {
  color: #c9a06a;
}

.foot-base {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  max-width: var(--max);
  margin: 34px auto 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: #4d6172;
}

/* ============ REVEAL ============ */

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  .reveal.is-in {
    opacity: 1;
    transform: none;
  }
}

/* ============ ANIMATIONS ============ */

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes bands {
  to { transform: rotate(360deg); }
}

@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(94, 231, 255, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(94, 231, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(94, 231, 255, 0); }
}

@keyframes markerPulse {
  0% { transform: scale(0.55); opacity: 0.9; }
  80% { transform: scale(1.5); opacity: 0; }
  100% { transform: scale(1.5); opacity: 0; }
}

@keyframes feed {
  0% { transform: translateX(-100%); }
  60%, 100% { transform: translateX(260%); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sweep,
  .structure-bands,
  .live-dot,
  .feed-bar::after,
  .storm-marker__ring {
    animation: none !important;
  }
  .scale-marker { transition: none; }
}

/* ============ RESPONSIVE ============ */

@media (max-width: 1080px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 34px;
    padding-top: 56px;
  }

  .hero-visual {
    width: 100%;
    right: -8%;
    opacity: 0.12;
  }

  .readout {
    max-width: 620px;
  }

  .section-head {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .section-desc {
    grid-column: 2;
    max-width: 58ch;
  }

  .forecast-grid,
  .science-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .structure-panel {
    position: static;
  }

  .structure {
    max-width: 560px;
    margin: 0 auto;
  }

  .mini-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .safety-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .foot-grid {
    grid-template-columns: 1fr 1fr;
  }

  .foot-grid > div:first-child {
    grid-column: 1 / -1;
  }

  .distance-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* 窄屏把横向滚动的 ticker 改成两列信息网格，避免内容被截断 */
  .ticker-inner {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 18px;
    width: 100%;
    min-width: 0;
    white-space: normal;
  }

  .ticker-inner span {
    justify-content: flex-start;
    gap: 8px;
  }

  .ticker-inner span + span::before {
    display: none;
  }
}

@media (max-width: 700px) {
  .site-nav {
    display: none;
  }
}

@media (max-width: 640px) {
  html {
    scroll-padding-top: 76px;
  }

  .site-head {
    height: 58px;
  }

  .head-live {
    font-size: 10.5px;
    letter-spacing: 0.08em;
  }

  .storm-cn {
    font-size: clamp(68px, 21vw, 102px);
  }

  .storm-en {
    padding-bottom: 6px;
    letter-spacing: 0.32em;
  }

  .hero {
    padding-top: 42px;
  }

  .hero-meta {
    gap: 8px 18px;
  }

  .readout {
    padding: 16px 16px 13px;
  }

  .ro-value {
    font-size: 21px;
  }

  .ro-value--sm {
    font-size: 17px;
  }

  .section-head {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .sec-num {
    width: 32px;
    height: 32px;
    font-size: 11px;
  }

  .section-desc {
    grid-column: 1;
    padding-left: 0;
    border-left: 0;
  }

  .map-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .switch {
    align-self: flex-start;
  }

  .map {
    height: 430px;
  }

  .map-legend {
    gap: 5px 9px;
    font-size: 10px;
  }

  .panel {
    padding: 15px;
  }

  .panel-head {
    flex-direction: column;
    gap: 8px;
  }

  .panel-side {
    text-align: left;
    max-width: none;
  }

  /* 移动端时间线只保留最关键的列，避免横向溢出 */
  .timeline-table th:nth-child(2),
  .timeline-table td:nth-child(2),
  .timeline-table th:nth-child(4),
  .timeline-table td:nth-child(4),
  .timeline-table th:nth-child(7),
  .timeline-table td:nth-child(7) {
    display: none;
  }

  .timeline-table th,
  .timeline-table td {
    padding: 8px 6px;
    font-size: 12px;
  }

  .structure-labels {
    font-size: 15px;
  }

  .chart .axis-text {
    font-size: 11px;
  }

  .safety-num {
    margin-bottom: 16px;
  }

  .safety-grid,
  .mini-grid {
    grid-template-columns: 1fr;
  }

  .foot-grid {
    grid-template-columns: 1fr;
  }

  .foot-base {
    flex-direction: column;
    gap: 4px;
  }

  .ticker-inner {
    padding-left: 16px;
    padding-right: 16px;
  }
}
