/* ========== niuniu869 status · mission-control theme ========== */
:root {
  --bg: #04060c;
  --panel: rgba(11, 17, 30, 0.82);
  --panel-solid: #0b111e;
  --border: #1b2a44;
  --border-hi: #2e4a75;
  --text: #dbe6f5;
  --dim: #5b6f8e;
  --faint: #33415c;
  --green: #34d399;
  --green-hi: #00ff9d;
  --cyan: #22d3ee;
  --amber: #fbbf24;
  --red: #f87171;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scrollbar-color: var(--faint) var(--bg); }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(52, 211, 153, .25); }

/* ---------- background layers ---------- */
#bg-stars { position: fixed; inset: 0; z-index: -3; }
.bg-grid {
  position: fixed; left: -50%; right: -50%; bottom: -12%; height: 62%;
  z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(rgba(34, 211, 238, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, .07) 1px, transparent 1px);
  background-size: 44px 44px;
  transform: perspective(420px) rotateX(61deg);
  animation: gridflow 9s linear infinite;
  mask-image: linear-gradient(to top, rgba(0,0,0,.9), transparent 85%);
  -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,.9), transparent 85%);
}
@keyframes gridflow { from { background-position-y: 0; } to { background-position-y: 44px; } }
.bg-scan {
  position: fixed; inset: 0; z-index: 60; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.022) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}
.bg-vignette {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse 120% 90% at 50% 0%, transparent 55%, rgba(2,4,9,.75) 100%);
}

/* ---------- layout ---------- */
.wrap { max-width: 1320px; margin: 0 auto; padding: 0 28px 90px; }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 20px 0; border-bottom: 1px solid var(--border);
  font-family: var(--mono); font-size: 13px;
}
.logo-dot {
  width: 12px; height: 12px; border-radius: 3px;
  background: var(--green); box-shadow: 0 0 12px var(--green);
  animation: dotpulse 2.4s ease-in-out infinite;
}
@keyframes dotpulse { 50% { box-shadow: 0 0 22px var(--green-hi), 0 0 4px var(--green); } }
.topbar .brand { letter-spacing: .18em; color: var(--text); font-weight: 700; }
.topbar .brand b { color: var(--green); font-weight: 700; }
.topbar .spacer { flex: 1; }
.topbar .meta { color: var(--dim); letter-spacing: .08em; }
.topbar .meta b { color: var(--cyan); font-weight: 500; }
.badge {
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em;
  padding: 3px 10px; border-radius: 4px; border: 1px solid var(--border-hi);
  color: var(--amber); background: rgba(251, 191, 36, .07);
}

/* ---------- section label ---------- */
.sec-label {
  font-family: var(--mono); font-size: 13px; color: var(--dim);
  letter-spacing: .12em; margin: 46px 0 18px;
}
.sec-label::before { content: "// "; color: var(--amber); }
.sec-label .en { color: var(--faint); margin-left: 10px; font-size: 11px; }

