/* ============================================================
   spark-panel · 全局样式
   配色取自抖音：红 #FE2C55 / 青 #25F4EE
   ============================================================ */

:root {
  --bg: #08080c;
  --bg-soft: #0d0d13;
  --panel: #121219;
  --card: #171720;
  --card-hover: #1c1c27;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.13);
  --text: #f1f1f6;
  --text-dim: #9b9bad;
  --text-mute: #64647a;
  --red: #fe2c55;
  --red-soft: rgba(254, 44, 85, 0.12);
  --cyan: #25f4ee;
  --cyan-soft: rgba(37, 244, 238, 0.1);
  --green: #35d07f;
  --yellow: #ffb020;
  --radius: 14px;
  --shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.9);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* 背景光晕 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(680px 420px at 12% -8%, rgba(254, 44, 85, 0.16), transparent 70%),
    radial-gradient(620px 400px at 92% 4%, rgba(37, 244, 238, 0.09), transparent 72%);
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); background-clip: content-box; }

/* ============================================================
   认证页（登录 / 注册）
   ============================================================ */

.auth {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(380px, 44%) 1fr;
  min-height: 100vh;
}

.auth-brand {
  position: relative;
  padding: 56px 52px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(160deg, rgba(254, 44, 85, 0.14), transparent 46%),
    linear-gradient(20deg, rgba(37, 244, 238, 0.08), transparent 50%),
    var(--bg-soft);
  overflow: hidden;
}

.auth-brand::after {
  content: "";
  position: absolute;
  width: 560px;
  height: 560px;
  right: -240px;
  bottom: -280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(254, 44, 85, 0.22), transparent 62%);
  filter: blur(20px);
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 650;
  letter-spacing: 0.3px;
  font-size: 15px;
}

.brand-glyph {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--red), #ff6b3d);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 22px -8px rgba(254, 44, 85, 0.9);
}

.brand-glyph svg { width: 18px; height: 18px; }

.auth-headline {
  position: relative;
  z-index: 1;
  max-width: 400px;
}

.auth-headline h1 {
  margin: 0 0 16px;
  font-size: 34px;
  line-height: 1.28;
  font-weight: 640;
  letter-spacing: -0.5px;
}

.auth-headline h1 em {
  font-style: normal;
  background: linear-gradient(100deg, var(--red), #ff7a45 45%, var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.auth-headline p {
  margin: 0;
  color: var(--text-dim);
  font-size: 14.5px;
  max-width: 340px;
}

.auth-points {
  position: relative;
  z-index: 1;
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
  max-width: 360px;
}

.auth-points li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--text-dim);
  font-size: 13.5px;
}

.auth-points li svg { flex: none; margin-top: 3px; color: var(--cyan); }

.auth-foot {
  position: relative;
  z-index: 1;
  color: var(--text-mute);
  font-size: 12px;
}

.auth-main {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 48px clamp(32px, 7vw, 96px);
}

.auth-form {
  width: 100%;
  max-width: 380px;
}

.auth-form h2 {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 620;
  letter-spacing: -0.3px;
}

.auth-form .sub {
  margin: 0 0 30px;
  color: var(--text-dim);
  font-size: 13.5px;
}

/* ============================================================
   表单
   ============================================================ */

.field { margin-bottom: 18px; }

.field label {
  display: block;
  margin-bottom: 7px;
  font-size: 12.5px;
  color: var(--text-dim);
  font-weight: 500;
}

.field .hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-mute);
}

.input {
  width: 100%;
  height: 42px;
  padding: 0 13px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.16s, background 0.16s, box-shadow 0.16s;
}

.input::placeholder { color: var(--text-mute); }

.input:focus {
  outline: none;
  border-color: rgba(254, 44, 85, 0.6);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 3px rgba(254, 44, 85, 0.13);
}

select.input { cursor: pointer; }
select.input option { background: var(--card); color: var(--text); }

