
:root {
  


  --bg: #0b1117;
  --bg-soft: #111a23;
  --panel: #16212c;
  --panel-2: #1b2836;
  --line: #26384a;
  --line-soft: #1e2c39;
  --text: #e6eef6;
  --text-dim: #9db2c6;
  --text-faint: #71889c;
  
  --accent: #5ee0a8;
  --accent-dim: #2a9d6f;
  --accent-soft: rgba(94, 224, 168, .14);
  --blue: #6fb6ff;
  --amber: #ffd08a;
  --red: #ff8a9c;
  --radius: 12px;
  --shadow: 0 8px 28px rgba(0, 0, 0, .38);
  --shadow-soft: 0 2px 10px rgba(0, 0, 0, .22);
  
  --ease: cubic-bezier(.4, 0, .2, 1);
}

* { box-sizing: border-box; }




[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1100px 520px at 12% -8%, rgba(94, 224, 168, .08), transparent 62%),
    radial-gradient(900px 460px at 92% 4%, rgba(111, 182, 255, .07), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

button, input, select, textarea { font: inherit; color: inherit; }


.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  transition: .16s ease;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { border-color: var(--accent-dim); background: #1e2f42; }
.btn:disabled { opacity: .42; cursor: not-allowed; }
.btn.primary {
  background: linear-gradient(180deg, #2ee08f, #17b573);
  border-color: #24c47c;
  color: #04220f;
  font-weight: 600;
}
.btn.primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn.danger { border-color: #573039; color: #ffc2cb; }
.btn.danger:hover:not(:disabled) { background: #32202a; border-color: #8c4257; }
.btn.tiny { padding: 4px 10px; font-size: 12px; border-radius: 7px; }
.btn.block { width: 100%; }

input, select, textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #0b141c;
  outline: none;
  transition: .16s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent-dim); }
label { display: block; margin-bottom: 12px; }
label > span { display: block; margin-bottom: 5px; color: var(--text-dim); font-size: 12.5px; }

.code {
  font-family: "JetBrains Mono", Consolas, "Courier New", monospace;
  font-size: 12.5px;
  background: #060b10;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px 13px;
  word-break: break-all;
  white-space: pre-wrap;
  color: #9ff5cd;
}

.muted { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.err { color: var(--red); font-size: 13px; margin-bottom: 10px; }
.ok  { color: var(--accent); }
.center { text-align: center; }
.mono { font-family: "JetBrains Mono", Consolas, monospace; }


/* ============ 登录 / 注册 ============ */
.auth-view {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 20px;
  overflow: hidden;
}

/* 背景：极淡网格 + 三团缓慢漂移的光晕 */
.auth-bg { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.auth-bg::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.028) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, #000 30%, transparent 78%);
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, #000 30%, transparent 78%);
}
.auth-bg .glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .5;
  animation: auth-drift 18s ease-in-out infinite alternate;
}
.auth-bg .glow.a {
  width: 520px; height: 520px; left: -120px; top: -160px;
  background: radial-gradient(circle, rgba(94,224,168,.30), transparent 68%);
}
.auth-bg .glow.b {
  width: 460px; height: 460px; right: -110px; bottom: -150px;
  animation-delay: -7s;
  background: radial-gradient(circle, rgba(111,182,255,.22), transparent 68%);
}
.auth-bg .glow.c {
  width: 320px; height: 320px; left: 52%; top: 8%;
  animation-delay: -12s;
  background: radial-gradient(circle, rgba(94,224,168,.12), transparent 70%);
}
@keyframes auth-drift {
  from { transform: translate3d(0,0,0) scale(1); }
  to   { transform: translate3d(26px,-22px,0) scale(1.09); }
}

.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 410px;
  background: linear-gradient(180deg, rgba(24,35,47,.97), rgba(14,21,29,.99));
  border: 1px solid rgba(255,255,255,.075);
  border-radius: 18px;
  padding: 30px 28px 26px;
  box-shadow:
    0 24px 60px -20px rgba(0,0,0,.85),
    0 1px 0 rgba(255,255,255,.055) inset;
  overflow: hidden;
  animation: auth-card-in .5s cubic-bezier(.22,1,.36,1) both;
}
@keyframes auth-card-in {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to   { opacity: 1; transform: none; }
}
.auth-card::before {
  content: "";
  position: absolute; left: 0; right: 0; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(94,224,168,.55), transparent);
}

