/* ==========================================================
   EasyTier Console — Design System
   ========================================================== */

:root {
  /* 颜色 */
  --brand: #3b7cf0;
  --brand-2: #5b9bff;
  --brand-deep: #1f5bd0;
  --violet: #7c5cf0;
  --green: #17a673;
  --green-soft: #d8f5ea;
  --red: #e2564a;
  --red-soft: #fde3e0;
  --amber: #e08c1d;

  /* 深色底 */
  --bg: #0d1117;
  --bg-2: #121821;
  --panel: #161d27;
  --panel-2: #1b2431;
  --panel-3: #212c3c;
  --line: #27323f;
  --line-2: #33404f;

  /* 文字 */
  --text: #e8eef7;
  --text-2: #9fb0c4;
  --text-3: #64758a;

  /* 阴影 / 圆角 */
  --sh-sm: 0 1px 2px rgba(0,0,0,.4);
  --sh-md: 0 4px 16px rgba(0,0,0,.35);
  --sh-lg: 0 24px 64px rgba(0,0,0,.55);
  --r-sm: 7px;
  --r-md: 11px;
  --r-lg: 16px;
  --r-xl: 22px;

  --sidebar-w: 274px;
  --bar-h: 58px;

  --ease: cubic-bezier(.32,.72,.28,1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  height: 100%;
}

body {
  background:
    radial-gradient(1100px 520px at 82% -12%, rgba(59,124,240,.13), transparent 62%),
    radial-gradient(900px 460px at 2% 102%, rgba(124,92,240,.09), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  font-size: 13.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

[hidden] { display: none !important; }

.mono {
  font-family: "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;
  font-variant-ligatures: none;
  letter-spacing: -.01em;
}

.dim { color: var(--text-3); }

::selection { background: rgba(59,124,240,.34); }

/* 滚动条 */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--line-2);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: #465568; background-clip: padding-box; }

/* ============ 启动过渡 ============ */
.boot-screen {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 20px;
  background: var(--bg);
  z-index: 500;
  animation: fadeIn .2s ease;
}
.boot-screen p { color: var(--text-3); font-size: 12.5px; letter-spacing: .04em; margin: 0; }
.boot-mark { display: flex; gap: 7px; }
.boot-mark i {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--brand);
  animation: bounceDot 1.1s infinite var(--ease);
}
.boot-mark i:nth-child(2) { animation-delay: .14s; background: var(--brand-2); }
.boot-mark i:nth-child(3) { animation-delay: .28s; background: var(--violet); }

@keyframes bounceDot {
  0%, 70%, 100% { transform: translateY(0); opacity: .5; }
  35% { transform: translateY(-9px); opacity: 1; }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ============ 登录 ============ */
.login-wrap {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 400;
  overflow: hidden;
  background: var(--bg);
}
.login-bg { position: absolute; inset: 0; overflow: hidden; }
.login-bg span {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .5;
}
.login-bg span:nth-child(1) {
  width: 540px; height: 540px;
  background: #1f5bd0;
  top: -190px; left: -120px;
  animation: drift 19s ease-in-out infinite;
}
.login-bg span:nth-child(2) {
  width: 460px; height: 460px;
  background: #7c5cf0;
  bottom: -180px; right: -100px;
  animation: drift 23s ease-in-out infinite reverse;
}
.login-bg span:nth-child(3) {
  width: 320px; height: 320px;
  background: #0e7a6a;
  top: 46%; left: 56%;
  opacity: .28;
  animation: drift 27s ease-in-out infinite;
}
@keyframes drift {
  0%, 100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(46px,-36px) scale(1.14); }
}

.login-card {
  position: relative;
  width: 396px;
  padding: 34px 34px 22px;
  background: linear-gradient(180deg, rgba(28,36,48,.94), rgba(20,26,35,.97));
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-lg), inset 0 1px 0 rgba(255,255,255,.045);
  backdrop-filter: blur(22px);
  animation: cardIn .5s var(--ease) both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px) scale(.975); }
  to { opacity: 1; transform: none; }
}

.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.brand-logo {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 13px;
  background: linear-gradient(145deg, var(--brand) 0%, var(--violet) 100%);
  color: #fff;
  box-shadow: 0 8px 22px -6px rgba(59,124,240,.68);
  flex-shrink: 0;
}
.brand-logo svg { width: 27px; height: 27px; }
.brand-logo.sm { width: 32px; height: 32px; border-radius: 9px; }
.brand-logo.sm svg { width: 19px; height: 19px; }