/* ============================================================
   按钮
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  padding: 0 17px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 550;
  transition: transform 0.12s, filter 0.16s, background 0.16s, border-color 0.16s;
  white-space: nowrap;
}

.btn:active { transform: translateY(1px) scale(0.995); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--red), #ff5c3d);
  color: #fff;
  box-shadow: 0 10px 26px -12px rgba(254, 44, 85, 0.85);
}

.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line-strong);
  color: var(--text);
}

.btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.08); }

.btn-quiet {
  background: transparent;
  color: var(--text-dim);
  padding: 0 10px;
  height: 32px;
  font-size: 12.5px;
}

.btn-quiet:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }

.btn-danger {
  background: rgba(254, 44, 85, 0.1);
  border-color: rgba(254, 44, 85, 0.3);
  color: #ff8095;
}

.btn-danger:hover { background: rgba(254, 44, 85, 0.18); }

.btn-block { width: 100%; }
.btn-lg { height: 44px; font-size: 14px; }

/* ============================================================
   应用骨架
   ============================================================ */

.app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 236px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  border-right: 1px solid var(--line);
  background: rgba(13, 13, 19, 0.72);
  backdrop-filter: blur(14px);
}

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 22px;
  font-weight: 640;
  font-size: 14.5px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.nav-label {
  padding: 16px 10px 7px;
  font-size: 11px;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: var(--text-mute);
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 9px;
  color: var(--text-dim);
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.nav-item svg { width: 17px; height: 17px; flex: none; opacity: 0.85; }
.nav-item:hover { background: rgba(255, 255, 255, 0.045); color: var(--text); }

.nav-item.active {
  background: linear-gradient(100deg, rgba(254, 44, 85, 0.16), rgba(254, 44, 85, 0.05));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(254, 44, 85, 0.22);
}

.nav-item.active svg { color: var(--red); opacity: 1; }

.nav-item .count {
  margin-left: auto;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-dim);
  font-family: var(--mono);
}

.sidebar-user {
  margin-top: auto;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 650;
  color: #fff;
  flex: none;
  background: linear-gradient(135deg, var(--red), #7c2bff);
}

.avatar.cyan { background: linear-gradient(135deg, var(--cyan), #1a8fff); color: #04212a; }

.sidebar-user .meta { min-width: 0; flex: 1; }
.sidebar-user .name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user .role { font-size: 11.5px; color: var(--text-mute); }

.main {
  padding: 26px clamp(20px, 3.4vw, 40px) 60px;
  min-width: 0;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.page-head h1 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 630;
  letter-spacing: -0.3px;
}

.page-head .desc {
  margin: 0;
  color: var(--text-dim);
  font-size: 13px;
}

.page-actions { display: flex; gap: 9px; align-items: center; }

/* ============================================================
   卡片 / 统计
   ============================================================ */

.grid { display: grid; gap: 14px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.stat {
  padding: 16px 17px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--card), rgba(18, 18, 25, 0.6));
  position: relative;
  overflow: hidden;
}

.stat::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.14), transparent);
}

.stat .label {
  font-size: 12px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.stat .value {
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.8px;
  line-height: 1.1;
  font-family: var(--mono);
}

.stat .value small { font-size: 13px; color: var(--text-mute); font-weight: 500; margin-left: 3px; }

.stat .delta { margin-top: 7px; font-size: 12px; color: var(--text-mute); }
.stat .delta b { color: var(--green); font-weight: 600; }
.stat .delta b.bad { color: var(--red); }

.card {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  overflow: hidden;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}

.card-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body { padding: 18px; }
.card-body.tight { padding: 0; }

/* ============================================================
   状态徽标
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 550;
  line-height: 1.7;
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.badge.online { color: #55e39a; background: rgba(53, 208, 127, 0.1); border-color: rgba(53, 208, 127, 0.22); }
.badge.online::before { animation: pulse 2s infinite; }
.badge.offline { color: var(--text-mute); background: rgba(255, 255, 255, 0.04); border-color: var(--line); }
.badge.warn { color: var(--yellow); background: rgba(255, 176, 32, 0.1); border-color: rgba(255, 176, 32, 0.22); }
.badge.danger { color: #ff7a8f; background: rgba(254, 44, 85, 0.1); border-color: rgba(254, 44, 85, 0.24); }
.badge.info { color: var(--cyan); background: var(--cyan-soft); border-color: rgba(37, 244, 238, 0.2); }

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 currentColor; }
  50% { opacity: 0.55; box-shadow: 0 0 0 3px transparent; }
}

/* ============================================================
   表格
   ============================================================ */

.table { width: 100%; border-collapse: collapse; font-size: 13px; }

.table th {
  text-align: left;
  padding: 10px 18px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-mute);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.table td {
  padding: 13px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background 0.14s; }
.table tbody tr:hover { background: rgba(255, 255, 255, 0.025); }

.table .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ============================================================
   账号卡片
   ============================================================ */

.acc-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }

.acc {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 17px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.18s, transform 0.18s, background 0.18s;
}

.acc:hover { border-color: var(--line-strong); background: var(--card-hover); }

.acc-top { display: flex; align-items: center; gap: 12px; margin-bottom: 15px; }

.acc-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 17px;
  color: #fff;
  flex: none;
  position: relative;
}

.acc-avatar::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.acc-name { font-size: 14.5px; font-weight: 600; margin-bottom: 3px; }
.acc-uid { font-size: 11.5px; color: var(--text-mute); font-family: var(--mono); }

.acc-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 14px;
}

.acc-metrics div {
  background: rgba(255, 255, 255, 0.022);
  padding: 10px 11px;
}

.acc-metrics .k { font-size: 11px; color: var(--text-mute); margin-bottom: 3px; }
.acc-metrics .v { font-size: 15px; font-weight: 640; font-family: var(--mono); }

.acc-targets { display: flex; flex-direction: column; gap: 7px; margin-bottom: 15px; flex: 1; }

.acc-actions { margin-top: auto; }

.target-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  padding: 6px 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.022);
}

.target-row .dot { width: 5px; height: 5px; border-radius: 50%; flex: none; }
.target-row .dot.ok { background: var(--green); }
.target-row .dot.bad { background: var(--red); }
.target-row .dot.pending { background: var(--text-mute); }
.target-row .tname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.target-row .tdays { font-family: var(--mono); color: var(--text-dim); font-size: 12px; }

.acc-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.acc-actions .btn {
  flex: 1 1 calc(33.333% - 6px);
  min-width: 0;
  height: 34px;
  font-size: 12.5px;
  padding: 0 8px;
}
/* 「好友 / 话术」是主操作，独占一行，其余三个平分一行 */
.acc-actions .btn.acc-main { flex: 1 1 100%; }

@media (max-width: 560px) {
  .acc-actions .btn:not(.acc-main) { flex: 1 1 calc(50% - 4px); }
}

/* ============================================================
   服务器节点
   ============================================================ */

.srv {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.srv:last-child { border-bottom: none; padding-bottom: 0; }
.srv:first-child { padding-top: 0; }

.srv-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  flex: none;
  color: var(--text-dim);
}

.srv-info { flex: 1; min-width: 0; }
.srv-info .n { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.srv-info .h { font-size: 11.5px; color: var(--text-mute); font-family: var(--mono); }

.srv-bars { display: flex; gap: 14px; }
.srv-bar { width: 92px; }
.srv-bar .bl { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--text-mute); margin-bottom: 4px; }
.srv-bar .bt { height: 4px; border-radius: 99px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.srv-bar .bf { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--cyan), var(--red)); }

/* ============================================================
   弹窗
   ============================================================ */

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 4, 8, 0.74);
  backdrop-filter: blur(6px);
  animation: fade 0.18s ease;
}

.modal-mask.open { display: flex; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: 100%;
  max-width: 420px;
  /* 限高 + 内部滚动：内容再多也不会撑破视口 */
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  box-shadow: var(--shadow);
  animation: rise 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
  overflow: hidden;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.modal-head h3 { margin: 0; font-size: 15px; font-weight: 620; }
.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}
.modal-head, .modal-foot { flex: none; }
.modal-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  background: rgba(255, 255, 255, 0.015);
}

.x-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-mute);
  display: grid;
  place-items: center;
  font-size: 17px;
  line-height: 1;
}

.x-btn:hover { background: rgba(255, 255, 255, 0.07); color: var(--text); }

