:root {
  --bg: #0b1424;
  --bg-2: rgba(16, 28, 46, 0.94);
  --line: rgba(214, 228, 255, 0.14);
  --line-2: rgba(186, 220, 255, 0.28);
  --text: #f6f1e6;
  --mute: #c9d6ea;
  --faint: #93a6c0;
  --accent: #7ad7ff;
  --good: #34d399;
  --warn: #fbbf24;
  --bad: #fb7185;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --sans: Inter, "Noto Sans SC", "Segoe UI", "PingFang SC", "Microsoft YaHei UI", sans-serif;
  --display: Syne, Inter, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--sans);
  background: #020010;
  color: var(--text);
  letter-spacing: -0.011em;
}
#view { min-height: 100%; }
button, input { font-family: inherit; }
[hidden] { display: none !important; }

.gate {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: #050814;
}
#storm, #storm-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}
#storm-bg { opacity: 0.12; }
.gate-vignette, .gate-scan, .gate-noise, .hud-frame {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.gate-vignette {
  z-index: 1;
  background:
    radial-gradient(1200px 640px at 50% 42%, transparent 0%, rgba(5,8,20,0.08) 58%, rgba(5,8,16,0.55) 100%);
}
.gate-scan {
  z-index: 1;
  opacity: 0.08;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0 2px,
    rgba(180, 220, 255, 0.035) 3px
  );
}
.gate-noise {
  z-index: 1;
  opacity: 0.04;
  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='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.9'/%3E%3C/svg%3E");
}
.hud-frame i {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(173, 230, 255, 0.45);
  z-index: 2;
}
.hud-frame .tl { top: 18px; left: 18px; border-right: 0; border-bottom: 0; }
.hud-frame .tr { top: 18px; right: 18px; border-left: 0; border-bottom: 0; }
.hud-frame .bl { bottom: 18px; left: 18px; border-right: 0; border-top: 0; }
.hud-frame .br { bottom: 18px; right: 18px; border-left: 0; border-top: 0; }