.login-brand h1 { font-size: 18px; font-weight: 680; margin: 0 0 3px; letter-spacing: -.015em; }
.login-brand p { font-size: 12px; color: var(--text-3); margin: 0; }

.field-label {
  display: block;
  font-size: 11.5px;
  font-weight: 620;
  color: var(--text-2);
  margin-bottom: 8px;
  letter-spacing: .03em;
}

.pwd-wrap { position: relative; }
.pwd-ico {
  position: absolute; left: 13px; top: 50%;
  transform: translateY(-50%);
  width: 17px; height: 17px;
  color: var(--text-3);
  pointer-events: none;
}
#pwdInput {
  width: 100%;
  height: 44px;
  padding: 0 14px 0 40px;
  background: rgba(9,13,18,.72);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  color: var(--text);
  font-size: 14px;
  letter-spacing: .12em;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
#pwdInput::placeholder { letter-spacing: 0; color: var(--text-3); }
#pwdInput:focus {
  outline: none;
  border-color: var(--brand);
  background: rgba(9,13,18,.95);
  box-shadow: 0 0 0 3.5px rgba(59,124,240,.16);
}
.shake { animation: shake .4s; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  22% { transform: translateX(-7px); }
  44% { transform: translateX(6px); }
  66% { transform: translateX(-4px); }
  88% { transform: translateX(2px); }
}

.err-line {
  color: #f08a80;
  font-size: 12.5px;
  min-height: 18px;
  margin: 9px 0 4px;
}

.btn-block { width: 100%; height: 44px; margin-top: 6px; }

.login-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 22px; padding-top: 15px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--text-3);
}
.login-sec { display: inline-flex; align-items: center; gap: 6px; }
.login-sec i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(23,166,115,.16);
}

/* ============ 通用按钮 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 15px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 560;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all .16s var(--ease);
  position: relative;
  user-select: none;
}
.btn svg { width: 15px; height: 15px; fill: currentColor; stroke: none; }
.btn svg[fill="none"] { fill: none; }
.btn:active { transform: scale(.975); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(180deg, var(--brand-2), var(--brand));
  color: #fff;
  box-shadow: 0 4px 14px -4px rgba(59,124,240,.6), inset 0 1px 0 rgba(255,255,255,.16);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #6aa6ff, #4685f5);
  box-shadow: 0 6px 20px -4px rgba(59,124,240,.76), inset 0 1px 0 rgba(255,255,255,.2);
}

.btn-ghost {
  background: var(--panel-2);
  border-color: var(--line-2);
  color: var(--text-2);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--panel-3);
  border-color: #3d4b5c;
  color: var(--text);
}

.btn-danger {
  background: linear-gradient(180deg, #e8604f, var(--red));
  color: #fff;
  box-shadow: 0 4px 14px -4px rgba(226,86,74,.56), inset 0 1px 0 rgba(255,255,255,.14);
}
.btn-danger:hover:not(:disabled) { filter: brightness(1.08); }

.btn-sm { height: 31px; padding: 0 12px; font-size: 12.5px; }

.btn.loading { color: transparent !important; pointer-events: none; }
.btn.loading::after {
  content: '';
  position: absolute;
  width: 15px; height: 15px;
  border: 2px solid rgba(255,255,255,.32);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: all .16s;
  flex-shrink: 0;
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { background: var(--panel-3); color: var(--text); border-color: var(--line); }
.icon-btn.sm { width: 28px; height: 28px; }
.icon-btn.sm svg { width: 15px; height: 15px; }
.icon-btn.spin svg { animation: spin .55s var(--ease); }

/* ============ 顶栏 ============ */
.app { height: 100%; display: flex; flex-direction: column; }

