:root {
  color-scheme: dark;
  --bg: #0b0c0d;
  --panel: #121315;
  --panel-2: #17191b;
  --raise: #1c1e21;
  --line: #26292d;
  --ink: #e7e5e2;
  --muted: #a4a8ae;
  --dim: #7a7f86;
  --red: #c8102e;
  --red-wash: #1d0d10;
  --gold: #c8a349;
  --link: #7fa8cd;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC",
    system-ui, -apple-system, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.55;
  overflow-x: hidden;
}

.space-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

#stars {
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0.7;
}

.scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.12) 2px,
    rgba(0, 0, 0, 0.12) 3px
  );
  opacity: 0.25;
  mix-blend-mode: multiply;
}

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

/* —— Top command bar —— */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1.25rem;
  background: rgba(18, 19, 21, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: inherit;
  text-decoration: none;
}

.topbar__brand:hover {
  text-decoration: none;
  color: inherit;
}

.topbar__brand img {
  border: 1px solid var(--line);
  background: #0b0c0d;
}

.topbar__name {
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: 5px;
  font-size: 14px;
}

.topbar__code {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--dim);
  border-left: 1px solid var(--line);
  padding-left: 0.65rem;
}

.topbar__status {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 1.2px;
  color: var(--muted);
}

.topbar__status .sep {
  color: var(--line);
}

.sig {
  width: 7px;
  height: 7px;
  background: var(--gold);
  box-shadow: 0 0 0 0 rgba(200, 163, 73, 0.5);
  animation: sig 1.8s infinite;
}

.sig.is-alert {
  background: var(--red);
  animation-name: sig-alert;
}

@keyframes sig {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(200, 163, 73, 0.45);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(200, 163, 73, 0);
  }
}

@keyframes sig-alert {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(200, 16, 46, 0.5);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(200, 16, 46, 0);
  }
}

/* —— Hero：APOD 全幅抢眼 —— */
.hero {
  position: relative;
  min-height: min(88vh, 820px);
  display: grid;
  align-items: end;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  background: var(--bg);
}

.hero__media {
  position: absolute;
  inset: 0;
  background-color: #0b0c0d;
  background-size: cover;
  background-position: center center;
  transform: scale(1.04);
  animation: apod-drift 28s ease-in-out infinite alternate;
  filter: saturate(1.15) contrast(1.08);
}

@keyframes apod-drift {
  from {
    transform: scale(1.04) translate3d(0, 0, 0);
  }
  to {
    transform: scale(1.1) translate3d(-1.5%, -1%, 0);
  }
}

.hero__veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      180deg,
      rgba(11, 12, 13, 0.55) 0%,
      rgba(11, 12, 13, 0.12) 38%,
      rgba(11, 12, 13, 0.2) 58%,
      rgba(11, 12, 13, 0.92) 100%
    ),
    radial-gradient(ellipse at 70% 30%, transparent 0%, rgba(11, 12, 13, 0.25) 70%);
}

.hero__scan {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(200, 163, 73, 0.7), transparent);
  animation: scan 8s linear infinite;
  opacity: 0.85;
  z-index: 1;
}

.hero__inner {
  position: relative;
  z-index: 2;
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.35rem 2.5rem;
}

.hero__brandline {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.hero__brandline img {
  border: 1px solid rgba(38, 41, 45, 0.9);
  background: rgba(11, 12, 13, 0.65);
}

.hero__brand {
  margin: 0;
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 6px;
  color: #f2f0ed;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.65);
}

.hero__product {
  margin: 0.2rem 0 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 2px;
  color: rgba(200, 163, 73, 0.95);
}

.apod-spotlight {
  max-width: 46rem;
  padding: 1.15rem 1.25rem 1.25rem;
  background: linear-gradient(
    135deg,
    rgba(11, 12, 13, 0.72) 0%,
    rgba(18, 19, 21, 0.45) 100%
  );
  border: 1px solid rgba(200, 163, 73, 0.45);
  border-left: 3px solid var(--gold);
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

.apod-spotlight__kicker {
  margin: 0 0 0.55rem;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--gold);
  text-transform: uppercase;
}

.apod-spotlight__title {
  margin: 0;
  font-family: var(--sans);
  font-size: clamp(1.65rem, 4.5vw, 2.65rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: #f7f5f1;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.55);
}

.apod-spotlight__meta {
  margin: 0.75rem 0 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.8px;
  color: rgba(231, 229, 226, 0.78);
}

.hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1.25rem;
}

.chip {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 1px;
  padding: 0.4rem 0.65rem;
  border: 1px solid rgba(38, 41, 45, 0.95);
  background: rgba(11, 12, 13, 0.72);
  color: #d4d6da;
  backdrop-filter: blur(6px);
}

.chip strong {
  color: var(--gold);
  font-weight: 700;
}

.chip.is-alert {
  border-color: var(--red);
  color: #f2e9ea;
  background: rgba(29, 13, 16, 0.85);
}

.chip.is-alert strong {
  color: var(--red);
}

@keyframes scan {
  from {
    top: -2%;
  }
  to {
    top: 102%;
  }
}

/* —— Decks —— */
main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.5rem 1.25rem 3.5rem;
}