/* ============================================================
   扫码
   ============================================================ */

.qr-wrap { display: flex; flex-direction: column; align-items: center; padding: 6px 0 2px; }

.qr-frame {
  position: relative;
  width: 196px;
  height: 196px;
  border-radius: 14px;
  background: #fff;
  padding: 12px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 20px 50px -22px rgba(254, 44, 85, 0.7);
}

.qr-frame canvas { width: 100%; height: 100%; display: block; image-rendering: pixelated; }

/* 真二维码图片 */
.qr-frame #qrImg {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  border-radius: 4px;
}
.qr-frame #qrImg[hidden] { display: none; }

/* 出码等待态 */
.qr-frame .qr-placeholder {
  position: absolute;
  inset: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #6b7280;
  font-size: 12px;
  text-align: center;
  line-height: 1.5;
}
.qr-frame .qr-placeholder[hidden] { display: none; }
.qr-frame .qr-spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2.5px solid rgba(17, 24, 39, 0.14);
  border-top-color: #FE2C55;
  animation: qrspin 0.85s linear infinite;
}
@keyframes qrspin { to { transform: rotate(360deg); } }

.qr-frame .scanline {
  position: absolute;
  left: 12px;
  right: 12px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  box-shadow: 0 0 12px var(--cyan);
  animation: scan 2.4s ease-in-out infinite;
}

@keyframes scan {
  0%, 100% { top: 14px; opacity: 0.2; }
  50% { top: calc(100% - 16px); opacity: 1; }
}

.qr-frame.done .scanline { display: none; }

.qr-frame .overlay {
  position: absolute;
  inset: 12px;
  border-radius: 8px;
  display: none;
  place-items: center;
  text-align: center;
  background: rgba(255, 255, 255, 0.94);
  color: #111;
  font-size: 12.5px;
  font-weight: 600;
  padding: 10px;
}

.qr-frame.done .overlay { display: grid; }
.qr-frame.expired .overlay { display: grid; }

.qr-status { margin-top: 16px; font-size: 13px; color: var(--text-dim); text-align: center; }
.qr-status b { color: var(--text); }
.qr-timer { margin-top: 4px; font-size: 11.5px; color: var(--text-mute); font-family: var(--mono); }

.qr-steps {
  list-style: none;
  margin: 18px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
  display: grid;
  gap: 8px;
  width: 100%;
}

.qr-steps li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-mute);
}

.qr-steps li .n {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-family: var(--mono);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-dim);
  flex: none;
}