.appbar {
  height: var(--bar-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 20px;
  background: rgba(15,20,27,.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
  z-index: 30;
}

.brand { display: flex; align-items: center; gap: 10px; margin-right: 6px; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.15; }
.brand-txt b { font-size: 14px; font-weight: 680; letter-spacing: -.01em; }
.brand-txt span { font-size: 10px; color: var(--text-3); letter-spacing: .11em; text-transform: uppercase; }

.hdr-metrics {
  display: flex; align-items: center; gap: 4px;
  padding-left: 18px;
  border-left: 1px solid var(--line);
}
.hm {
  display: flex; flex-direction: column;
  padding: 0 15px;
  border-right: 1px solid var(--line);
  min-width: 60px;
}
.hm-label { font-size: 10.5px; color: var(--text-3); letter-spacing: .05em; }
.hm-val {
  font-size: 16px; font-weight: 660;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  transition: color .2s;
}
.hm-val.bump { animation: bumpVal .38s var(--ease); }
@keyframes bumpVal {
  0% { transform: scale(1); }
  40% { transform: scale(1.16); color: var(--brand-2); }
  100% { transform: scale(1); }
}

.hm-wide { min-width: 140px; padding-right: 0; border-right: none; }
.hm-bar-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.hm-pct { font-size: 11.5px; font-weight: 600; color: var(--brand-2); font-variant-numeric: tabular-nums; }
.hm-bar {
  height: 3px; border-radius: 99px;
  background: var(--panel-3);
  margin-top: 6px; overflow: hidden;
}
.hm-bar i {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--violet));
  border-radius: 99px;
  transition: width .5s var(--ease);
}

.hdr-right {
  margin-left: auto;
  display: flex; align-items: center; gap: 6px;
}
.hdr-time {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11.5px; color: var(--text-3);
  font-variant-numeric: tabular-nums;
  padding-right: 6px;
}
.dot-live {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(23,166,115,.55);
  animation: pulseDot 2s infinite;
  flex-shrink: 0;
}
@keyframes pulseDot {
  0% { box-shadow: 0 0 0 0 rgba(23,166,115,.5); }
  70% { box-shadow: 0 0 0 7px rgba(23,166,115,0); }
  100% { box-shadow: 0 0 0 0 rgba(23,166,115,0); }
}

/* ============ 布局 ============ */
.layout { flex: 1; display: flex; min-height: 0; }

.side {
  width: var(--sidebar-w);
  flex-shrink: 0;
  display: flex; flex-direction: column;
  background: rgba(18,24,33,.62);
  border-right: 1px solid var(--line);
  min-height: 0;
}

.side-head {
  height: 44px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px 0 18px;
  font-size: 11px; font-weight: 620;
  color: var(--text-3);
  letter-spacing: .09em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}

.net-list { flex: 1; overflow-y: auto; padding: 9px; }

.side-empty {
  padding: 30px 14px; text-align: center;
}
.side-empty p { font-size: 13px; color: var(--text-2); margin: 0 0 4px; font-weight: 560; }
.side-empty span { font-size: 11.5px; color: var(--text-3); }

.net-item {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 11px;
  border-radius: var(--r-md);
  cursor: pointer;
  border: 1px solid transparent;
  margin-bottom: 3px;
  transition: all .16s var(--ease);
  position: relative;
}
.net-item:hover { background: rgba(255,255,255,.035); }
.net-item.active {
  background: linear-gradient(90deg, rgba(59,124,240,.16), rgba(59,124,240,.045));
  border-color: rgba(59,124,240,.34);
}
.net-item.active::before {
  content: '';
  position: absolute; left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 22px;
  border-radius: 0 3px 3px 0;
  background: var(--brand);
  box-shadow: 0 0 10px rgba(59,124,240,.8);
}

.net-avatar {
  width: 34px; height: 34px;
  flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 9px;
  font-size: 11.5px; font-weight: 700;
  letter-spacing: .03em;
  color: #cfe0ff;
  background: linear-gradient(145deg, rgba(59,124,240,.3), rgba(124,92,240,.24));
  border: 1px solid rgba(59,124,240,.28);
  position: relative;
}
.net-avatar.down {
  color: var(--text-3);
  background: var(--panel-2);
  border-color: var(--line-2);
}
.net-avatar.up::after {
  content: '';
  position: absolute; right: -3px; bottom: -3px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--green);
  border: 2px solid #10161e;
}
.net-avatar.down::after {
  content: '';
  position: absolute; right: -3px; bottom: -3px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--text-3);
  border: 2px solid #10161e;
}