.deck {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.deck__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.55rem;
}

.deck__code {
  margin: 0 0 0.35rem;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--red);
}

.deck__head h2 {
  margin: 0;
  font-family: var(--mono);
  font-size: clamp(1.35rem, 3vw, 1.7rem);
  letter-spacing: 0.2em;
  font-weight: 700;
}

.deck__meta,
.deck__lead {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.6px;
  color: var(--dim);
}

.deck__lead {
  margin: 0 0 1.2rem;
  font-family: var(--sans);
  letter-spacing: 0;
  color: var(--muted);
  font-size: 12.5px;
}

.muted {
  color: var(--muted) !important;
  font-size: 11.5px !important;
}

/* —— Geomag —— */
.geomag {
  display: grid;
  gap: 1.25rem;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 1.25rem 1.1rem 1.4rem;
}

@media (min-width: 840px) {
  .geomag {
    grid-template-columns: 280px 1fr;
    align-items: center;
  }
}

.geomag__gauge {
  text-align: center;
}

.gauge {
  width: min(260px, 100%);
  height: auto;
}

.gauge__track {
  fill: none;
  stroke: var(--line);
  stroke-width: 12;
  stroke-linecap: square;
}

.gauge__value {
  fill: none;
  stroke: url(#gArc);
  stroke-width: 12;
  stroke-linecap: square;
  stroke-dasharray: 301.6;
  stroke-dashoffset: 301.6;
  transition: stroke-dashoffset 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

.gauge__num {
  fill: var(--ink);
  font-family: var(--mono);
  font-size: 36px;
  font-weight: 700;
  text-anchor: middle;
}

.gauge__unit {
  fill: var(--dim);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 1.5px;
  text-anchor: middle;
}

.geomag__status {
  margin: 0.15rem 0 0;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--gold);
}

.geomag__status.level-alert {
  color: var(--red);
}

.geomag__impact {
  margin: 0 0 1rem;
  font-size: 14px;
  color: #d0d3d7;
  line-height: 1.5;
  white-space: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
}

.spark {
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 0.7rem 0.8rem 0.45rem;
}

.spark__chart {
  position: relative;
}

.spark svg {
  width: 100%;
  height: 72px;
  display: block;
  cursor: crosshair;
}

.spark__tip {
  position: absolute;
  top: 0.2rem;
  z-index: 2;
  padding: 0.22rem 0.5rem;
  background: rgba(11, 12, 13, 0.94);
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.5px;
  white-space: nowrap;
  pointer-events: none;
}

.spark__tip[data-kind="predicted"] {
  border-color: rgba(127, 168, 205, 0.45);
}

.spark__tip[data-kind="estimated"] {
  border-color: rgba(164, 168, 174, 0.5);
}

.spark__tip[data-kind="observed"] {
  border-color: rgba(200, 163, 73, 0.45);
}

.spark__label {
  margin: 0.4rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.15rem;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 1.1px;
  color: var(--dim);
}

.spark-leg {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.spark-leg::before {
  content: "";
  display: block;
  width: 14px;
  height: 0;
  border-top: 2px solid currentColor;
}

.spark-leg--observed {
  color: var(--gold);
}

.spark-leg--estimated {
  color: #9aa0a6;
}

.spark-leg--estimated::before {
  border-top-width: 1.5px;
  opacity: 0.85;
}

.spark-leg--predicted {
  color: var(--link);
}

.spark-leg--predicted::before {
  border-top-width: 1.5px;
  border-top-style: dotted;
}

.spark-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.spark-line--observed {
  stroke: var(--gold);
  stroke-width: 1.75;
}

.spark-line--estimated {
  stroke: #8b9198;
  stroke-width: 1.5;
  stroke-opacity: 0.95;
}

.spark-line--predicted {
  stroke: var(--link);
  stroke-width: 1.35;
  stroke-dasharray: 1.5 3.5;
  stroke-opacity: 0.85;
}

.spark-area {
  fill: rgba(200, 163, 73, 0.08);
  stroke: none;
  pointer-events: none;
}

.spark-grid {
  stroke: var(--line);
  stroke-width: 1;
  pointer-events: none;
}

.spark-hit {
  cursor: crosshair;
}

.spark-active {
  fill: var(--gold);
  stroke: #0b0c0d;
  stroke-width: 1.25;
  pointer-events: none;
}

.spark-active[data-kind="predicted"] {
  fill: var(--link);
}

.spark-active[data-kind="estimated"] {
  fill: #a4a8ae;
}

/* —— Orbit map —— */
.orbit {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (min-width: 900px) {
  .orbit {
    grid-template-columns: 1fr 280px;
    align-items: stretch;
  }
}

.orbit__svg {
  width: 100%;
  height: auto;
  background:
    radial-gradient(ellipse at 12% 50%, rgba(127, 168, 205, 0.08), transparent 40%),
    var(--panel);
  border: 1px solid var(--line);
}

.orbit__svg .neo-marker {
  cursor: pointer;
  outline: none;
}

.orbit__svg .neo-marker:hover .neo-halo {
  fill-opacity: 0.14 !important;
}

.orbit__svg .neo-marker.is-selected {
  cursor: default;
}

.orbit__detail {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 1.1rem 1.15rem;
  min-height: 200px;
}

.orbit__hint {
  margin: 0;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.8px;
}

.orbit-detail__name {
  margin: 0 0 0.75rem;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.orbit-detail__row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.35rem 0;
  font-size: 12px;
}

.orbit-detail__row span:first-child {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--muted);
}

.orbit-detail__plain {
  margin: 0.9rem 0 0;
  font-size: 12.5px;
  color: #d0d3d7;
  line-height: 1.65;
}

/* —— Launch rail —— */
.rail {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.rail-item {
  background: var(--panel);
}

.rail-item.is-open {
  background: var(--panel-2);
}

.rail-item__hit {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 108px 1fr;
  width: 100%;
  margin: 0;
  padding: 1rem 1.1rem;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.rail-item__hit:disabled {
  cursor: default;
}

.rail-item__hit:not([disabled]):hover {
  background: rgba(255, 255, 255, 0.02);
}

@media (min-width: 720px) {
  .rail-item__hit {
    grid-template-columns: 140px 1fr auto;
    align-items: center;
  }
}

.rail-item__t {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--gold);
}

.rail-item__t strong {
  display: block;
  font-size: 16px;
  color: var(--ink);
  letter-spacing: 0.5px;
  margin-bottom: 0.2rem;
}

.rail-item__body h3 {
  margin: 0 0 0.3rem;
  font-size: 14px;
  font-weight: 700;
}

.rail-item__dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  vertical-align: middle;
}

.rail-item__body p {
  margin: 0.15rem 0;
  color: var(--muted);
  font-size: 12px;
}

.rail-item__teaser {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rail-item.is-open .rail-item__teaser {
  display: none;
}

.rail-item__eta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1.2px;
  color: var(--dim);
  white-space: nowrap;
}

.rail-item__eta em {
  color: var(--red);
  font-style: normal;
}

.rail-item__more {
  padding: 0 1.1rem 1.05rem;
  border-top: 1px solid var(--line);
}

.rail-item__rows {
  display: grid;
  gap: 0.35rem;
  padding-top: 0.85rem;
}

.rail-item__rows > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 12px;
}

.rail-item__rows span {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--dim);
  flex-shrink: 0;
}

.rail-item__rows strong {
  font-weight: 600;
  text-align: right;
}

.rail-item__full {
  margin: 0.75rem 0 0;
  font-size: 12.5px;
  line-height: 1.65;
  color: #d0d3d7;
}

.empty {
  padding: 1.25rem;
  color: var(--muted);
  background: var(--panel);
  border: 1px dashed var(--line);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.8px;
}

.footer {
  margin-top: 3rem;
  border-top: 1px solid var(--line);
  background: var(--panel);
  text-align: center;
  padding: 1.75rem 1.25rem 2.5rem;
  color: var(--muted);
  font-size: 11.5px;
}

.footer p {
  margin: 0.3rem auto;
  max-width: 40rem;
}

.disclaimer {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--gold);
}