.gate-card {
  position: relative;
  z-index: 3;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 48px 20px 40px;
}
.brand {
  width: min(860px, 94vw);
  margin-bottom: 8px;
}
.kicker {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.46em;
  color: rgba(255, 214, 255, 0.72);
  margin-bottom: 12px;
}
.word {
  font-family: var(--display);
  font-size: clamp(48px, 8.4vw, 92px);
  font-weight: 800;
  letter-spacing: 0.16em;
  line-height: 0.95;
  width: 100%;
  padding-right: 0.16em;
  background: linear-gradient(90deg, #fff 0%, #67e8f9 18%, #e879f9 42%, #fbbf24 68%, #fff 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: sheen 8s linear infinite;
  filter: drop-shadow(0 0 28px rgba(168, 85, 247, 0.42));
}
@keyframes sheen {
  0% { background-position: 0% 50%; }
  100% { background-position: 220% 50%; }
}
.tag {
  margin: 14px 0 30px;
  color: rgba(226, 232, 255, 0.72);
  font-size: 13px;
  letter-spacing: 0.16em;
  font-family: var(--mono);
}
.form-card {
  position: relative;
  width: min(420px, 92vw);
  text-align: left;
  padding: 22px 22px 18px;
  border-radius: 18px;
  background: rgba(10, 8, 28, 0.58);
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow:
    0 24px 90px rgba(40, 0, 80, 0.28),
    inset 0 1px 0 rgba(255,255,255,0.1);
  backdrop-filter: blur(22px) saturate(1.4);
}
.form-card .stamp {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.28em;
  color: #f9a8d4;
  margin-bottom: 8px;
}
.form-card h2 {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: #f5f3ff;
}
.form-card .lead {
  margin: 6px 0 20px;
  color: var(--mute);
  font-size: 13px;
  line-height: 1.45;
}
.fine {
  margin-top: 18px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: rgba(255,255,255,0.38);
}
.field { margin-bottom: 16px; }
.field label, .row label {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 8px;
}
.field input, .row input {
  width: 100%;
  height: 46px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: rgba(255,255,255,0.035);
  color: var(--text);
  padding: 0 14px;
  font-size: 15px;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.field input:focus, .row input:focus {
  border-color: rgba(125, 211, 252, 0.8);
  box-shadow: 0 0 0 4px rgba(125, 211, 252, 0.12);
  background: rgba(255,255,255,0.05);
}
.btn {
  cursor: pointer;
  border: 0;
  font-weight: 600;
  transition: transform .15s, filter .15s, background .15s;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  width: 100%;
  height: 46px;
  margin-top: 8px;
  border-radius: 10px;
  color: #0b0618;
  background: linear-gradient(90deg, #67e8f9, #c084fc 48%, #fb7185);
  box-shadow: 0 0 32px rgba(192, 132, 252, 0.35);
  font-size: 13px;
  letter-spacing: 0.22em;
  font-family: var(--mono);
}
.btn-primary:hover { filter: brightness(1.08); }
.err {
  min-height: 18px;
  margin-top: 12px;
  color: var(--bad);
  font-size: 13px;
}

.app {
  position: relative;
  min-height: 100vh;
  background:
    radial-gradient(980px 460px at 8% -12%, rgba(56, 189, 248, 0.20), transparent 54%),
    radial-gradient(760px 420px at 100% 0%, rgba(251, 191, 36, 0.10), transparent 50%),
    #0b1424;
}
.app::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.028) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.28), transparent 62%);
}
.app .topbar, .app .wrap { position: relative; z-index: 1; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px max(28px, calc(50% - 560px));
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(11, 20, 36, 0.88);
  backdrop-filter: blur(18px);
}
.logo {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: 0.14em;
  font-size: 15px;
}
.logo span {
  font-family: var(--mono);
  color: var(--mute);
  font-weight: 500;
  margin-left: 12px;
  font-size: 11px;
  letter-spacing: 0.22em;
}
.uptime {
  font-family: var(--mono);
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 0.12em;
  margin-left: 14px;
}
.actions { display: flex; gap: 8px; }
.btn-ghost, .tiny {
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line-2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.btn-ghost:hover, .tiny:hover { background: rgba(255,255,255,0.04); }
.btn-soft {
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  border: 0;
  background: linear-gradient(90deg, rgba(103,232,249,0.18), rgba(192,132,252,0.18));
  color: #e0f2fe;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.wrap { max-width: 1120px; margin: 0 auto; padding: 26px 28px 80px; }
.board {
  background:
    linear-gradient(180deg, rgba(20, 38, 62, 0.96), rgba(12, 22, 38, 0.94));
  border: 1px solid rgba(186, 220, 255, 0.18);
  border-radius: 18px;
  padding: 22px 24px 18px;
  margin-bottom: 16px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
}
.board-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 14px;
}
.board-kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--faint);
  margin-bottom: 8px;
}
.board-big {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text);
  line-height: 1.1;
}
.board-big em {
  font-style: normal;
  color: var(--mute);
  font-size: 18px;
  font-weight: 500;
}
.board-left {
  flex: none;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.12);
  color: #6ee7b7;
  font-size: 13px;
  font-weight: 600;
}
.board-left.hot {
  background: rgba(251, 191, 36, 0.14);
  color: #fcd34d;
}
.bar {
  height: 8px;
  border-radius: 99px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #67e8f9, #fbbf24);
}
.bar.hot i, .mini-bar.hot i { background: linear-gradient(90deg, #fb7185, #fbbf24); }
.bar.warn i, .mini-bar.warn i { background: linear-gradient(90deg, #fbbf24, #fb7185); }
.bar.given i { background: linear-gradient(90deg, #c084fc, #67e8f9); }
.meters { display: grid; gap: 12px; }
.bar-lab {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  color: var(--mute);
  font-size: 12px;
}
.bar-lab b { color: var(--text); font-variant-numeric: tabular-nums; }
.bar-lab.hot, .mono.hot { color: #fda4af; }
.mono.warn { color: #fde68a; }
.board-meta {
  margin-top: 12px;
  color: var(--mute);
  font-size: 13px;
  line-height: 1.5;
}
.board-meta.hot { color: #fcd34d; }
.kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.kpi {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 16px 14px;
  backdrop-filter: blur(12px);
}
.kpi b {
  display: block;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  color: var(--text);
}
.kpi span {
  font-family: var(--mono);
  color: var(--mute);
  font-size: 10px;
  letter-spacing: 0.08em;
}
.kpi .ok { color: var(--good); }
.kpi .bad { color: var(--bad); }
.kpi .note {
  display: block;
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0;
  text-transform: none;
  margin-top: 4px;
  font-family: var(--sans);
}

.who {
  font-family: var(--mono);
  color: var(--mute);
  font-size: 12px;
  letter-spacing: 0.08em;
  margin: 0 0 14px;
}
.alerts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}
.pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  color: var(--mute);
  font-size: 12px;
}
.pill.ok { color: #6ee7b7; border-color: rgba(52, 211, 153, 0.28); }
.pill.warn { color: #fde68a; border-color: rgba(251, 191, 36, 0.35); }
.pill.hot { color: #fda4af; border-color: rgba(251, 113, 133, 0.4); }
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 0 0 12px;
}
.search {
  flex: 1;
  min-width: 220px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: rgba(255,255,255,0.035);
  color: var(--text);
  padding: 0 12px;
  font-size: 14px;
  outline: none;
}
.search:focus {
  border-color: rgba(125, 211, 252, 0.8);
  box-shadow: 0 0 0 4px rgba(125, 211, 252, 0.12);
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button {
  height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--mute);
  font-size: 12px;
  cursor: pointer;
}
.chips button em {
  font-style: normal;
  margin-left: 4px;
  font-family: var(--mono);
  color: var(--faint);
}
.chips button.on {
  color: var(--text);
  border-color: rgba(125, 211, 252, 0.5);
  background: rgba(125, 211, 252, 0.12);
}
.empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--mute);
  font-size: 13px;
}
.mini-bar {
  height: 5px;
  margin: 6px 0 4px;
  border-radius: 99px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}
.mini-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #67e8f9, #34d399); }
.row-user.hot { background: rgba(251, 113, 133, 0.06); }
.row-user.warn { background: rgba(251, 191, 36, 0.05); }
.row-user.live { box-shadow: inset 3px 0 0 var(--good); }
.badge.soon { color: var(--warn); }
.badge.soon::before { background: var(--warn); }
.usage {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 16px;
  background: rgba(255,255,255,0.03);
}
.usage-top { font-size: 13px; color: var(--text); margin-bottom: 8px; }
.usage-sub { margin-top: 8px; font-size: 12px; color: var(--mute); }

.table {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-2);
  backdrop-filter: blur(12px);
}
.row-head, .row-user {
  display: grid;
  grid-template-columns: 1.15fr 0.7fr 0.85fr 1.15fr 0.9fr 1fr 36px;
  gap: 8px;
  align-items: center;
  padding: 13px 16px;
}
.row-head {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}
.row-user {
  border-top: 1px solid var(--line);
  cursor: pointer;
  font-size: 14px;
  transition: background .15s;
}
.row-user:hover { background: rgba(125, 211, 252, 0.06); }
.row-user.off { opacity: 0.5; }
.name { font-weight: 600; font-size: 15px; color: var(--text); }
.sub { color: var(--mute); font-size: 12px; margin-top: 2px; }
.device-link {
  display: inline;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
  color: #7dd3fc;
  cursor: pointer;
  font: inherit;
}
.device-link:hover { text-decoration: underline; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--mute);
}
.badge::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--faint);
}
.badge.on { color: var(--good); }
.badge.on::before { background: var(--good); box-shadow: 0 0 8px var(--good); }
.badge.stop { color: var(--bad); }
.badge.stop::before { background: var(--bad); }
.mono { font-variant-numeric: tabular-nums; color: var(--mute); font-size: 13px; font-family: var(--mono); }
.chev { color: var(--faint); text-align: right; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.58);
  display: none;
  z-index: 40;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.modal.is-open { display: block; }
.drawer {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(520px, 100%);
  background: #102038;
  border-left: 1px solid var(--line);
  overflow: auto;
  padding: 22px 22px 32px;
  animation: in .22s ease;
}
.dialog {
  width: min(360px, 92vw);
  max-height: min(68vh, 480px);
  overflow: auto;
  margin: 8vh auto 8vh;
  background: #102038;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 14px 12px;
  animation: pop .18s ease;
}
.dialog h2 { font-size: 18px; }
.dialog .hint { font-size: 12px; margin-bottom: 10px; }
.dialog .ip-list {
  padding: 2px 10px;
  margin-bottom: 10px;
}
.dialog .ip-list li { padding: 8px 0; }
.dialog .ip-main { font-size: 13px; }
.dialog .ip-geo { font-size: 12px; margin-top: 2px; }
.dialog .ip-time { font-size: 11px; margin-top: 1px; }
.dialog .pair { margin: 8px 0 0; }
@keyframes in { from { transform: translateX(16px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer h2, .dialog h2 {
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.hint { color: var(--mute); font-size: 13px; margin-bottom: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row { margin-bottom: 12px; }
.switch-row, .pair { display: flex; gap: 8px; margin: 10px 0 16px; }
.tiny { flex: 1; }
.danger { color: var(--bad); border-color: rgba(251,113,133,0.4); }
.qr-box {
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  background: #fff;
  color: #111;
}
.qr-box img { width: 220px; height: 220px; background: #fff; }
.qr-box p { margin: 8px 0; font-size: 13px; font-weight: 650; color: #111; }
.link, .foot-note, .ip-empty {
  font-size: 12px;
  color: var(--mute);
  word-break: break-all;
}
.qr-box .link, .qr-box .foot-note { color: #666; }
.qr-box .foot-note {
  word-break: break-word;
  font-weight: 450;
  line-height: 1.55;
  text-align: left;
}
.qr-box .pair { flex-wrap: wrap; }
.qr-box .tiny { color: #111; border-color: #d4d4d8; background: #fff; }
.ip-line {
  color: #fff4d6;
  font-family: var(--mono);
  font-size: 12px;
  margin-top: 4px;
  word-break: break-all;
}
.ip-list {
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 13px;
  background: rgba(255,255,255,0.03);
}
.ip-list li { list-style: none; padding: 12px 0; border-bottom: 1px solid var(--line); }
.ip-list li:last-child { border-bottom: 0; }
.ip-main {
  font-family: var(--mono);
  font-weight: 650;
  font-size: 16px;
  color: #fff;
  letter-spacing: 0.02em;
}
.ip-geo {
  margin-top: 6px;
  font-size: 14px;
  color: #fff4d6;
  font-family: "Noto Sans SC", Inter, sans-serif;
  white-space: normal;
  word-break: break-word;
}
.ip-edge .ip-geo { color: #fbbf24; }
.ip-real .ip-main { color: #fff; }
.ip-try .ip-main { color: #fbbf24; }
.ip-try .ip-geo { color: #fde68a; }
.ip-time {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: #fde68a;
}
.loc-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(125, 211, 252, 0.12);
  color: #bae6fd;
  font-size: 12px;
  white-space: nowrap;
}
.loc-picks { display: grid; gap: 8px; }
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}
.check input { width: 16px; height: 16px; accent-color: #67e8f9; }
.check.off { opacity: 0.48; cursor: not-allowed; }

@media (prefers-reduced-motion: reduce) {
  .word { animation: none; }
  .drawer, .dialog { animation: none; }
}

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .word { font-size: 42px; letter-spacing: 0.12em; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .board-top { flex-direction: column; align-items: flex-start; }
  .row-head { display: none; }
  .row-user { grid-template-columns: 1fr auto; }
  .row-user > :nth-child(3),
  .row-user > :nth-child(6),
  .row-user > :nth-child(7) { display: none; }
  .wrap, .topbar { padding-left: 16px; padding-right: 16px; }
  .uptime { display: none; }
}