/* ---------- hero ---------- */
.hero { text-align: center; padding: 74px 0 30px; position: relative; }
.hero .tag { font-family: var(--mono); font-size: 13px; letter-spacing: .3em; color: var(--dim); margin-bottom: 22px; }
.hero .tag::before { content: "[ "; color: var(--faint); }
.hero .tag::after { content: " ]"; color: var(--faint); }
.hero-status { display: inline-flex; align-items: center; gap: 26px; }
.hero-orb { position: relative; width: 26px; height: 26px; flex: none; }
.hero-orb i {
  position: absolute; inset: 6px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 18px var(--green);
}
.hero-orb::before, .hero-orb::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 1px solid var(--green); animation: ripple 2.6s ease-out infinite;
}
.hero-orb::after { animation-delay: 1.3s; }
@keyframes ripple { from { transform: scale(.6); opacity: .9; } to { transform: scale(2.6); opacity: 0; } }
.hero-status.warn .hero-orb i { background: var(--amber); box-shadow: 0 0 18px var(--amber); }
.hero-status.warn .hero-orb::before, .hero-status.warn .hero-orb::after { border-color: var(--amber); }
.hero-status.bad .hero-orb i { background: var(--red); box-shadow: 0 0 18px var(--red); }
.hero-status.bad .hero-orb::before, .hero-status.bad .hero-orb::after { border-color: var(--red); }
.hero-status.unknown .hero-orb i { background: var(--dim); box-shadow: 0 0 14px var(--dim); }
.hero-status.unknown .hero-orb::before, .hero-status.unknown .hero-orb::after { border-color: var(--dim); }
.hero h1 {
  font-family: var(--mono); font-weight: 700;
  font-size: clamp(30px, 5.4vw, 62px); letter-spacing: .04em; line-height: 1.1;
  text-shadow: 0 0 34px rgba(52, 211, 153, .35);
}
.hero-status.warn h1 { text-shadow: 0 0 34px rgba(251, 191, 36, .35); }
.hero-status.bad h1 { text-shadow: 0 0 34px rgba(248, 113, 113, .4); }
.hero .zh { margin-top: 14px; font-size: 16px; color: var(--dim); letter-spacing: .5em; text-indent: .5em; }
.hero-stats {
  display: flex; justify-content: center; gap: 0; margin-top: 44px;
  font-family: var(--mono); flex-wrap: wrap;
}
.hstat { padding: 0 34px; border-right: 1px solid var(--border); }
.hstat:last-child { border-right: 0; }
.hstat .v { font-size: 26px; color: var(--green-hi); font-weight: 700; font-variant-numeric: tabular-nums; }
.hstat .v.cy { color: var(--cyan); }
.hstat .v.am { color: var(--amber); }
.hstat .k { font-size: 11px; color: var(--dim); letter-spacing: .16em; margin-top: 6px; }

/* ---------- cards grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 18px; }
.card {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, rgba(14, 21, 38, .88), rgba(7, 11, 20, .92));
  border: 1px solid var(--border); border-radius: 10px;
  padding: 18px 20px 16px;
  transition: border-color .25s, transform .25s, box-shadow .25s;
  animation: cardin .5s ease backwards;
}
@keyframes cardin { from { opacity: 0; transform: translateY(14px); } }
#cards.played .card, .played .card { animation: none; }
.card:hover { border-color: var(--border-hi); transform: translateY(-2px); box-shadow: 0 8px 34px rgba(0, 0, 0, .5), 0 0 0 1px rgba(46, 74, 117, .3); }
.card::before, .card::after {
  content: ""; position: absolute; width: 14px; height: 14px; pointer-events: none;
  border-color: var(--faint); transition: border-color .25s;
}
.card::before { top: 0; left: 0; border-top: 2px solid; border-left: 2px solid; border-color: var(--faint); border-top-left-radius: 9px; }
.card::after { bottom: 0; right: 0; border-bottom: 2px solid; border-right: 2px solid; border-color: var(--faint); border-bottom-right-radius: 9px; }
.card:hover::before, .card:hover::after { border-color: var(--green); }
.card .sweep {
  position: absolute; top: 0; bottom: 0; width: 90px; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(148, 197, 255, .05), transparent);
  animation: sweep 7s ease-in-out infinite;
}
@keyframes sweep { 0%, 55% { left: -100px; } 85%, 100% { left: 110%; } }

.card-head { display: flex; align-items: center; gap: 11px; }
.orb { position: relative; width: 11px; height: 11px; flex: none; border-radius: 50%; }
.orb.up { background: var(--green); box-shadow: 0 0 10px var(--green); }
.orb.up::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid var(--green); animation: ripple 2.2s ease-out infinite; }
.orb.down { background: var(--red); box-shadow: 0 0 10px var(--red); animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: .35; } }
.orb.unknown { background: var(--faint); }
.card-name { font-size: 15.5px; font-weight: 600; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-url { font-family: var(--mono); font-size: 11px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; }
.card-url a { color: inherit; text-decoration: none; }
.card-url a:hover { color: var(--cyan); }
.lat-pill {
  margin-left: auto; flex: none; font-family: var(--mono); font-size: 12px;
  padding: 3px 9px; border-radius: 4px; border: 1px solid var(--border);
  color: var(--cyan); background: rgba(34, 211, 238, .06); font-variant-numeric: tabular-nums;
}
.lat-pill.down { color: var(--red); border-color: rgba(248, 113, 113, .4); background: rgba(248, 113, 113, .08); }
.lat-pill.unknown { color: var(--dim); }
.spark { width: 100%; height: 46px; display: block; margin: 13px 0 8px; }

.uptime-row { display: flex; align-items: baseline; justify-content: space-between; font-family: var(--mono); margin-top: 2px; }
.uptime-pct { font-size: 17px; font-weight: 700; color: var(--green-hi); font-variant-numeric: tabular-nums; }
.uptime-pct.am { color: var(--amber); } .uptime-pct.rd { color: var(--red); }
.uptime-label { font-size: 10.5px; color: var(--faint); letter-spacing: .14em; }
.ucells { display: flex; gap: 2px; margin-top: 8px; height: 26px; }
.ucell { flex: 1; min-width: 0; border-radius: 2px; background: #152034; transition: transform .12s; }
.ucell:hover { transform: scaleY(1.35); }
.ucell.g1 { background: #1d7a5a; } .ucell.g2 { background: #27a376; } .ucell.g3 { background: #34d399; box-shadow: 0 0 4px rgba(52,211,153,.35); }
.ucell.a1 { background: #b78a1f; } .ucell.a2 { background: #fbbf24; }
.ucell.r1 { background: #b03a3a; } .ucell.r2 { background: #f87171; }

/* ---------- footer ---------- */
.footer {
  margin-top: 70px; padding-top: 22px; border-top: 1px solid var(--border);
  font-family: var(--mono); font-size: 11.5px; color: var(--faint);
  display: flex; gap: 18px; flex-wrap: wrap; letter-spacing: .1em;
}
.footer a { color: var(--dim); text-decoration: none; }
.footer a:hover { color: var(--green); }
.footer .spacer { flex: 1; }
.cursor::after { content: "▊"; color: var(--green); animation: blink 1.1s step-end infinite; margin-left: 6px; }