.net-item-body { min-width: 0; flex: 1; }
.net-item-name {
  font-size: 13px; font-weight: 580;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  letter-spacing: -.005em;
}
.net-item-sub {
  font-size: 11px; color: var(--text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 1px;
}
.net-item-side { flex-shrink: 0; }
.mini-count {
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  color: var(--text-3);
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}
.mini-count.live {
  color: #58d6a4;
  background: rgba(23,166,115,.13);
  border-color: rgba(23,166,115,.28);
}

.side-foot {
  flex-shrink: 0;
  padding: 10px;
  border-top: 1px solid var(--line);
}
.side-btn {
  width: 100%; height: 34px;
  display: flex; align-items: center; gap: 8px;
  padding: 0 11px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 12.5px; font-family: inherit;
  cursor: pointer;
  transition: all .16s;
}
.side-btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.side-btn:hover { background: var(--panel-2); color: var(--text); border-color: var(--line-2); }

.side-meta {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-top: 11px; padding: 0 3px;
  font-size: 10.5px; color: var(--text-3);
}
.side-meta span { display: inline-flex; align-items: center; gap: 5px; }

/* ============ 主区 ============ */
.main {
  flex: 1; min-width: 0;
  overflow-y: auto;
  padding: 22px 26px 40px;
}

/* 空状态 */
.empty-state {
  height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding-bottom: 40px;
}
.es-art { width: 260px; margin-bottom: 8px; }
.es-art svg { width: 100%; height: auto; }
.empty-state h2 { font-size: 20px; font-weight: 660; margin: 0 0 10px; letter-spacing: -.02em; }
.empty-state p { font-size: 13px; color: var(--text-3); line-height: 1.75; margin: 0 0 22px; }

/* 网络头 */
.net-hero {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 24px;
  padding-bottom: 20px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.hero-main { min-width: 0; flex: 1; }
.hero-title { display: flex; align-items: center; gap: 12px; margin-bottom: 5px; }
.hero-title h1 {
  font-size: 23px; font-weight: 680; margin: 0;
  letter-spacing: -.025em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.net-status {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 9px;
  border-radius: 99px;
  font-size: 11px; font-weight: 600;
  color: #4fd6a2;
  background: rgba(23,166,115,.13);
  border: 1px solid rgba(23,166,115,.3);
  flex-shrink: 0;
}
.net-status i {
  width: 5px; height: 5px; border-radius: 50%;
  background: currentColor;
  animation: pulseDot 2s infinite;
}
.net-status.down {
  color: #f0938a;
  background: rgba(226,86,74,.12);
  border-color: rgba(226,86,74,.28);
}
.net-status.down i { animation: none; }

.hero-desc { font-size: 12.5px; color: var(--text-3); margin: 0 0 14px; }

.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.hchip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 29px; padding: 0 11px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 11.5px;
}
.hchip label { color: var(--text-3); font-size: 10.5px; letter-spacing: .04em; }
.hchip b { font-weight: 560; font-size: 12px; color: var(--text); }
.hchip.secret { padding-right: 4px; }
.hchip.secret b { min-width: 116px; font-size: 11.5px; color: var(--text-2); }

.eye-btn {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  background: transparent; border: none;
  border-radius: 5px;
  color: var(--text-3);
  cursor: pointer;
  transition: all .15s;
}
.eye-btn svg { width: 14px; height: 14px; }
.eye-btn:hover, .eye-btn.on { color: var(--brand-2); background: rgba(59,124,240,.12); }

.hero-acts { display: flex; align-items: center; gap: 8px; flex-shrink: 0; padding-top: 4px; }

/* 指标卡 */
.statbar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 11px;
  margin-bottom: 18px;
}
.stat-card {
  padding: 14px 15px 13px;
  background: linear-gradient(180deg, var(--panel), rgba(22,29,39,.6));
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  position: relative;
  overflow: hidden;
  transition: border-color .2s, transform .2s;
}
.stat-card:hover { border-color: var(--line-2); transform: translateY(-1px); }
.stat-card::after {
  content: '';
  position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.07), transparent);
}
.stat-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.stat-label { font-size: 11px; color: var(--text-3); letter-spacing: .045em; }
.stat-ico {
  width: 22px; height: 22px; border-radius: 6px;
  position: relative;
}
.stat-ico::before {
  content: ''; position: absolute; inset: 6px;
  border-radius: 3px;
}
.ico-on::before { background: var(--green); box-shadow: 0 0 10px rgba(23,166,115,.6); }
.ico-on { background: rgba(23,166,115,.1); }
.ico-lat::before { background: var(--brand); box-shadow: 0 0 10px rgba(59,124,240,.6); }
.ico-lat { background: rgba(59,124,240,.1); }
.ico-net::before { background: var(--violet); box-shadow: 0 0 10px rgba(124,92,240,.6); }
.ico-net { background: rgba(124,92,240,.1); }
.ico-rev::before { background: var(--red); box-shadow: 0 0 10px rgba(226,86,74,.5); }
.ico-rev { background: rgba(226,86,74,.1); }

