:root {
  font: 16px/1.55 "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  color: #f4f6ff;
  background: #0c1425;
  --muted: #aab8ce;
  --line: #30415e;
  --panel: #162237;
  --accent: #91aeff;
  --cyan: #6de8da;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: radial-gradient(ellipse at 15% 0%, #1a3154 0, #0c1425 56%); }
.shell { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
.topbar { border-bottom: 1px solid #32445c; background: #0d1729cc; }
.masthead { height: 68px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 12px; font-size: 1.14rem; font-weight: 700; letter-spacing: .01em; }
.brand-mark { width: 15px; height: 15px; border: 2px solid var(--cyan); border-radius: 4px; transform: rotate(45deg); box-shadow: 0 0 18px #6de8da4a; }
.tag { padding: 3px 10px; border: 1px solid var(--line); border-radius: 20px; color: var(--muted); font-size: .75rem; }
h1, h2, p { margin: 0; }
h1 { line-height: 1.12; letter-spacing: -.055em; }
h2 { font-size: 1.22rem; }
button, input { font: inherit; }
button, a.button { -webkit-tap-highlight-color: transparent; }
button:not(:disabled), a[href] { cursor: pointer; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 4px; }
.gate { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(24px, 8vw, 120px); align-items: center; margin-block: clamp(44px, 10vw, 126px); }
.intro h1 { font-size: clamp(3rem, 8vw, 6.2rem); margin: 12px 0 20px; }
.eyebrow { color: var(--cyan); font: 600 .82rem/1.3 ui-monospace, monospace; letter-spacing: .15em; }
.muted { color: var(--muted); }
.intro .muted { max-width: 24rem; line-height: 1.8; }
.topology { position: relative; width: min(100%, 420px); height: 72px; margin-top: 28px; overflow: hidden; background: repeating-linear-gradient(90deg, #7aa2e918 0 1px, transparent 1px 34px), repeating-linear-gradient(0deg, #7aa2e918 0 1px, transparent 1px 18px); mask-image: linear-gradient(90deg, black 76%, transparent); }
.topology::before { position: absolute; content: ""; top: 50%; height: 26px; left: 8px; right: 20px; border: solid #7e98cb; border-width: 1px 0 1px 1px; transform: translateY(-50%) skewX(-34deg); opacity: .65; }
.topology i { display: block; position: absolute; top: 18px; left: 10%; width: 10px; height: 10px; background: var(--cyan); border: 2px solid #162b46; border-radius: 50%; box-shadow: 0 0 13px #6de8da9b; }
.topology i:nth-child(2) { top: 43px; left: 25%; }
.topology i:nth-child(3) { left: 43%; }
.topology i:nth-child(4) { top: 43px; left: 62%; }
.topology i:nth-child(5) { left: 80%; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); box-shadow: 0 18px 48px #060c1860; }
.auth { padding: clamp(22px, 4vw, 38px); }
.auth h2 { font-size: 1.55rem; margin-bottom: 24px; }
.auth label { display: block; margin-bottom: 8px; font-size: .9rem; }
.input-wrap { display: flex; align-items: center; border: 1px solid #475c7c; border-radius: 9px; background: #0c1528; }
.input-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px #91aeff32; }
.input-wrap input { min-width: 0; flex: 1; width: 100%; padding: 12px 13px; border: 0; background: transparent; outline: none; color: inherit; }
.input-wrap input::placeholder { color: #90a2bd; }
.text-button { border: 0; padding: 7px 9px; border-radius: 6px; color: var(--accent); background: transparent; font-size: .83rem; white-space: nowrap; }
.input-wrap .text-button { margin-right: 5px; }
.text-button:hover:not(:disabled) { background: #91aeff19; }
.button { display: inline-flex; min-height: 42px; gap: 12px; align-items: center; justify-content: center; padding: 9px 14px; border: 1px solid transparent; border-radius: 9px; font-size: .88rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.primary { background: #a8bdff; color: #111d39; }
.primary:hover:not(:disabled):not([aria-disabled]) { background: #cad7ff; }
.secondary { border-color: #455776; background: #182740; color: #edf2ff; }
.secondary:hover:not(:disabled) { background: #263a59; }
.auth .primary { display: flex; justify-content: space-between; width: 100%; margin-top: 16px; }
.note { font-size: .82rem; }
.auth .note { margin-top: 14px; min-height: 1.55em; }
.error { color: #ffadba; }
.button:disabled, .button[aria-disabled="true"], .text-button:disabled { opacity: .52; }
.dashboard-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-top: 50px; }
.dashboard-head h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); margin: 8px 0 12px; }
.controls { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 26px 0 18px; }
.toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: #15213a; font-size: .85rem; cursor: pointer; }
.toggle input { appearance: none; position: relative; margin: 0; width: 33px; height: 18px; border: 1px solid #7184a5; border-radius: 20px; background: #263652; cursor: pointer; }
.toggle input::before { position: absolute; content: ""; inset: 3px auto auto 3px; width: 10px; height: 10px; border-radius: 50%; background: #e2ebff; }
.toggle input:checked { background: #427d85; border-color: var(--cyan); }
.toggle input:checked::before { transform: translateX(15px); }
.groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 36px; }
.group { overflow: hidden; }
.directory .group-head { border-bottom: 1px solid var(--line); }
.directory-entry { display: flex; gap: 10px; align-items: center; justify-content: space-between; min-height: 74px; padding: 12px 18px; }
.directory-entry + .directory-entry { border-top: 1px solid var(--line); }
.group-head, .group-end { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 17px 18px; }
.group-end { min-height: 78px; border-top: 1px solid var(--line); }
.count { padding: 3px 9px; border-radius: 20px; color: var(--cyan); background: #25414c; font-size: .75rem; white-space: nowrap; }
.columns { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(55px, .85fr) minmax(47px, .75fr) 48px; align-items: center; gap: 8px; padding-inline: 18px; }
.group > .columns { min-height: 36px; font-size: .75rem; color: var(--muted); background: #0e192b; }
.routes { list-style: none; margin: 0; padding: 0; }
.route { min-height: 63px; padding-block: 8px; border-bottom: 1px solid #263752; }
.route:last-child { border-bottom: 0; }
.route.active { background: #203653; box-shadow: inset 3px 0 #92adff; }
.route-title { min-width: 0; display: grid; gap: 1px; }
.name, .selection { font-size: .92rem; font-weight: 650; overflow-wrap: anywhere; }
.subtle { display: block; font-size: .73rem; color: var(--muted); }
.latency { font: .77rem ui-monospace, monospace; color: #c7d5ec; white-space: nowrap; }
.status { color: #c0cbe0; font-size: .8rem; white-space: nowrap; }
.status::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 5px; background: currentColor; vertical-align: 2px; }
.status[data-state="available"] { color: var(--cyan); }
.status[data-state="timeout"] { color: #ffd28f; }
.status[data-state="error"] { color: #ffadba; }
.target { display: grid; min-height: 68vh; place-items: center; }
.target .panel { max-width: 500px; padding: 32px; }
.target h1 { margin-block: 12px 16px; font-size: 2.4rem; }
.target .button { margin-top: 22px; }

@media (max-width: 850px) {
  .groups { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .shell { width: calc(100% - 32px); }
  .masthead { height: 56px; }
  .gate { grid-template-columns: 1fr; margin-block: 42px; }
  .topology { height: 54px; margin-top: 18px; }
  .dashboard-head { margin-top: 34px; align-items: start; }
  .dashboard-head > .button { margin-top: 21px; }
  .columns, .group-head, .group-end { padding-inline: 12px; }
  .controls .note { flex-basis: 100%; }
}