.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.auth-card .logo-mark { width: 38px; height: 38px; border-radius: 11px; font-size: 14px; flex: none; }
.auth-brand-txt b { display: block; font-size: 18px; line-height: 1.2; letter-spacing: .2px; }
.auth-brand-txt span { display: block; font-size: 11.5px; color: var(--text-faint); letter-spacing: .6px; margin-top: 2px; }
.auth-sub { color: var(--text-dim); font-size: 13px; margin: 0 0 22px; }

/* 分段标签 */
.auth-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 11px;
  background: #0a131c;
  border: 1px solid rgba(255,255,255,.045);
  margin-bottom: 22px;
}
.auth-tabs button {
  flex: 1;
  padding: 9px 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-dim);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: color .2s, background .2s;
}
.auth-tabs button:hover { color: var(--text); }
.auth-tabs button.active {
  background: linear-gradient(180deg, #1d2c3b, #17242f);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 2px 8px -2px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.07);
}

/* 输入 */
.auth-card .field { margin-bottom: 15px; }
.auth-card .field label { display: block; font-size: 12.5px; color: var(--text-dim); margin-bottom: 7px; font-weight: 500; }
.wrap { position: relative; display: flex; align-items: center; }
.wrap .ico {
  position: absolute; left: 13px; width: 17px; height: 17px;
  color: var(--text-faint); pointer-events: none; transition: color .18s;
}
.wrap input {
  width: 100%;
  padding: 13px 44px 13px 40px;
  background: #0a131c;
  border: 1px solid rgba(255,255,255,.075);
  border-radius: 11px;
  color: var(--text);
  font-size: 14.5px;
  font-family: inherit;
  outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.wrap input::placeholder { color: #4c5f70; }
.wrap input:hover { border-color: rgba(255,255,255,.14); }
.wrap input:focus {
  border-color: rgba(94,224,168,.55);
  background: #0c1620;
  box-shadow: 0 0 0 3px rgba(94,224,168,.12);
}
.wrap:focus-within .ico { color: var(--accent); }

.eye {
  position: absolute; right: 8px; width: 34px; height: 34px;
  border: 0; border-radius: 8px; background: transparent;
  color: var(--text-faint); cursor: pointer;
  display: grid; place-items: center; transition: .16s;
}
.eye:hover { background: rgba(255,255,255,.05); color: var(--text); }

/* 验证码输入行：输入框 + 获取按钮 */
.code-row input { padding-right: 118px; }
.code-btn {
  position: absolute; right: 6px;
  height: 34px; padding: 0 11px;
  border: 1px solid rgba(94,224,168,.32);
  border-radius: 8px;
  background: rgba(94,224,168,.08);
  color: var(--accent);
  font-size: 12px; font-weight: 600; font-family: inherit;
  cursor: pointer; white-space: nowrap;
  transition: .16s;
}
.code-btn:hover:not([disabled]) {
  background: rgba(94,224,168,.16);
  border-color: rgba(94,224,168,.55);
}
.code-btn[disabled] {
  color: var(--text-faint);
  border-color: rgba(255,255,255,.08);
  background: transparent;
  cursor: not-allowed;
}
.code-btn.sending { color: var(--text-dim); }

.caps { display: none; align-items: center; gap: 6px; margin-top: 7px; font-size: 11.5px; color: var(--amber); }
.caps.on { display: flex; }

/* 密码强度 */
.strength { margin-top: 9px; display: none; }
.strength.on { display: block; }
.strength .bars { display: flex; gap: 4px; margin-bottom: 5px; }
.strength .bars i { flex: 1; height: 3px; border-radius: 2px; background: rgba(255,255,255,.08); transition: background .25s; }
.strength[data-lv="1"] .bars i:nth-child(1) { background: var(--red); }
.strength[data-lv="2"] .bars i:nth-child(-n+2) { background: var(--amber); }
.strength[data-lv="3"] .bars i:nth-child(-n+3) { background: var(--accent); }
.strength span { font-size: 11.5px; color: var(--text-faint); }

/* 记住我 */
.auth-row { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 18px; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; margin: 0; }
.check span { font-size: 12.5px; color: var(--text-dim); }
.auth-hint { font-size: 12px; color: var(--text-faint); }

/* 按钮 */
.auth-card .btn.primary {
  width: 100%;
  padding: 13px;
  border-radius: 11px;
  font-size: 14.5px;
  font-weight: 650;
  color: #04210f;
  background: linear-gradient(135deg, #6cf0b8, var(--accent-dim));
  box-shadow: 0 10px 26px -12px rgba(94,224,168,.85);
  transition: transform .14s, box-shadow .18s, filter .18s;
}
.auth-card .btn.primary:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 14px 30px -12px rgba(94,224,168,.95); }
.auth-card .btn.primary:active { transform: translateY(0); }
.auth-card .btn.primary[disabled] { opacity: .75; cursor: not-allowed; transform: none; }

.auth-card .spin {
  display: none;
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(4,33,15,.35);
  border-top-color: #04210f;
  animation: auth-sp .7s linear infinite;
  vertical-align: -2px; margin-right: 8px;
}
.auth-card .btn.loading .spin { display: inline-block; }
@keyframes auth-sp { to { transform: rotate(360deg); } }

/* 错误提示 */
.auth-err {
  display: none;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 13px;
  margin: 0 0 15px;
  border-radius: 10px;
  background: rgba(255,138,156,.09);
  border: 1px solid rgba(255,138,156,.28);
  color: #ffc2cb;
  font-size: 12.5px;
  line-height: 1.5;
}
.auth-err:not([hidden]) { display: flex; animation: auth-shake .38s; }
@keyframes auth-shake {
  0%,100% { transform: translateX(0); }
  22% { transform: translateX(-6px); }
  44% { transform: translateX(5px); }
  66% { transform: translateX(-3px); }
  88% { transform: translateX(2px); }
}

.auth-foot {
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid rgba(255,255,255,.05);
  font-size: 11.5px;
  color: var(--text-faint);
  text-align: center;
  line-height: 1.6;
}

@media (max-width: 440px) {
  .auth-card { padding: 26px 20px 22px; border-radius: 16px; }
  .auth-brand-txt b { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-bg .glow, .auth-card, .auth-err:not([hidden]) { animation: none !important; }
}


.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 22px;
  


  background: rgba(7, 12, 17, .97);
  border-bottom: 1px solid var(--line-soft);
}
.topbar .logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.topbar .spacer { flex: 1; }
.topbar .user { color: var(--text-dim); font-size: 13px; }
.topbar .user b { color: var(--text); }


main { position: relative; z-index: 1; padding: 22px; max-width: 1560px; margin: 0 auto; }

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 26px 0 12px;
  font-size: 15px;
  font-weight: 600;
}
.section-title .sub { font-size: 12.5px; color: var(--text-faint); font-weight: 400; }

.summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  gap: 12px;
}
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 17px;
}
.stat .k { font-size: 12.5px; color: var(--text-dim); margin-bottom: 5px; }
.stat .v { font-size: 23px; font-weight: 700; letter-spacing: -.4px; }
.stat .v.small { font-size: 18px; }
.stat .u { font-size: 12px; color: var(--text-faint); margin-left: 4px; font-weight: 400; }
.stat.up .v { color: var(--amber); }
.stat.down .v { color: var(--blue); }
.stat.total .v { color: var(--accent); }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}