.stat-val {
  font-size: 26px; font-weight: 660;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.025em;
  display: flex; align-items: baseline; gap: 4px;
}
.stat-unit { font-size: 12px; font-weight: 500; color: var(--text-3); letter-spacing: 0; }
.stat-bar {
  height: 3px; border-radius: 99px;
  background: var(--panel-3);
  margin-top: 10px;
  overflow: hidden;
}
.stat-bar i {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--green), #3fd6a0);
  border-radius: 99px;
  transition: width .5s var(--ease);
}
.stat-foot { font-size: 10.5px; color: var(--text-3); margin-top: 9px; }

/* 工具栏 */
.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px;
  margin-bottom: 13px;
  flex-wrap: wrap;
}
.group-filter { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.filter-chip {
  height: 28px; padding: 0 11px;
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--text-2);
  font-size: 12px; font-family: inherit;
  cursor: pointer;
  transition: all .15s;
}
.filter-chip b {
  font-size: 10.5px; font-weight: 600;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.filter-chip:hover { border-color: var(--line-2); color: var(--text); }
.filter-chip.on {
  background: rgba(59,124,240,.15);
  border-color: rgba(59,124,240,.42);
  color: #a8c8ff;
}
.filter-chip.on b { color: #a8c8ff; }

.toolbar-right { display: flex; align-items: center; gap: 8px; }

.search-wrap { position: relative; }
.search-wrap svg {
  position: absolute; left: 10px; top: 50%;
  transform: translateY(-50%);
  width: 15px; height: 15px;
  color: var(--text-3);
  pointer-events: none;
}
#devSearch {
  width: 216px; height: 32px;
  padding: 0 11px 0 32px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 12.5px;
  font-family: inherit;
  transition: all .16s;
}
#devSearch::placeholder { color: var(--text-3); }
#devSearch:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(59,124,240,.13);
  width: 246px;
}
#devSearch::-webkit-search-cancel-button { filter: invert(.6); }

.select {
  height: 32px; padding: 0 11px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 12.5px; font-family: inherit;
  cursor: pointer;
  transition: all .16s;
}
.select:hover { border-color: var(--line-2); color: var(--text); }
.select:focus { outline: none; border-color: var(--brand); }

/* ============ 设备表 ============ */
.table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}

