:root {
  --bg: #0b1018;
  --bg-2: #101826;
  --card: #121826;
  --line: #1e293b;
  --ink: #e8eef8;
  --ink-2: #94a3b8;
  --muted: #64748b;
  --blue: #3b82f6;
  --mint: #34d399;
  --amber: #fbbf24;
  --red: #f87171;
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
body {
  min-height: 100vh;
  background-image:
    radial-gradient(800px 420px at 8% -8%, rgba(59, 130, 246, .16), transparent 58%),
    radial-gradient(640px 360px at 100% 0%, rgba(52, 211, 153, .08), transparent 55%);
}
a { color: var(--blue); text-decoration: none; }
code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: .88em;
  background: rgba(59, 130, 246, .12);
  border-radius: 5px;
  padding: 1px 5px;
}

[hidden] { display: none !important; }

.live-dot {
  display: inline-block;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, .55);
  animation: pulse 2.2s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .5); }
  70% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.gate {
  position: fixed; inset: 0; z-index: 40;
  display: grid; place-items: center; padding: 24px;
}
.gate-card {
  width: 100%; max-width: 380px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 26px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .5);
}
.gate-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.gate-brand h1 { margin: 0; font-size: 18px; }
.gate-brand p { margin: 2px 0 0; color: var(--ink-2); font-size: 12.5px; }
.gate-dot {
  width: 34px; height: 34px; border-radius: 11px;
  background: linear-gradient(140deg, var(--blue), #6366f1);
}
.gate-hint { min-height: 18px; margin: 4px 0 12px; font-size: 12.5px; color: var(--amber); }
.gate-foot { margin: 14px 0 0; font-size: 12px; color: var(--muted); text-align: center; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  height: 56px;
  padding: 0 24px;
  background: rgba(11, 16, 24, .88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 9px;
  background: linear-gradient(140deg, var(--blue), #6366f1);
}
.brand strong { font-size: 15px; font-weight: 650; letter-spacing: .15px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.online { display: flex; align-items: center; gap: 7px; color: #cbd5e1; font-size: 13px; }
.stamp { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.icon-btn {
  padding: 6px 10px; border: 0; background: transparent;
  color: var(--ink-2); font: inherit; font-size: 13px; cursor: pointer;
}
.icon-btn:hover { color: var(--ink); }

.stage {
  max-width: 1440px;
  margin: 0 auto;
  padding: 18px 24px 36px;
  display: grid;
  grid-template-columns: minmax(0, 1.68fr) minmax(280px, .32fr);
  gap: 18px;
  align-items: start;
}
.sec-label {
  display: flex; align-items: center; gap: 7px;
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: .6px;
  color: var(--ink-2);
}
.board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.mcard {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px 14px;
  min-height: 214px;
}
.mcard header {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; color: var(--ink-2);
  margin-bottom: 10px;
}
.mcard header em, .mcard header small {
  font-style: normal; color: var(--muted); font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.split { display: flex; align-items: center; gap: 14px; }
.ring-wrap { position: relative; width: 128px; height: 128px; flex: none; }
.ring { width: 128px; height: 128px; transform: rotate(-90deg); }
.ring-bg, .ring-fg { fill: none; stroke-width: 10; }
.ring-bg { stroke: #1e293b; }
.ring-fg {
  stroke: var(--blue);
  stroke-linecap: round;
  stroke-dasharray: 326.7;
  stroke-dashoffset: 326.7;
  transition: stroke-dashoffset .4s ease;
}
.ring-fg.mint { stroke: var(--mint); }
.ring-num {
  position: absolute; inset: 0;
  display: flex; align-items: baseline; justify-content: center; gap: 1px;
  padding-top: 44px;
}
.ring-num b { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.ring-num small { color: var(--muted); font-size: 13px; }
.spark-box { flex: 1; min-width: 0; }
.spark-scale {
  display: flex; flex-direction: column; justify-content: space-between;
  height: 110px; float: left; width: 26px;
  font-size: 10px; color: var(--muted);
}
.spark { width: calc(100% - 26px); height: 110px; display: block; }
.spark-foot {
  display: flex; justify-content: space-between;
  margin-left: 26px; font-size: 10px; color: var(--muted);
}
.legend { flex: 1; font-size: 13px; color: var(--ink-2); line-height: 1.95; }
.legend.inline { display: flex; gap: 18px; margin-top: 12px; }
.legend b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.legend-pair { margin: 10px 0 0; font-size: 20px; font-weight: 700; color: var(--ink); letter-spacing: -.03em; }
.sw {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--muted); margin-right: 6px;
}
.sw.mint { background: var(--mint); }
.sw.blue { background: var(--blue); }
.disk-hero {
  font-size: 30px; font-weight: 700; letter-spacing: -.04em;
  margin: 8px 0 14px;
}
.bar { height: 10px; background: #1e293b; border-radius: 99px; overflow: hidden; }
.bar.thick { height: 12px; }
.bar i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, #2563eb, #60a5fa);
  border-radius: 99px;
  transition: width .4s ease;
}
.net-card { min-height: 214px; }
.net-chart { width: 100%; height: 156px; display: block; }

.strip {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 8px;
}
.strip > div { padding: 2px 16px; }
.strip > div + div { border-left: 1px solid var(--line); }
.strip span { display: block; color: var(--ink-2); font-size: 12px; margin-bottom: 6px; }
.strip b { color: var(--ink); font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; }

.svc-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 8px 12px;
}
.svc-list { display: flex; flex-direction: column; }
.svc-row {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 11px 10px;
  border: 0; border-radius: 12px;
  background: transparent;
  color: inherit; font: inherit; text-align: left;
  cursor: pointer;
}
.svc-row:hover { background: #182234; }
.svc-row .ico {
  width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center;
  font-size: 13px; flex: none;
  background: rgba(59, 130, 246, .14);
}
.svc-row .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--muted); }
.svc-row .dot.ok { background: var(--mint); box-shadow: 0 0 0 3px rgba(52, 211, 153, .16); }
.svc-row .dot.warn { background: var(--amber); }
.svc-row .dot.down { background: var(--red); }
.svc-row b { flex: 1; font-weight: 600; font-size: 13.5px; }
.svc-row em { font-style: normal; color: var(--ink-2); font-variant-numeric: tabular-nums; font-size: 13px; }
.svc-row span.chev { color: var(--muted); }
.svc-hint { margin: 4px 10px 8px; color: var(--muted); font-size: 12px; }

[data-enter] {
  opacity: 0;
  transform: translateY(10px);
  animation: enter .42s ease forwards;
}
[data-enter="2"] { animation-delay: .06s; }
[data-enter="3"] { animation-delay: .12s; }
[data-enter="4"] { animation-delay: .16s; }
[data-enter="5"] { animation-delay: .2s; }
[data-enter="6"] { animation-delay: .24s; }
@keyframes enter {
  to { opacity: 1; transform: none; }
}

.work {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(4, 8, 14, .72);
  padding: 24px 16px;
}
.work:not([hidden]) { display: grid; place-items: center; }
.work-card {
  width: min(1120px, 100%);
  max-height: min(88vh, 920px);
  display: flex; flex-direction: column;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .55);
  animation: pop .2s ease;
}
@keyframes pop {
  from { opacity: 0; transform: scale(.96); }
  to { opacity: 1; transform: none; }
}
.work-bar {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--line);
}
.work-bar h2 { margin: 0; font-size: 17px; }
.work-bar p { margin: 3px 0 0; color: var(--muted); font-size: 12.5px; }
.work-body { overflow: auto; padding: 16px 18px 20px; }

.panel { display: none; }
.panel.is-on { display: block; }
.panel-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 1.05fr);
  gap: 14px;
}
.panel-grid.one { grid-template-columns: 1fr; }
.lead { margin: 0 0 10px; font-size: 16px; font-weight: 600; }
.copy { margin: 0 0 16px; color: var(--ink-2); font-size: 13px; }
.seat-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.seat {
  min-width: 52px; padding: 8px 12px; text-align: center;
  background: #0d131e; border: 1px solid var(--line); border-radius: 10px;
  font-weight: 650;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; }
.card-head.tight { margin-top: 16px; }
.card-head h3 { margin: 0; font-size: 14px; }
.card-head .link, .card-head .search { margin-left: auto; }
.pill {
  padding: 1px 8px; border-radius: 999px;
  background: rgba(59, 130, 246, .16);
  font-size: 11.5px; color: #bfdbfe;
}

.field { display: block; margin-bottom: 12px; }
.field > span { display: block; margin-bottom: 6px; font-size: 12px; color: var(--ink-2); }
.field > span em { font-style: normal; color: var(--muted); font-size: 11px; }
input[type=text], input[type=password], input[type=search], input[type=file], textarea {
  width: 100%; padding: 9px 11px;
  background: #0d131e; border: 1px solid var(--line); border-radius: 9px;
  color: var(--ink); font: inherit; font-size: 13.5px; outline: none;
}
input:focus, textarea:focus { border-color: var(--blue); }
input[readonly] { color: var(--ink-2); }
textarea { resize: vertical; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.search { width: 190px; padding: 6px 10px; font-size: 12.5px; }

.btn {
  padding: 9px 16px; border: 1px solid var(--line); border-radius: 9px;
  background: #182234; color: var(--ink); font: inherit; font-size: 13.5px; cursor: pointer;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--blue); border-color: transparent; color: #fff; font-weight: 600; }
.btn-danger { background: #3a1c22; border-color: #6b2b34; color: #ffb3b3; }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-wide { width: 100%; }
.btn-mini { padding: 4px 10px; font-size: 12px; }
.actions { display: flex; align-items: center; gap: 12px; }
.mini { font-size: 12.5px; color: var(--ink-2); }
.mini.ok { color: var(--mint); }
.mini.bad { color: var(--red); }

.drop {
  margin-bottom: 14px; padding: 22px 16px;
  border: 1.5px dashed #2e3d5c; border-radius: 12px;
  background: rgba(59, 130, 246, .04); text-align: center; cursor: pointer;
}
.drop:hover, .drop.is-over { border-color: var(--blue); }
.drop.has-file { border-style: solid; border-color: var(--mint); }
.drop-inner p { margin: 8px 0 3px; font-size: 13px; color: var(--ink-2); }
.drop-inner p b { color: var(--ink); }
.drop-icon { font-size: 20px; color: var(--blue); }
.writeplan {
  margin: 4px 0 14px; padding: 12px 14px;
  background: #0d131e; border-radius: 10px; font-size: 12px; color: var(--ink-2);
}
.writeplan ol { margin: 7px 0 0; padding-left: 19px; }
.guard {
  margin: 13px 0 0; padding: 9px 12px;
  background: rgba(251, 191, 36, .07);
  border-left: 2px solid var(--amber);
  font-size: 12px; color: #d8c49a;
}

.kv { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; }
.kv dt { font-size: 12px; color: var(--muted); }
.kv dd { margin: 0; font-size: 12.5px; word-break: break-all; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 10px; max-height: 330px; }
.table-wrap.tall { max-height: 480px; }
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th, .table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th { position: sticky; top: 0; background: #0f1622; color: var(--ink-2); }
.table td.wrap { white-space: normal; min-width: 170px; color: var(--ink-2); }
.table .mono { font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; }
.tag { display: inline-block; padding: 1px 7px; border-radius: 5px; font-size: 11px; background: rgba(59, 130, 246, .14); color: #bfdbfe; }
.tag.now { background: rgba(52, 211, 153, .16); color: #9df0c6; }
.empty { padding: 22px; text-align: center; color: var(--muted); }

.modal { position: fixed; inset: 0; z-index: 70; background: rgba(4, 7, 12, .74); padding: 22px; }
.modal:not([hidden]) { display: grid; place-items: center; }
.modal-card {
  width: 100%; max-width: 440px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 15px; padding: 21px;
}
.modal-card h3 { margin: 0 0 9px; font-size: 15px; }
.modal-card p { margin: 0; font-size: 13px; color: var(--ink-2); }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  z-index: 80; padding: 11px 20px;
  background: #16202f; border: 1px solid var(--line); border-radius: 11px;
  font-size: 13px; max-width: 82vw;
}

@media (max-width: 1100px) {
  .stage { grid-template-columns: 1fr; padding: 16px 16px 28px; }
  .panel-grid { grid-template-columns: 1fr; }
  .work { padding: 10px; }
  .work-card { max-height: 94vh; }
}
@media (max-width: 720px) {
  .board { grid-template-columns: 1fr; }
  .topbar { padding: 0 14px; height: 52px; }
  .online { display: none; }
  .row { grid-template-columns: 1fr; }
  .search { width: 100%; }
  .strip { grid-template-columns: 1fr 1fr; padding: 10px 6px; }
  .strip > div { padding: 8px 12px; }
  .strip > div + div { border-left: 0; }
  .strip > div:nth-child(odd) { border-right: 1px solid var(--line); }
  .strip > div:nth-child(n+3) { border-top: 1px solid var(--line); }
}

@media (prefers-reduced-motion: reduce) {
  [data-enter], .work-card, .live-dot, .ring-fg, .bar i {
    animation: none !important;
    transition: none !important;
  }
  [data-enter] { opacity: 1; transform: none; }
}