/* ---------- token gate (internal) ---------- */
.gate {
  position: fixed; inset: 0; z-index: 100; display: flex;
  align-items: center; justify-content: center;
  background: rgba(3, 5, 10, .86); backdrop-filter: blur(10px);
}
.gate.hidden { display: none; }
.gate-box {
  width: min(430px, 90vw); background: var(--panel-solid);
  border: 1px solid var(--border-hi); border-radius: 12px; padding: 36px 34px;
  font-family: var(--mono); box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 0 1px rgba(46,74,117,.2), 0 0 60px rgba(34, 211, 238, .05);
}
.gate-box h2 { font-size: 15px; letter-spacing: .2em; color: var(--amber); margin-bottom: 8px; }
.gate-box p { font-size: 12px; color: var(--dim); margin-bottom: 22px; line-height: 1.7; }
.gate-box input {
  width: 100%; background: #060a13; border: 1px solid var(--border);
  border-radius: 6px; color: var(--green-hi); font-family: var(--mono);
  font-size: 14px; padding: 12px 14px; outline: none; letter-spacing: .1em;
}
.gate-box input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(52, 211, 153, .12); }
.gate-box button {
  width: 100%; margin-top: 14px; padding: 12px; border-radius: 6px;
  border: 1px solid var(--green); background: rgba(52, 211, 153, .1);
  color: var(--green-hi); font-family: var(--mono); font-size: 13px;
  letter-spacing: .2em; cursor: pointer; transition: background .2s;
}
.gate-box button:hover { background: rgba(52, 211, 153, .22); }
.gate-err { color: var(--red); font-size: 11.5px; margin-top: 12px; min-height: 16px; }
.gate-box.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }

/* ---------- internal: node cards ---------- */
.node-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 18px; }
.node-card.off { border-color: rgba(248, 113, 113, .35); }
.node-card.off .node-body { opacity: .35; filter: saturate(.3); }
.node-top { display: flex; align-items: center; gap: 11px; margin-bottom: 16px; }
.node-code {
  font-family: var(--mono); font-size: 19px; font-weight: 700; letter-spacing: .1em;
  color: var(--cyan); text-shadow: 0 0 16px rgba(34, 211, 238, .4);
}
.node-region { font-size: 12px; color: var(--dim); }
.node-offline-tag { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--red); letter-spacing: .1em; }
.node-uptime { margin-left: auto; font-family: var(--mono); font-size: 11.5px; color: var(--dim); font-variant-numeric: tabular-nums; }
.node-body { display: flex; gap: 20px; align-items: center; }
.ring { position: relative; width: 108px; height: 108px; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring .rv { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: var(--mono); }
.ring .rv b { font-size: 21px; color: var(--green-hi); font-variant-numeric: tabular-nums; }
.ring .rv span { font-size: 9.5px; color: var(--dim); letter-spacing: .12em; margin-top: 2px; }
.node-meters { flex: 1; min-width: 0; }
.meter { margin-bottom: 13px; }
.meter:last-child { margin-bottom: 0; }
.meter .mrow { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; color: var(--dim); margin-bottom: 5px; letter-spacing: .08em; }
.meter .mrow b { color: var(--text); font-variant-numeric: tabular-nums; font-weight: 500; }
.bar { height: 6px; background: #101a2d; border-radius: 3px; overflow: hidden; }
.bar i {
  display: block; height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, #0e6f52, var(--green));
  box-shadow: 0 0 8px rgba(52, 211, 153, .5);
  transition: width .8s cubic-bezier(.22, 1, .36, 1);
}
.bar i.cy { background: linear-gradient(90deg, #0b6172, var(--cyan)); box-shadow: 0 0 8px rgba(34, 211, 238, .5); }
.bar i.am { background: linear-gradient(90deg, #8a6413, var(--amber)); box-shadow: 0 0 8px rgba(251, 191, 36, .5); }
.net-row { display: flex; gap: 16px; font-family: var(--mono); font-size: 11.5px; color: var(--dim); margin-top: 14px; }
.net-row b { color: var(--cyan); font-weight: 500; font-variant-numeric: tabular-nums; }
.nodehist { width: 100%; height: 40px; display: block; margin-top: 12px; }

/* ---------- internal: node detail ---------- */
.ring-col { flex: none; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.load-trio {
  display: flex; gap: 8px; align-items: baseline;
  font-family: var(--mono); font-size: 10.5px; color: var(--faint); letter-spacing: .04em;
}
.load-trio b { color: var(--dim); font-weight: 500; font-variant-numeric: tabular-nums; }
.kv-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 7px 14px;
  margin-top: 4px; padding-top: 11px; border-top: 1px dashed rgba(27, 42, 68, .8);
}
.kv { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--mono); font-size: 10.5px; }
.kv span { color: var(--faint); letter-spacing: .08em; }
.kv b { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }
.kv b.gn { color: var(--green); } .kv b.rd { color: var(--red); } .kv b.am { color: var(--amber); }

/* ---------- internal: gateway cards ---------- */
.gw-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.gw-card { padding: 15px 18px 13px; }
.gw-card.off { border-color: rgba(248, 113, 113, .35); }
.gw-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.gw-name { font-size: 14px; font-weight: 600; letter-spacing: .02em; }
.gw-port { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--faint); }
.gw-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.gw-stats .kv { flex-direction: column; align-items: flex-start; gap: 3px; }
.gw-stats .kv b { font-size: 12px; }

/* ---------- internal: event console ---------- */
.console {
  background: linear-gradient(180deg, rgba(8, 12, 22, .92), rgba(5, 8, 15, .95));
  border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 18px; font-family: var(--mono); font-size: 11.5px;
  max-height: 430px; overflow-y: auto;
}
.ev-row {
  display: flex; align-items: baseline; gap: 12px;
  padding: 5.5px 0; border-bottom: 1px solid rgba(27, 42, 68, .45);
  line-height: 1.5;
}
.ev-row:last-child { border-bottom: 0; }
.ev-time { flex: none; width: 128px; color: var(--faint); font-variant-numeric: tabular-nums; letter-spacing: .03em; }
.ev-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; align-self: center; }
.ev-dot.rd { background: var(--red); box-shadow: 0 0 6px var(--red); }
.ev-dot.am { background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.ev-dot.gn { background: var(--green); box-shadow: 0 0 6px var(--green); }
.ev-kind { flex: none; width: 46px; font-size: 10px; letter-spacing: .1em; }
.ev-kind.rd { color: var(--red); } .ev-kind.am { color: var(--amber); } .ev-kind.gn { color: var(--green); }
.ev-text { color: var(--dim); word-break: break-all; }
.ev-empty { color: var(--faint); text-align: center; padding: 26px 0; letter-spacing: .12em; }

/* ---------- internal: llm cards ---------- */
.llm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 16px; }
.llm-card { padding: 16px 18px 14px; }
.llm-head { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; }
.vbadge {
  width: 34px; height: 34px; flex: none; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 14px; font-weight: 700;
  border: 1px solid var(--border-hi); background: rgba(34, 211, 238, .07); color: var(--cyan);
  text-shadow: 0 0 10px currentColor;
}
.llm-name { font-size: 14px; font-weight: 600; }
.llm-vendor { font-family: var(--mono); font-size: 10px; color: var(--faint); letter-spacing: .1em; margin-top: 2px; }
.llm-state { margin-left: auto; }
.llm-balance { font-family: var(--mono); margin-bottom: 10px; }
.llm-balance .bv { font-size: 24px; font-weight: 700; color: var(--green-hi); font-variant-numeric: tabular-nums; }
.llm-balance .bv.dim2 { color: var(--dim); font-size: 17px; }
.llm-balance .bk { font-size: 10px; color: var(--dim); letter-spacing: .14em; margin-top: 3px; }
.llm-rows { font-family: var(--mono); font-size: 11.5px; }
.llm-rows .r { display: flex; justify-content: space-between; padding: 5px 0; border-top: 1px dashed rgba(27, 42, 68, .8); color: var(--dim); }
.llm-rows .r b { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }
.llm-rows .r b.rd { color: var(--red); } .llm-rows .r b.am { color: var(--amber); } .llm-rows .r b.gn { color: var(--green); }

/* ---------- tables & pills ---------- */
.tbl { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 12px; }
.tbl th { text-align: left; color: var(--faint); font-weight: 500; letter-spacing: .14em; font-size: 10.5px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.tbl td { padding: 9px 10px; border-bottom: 1px solid rgba(27, 42, 68, .5); color: var(--text); font-variant-numeric: tabular-nums; }
.tbl tr:hover td { background: rgba(34, 211, 238, .03); }
.tbar { width: 130px; height: 5px; background: #101a2d; border-radius: 3px; overflow: hidden; display: inline-block; vertical-align: middle; margin-right: 10px; }
.tbar i { display: block; height: 100%; background: linear-gradient(90deg, #0b6172, var(--cyan)); border-radius: 3px; }
.pill {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 12px; padding: 9px 16px;
  border: 1px solid var(--border); border-radius: 6px; background: var(--panel);
}
.pill .lat { color: var(--faint); font-size: 11px; }
.pill-row { display: flex; gap: 14px; flex-wrap: wrap; }
.note { font-family: var(--mono); font-size: 11px; color: var(--faint); margin-top: 12px; letter-spacing: .06em; }
.stale-tag { color: var(--amber); }

@media (max-width: 720px) {
  .wrap { padding: 0 16px 70px; }
  .grid { grid-template-columns: 1fr; }
  .hero { padding: 52px 0 22px; }
  .hstat { padding: 0 18px; }
  .topbar .meta.hide-s { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01s !important; animation-iteration-count: 1 !important; transition-duration: .01s !important; }
}
