:root {
  color-scheme: dark;
  --bg: #07111f;
  --bg-deep: #040a13;
  --panel: rgba(13, 28, 47, .84);
  --panel-soft: rgba(15, 35, 57, .66);
  --line: rgba(160, 195, 218, .15);
  --line-strong: rgba(160, 195, 218, .28);
  --text: #eff7fa;
  --muted: #91a9b8;
  --faint: #5f7484;
  --orange: #ffb86b;
  --mint: #5ed7d1;
  --blue: #6db5ff;
  --purple: #b8a1ff;
  --red: #ff7d8d;
  --shadow: 0 24px 70px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg-deep); }
body { margin: 0; background: radial-gradient(circle at 82% 0%, rgba(53, 112, 150, .16), transparent 32rem), linear-gradient(160deg, #091727 0%, var(--bg-deep) 58%); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
a { color: inherit; }
button, select { font: inherit; }
.app-shell { max-width: 1480px; margin: 0 auto; padding: 0 34px 30px; }
.topbar { min-height: 84px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand-lockup, .topbar-actions, .card-heading, .hero-meta, .panel-actions, .timeline-legend, .map-caption { display: flex; align-items: center; }
.brand-lockup { gap: 13px; }
.brand-mark { position: relative; width: 32px; height: 32px; }
.brand-mark span { position: absolute; width: 19px; height: 19px; border-radius: 50%; top: 3px; left: 4px; background: var(--orange); box-shadow: 0 0 22px rgba(255, 184, 107, .64); }
.brand-mark i { position: absolute; left: 1px; bottom: 2px; width: 29px; height: 8px; border: 2px solid var(--mint); border-left: 0; border-right: 0; border-radius: 50%; transform: rotate(-8deg); }
.eyebrow { color: var(--muted); font-size: 11px; font-weight: 750; letter-spacing: .16em; margin: 0 0 6px; }
.eyebrow.accent { color: var(--orange); }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 15px; letter-spacing: -.02em; margin: 0; }
h2 { font-size: clamp(32px, 4.2vw, 63px); line-height: .98; letter-spacing: -.055em; max-width: 620px; margin-bottom: 18px; }
h3 { font-size: 18px; letter-spacing: -.025em; margin: 0; }
.topbar-actions { gap: 14px; }
.version-badge { color: var(--orange); border: 1px solid rgba(255, 184, 107, .34); border-radius: 999px; padding: 4px 7px; font-size: 9px; letter-spacing: .08em; }
.live-badge { color: var(--mint); font-size: 12px; letter-spacing: .03em; }
.pulse-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 4px rgba(94, 215, 209, .12), 0 0 16px var(--mint); vertical-align: 1px; }
.ghost-button { background: transparent; color: var(--text); border: 1px solid var(--line-strong); border-radius: 9px; padding: 8px 11px; cursor: pointer; transition: background .18s, border-color .18s; }
.ghost-button:hover { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.4); }
.ghost-button span { color: var(--orange); font-size: 16px; margin-left: 4px; }
.hero-grid { min-height: 330px; display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 30px; align-items: center; position: relative; overflow: hidden; }
.hero-grid::after { content: ""; position: absolute; left: -14%; right: 45%; bottom: 18px; height: 1px; background: linear-gradient(90deg, transparent, rgba(94, 215, 209, .5), transparent); }
.hero-copy { position: relative; z-index: 1; padding: 44px 0 46px; }
.hero-text { color: var(--muted); max-width: 500px; line-height: 1.7; font-size: 16px; }
.hero-meta { gap: 18px; color: var(--faint); font-size: 12px; margin-top: 26px; }
.hero-orbit { height: 300px; position: relative; transform: rotate(-13deg); }
.orbit { position: absolute; border: 1px solid rgba(109, 181, 255, .24); border-radius: 50%; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.orbit-one { width: 270px; height: 160px; }
.orbit-two { width: 370px; height: 220px; transform: translate(-50%, -50%) rotate(38deg); border-color: rgba(94, 215, 209, .18); }
.sun-core { position: absolute; width: 90px; height: 90px; top: 50%; left: 50%; border-radius: 50%; transform: translate(-50%, -50%); background: radial-gradient(circle at 35% 30%, #ffe2ad 0, var(--orange) 28%, #d87846 72%, #723c45 100%); box-shadow: 0 0 32px rgba(255, 184, 107, .62), 0 0 95px rgba(255, 135, 65, .27); }
.sun-core::before, .sun-core::after { content: ""; position: absolute; border-radius: 50%; background: rgba(110, 40, 38, .3); }
.sun-core::before { width: 15px; height: 11px; top: 24px; left: 21px; }
.sun-core::after { width: 9px; height: 8px; top: 57px; left: 53px; }
.earth-orb { width: 27px; height: 27px; position: absolute; top: 26px; right: 40px; border-radius: 50%; background: radial-gradient(circle at 32% 30%, #c4efff, #2f8bd3 44%, #113c73 82%); box-shadow: 0 0 25px rgba(109, 181, 255, .6); }
.earth-orb span { position: absolute; width: 12px; height: 5px; border-radius: 50%; background: rgba(153, 238, 205, .78); top: 8px; left: 4px; transform: rotate(-22deg); }
.signal { position: absolute; border: 1px solid rgba(94, 215, 209, .45); border-left: 0; border-right: 0; border-radius: 50%; width: 100px; height: 55px; }
.signal-one { top: 4px; right: -4px; transform: rotate(-26deg); }
.signal-two { top: -20px; right: -22px; transform: rotate(-26deg) scale(.72); opacity: .65; }
.status-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; }
.status-card, .panel { background: linear-gradient(145deg, rgba(18, 39, 63, .84), rgba(8, 22, 39, .74)); border: 1px solid var(--line); box-shadow: var(--shadow); }
.status-card { min-height: 155px; border-radius: 13px; padding: 16px 18px 14px; position: relative; overflow: hidden; }
.status-card::after { content: ""; position: absolute; width: 120px; height: 120px; right: -64px; bottom: -72px; border-radius: 50%; border: 1px solid rgba(255,255,255,.1); }
.solar-card { border-top: 2px solid var(--orange); }
.geomag-card { border-top: 2px solid var(--mint); }
.proton-card { border-top: 2px solid var(--purple); }
.cosmic-card { border-top: 2px solid var(--blue); }
.card-heading { gap: 8px; color: var(--muted); font-size: 13px; }
.card-icon { color: var(--orange); font-size: 19px; line-height: 1; }
.geomag-card .card-icon { color: var(--mint); }
.proton-card .card-icon { color: var(--purple); }
.cosmic-card .card-icon { color: var(--blue); }
.source-tag { margin-left: auto; border: 1px solid var(--line); border-radius: 999px; color: var(--faint); font-size: 9px; letter-spacing: .06em; padding: 3px 6px; }
.metric-line { display: flex; align-items: baseline; gap: 9px; margin: 18px 0 7px; }
.metric-line strong { color: var(--text); font-size: 32px; letter-spacing: -.06em; }
.metric-line span { color: var(--orange); font-size: 12px; }
.geomag-card .metric-line span { color: var(--mint); }
.proton-card .metric-line span { color: var(--purple); }
.cosmic-card .metric-line span { color: var(--blue); }
.metric-detail { color: var(--muted); font-size: 11px; min-height: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-bars { height: 27px; display: flex; gap: 3px; align-items: end; margin-top: 14px; opacity: .9; }
.mini-bars span { flex: 1; min-width: 3px; height: 30%; border-radius: 2px 2px 0 0; background: linear-gradient(180deg, var(--orange), rgba(255,184,107,.17)); }
.scale-track { height: 5px; background: rgba(255,255,255,.07); margin-top: 15px; border-radius: 9px; overflow: hidden; }
.scale-track span { display: block; height: 100%; width: 18%; background: linear-gradient(90deg, var(--mint), var(--orange), var(--red)); border-radius: inherit; transition: width .5s ease; }
.scale-labels { display: flex; justify-content: space-between; color: var(--faint); font-size: 9px; margin-top: 6px; }
.sparkline { height: 35px; margin-top: 9px; display: flex; align-items: end; gap: 3px; }
.sparkline span { flex: 1; min-width: 3px; height: 30%; background: linear-gradient(180deg, var(--purple), rgba(184,161,255,.09)); border-radius: 2px 2px 0 0; }
.inline-link, .source-link { color: var(--blue); text-decoration: none; font-size: 11px; }
.inline-link { display: inline-block; margin-top: 13px; }
.inline-link:hover, .source-link:hover { color: #c5e3ff; text-decoration: underline; }
.main-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(330px, .9fr); gap: 13px; margin-top: 13px; }
.lower-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(330px, .9fr); gap: 13px; margin-top: 13px; }
.panel { border-radius: 13px; padding: 22px; min-width: 0; }
.panel-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 20px; }
.panel-header .eyebrow { margin-bottom: 6px; }
.timeline-chart { position: relative; height: 245px; padding: 8px 0 26px 28px; overflow: hidden; }
.chart-y-labels { position: absolute; left: 0; top: 12px; bottom: 38px; display: flex; flex-direction: column; justify-content: space-between; color: var(--faint); font-size: 10px; }
.chart-gridlines { position: absolute; top: 13px; right: 0; bottom: 38px; left: 30px; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.chart-gridlines i { display: block; border-top: 1px dashed rgba(145, 169, 184, .12); }
.xray-chart { position: relative; display: block; z-index: 1; height: 185px; width: 100%; overflow: visible; }
.chart-x-labels { position: absolute; left: 31px; right: 0; bottom: 11px; display: flex; justify-content: space-between; color: var(--faint); font-size: 10px; }
.chart-empty { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: var(--faint); font-size: 12px; z-index: 2; }
.chart-empty.hidden { display: none; }
.timeline-legend { flex-wrap: wrap; gap: 18px; border-top: 1px solid var(--line); padding-top: 14px; color: var(--muted); font-size: 11px; }
.legend-line { display: inline-block; width: 20px; border-top: 2px solid var(--orange); vertical-align: 3px; margin-right: 6px; }
.legend-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--mint); vertical-align: 1px; margin-right: 6px; }
.muted { color: var(--faint); }
.event-list, .quake-list { display: flex; flex-direction: column; }
.event-row { display: grid; grid-template-columns: 72px 1fr auto; gap: 12px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line); }
.event-row:last-child, .quake-row:last-child { border-bottom: 0; }
.event-kind { font-size: 10px; letter-spacing: .09em; color: var(--orange); }
.event-kind.cme { color: var(--purple); }
.event-kind.sep { color: var(--mint); }
.event-title { font-size: 13px; color: var(--text); }
.event-sub { color: var(--muted); font-size: 10px; margin-top: 4px; }
.event-time { color: var(--faint); font-size: 10px; white-space: nowrap; }
.panel-footnote { color: var(--faint); border-top: 1px solid var(--line); padding-top: 12px; margin-top: 10px; font-size: 10px; line-height: 1.55; }
.quake-map { height: 380px; border-radius: 9px; overflow: hidden; background: #091725; border: 1px solid var(--line); }
.leaflet-container { background: #091725; font-family: inherit; }
.leaflet-tile { filter: saturate(.72) brightness(.72) contrast(1.04) hue-rotate(160deg); }
.leaflet-control-attribution { background: rgba(5, 15, 27, .72) !important; color: #788f9d !important; font-size: 9px !important; }
.leaflet-control-attribution a { color: #a8cbe0 !important; }
.leaflet-interactive { filter: drop-shadow(0 0 4px rgba(255, 125, 141, .5)); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: #0c2035; color: var(--text); border: 1px solid var(--line-strong); }
.leaflet-popup-content { font-size: 12px; line-height: 1.5; }
.map-caption { justify-content: space-between; color: var(--faint); font-size: 10px; margin-top: 11px; }
.map-legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--red); margin-right: 6px; }
.panel-actions { gap: 15px; }
.filter-group { display: inline-flex; align-items: center; gap: 6px; }
.filter-group label { color: var(--faint); font-size: 10px; }
.count-chip { color: var(--mint); border: 1px solid rgba(94, 215, 209, .3); border-radius: 999px; padding: 4px 8px; font-size: 10px; }
.select-control { color: var(--muted); background: #0d263f; border: 1px solid var(--line-strong); border-radius: 7px; padding: 6px 8px; font-size: 11px; }
.quake-row { display: grid; grid-template-columns: 46px minmax(0,1fr) auto; gap: 11px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.quake-mag { color: var(--orange); font-weight: 720; font-size: 18px; letter-spacing: -.04em; }
.quake-place { color: var(--text); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quake-meta { color: var(--muted); font-size: 10px; margin-top: 4px; }
.quake-time { color: var(--faint); font-size: 10px; white-space: nowrap; }
.loading-row, .empty-row { color: var(--faint); padding: 32px 0; text-align: center; font-size: 12px; }
.source-block { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: rgba(0, 0, 0, .12); }
.source-block-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.source-block-header a { color: var(--text); font-size: 11px; text-decoration: none; }
.source-block-header a:hover { color: var(--blue); }
.source-status { color: var(--muted); font-size: 10px; white-space: nowrap; }
.count-chip.connected { color: var(--mint); border-color: rgba(94, 215, 209, .55); }
.automation-panel { margin-top: 13px; }
.automation-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr); gap: 13px; }
.automation-summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.automation-summary > div { min-height: 94px; padding: 15px; background: rgba(11, 29, 48, .92); }
.automation-summary span, .automation-summary small { display: block; color: var(--faint); font-size: 10px; }
.automation-summary strong { display: block; margin-top: 10px; color: var(--text); font-size: 18px; letter-spacing: -.03em; }
.automation-summary small { margin-top: 6px; color: var(--muted); line-height: 1.4; }
.automation-sources { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: rgba(0, 0, 0, .12); }
.automation-source-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.automation-source-row:last-child { border-bottom: 0; }
.automation-source-row strong, .automation-source-row small { display: block; }
.automation-source-row strong { color: var(--text); font-size: 11px; }
.automation-source-row small, .automation-source-row time { color: var(--faint); font-size: 9px; margin-top: 4px; }
.source-run-state { font-size: 10px; color: var(--muted); }
.source-run-state.ok { color: var(--mint); }
.source-run-state.error { color: var(--red); }
.source-run-state.skipped { color: var(--orange); }
.automation-latest { margin-top: 13px; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: rgba(0, 0, 0, .12); }
.automation-event-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.automation-event-row:last-child { border-bottom: 0; }
.automation-event-kind { font-size: 10px; color: var(--orange); }
.automation-event-kind.health { color: var(--purple); }
.automation-event-row strong, .automation-event-row small { display: block; }
.automation-event-row strong { color: var(--text); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.automation-event-row a { color: inherit; text-decoration: none; }
.automation-event-row a:hover { color: var(--blue); text-decoration: underline; }
.automation-event-row small, .automation-event-row time { color: var(--faint); font-size: 9px; margin-top: 4px; }
.cwa-panel { margin-top: 13px; }
.cwa-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .85fr); gap: 13px; }
.cwa-swoo-block, .cwa-data-block { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: rgba(0, 0, 0, .12); }
.cwa-product-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); }
.cwa-product { min-height: 70px; padding: 13px; background: rgba(11, 29, 48, .92); text-decoration: none; transition: background .18s; }
.cwa-product:hover { background: rgba(94, 215, 209, .1); }
.cwa-product strong, .cwa-product span { display: block; }
.cwa-product strong { color: var(--text); font-size: 12px; }
.cwa-product span { margin-top: 6px; color: var(--faint); font-size: 10px; line-height: 1.4; }
.cwa-image-row { display: grid; grid-template-columns: minmax(180px, .85fr) 1.15fr; gap: 14px; align-items: center; padding: 14px; }
.cwa-image-row a { display: block; }
.cwa-image-row img { display: block; width: 100%; height: 108px; object-fit: contain; object-position: center; border: 1px solid var(--line); border-radius: 6px; background: #091725; }
.cwa-image-row strong { color: var(--mint); font-size: 12px; }
.cwa-image-row p { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.cwa-metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); }
.cwa-metric-grid-single { grid-template-columns: 1fr; }
.cwa-metric-grid div { min-height: 112px; padding: 15px; background: rgba(11, 29, 48, .92); }
.cwa-metric-grid span, .cwa-metric-grid small { display: block; color: var(--faint); font-size: 10px; }
.cwa-metric-grid strong { display: block; margin-top: 12px; color: var(--text); font-size: 22px; letter-spacing: -.04em; }
.cwa-metric-grid small { margin-top: 6px; color: var(--muted); line-height: 1.4; }
.cwa-data-links { display: flex; flex-wrap: wrap; gap: 8px; padding: 13px 14px; }
.cwa-data-links a { color: var(--blue); font-size: 10px; text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: 5px 8px; }
.cwa-data-links a:hover { border-color: rgba(94, 215, 209, .45); color: #c5e3ff; }
.research-strip { margin-top: 13px; padding: 24px; border: 1px solid rgba(94, 215, 209, .2); border-radius: 13px; background: radial-gradient(circle at 100% 0, rgba(94, 215, 209, .11), transparent 29rem), rgba(9, 28, 43, .62); display: flex; justify-content: space-between; align-items: center; gap: 30px; }
.research-strip h3 { font-size: 27px; margin-bottom: 8px; }
.research-strip p:not(.eyebrow) { color: var(--muted); font-size: 13px; max-width: 610px; line-height: 1.6; margin-bottom: 0; }
.research-links { display: grid; grid-template-columns: repeat(3, minmax(120px, 1fr)); gap: 9px; min-width: 390px; }
.research-links a { border: 1px solid var(--line); border-radius: 9px; padding: 13px; text-decoration: none; background: rgba(0,0,0,.12); transition: background .18s, border-color .18s; }
.research-links a:hover { background: rgba(94, 215, 209, .08); border-color: rgba(94, 215, 209, .42); }
.research-links span, .research-links small { display: block; }
.research-links span { color: var(--text); font-size: 12px; }
.research-links small { color: var(--faint); font-size: 10px; margin-top: 5px; }
.research-links b { display: block; color: var(--mint); font-size: 14px; text-align: right; margin-top: 8px; }
.footer { display: flex; justify-content: space-between; color: var(--faint); font-size: 10px; padding: 25px 1px 0; }

@media (max-width: 1100px) {
  .status-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-grid { grid-template-columns: minmax(0, 1fr) 300px; }
  .main-grid, .lower-grid { grid-template-columns: 1fr; }
  .cwa-grid { grid-template-columns: 1fr; }
  .automation-grid { grid-template-columns: 1fr; }
  .research-strip { align-items: flex-start; flex-direction: column; }
  .research-links { width: 100%; min-width: 0; }
}
@media (max-width: 680px) {
  .app-shell { padding: 0 16px 22px; }
  .topbar { min-height: 72px; }
  .topbar-actions .live-badge { display: none; }
  .version-badge { font-size: 8px; }
  .hero-grid { min-height: 370px; grid-template-columns: 1fr; }
  .hero-copy { padding: 48px 0 0; }
  .hero-orbit { height: 170px; margin-top: -10px; transform: scale(.75) rotate(-13deg); transform-origin: 62% 50%; }
  .hero-grid::after { right: 5%; bottom: 10px; }
  .status-grid { grid-template-columns: 1fr; }
  .panel { padding: 17px; }
  .panel-header { margin-bottom: 16px; }
  .panel-header h3 { font-size: 18px; }
  .source-link { white-space: nowrap; }
  .timeline-chart { height: 210px; }
  .xray-chart { height: 155px; }
  .quake-map { height: 300px; min-height: 300px; }
  .research-links { grid-template-columns: 1fr; }
  .cwa-product-grid { grid-template-columns: repeat(2, 1fr); }
  .automation-summary { grid-template-columns: 1fr; }
  .automation-source-row { grid-template-columns: minmax(0, 1fr) auto; }
  .automation-source-row time { display: none; }
  .automation-event-row { grid-template-columns: 42px minmax(0, 1fr); }
  .automation-event-row time { display: none; }
  .cwa-image-row { grid-template-columns: 1fr; }
  .footer { gap: 10px; flex-direction: column; }
}