.dev-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.dev-table thead th {
  text-align: left;
  padding: 10px 14px;
  font-size: 10.5px; font-weight: 620;
  color: var(--text-3);
  letter-spacing: .075em;
  text-transform: uppercase;
  background: rgba(255,255,255,.018);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.dev-table tbody tr {
  border-bottom: 1px solid rgba(39,50,63,.62);
  transition: background .14s;
}
.dev-table tbody tr:last-child { border-bottom: none; }
.dev-table tbody tr:hover { background: rgba(255,255,255,.024); }
.dev-table tbody tr.revoked { background: rgba(226,86,74,.035); }
.dev-table tbody tr.revoked:hover { background: rgba(226,86,74,.06); }
.dev-table tbody tr.row-busy { opacity: .5; pointer-events: none; }

.dev-table td {
  padding: 11px 14px;
  vertical-align: middle;
  font-size: 12.5px;
}

.cell-dev { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dev-ava {
  width: 32px; height: 32px;
  flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 8px;
  font-size: 11px; font-weight: 700;
  color: var(--text-2);
  background: var(--panel-3);
  border: 1px solid var(--line-2);
  transition: all .2s;
  position: relative;
}
.dev-ava.online {
  color: #cfe0ff;
  background: linear-gradient(145deg, rgba(59,124,240,.26), rgba(124,92,240,.2));
  border-color: rgba(59,124,240,.36);
}
.dev-ava.online::after {
  content: '';
  position: absolute; right: -2px; bottom: -2px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  border: 2px solid var(--panel);
}
.dev-ava.revoked {
  color: #f0938a;
  background: rgba(226,86,74,.1);
  border-color: rgba(226,86,74,.24);
}

.dev-meta { min-width: 0; }
.dev-name {
  font-weight: 570;
  display: flex; align-items: center; gap: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dev-note {
  font-size: 11px; color: var(--text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 1px;
}

.nat-chip {
  font-size: 9.5px; font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  color: #a4b6cc;
  background: var(--panel-3);
  border: 1px solid var(--line-2);
  letter-spacing: .02em;
  flex-shrink: 0;
}

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  height: 21px; padding: 0 8px;
  border-radius: 99px;
  font-size: 10.5px; font-weight: 600;
  white-space: nowrap;
}
.pill i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.pill.on { color: #4fd6a2; background: rgba(23,166,115,.14); border: 1px solid rgba(23,166,115,.26); }
.pill.on i { animation: pulseDot 2.2s infinite; }
.pill.off { color: #8a9bad; background: rgba(138,155,173,.1); border: 1px solid rgba(138,155,173,.2); }
.pill.rev { color: #f0938a; background: rgba(226,86,74,.12); border: 1px solid rgba(226,86,74,.24); }

.ip-chip {
  font-size: 12px;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: #b8cade;
  white-space: nowrap;
}

.group-chip {
  display: inline-block;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(124,92,240,.13);
  border: 1px solid rgba(124,92,240,.24);
  color: #bfaeff;
  white-space: nowrap;
}
.tag-chip {
  display: inline-block;
  font-size: 10px;
  padding: 1px 5px;
  margin-left: 4px;
  border-radius: 4px;
  background: var(--panel-3);
  border: 1px solid var(--line-2);
  color: var(--text-3);
  white-space: nowrap;
}

.lat-cell {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: var(--text-2);
}
.lat-cell.good { color: #4fd6a2; }
.lat-cell.mid { color: #e8b45c; }
.lat-cell.bad { color: #f0938a; }

/* 链路类型 + 延迟 */
.cell-conn { white-space: nowrap; }

.conn-chip {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 620;
  padding: 2px 8px;
  border-radius: 99px;
  letter-spacing: .03em;
  color: #9fb0c4;
  background: var(--panel-3);
  border: 1px solid var(--line-2);
  vertical-align: middle;
}
.conn-chip.p2p {
  color: #4fd6a2;
  background: rgba(23,166,115,.13);
  border-color: rgba(23,166,115,.32);
}
.conn-chip.p2p::before {
  content: '⇄ ';
  font-weight: 700;
}
.conn-chip.relay {
  color: #e8b45c;
  background: rgba(224,140,29,.12);
  border-color: rgba(224,140,29,.32);
}
.conn-chip.relay::before {
  content: '⇌ ';
  font-weight: 700;
}

.lat-inline {
  margin-left: 8px;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
}
.lat-inline.good { color: #4fd6a2; }
.lat-inline.mid { color: #e8b45c; }
.lat-inline.bad { color: #f0938a; }

/* 实时网速列 */
.cell-speed { white-space: nowrap; }
.speed-cell {
  display: flex; flex-direction: column; gap: 1px;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  line-height: 1.45;
}
.speed-cell .spd i,
.spd i {
  font-style: normal;
  font-size: 9.5px;
  color: var(--text-3);
  margin-left: 1px;
}
.spd { font-variant-numeric: tabular-nums; }
.spd.down { color: #6db3ff; }
.spd.up { color: #bfaeff; }

/* 统计卡中的速率 / 连接方式 */
.speed-line { gap: 14px; }
.speed-line .spd { font-size: 19px; display: inline-flex; align-items: baseline; }
.speed-line .spd i { font-size: 10px; margin-left: 3px; }

.conn-line { gap: 18px; }
.conn-big {
  display: inline-flex; align-items: baseline; gap: 5px;
  font-variant-numeric: tabular-nums;
}
.conn-big i {
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
}
.conn-big.p2p { color: #4fd6a2; }
.conn-big.p2p i { color: rgba(79,214,162,.75); }
.conn-big.relay { color: #e8b45c; }
.conn-big.relay i { color: rgba(232,180,92,.75); }

.stat-foot.total-flow {
  display: flex; align-items: center; gap: 12px;
  font-variant-numeric: tabular-nums;
}
.stat-foot.total-flow .spd { font-size: 10.5px; }

/* P2P / 中继流量拆分卡 */
.stat-foot.flow-split {
  display: flex; flex-direction: column; gap: 2px;
  font-variant-numeric: tabular-nums;
}
.stat-foot.flow-split .spd {
  font-size: 11px;
  font-weight: 600;
}
.stat-foot.flow-split .flow-detail {
  font-size: 10px;
  color: var(--text-3);
}
.stat-foot.flow-split .spd.down { color: #4fd6a2; }
.stat-foot.flow-split.relay-tone .spd { color: #e8b45c; }

.cell-actions { text-align: right; }
.row-actions {
  display: inline-flex; align-items: center; gap: 4px;
  justify-content: flex-end;
}

.act-btn {
  height: 26px;
  padding: 0 9px;
  background: transparent;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  color: var(--text-2);
  font-size: 11.5px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all .14s;
}
.act-btn:hover {
  background: var(--panel-3);
  border-color: #465568;
  color: var(--text);
}
.act-btn:active { transform: scale(.94); }
.act-btn.primary {
  color: #a8c8ff;
  border-color: rgba(59,124,240,.36);
  background: rgba(59,124,240,.1);
}
.act-btn.primary:hover {
  background: rgba(59,124,240,.22);
  border-color: rgba(59,124,240,.6);
  color: #d2e2ff;
}
.act-btn.danger { color: #d99a93; }
.act-btn.danger:hover {
  background: rgba(226,86,74,.14);
  border-color: rgba(226,86,74,.42);
  color: #ffb3aa;
}

/* 表格空态 */
.empty-row { padding: 0 !important; }
.empty-inline {
  padding: 52px 20px;
  text-align: center;
}
.ei-ico {
  width: 44px; height: 44px;
  margin: 0 auto 14px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--panel-2);
  border: 1px dashed var(--line-2);
  color: var(--text-3);
  font-size: 19px;
  font-weight: 300;
}
.empty-inline p { font-size: 13.5px; margin: 0 0 5px; color: var(--text-2); font-weight: 550; }
.empty-inline span { font-size: 11.5px; color: var(--text-3); display: block; }
.empty-inline .btn { margin-top: 16px; }

/* ============ 模态 ============ */
.modal {
  position: fixed; inset: 0;
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(6,9,13,.68);
  backdrop-filter: blur(7px);
  animation: fadeIn .16s ease;
}
.modal-card {
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 48px);
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #1a2230, #151b25);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg), inset 0 1px 0 rgba(255,255,255,.05);
  animation: modalIn .24s var(--ease);
  overflow: hidden;
}
.modal-card.wide { max-width: 720px; }
.modal-card.narrow { max-width: 414px; }

@keyframes modalIn {
  from { opacity: 0; transform: translateY(14px) scale(.978); }
  to { opacity: 1; transform: none; }
}

.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px;
  padding: 17px 18px 14px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.modal-head h3 { font-size: 15px; font-weight: 660; margin: 0; letter-spacing: -.01em; }
.modal-head p { font-size: 11.5px; color: var(--text-3); margin: 3px 0 0; }

.modal-body { padding: 17px 18px; overflow-y: auto; }

.modal-foot {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 8px;
  padding: 13px 18px;
  border-top: 1px solid var(--line);
  background: rgba(0,0,0,.16);
  flex-shrink: 0;
}
.modal-foot.center { justify-content: center; }
.foot-hint {
  margin-right: auto;
  font-size: 11px; color: var(--text-3);
}

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }

.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field label {
  display: block;
  font-size: 11.5px; font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
  letter-spacing: .015em;
}
.field label i { color: var(--red); font-style: normal; }
.field input, .field select {
  width: 100%; height: 36px;
  padding: 0 11px;
  background: rgba(8,12,17,.62);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  transition: all .16s;
}
.field input::placeholder { color: var(--text-3); }
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(59,124,240,.14);
  background: rgba(8,12,17,.9);
}
.hint { display: block; font-size: 10.5px; color: var(--text-3); margin-top: 5px; }

/* 确认框 */
.cfm-body { padding: 26px 24px 6px; text-align: center; }
.cfm-icon {
  width: 46px; height: 46px;
  margin: 0 auto 14px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-size: 21px; font-weight: 700;
}
.cfm-icon.danger {
  color: #ff9b91;
  background: rgba(226,86,74,.13);
  border: 1px solid rgba(226,86,74,.3);
  box-shadow: 0 0 26px -6px rgba(226,86,74,.44);
}
.cfm-icon.warn {
  color: #f0c273;
  background: rgba(224,140,29,.13);
  border: 1px solid rgba(224,140,29,.3);
}
.cfm-body h3 { font-size: 15.5px; font-weight: 660; margin: 0 0 10px; }
.cfm-text { text-align: left; }
.cfm-text p {
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.7;
  margin: 0 0 7px;
}
.cfm-text p:last-child { margin-bottom: 0; }

/* 命令标签 */
.cmd-tabs {
  display: flex; gap: 2px;
  padding: 10px 14px 0;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
  overflow-x: auto;
}
.cmd-tab {
  padding: 8px 12px 10px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-3);
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
  margin-bottom: -1px;
}
.cmd-tab:hover { color: var(--text-2); }
.cmd-tab.on { color: var(--brand-2); border-bottom-color: var(--brand); font-weight: 560; }

.code-wrap {
  flex: 1;
  min-height: 0;
  padding: 15px 16px;
  overflow: auto;
}
.code {
  margin: 0;
  padding: 14px 16px;
  background: #0a0e13;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-family: "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.72;
  color: #c7d6e8;
  white-space: pre-wrap;
  word-break: break-all;
  user-select: text;
}

/* 网络管理列表 */
.manage-list { padding: 12px; overflow-y: auto; max-height: 62vh; }
.manage-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--panel);
  margin-bottom: 8px;
}
.manage-row:last-child { margin-bottom: 0; }
.manage-main { flex: 1; min-width: 0; }
.manage-name {
  font-size: 13px; font-weight: 580;
  display: flex; align-items: center; gap: 8px;
}
.manage-sub {
  font-size: 11px; color: var(--text-3);
  margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.manage-acts { display: flex; gap: 5px; flex-shrink: 0; }
.pill-mini {
  font-size: 9.5px; font-weight: 620;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: .02em;
}
.pill-mini.on { color: #4fd6a2; background: rgba(23,166,115,.14); }
.pill-mini.off { color: #8a9bad; background: rgba(138,155,173,.12); }

/* ============ 抽屉 ============ */
.drawer-mask {
  position: fixed; inset: 0;
  background: rgba(6,9,13,.55);
  backdrop-filter: blur(3px);
  z-index: 150;
  animation: fadeIn .18s ease;
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(660px, 92vw);
  z-index: 160;
  display: flex; flex-direction: column;
  background: #10161f;
  border-left: 1px solid var(--line-2);
  box-shadow: -20px 0 60px rgba(0,0,0,.5);
  animation: slideIn .26s var(--ease);
}
@keyframes slideIn {
  from { transform: translateX(28px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.drawer-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.drawer-head h3 { font-size: 14.5px; font-weight: 640; margin: 0; }
.drawer-head p { font-size: 11px; color: var(--text-3); margin: 3px 0 0; }
.log-box {
  flex: 1;
  margin: 0;
  padding: 14px 16px;
  overflow: auto;
  font-family: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.7;
  color: #9fb3c8;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ============ Toast ============ */
.toast {
  position: fixed;
  bottom: 26px; left: 50%;
  transform: translate(-50%, 22px);
  z-index: 600;
  padding: 11px 18px;
  max-width: min(560px, 88vw);
  background: #1e2836;
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--brand);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 12.5px;
  box-shadow: var(--sh-lg);
  opacity: 0;
  pointer-events: none;
  transition: all .26s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { border-left-color: var(--green); }
.toast.err { border-left-color: var(--red); }

/* ============ 响应式 ============ */
.only-mobile { display: none; }

@media (max-width: 1080px) {
  .hm-wide { display: none; }
  .statbar { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .only-mobile { display: grid; }
  .hdr-metrics { display: none; }

  .side {
    position: fixed;
    left: 0; top: var(--bar-h); bottom: 0;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform .26s var(--ease);
    background: #10161f;
    box-shadow: 12px 0 40px rgba(0,0,0,.5);
  }
  body.side-open .side { transform: none; }

  .main { padding: 16px 15px 32px; }
  .statbar { grid-template-columns: repeat(2, 1fr); }
  .net-hero { flex-direction: column; }
  .hero-acts { width: 100%; }
  .hero-acts .btn { flex: 1; }
  .grid2 { grid-template-columns: 1fr; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-right { justify-content: stretch; }
  .search-wrap { flex: 1; }
  #devSearch { width: 100%; }
  #devSearch:focus { width: 100%; }

  .dev-table thead { display: none; }
  .dev-table, .dev-table tbody, .dev-table tr, .dev-table td { display: block; width: 100%; }
  .dev-table tr {
    padding: 12px;
    border-bottom: 1px solid var(--line) !important;
  }
  .dev-table td { padding: 3px 0; }
  .cell-actions { text-align: left; margin-top: 6px; }
  .row-actions { justify-content: flex-start; }
}

@media (max-width: 560px) {
  .login-card { width: 100%; padding: 28px 22px 18px; margin: 0 16px; }
  .hero-title h1 { font-size: 19px; }
  .statbar { grid-template-columns: 1fr; }
  .appbar { padding: 0 12px; gap: 10px; }
  .hdr-time { display: none; }
}