.region-scope {
  display: flex; flex-wrap: wrap; gap: 7px;
  padding-bottom: 15px; margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.region-scope .chip {
  padding: 4px 13px; font-size: 12.5px;
  background: transparent; color: var(--text-dim);
  border: 1px solid var(--line); border-radius: 16px; cursor: pointer;
}
.region-scope .chip:hover { color: var(--text); }
.region-scope .chip.active {
  color: #0b1117; background: var(--accent, #57d9a3); border-color: transparent;
}

.region-scope .chip.offline { opacity: .65; }
.region-scope .chip .dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  margin-right: 6px; vertical-align: middle;
}
.region-scope .chip .dot.off { background: #6b7c8c; }


.isp-strip { margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.isp-strip-head {
  display: flex; align-items: baseline; justify-content: space-between;
  font-size: 12.5px; color: var(--text-faint); font-weight: 500; margin-bottom: 9px;
}
.isp-bar {
  display: flex; height: 11px; border-radius: 6px; overflow: hidden;
  background: #0f1a24;
}
.isp-bar > i {
  display: block; height: 100%; width: 100%;
  transform-origin: left center;
  will-change: transform;
  transition: transform .4s ease;
}
.isp-legend {
  display: flex; flex-wrap: wrap; gap: 9px 20px;
  margin-top: 11px; font-size: 12.5px; color: var(--text-dim);
}
.isp-legend span { display: inline-flex; align-items: center; gap: 6px; }
.isp-legend i { width: 9px; height: 9px; border-radius: 2px; flex: none; }
.isp-legend b { color: var(--text); font-weight: 600; }
.isp-legend em { color: var(--text-faint); font-style: normal; }

.region-list { display: flex; flex-direction: column; gap: 9px; }
.region-row {
  display: grid;
  grid-template-columns: 22px 96px 1fr 118px;
  align-items: center;
  gap: 11px;
  font-size: 13px;
}
.region-rank {
  color: var(--text-faint);
  font-weight: 700;
  font-size: 12px;
  text-align: center;
}
.region-rank.top { color: var(--accent); }
.region-name { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.region-bar { height: 7px; background: #0f1a24; border-radius: 4px; overflow: hidden; }



.region-bar > i {
  display: block; height: 100%; width: 100%;
  transform-origin: left center;
  background: linear-gradient(90deg, #2a9d6f, #5ee0a8);
  border-radius: 4px;
  will-change: transform;
  transition: transform .4s ease;
}
.region-val { text-align: right; color: var(--text-dim); font-size: 12.5px; }


.code-hero {
  font-size: 13.5px;
  padding: 14px 16px;
  line-height: 1.7;
  word-break: break-all;
  border-color: var(--accent-dim);
  background: #101c24;
}
.btn.block { display: block; width: 100%; padding: 11px; font-size: 14px; }
.adv {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.adv > summary {
  cursor: pointer;
  font-size: 12.5px;
  color: var(--text-faint);
  list-style: none;
  user-select: none;
}
.adv > summary::before { content: "▸ "; }
.adv[open] > summary::before { content: "▾ "; }
.adv > summary:hover { color: var(--text-dim); }
.adv .code { margin-top: 6px; font-size: 11.5px; }


.selfcheck-banner {
  padding: 9px 12px;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 600;
  color: #ffe0b8;
  background: rgba(255, 190, 110, .14);
  border: 1px solid rgba(255, 190, 110, .34);
  border-radius: 9px;
}
.selfcheck-panel { border-color: rgba(255, 180, 80, .18); }
.card-warn {
  margin-top: 10px;
  padding: 7px 10px;
  font-size: 12.5px;
  color: #ffe0b8;
  background: rgba(255, 190, 110, .12);
  border: 1px solid rgba(255, 190, 110, .3);
  border-radius: 8px;
  cursor: help;
}
.check-row {
  display: grid;
  grid-template-columns: 10px 88px 1fr;
  align-items: baseline;
  gap: 9px;
  font-size: 12.5px;
  padding: 5px 0;
}
.check-row + .check-row { border-top: 1px solid var(--line-soft); }
.check-dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block; transform: translateY(-1px);
}
.check-dot.ok { background: var(--accent); box-shadow: 0 0 7px rgba(94, 224, 168, .4); }
.check-dot.bad { background: var(--red); box-shadow: 0 0 7px rgba(255, 138, 156, .42); }
.check-name { color: var(--text-dim); }
.check-detail { color: var(--text-faint); word-break: break-all; }
.ok-text { color: var(--accent); }
.bad-text { color: var(--red); }


.trend-box { position: relative; height: 190px; }
.trend-box canvas { width: 100%; height: 100%; display: block; }
.trend-legend { display: flex; gap: 18px; font-size: 12.5px; color: var(--text-dim); margin-bottom: 8px; }
.trend-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; }


.toolbar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin: 24px 0 13px; }
.toolbar .spacer { flex: 1; }
.rate-picker { display: flex; align-items: center; gap: 7px; font-size: 12.5px; }
.rate-picker select {
  width: auto;
  padding: 5px 9px;
  font-size: 12.5px;
  border-radius: 8px;
}
.rate-picker #live-hint { min-width: 58px; }
.chip {
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--panel);
  cursor: pointer;
  font-size: 12.5px;
  color: var(--text-dim);
}
.chip.active { border-color: var(--accent-dim); color: var(--accent); background: #14291f; }


.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 16px;
  transition: .18s ease;
}
.card:hover { border-color: #2f4d66; transform: translateY(-2px); }
.card.offline { opacity: .62; }

.card-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 13px; }
.card-title { flex: 1; min-width: 0; }
.card-title h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-title .meta { font-size: 11.5px; color: var(--text-faint); margin-top: 2px; }

.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-faint); flex-shrink: 0; margin-top: 7px;
}
.dot.on { background: var(--accent); box-shadow: 0 0 9px rgba(94, 224, 168, .48); }
.dot.off { background: #4a5c6b; }

.metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 13px; margin-bottom: 11px; }
.metric .k { font-size: 11.5px; color: var(--text-faint); }
.metric .v { font-size: 15px; font-weight: 600; }
.metric .v.amber { color: var(--amber); }
.metric .v.blue { color: var(--blue); }