.qr-steps li.on { color: var(--text); }
.qr-steps li.on .n { background: var(--red); color: #fff; }
.qr-steps li.ok { color: var(--green); }
.qr-steps li.ok .n { background: rgba(53, 208, 127, 0.2); color: var(--green); }

/* ============================================================
   提示条
   ============================================================ */

.toast-host {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 9px;
  pointer-events: none;
}

.toast {
  min-width: 210px;
  max-width: 340px;
  padding: 11px 15px;
  border-radius: 11px;
  border: 1px solid var(--line-strong);
  background: rgba(23, 23, 32, 0.96);
  backdrop-filter: blur(10px);
  font-size: 13px;
  box-shadow: var(--shadow);
  animation: toastIn 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.toast.err { border-color: rgba(254, 44, 85, 0.42); color: #ffa1b0; }
.toast.ok { border-color: rgba(53, 208, 127, 0.4); color: #7ce6b0; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ============================================================
   杂项
   ============================================================ */

.notice {
  display: flex;
  gap: 11px;
  padding: 12px 14px;
  border-radius: 11px;
  border: 1px solid rgba(255, 176, 32, 0.24);
  background: rgba(255, 176, 32, 0.07);
  font-size: 12.5px;
  color: #ffd089;
  line-height: 1.6;
}

.notice.cyan { border-color: rgba(37, 244, 238, 0.22); background: var(--cyan-soft); color: #a5f7f4; }
.notice svg { flex: none; margin-top: 2px; }

.empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-mute);
  font-size: 13px;
}

.code-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 9px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.3px;
  /* 32 字符 token 需要可换行 */
  word-break: break-all;
  max-width: 100%;
  line-height: 1.5;
}

.mono { font-family: var(--mono); }
.dim { color: var(--text-dim); }
.mute { color: var(--text-mute); }
.spacer { flex: 1; }
.section-gap { margin-top: 16px; }

.loading {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1080px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; padding: 12px; overflow-x: auto; }
  .sidebar .brand, .sidebar-user { display: none; }
  .nav { flex-direction: row; }
  .nav-label { display: none; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ============================================================
   节点分流
   ============================================================ */

.node-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.node-card {
  position: relative;
  padding: 18px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.18s, transform 0.18s;
}
.node-card:hover { border-color: rgba(255, 255, 255, 0.16); }
.node-card.is-busy { border-color: rgba(254, 44, 85, 0.3); }

.node-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.node-name { font-size: 15px; font-weight: 650; letter-spacing: -0.2px; }
.node-key { font-size: 11.5px; color: var(--text-mute); margin-top: 3px; word-break: break-all; }

.node-err {
  font-size: 12px;
  color: #ff7a8f;
  background: rgba(254, 44, 85, 0.07);
  border: 1px solid rgba(254, 44, 85, 0.18);
  border-radius: 9px;
  padding: 9px 11px;
  line-height: 1.55;
  word-break: break-all;
}

.meter { display: flex; flex-direction: column; gap: 5px; }
.meter-head {
  display: flex; justify-content: space-between;
  font-size: 11.5px; color: var(--text-dim);
}
.meter-head .mono { color: var(--text); font-size: 11.5px; }
.meter-track {
  height: 5px; border-radius: 3px; overflow: hidden;
  background: rgba(255, 255, 255, 0.07);
}
.meter-fill { height: 100%; border-radius: 3px; transition: width 0.4s ease; }
.meter-fill.ok { background: linear-gradient(90deg, #25f4ee, #35d07f); }
.meter-fill.warn { background: linear-gradient(90deg, #ffb020, #ff8a3d); }
.meter-fill.danger { background: linear-gradient(90deg, #fe2c55, #ff5c7c); }

.node-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 2px; font-size: 11.5px;
}

.node-reasons {
  font-size: 11.5px;
  color: #ffb020;
  background: rgba(255, 176, 32, 0.07);
  border: 1px solid rgba(255, 176, 32, 0.18);
  border-radius: 9px;
  padding: 7px 10px;
  line-height: 1.5;
}

.th-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}
.th-grid > div {
  display: flex; flex-direction: column; gap: 4px;
  padding: 11px 13px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  font-size: 12px;
}
.th-grid b { font-size: 14px; font-weight: 650; }

/* 好友 / 话术编辑器 */
.task-textarea {
  resize: vertical;
  min-height: 180px;
  line-height: 1.7;
  font-family: var(--mono);
  font-size: 12.5px;
  white-space: pre;
  overflow-x: auto;
}
.task-interval { display: flex; align-items: center; gap: 10px; }
.task-interval .input { width: 92px; flex: none; }

/* 好友行编辑器 */
.task-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.task-row .task-name { width: 160px; flex: none; }
.task-row .task-msg { flex: 1; min-width: 0; }
.task-row .btn-quiet { flex: none; padding: 6px 11px; font-size: 16px; line-height: 1; }

/* 按钮内图标统一尺寸：防止某个 SVG 漏写 width/height 被撑满容器 */
.btn svg { width: 15px; height: 15px; flex: none; }
.acc-actions .btn svg { width: 14px; height: 14px; }

/* 数据库控制台 */
.db-layout { display: grid; grid-template-columns: 230px 1fr; gap: 16px; }
.db-layout .card { min-width: 0; }
.db-tbl:hover { background: var(--card-hover); }
.db-tbl.is-active { background: rgba(254, 44, 85, 0.12); }
.db-scroll { overflow: auto; max-height: 62vh; }
.db-table { font-size: 12px; white-space: nowrap; }
.db-table th { position: sticky; top: 0; background: var(--panel); z-index: 1; }
.db-table td { max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.sql-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.sql-write { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-dim); cursor: pointer; }
@media (max-width: 760px) { .db-layout { grid-template-columns: 1fr; } }

/* 扫码弹窗里的服务器信息 */
.qr-server {
  margin-top: 14px;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.028);
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12px;
}
.qs-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.qs-row > span { color: var(--text-mute); flex: none; }
.qs-row > b { font-weight: 500; text-align: right; word-break: break-all; }

/* 发送时段网格 */
.slot-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  padding: 2px;
}
.slot {
  font-size: 11px;
  padding: 7px 0;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-family: var(--mono);
  transition: border-color .15s, color .15s, background .15s;
}
.slot:hover:not(:disabled) { border-color: var(--line-strong); color: var(--text); }
.slot.mine { border-color: var(--red); color: var(--red); background: rgba(254, 44, 85, .10); }
.slot.taken { opacity: .32; cursor: not-allowed; text-decoration: line-through; }
.slot:disabled { cursor: not-allowed; }

/* 二维码预计等待 */
.qr-eta { margin-top: 6px; font-size: 12px; color: var(--text-mute); }

/* dbadmin 站点限制 */
.settings-grid { display: flex; flex-direction: column; gap: 10px; }
.setting-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.022);
}
.setting-label { font-size: 13px; }
.setting-hint { font-size: 11.5px; color: var(--text-mute); margin-top: 3px; }
.setting-input { width: 96px; flex: none; text-align: right; font-family: var(--mono); }

/* 运行日志弹窗 */
.log-tabs { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.log-tabs .btn.is-active { border-color: var(--red); color: var(--red); }
.log-view {
  margin: 0;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 56vh;
  overflow: auto;
  color: var(--text-dim);
}

/* 扫码弹窗：短信验证 */
.verify-box {
  margin-top: 14px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(232, 184, 75, 0.35);
  background: rgba(232, 184, 75, 0.07);
}
.verify-title { font-size: 13px; font-weight: 600; color: #e8b84b; }
.verify-hint { font-size: 11.5px; color: var(--text-mute); margin: 6px 0 10px; line-height: 1.6; }
.verify-code-row { display: flex; gap: 8px; margin-top: 10px; }
.verify-code-row .input { flex: 1; letter-spacing: 2px; text-align: center; font-family: var(--mono); }

/* 服务器残留账号（无数据库归属） */
.orphan-tip {
  margin: 4px 0 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 11.5px;
  line-height: 1.6;
  color: #e8b84b;
  background: rgba(232, 184, 75, 0.08);
  border: 1px solid rgba(232, 184, 75, 0.25);
}

/* 扫码节点选择 */
.node-pick-list { display: flex; flex-direction: column; gap: 10px; }
.node-pick {
  display: block; width: 100%; text-align: left;
  padding: 12px 14px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.022);
  color: inherit; transition: border-color .15s, background .15s;
}
.node-pick:hover:not(:disabled) { border-color: var(--red); background: rgba(254, 44, 85, 0.06); }
.node-pick.is-disabled { opacity: .45; cursor: not-allowed; }
.np-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; }
.np-hint { margin-top: 5px; font-size: 11.5px; color: var(--text-mute); line-height: 1.6; }

/* dbadmin：R220 自动休眠开关 */
.switch { display: inline-flex; align-items: center; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  position: relative; width: 46px; height: 26px; border-radius: 999px;
  background: rgba(255,255,255,.10); border: 1px solid var(--line);
  transition: background .18s, border-color .18s;
}
.switch-track::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--text-mute); transition: transform .18s, background .18s;
}
.switch input:checked + .switch-track { background: rgba(254,44,85,.22); border-color: var(--red); }
.switch input:checked + .switch-track::after { transform: translateX(20px); background: var(--red); }
.switch input:disabled + .switch-track { opacity: .45; cursor: not-allowed; }

/* 扫码弹窗：忽略冷却勾选 */
.qr-force {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  color: var(--dim);
  cursor: pointer;
  user-select: none;
}
.qr-force:hover { border-color: var(--line-strong); color: var(--text); }
.qr-force input { accent-color: var(--red); cursor: pointer; }