.card-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  padding-top: 11px;
  border-top: 1px solid var(--line-soft);
}
.card-actions .btn {
  padding: 7px 4px;
  font-size: 12px;
  text-align: center;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rate-row { display: flex; gap: 16px; margin-bottom: 12px; }
.rate-row .item { flex: 1; }
.rate-row .k { font-size: 11.5px; color: var(--text-faint); }
.rate-row .v { font-size: 19px; font-weight: 700; letter-spacing: -.5px; }
.rate-row .v.up { color: var(--amber); }
.rate-row .v.down { color: var(--blue); }
.rate-row .sub { font-size: 11px; color: var(--text-faint); }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 11px;
  background: #17303f;
  color: var(--text-dim);
}

.empty {
  padding: 54px 20px;
  text-align: center;
  color: var(--text-faint);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}


.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(580px, 94vw);
  background: var(--bg-soft);
  border-left: 1px solid var(--line);
  transform: translateX(102%);
  transition: transform .26s cubic-bezier(.4, 0, .2, 1);
  z-index: 60;
  overflow-y: auto;
  box-shadow: -14px 0 40px rgba(0, 0, 0, .5);
}
.drawer.open { transform: translateX(0); }
.drawer-head {
  position: sticky; top: 0;
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px;
  background: rgba(12, 20, 28, .96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  z-index: 2;
}
.drawer-head h2 { margin: 0; font-size: 16px; flex: 1; }
.drawer-body { padding: 18px 20px 40px; }

.kv { display: grid; grid-template-columns: 116px 1fr; gap: 7px 14px; font-size: 13px; }
.kv .k { color: var(--text-faint); }
.kv .v { word-break: break-all; }

table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th, td { padding: 7px 9px; text-align: left; border-bottom: 1px solid var(--line-soft); }
th { color: var(--text-faint); font-weight: 500; font-size: 11.5px; }
tbody tr:hover { background: #0e1a24; }


.modal {
  position: fixed; inset: 0;
  background: rgba(3, 7, 10, .74);
  display: grid; place-items: center;
  padding: 22px;
  z-index: 80;
  backdrop-filter: blur(3px);
}
.modal[hidden] { display: none; }
.modal-card {
  width: 100%;
  max-width: 600px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 22px 24px;
  box-shadow: var(--shadow);
}
.modal-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.modal-head h2 { margin: 0 0 3px; font-size: 17px; }
.modal-head .sub { font-size: 12.5px; color: var(--text-dim); }
.modal-head .spacer { flex: 1; }
.modal-actions { display: flex; gap: 9px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }

.step { margin-bottom: 20px; }
.step-title { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; font-size: 13.5px; font-weight: 600; }
.step-title .n {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent-dim); color: #04220f;
  display: grid; place-items: center; font-size: 11.5px; font-weight: 700;
}


.toast {
  position: fixed;
  left: 50%; bottom: 30px;
  transform: translate(-50%, 130%);
  padding: 11px 20px;
  border-radius: 10px;
  background: #1b2b3d;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  z-index: 200;
  transition: transform .28s cubic-bezier(.4, 0, .2, 1);
  max-width: 90vw;
  font-size: 13px;
}
.toast.show { transform: translate(-50%, 0); }
.toast.ok { border-color: var(--accent-dim); color: #c6ffe7; }
.toast.err { border-color: #8c4257; color: #ffd0d8; }

.spin {
  display: inline-block;
  width: 13px; height: 13px;
  border: 2px solid rgba(255, 255, 255, .25);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }




.split {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.split > section { min-width: 0; }

.split .section-title { margin-top: 26px; }


.split .trend-box { height: 300px; }

@media (max-width: 1180px) {
  .split { grid-template-columns: 1fr; gap: 0; }
  .split .trend-box { height: 190px; }
}


.summary { gap: 10px; }
.stat { padding: 13px 15px; }
.stat .k { font-size: 12px; margin-bottom: 3px; }
.stat .v { font-size: 21px; }
.stat .v.small { font-size: 16.5px; }


.grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.card { padding: 15px 16px; }
.card-head { margin-bottom: 11px; }
.metrics { gap: 8px 11px; margin-bottom: 11px; }
.card-actions { padding-top: 11px; }


.bw-row {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  align-items: baseline;
  gap: 9px;
  padding: 5px 0;
  font-size: 12.5px;
}
.bw-row + .bw-row { border-top: 1px solid var(--line-soft); }
.bw-val { text-align: right; white-space: nowrap; }
.bad-text { color: var(--red); }
.ok-text { color: var(--accent); }


.dir-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
}
.dir-col { min-width: 0; }
.dir-title {
  display: flex; align-items: baseline; justify-content: space-between;
  font-size: 13px; font-weight: 600;
  padding-bottom: 9px; margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.dir-title.up { color: var(--amber); }
.dir-title.down { color: var(--blue); }
.dir-title .sub { font-size: 11.5px; color: var(--text-faint); font-weight: 400; }
@media (max-width: 1180px) {
  .dir-grid { grid-template-columns: 1fr; gap: 18px; }
}


.cards-collapsed {
  padding: 14px 16px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 13px;
  background: var(--panel);
}


.card-deploy {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--line-soft);
  font-size: 11.5px;
  color: var(--text-dim);
}

.deploy-rolling {
  color: var(--amber);
  animation: deploy-pulse 1.4s ease-in-out infinite;
}
@keyframes deploy-pulse {
  0%, 100% { opacity: .4; }
  50%      { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .deploy-rolling { animation: none; opacity: 1; }
}


.iso-inv-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
  margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  font-size: 12.5px;
}


.freq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 6px;
}
.freq-cell {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 7px;
  background: #0f1a24;
  border: 1px solid var(--line-soft);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.freq-cell b { font-size: 10px; font-weight: 500; color: var(--text-faint); }
.freq-cell.hot { color: var(--accent); border-color: #1e4034; }
.freq-cell.mid { color: var(--amber); border-color: #3d3524; }
.freq-cell.low { color: var(--text-dim); }
.freq-foot {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--line-soft);
  font-size: 12px;
  color: var(--text-faint);
}


.trend-box { height: 280px; }






:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 3px var(--accent-soft);
}


* { scrollbar-width: thin; scrollbar-color: #2b3f52 transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #2b3f52;
  border-radius: 6px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: #3d576e; background-clip: content-box; }


.card, .panel, .btn, .chip, .stat, .drawer, .modal-card, .toast {
  transition-timing-function: var(--ease);
}


.card:hover { transform: translateY(-1px); box-shadow: var(--shadow-soft); }


::selection { background: var(--accent-soft); color: var(--text); }


@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .card:hover { transform: none; }
}









@media (max-width: 820px) {
  main {
    padding: 12px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  }

  
  .topbar { padding: 10px 12px; gap: 9px; }
  .topbar .logo { font-size: 15px; }
  .topbar .user { display: none; }
  .topbar .btn.tiny { padding: 7px 11px; font-size: 13px; }

  
  
  input, select, textarea { font-size: 16px; }
  .btn { padding: 9px 14px; }
  .btn.tiny { padding: 8px 12px; font-size: 13px; }
  .chip { padding: 7px 14px; font-size: 13px; }

  
  .summary { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat { padding: 12px 13px; }
  .stat .k { font-size: 12px; }
  .stat .v { font-size: 19px; }
  .stat .v.small { font-size: 15.5px; }

  
  .toolbar { gap: 7px; margin: 18px 0 12px; }
  .rate-picker { font-size: 13px; }

  
  .grid { grid-template-columns: 1fr; gap: 12px; }
  .card { padding: 14px 15px; }
  .card:hover { transform: none; }          
  .card-actions { gap: 8px; }
  .card-actions { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
  .card-actions .btn { padding: 8px 2px; font-size: 11.5px; }

  
  .drawer { width: 100%; border-left: none; }
  .drawer-head { padding: 13px 15px; }
  .drawer-head h2 { font-size: 15px; }
  .drawer-body { padding: 14px 15px 40px; }

  
  .panel { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 400px; }

  
  .kv { grid-template-columns: 88px 1fr; gap: 6px 10px; font-size: 12.5px; }

  
  .region-row { grid-template-columns: 18px 68px 1fr 82px; gap: 7px; font-size: 12.5px; }
  .isp-legend { gap: 7px 13px; font-size: 12px; }
  .region-scope { gap: 6px; }

  
  .check-row { grid-template-columns: 10px 72px 1fr; gap: 7px; font-size: 12px; }
  .selfcheck-banner { font-size: 12.5px; padding: 8px 10px; }

  
  .modal { padding: 0; place-items: end stretch; }
  .modal-card {
    width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    border-radius: 16px 16px 0 0;
    padding: 18px 15px calc(20px + env(safe-area-inset-bottom, 0px));
  }
  .modal-head h2 { font-size: 16px; }
  .modal-actions { gap: 8px; }
  .modal-actions .btn { flex: 1; }

  
  .code { font-size: 12px; word-break: break-all; white-space: pre-wrap; }
  .code-hero { font-size: 12.5px; padding: 12px; line-height: 1.6; }

  
  .trend-box { height: 160px; }

  
  .toast {
    left: 12px;
    right: 12px;
    max-width: none;
    transform: translate(0, 130%);
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
  .toast.show { transform: translate(0, 0); }
}


@media (max-width: 400px) {
  main { padding: 10px; }
  .stat .v { font-size: 17px; }
  .stat { padding: 10px; }
  .region-row { grid-template-columns: 16px 60px 1fr 74px; gap: 6px; }
  .region-name { font-size: 11.5px; }
  .check-row { grid-template-columns: 10px 64px 1fr; }
  .card-actions { gap: 4px; }
  .card-actions .btn { padding: 8px 1px; font-size: 11px; }
}


@media (hover: none) {
  .card:hover { border-color: var(--line); }
  .btn:hover:not(:disabled) { background: transparent; border-color: var(--line); }
  .btn.primary:hover:not(:disabled) { filter: none; }
}


.disk-role {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 10.5px;
  font-style: normal;
  font-weight: 500;
  vertical-align: middle;
}
.disk-role.sys { background: #23303d; color: #9db2c6; }
.disk-role.data { background: #14291f; color: var(--accent); }
.disk-role.lv { background: #2a2740; color: #c0b3ff; }




@media (max-width: 820px) {
  html, body { font-size: 15px; }

  
  .panel table { min-width: 0; width: 100%; }
  table thead { display: none; }              
  table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "col1 col3"
      "col2 col4";
    row-gap: 4px;
    column-gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line-soft);
  }
  table tr:last-child { border-bottom: none; }
  table td { display: block; padding: 0 !important; border: none; }
  table tr > td:nth-child(1) { grid-area: col1; font-size: 14px; font-weight: 600; }
  table tr > td:nth-child(2) { grid-area: col2; font-size: 13px; color: var(--text-dim); }
  table tr > td:nth-child(3) { grid-area: col3; text-align: right; font-size: 14px; }
  table tr > td:nth-child(4) { grid-area: col4; text-align: right; font-size: 13px; color: var(--text-faint); }

  
  .region-row {
    grid-template-columns: 22px minmax(0, 1fr) auto;
    grid-template-areas:
      "rank name val"
      ".    bar  bar";
    row-gap: 5px;
    column-gap: 9px;
    font-size: 14px;
    padding: 3px 0;
  }
  .region-rank { grid-area: rank; font-size: 13px; }
  .region-name { grid-area: name; font-size: 14px; }
  .region-bar { grid-area: bar; height: 6px; }
  .region-val { grid-area: val; font-size: 13.5px; }

  
  .kv { grid-template-columns: 104px minmax(0, 1fr); gap: 9px 12px; font-size: 14px; }
  .kv .k { color: var(--text-dim); }

  
  .bw-row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; font-size: 14px; padding: 7px 0; }
  .bw-row .check-detail { grid-column: 1 / -1; font-size: 13px; }   
  .bw-val { font-size: 14px; }

  
  .check-row { grid-template-columns: 12px minmax(0, 1fr); gap: 6px 9px; font-size: 14px; padding: 7px 0; }
  .check-row .check-detail { grid-column: 2; font-size: 13px; }
  .selfcheck-banner { font-size: 14px; padding: 10px 12px; }

  
  .stat { padding: 13px 14px; }
  .stat .k { font-size: 12.5px; }
  .stat .v { font-size: 22px; }
  .stat .v.small { font-size: 18px; }

  
  #domains .region-name { font-size: 13.5px; }

  
  .item .v { font-size: 21px; }
  .metric .v { font-size: 17px; }
  .card-title h3 { font-size: 16px; }
}




.server-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.server-strip:empty { display: none; }
.srv {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  background: linear-gradient(180deg, var(--bg-soft), rgba(17, 26, 35, .6));
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  transition: border-color .2s;
  min-width: 0;
}
.srv:hover { border-color: var(--line); }
.srv-ring { width: 52px; height: 52px; flex-shrink: 0; }
.srv-ring circle { fill: none; stroke-width: 5; }
.srv-ring .track { stroke: rgba(120, 150, 185, .14); }
.srv-ring .bar {
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dashoffset .55s cubic-bezier(.4, 0, .2, 1), stroke .3s;
  filter: drop-shadow(0 0 5px currentColor);
  opacity: .92;
}
.srv-info { min-width: 0; }
.srv-info .sk { font-size: 11.5px; color: var(--text-faint); letter-spacing: .4px; line-height: 1.2; }
.srv-info .sv {
  font-size: 17px;
  font-weight: 650;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.4px;
  line-height: 1.35;
}
.srv-info .sv u { font-size: 11.5px; font-weight: 500; color: var(--text-faint); text-decoration: none; margin-left: 2px; }
.srv-info .sx { font-size: 11px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 1100px) {
  .server-strip { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  .server-strip { grid-template-columns: repeat(2, 1fr); gap: 9px; margin-bottom: 14px; }
  .srv { padding: 10px 12px; gap: 10px; border-radius: 12px; }
  .srv-ring { width: 42px; height: 42px; }
  .srv-info .sv { font-size: 15px; }
  .srv-info .sx { display: none; }
}


.diag-ok { color: var(--accent); font-size: 12.5px; margin-bottom: 2px; }
.diag-pre {
  max-height: 380px;
  overflow: auto;
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--line-soft);
  font: 12px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace;
  color: var(--text-dim);
  white-space: pre-wrap;
  word-break: break-word;
}

@media (hover: none) and (max-width: 820px) {
  .card:hover { border-color: var(--line); }
}
