/* ============================================================
   ZGate design system — deep-space dark, indigo→violet accent
   ============================================================ */
:root {
  --bg: #07090f;
  --bg-soft: #0b0e17;
  --surface: rgba(255, 255, 255, 0.028);
  --surface-2: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.075);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #e9ebf4;
  --text-2: #9aa1b5;
  --text-3: #5d6478;
  --accent: #6d7cff;
  --accent-2: #a06bff;
  --accent-grad: linear-gradient(135deg, #6d7cff, #a06bff);
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --info: #38bdf8;
  --radius: 16px;
  --radius-sm: 10px;
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 "Segoe UI", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 480px at 12% -8%, rgba(109, 124, 255, 0.13), transparent 60%),
    radial-gradient(800px 500px at 95% 0%, rgba(160, 107, 255, 0.09), transparent 55%),
    radial-gradient(700px 700px at 50% 115%, rgba(56, 189, 248, 0.05), transparent 60%);
}
::selection { background: rgba(109, 124, 255, 0.35); }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.18); }
::-webkit-scrollbar-track { background: transparent; }
a { color: var(--accent); text-decoration: none; }

/* ---------- layout ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 224px; flex-shrink: 0; padding: 22px 14px;
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh;
  background: linear-gradient(180deg, rgba(255,255,255,0.015), transparent 40%);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 10px 20px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; background: var(--accent-grad);
  display: grid; place-items: center; font-weight: 800; font-size: 17px; color: #fff;
  box-shadow: 0 6px 18px rgba(109, 124, 255, 0.35);
}
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: 0.4px; }
.brand-sub { font-size: 11px; color: var(--text-3); margin-top: -3px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 11px;
  color: var(--text-2); cursor: pointer; font-weight: 500; font-size: 13.5px;
  border: 1px solid transparent; transition: all 0.18s ease; user-select: none;
}
.nav-item:hover { color: var(--text); background: var(--surface-2); }
.nav-item.active {
  color: var(--text);
  background: linear-gradient(90deg, rgba(109,124,255,0.16), rgba(160,107,255,0.07));
  border-color: rgba(109, 124, 255, 0.28);
}
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.85; }
.nav-item.active svg { opacity: 1; color: var(--accent); }
.sidebar-foot { margin-top: auto; padding: 10px; font-size: 11.5px; color: var(--text-3); }

.main { flex: 1; min-width: 0; padding: 26px 30px 60px; max-width: 1360px; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; gap: 14px; flex-wrap: wrap; }
.page-title { font-size: 21px; font-weight: 700; letter-spacing: 0.2px; }
.page-desc { color: var(--text-3); font-size: 12.5px; margin-top: 2px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 26px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 30; backdrop-filter: blur(14px);
  background: rgba(7, 9, 15, 0.75);
}

/* ---------- cards & stats ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; position: relative;
}
.card.hover { transition: all 0.2s ease; }
.card.hover:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.card-title { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-6 { grid-template-columns: repeat(6, 1fr); }
.grid.cols-6 > .stat-card { grid-column: span 2; }
.grid.cols-6 > .stat-card:nth-child(n+4) { grid-column: span 3; }
@media (max-width: 1100px) { .grid.cols-4 { grid-template-columns: repeat(2, 1fr); } .grid.cols-3 { grid-template-columns: repeat(2, 1fr); } .grid.cols-6 > .stat-card, .grid.cols-6 > .stat-card:nth-child(n+4) { grid-column: span 3; } }
@media (max-width: 720px) { .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; } .grid.cols-6 > .stat-card { grid-column: span 1; } }

.stat-value { font-size: 30px; font-weight: 750; letter-spacing: 0.3px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-value.accent {
  background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat-label { font-size: 12px; color: var(--text-3); margin-top: 5px; }
.stat-sub { font-size: 12px; color: var(--text-2); margin-top: 8px; }

.hero-balance {
  background:
    radial-gradient(500px 220px at 85% -30%, rgba(160,107,255,0.25), transparent 65%),
    radial-gradient(420px 200px at 0% 130%, rgba(56,189,248,0.12), transparent 60%),
    var(--surface);
  border: 1px solid rgba(109, 124, 255, 0.25);
}

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; border-radius: 11px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.16s ease; user-select: none; white-space: nowrap;
  font-family: inherit;
}
.btn:hover { border-color: var(--border-strong); background: rgba(255,255,255,0.08); }
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--accent-grad); border: none; color: #fff; box-shadow: 0 6px 20px rgba(109,124,255,0.3); }
.btn.primary:hover { filter: brightness(1.1); }
.btn.danger { color: var(--bad); border-color: rgba(248,113,113,0.3); }
.btn.danger:hover { background: rgba(248,113,113,0.12); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 11px; font-size: 12px; border-radius: 9px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.input, select.input, textarea.input {
  width: 100%; padding: 9px 13px; border-radius: 11px; border: 1px solid var(--border);
  background: rgba(0,0,0,0.25); color: var(--text); font-size: 13.5px; font-family: inherit;
  transition: border-color 0.16s ease, box-shadow 0.16s ease; outline: none;
}
.input:focus { border-color: rgba(109,124,255,0.55); box-shadow: 0 0 0 3px rgba(109,124,255,0.14); }
.input::placeholder { color: var(--text-3); }
textarea.input { resize: vertical; min-height: 110px; font-family: var(--mono); font-size: 12.5px; line-height: 1.7; }
select.input option { background: #12151f; }
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 12px; color: var(--text-2); font-weight: 600; margin-bottom: 7px; }
.field .hint { font-size: 11.5px; color: var(--text-3); margin-top: 5px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; padding: 11px 14px; color: var(--text-3); font-weight: 600; font-size: 11.5px;
  letter-spacing: 0.6px; text-transform: uppercase; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.tbl td { padding: 11px 14px; border-bottom: 1px solid rgba(255,255,255,0.04); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background 0.13s ease; }
.tbl tbody tr:hover { background: rgba(255,255,255,0.028); }
.tbl .num { font-variant-numeric: tabular-nums; }
.tbl-empty { padding: 34px; text-align: center; color: var(--text-3); font-size: 13px; }

/* ---------- badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { color: var(--ok); background: rgba(52,211,153,0.1); }
.badge.warn { color: var(--warn); background: rgba(251,191,36,0.1); }
.badge.bad { color: var(--bad); background: rgba(248,113,113,0.1); }
.badge.info { color: var(--info); background: rgba(56,189,248,0.1); }
.badge.muted { color: var(--text-3); background: rgba(255,255,255,0.05); }
.badge.accent { color: #97a5ff; background: rgba(109,124,255,0.12); }

/* ---------- code / key display ---------- */
.code-line {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 11px;
  background: rgba(0,0,0,0.32); border: 1px solid var(--border); font-family: var(--mono);
  font-size: 12.5px; color: #c3c9de; overflow-x: auto; white-space: nowrap;
}
.code-line .grow { flex: 1; overflow-x: auto; }

/* ---------- toast ---------- */
.toasts { position: fixed; top: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  min-width: 260px; max-width: 380px; padding: 13px 16px; border-radius: 13px;
  background: rgba(18, 21, 32, 0.92); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow); font-size: 13px; backdrop-filter: blur(16px);
  animation: toast-in 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  display: flex; gap: 10px; align-items: flex-start;
}
.toast.ok { border-color: rgba(52,211,153,0.4); }
.toast.bad { border-color: rgba(248,113,113,0.4); }
@keyframes toast-in { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; background: rgba(4, 5, 9, 0.66);
  backdrop-filter: blur(6px); display: grid; place-items: center; padding: 24px;
  animation: fade-in 0.18s ease;
}
.modal {
  width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto;
  background: #0e1119; border: 1px solid var(--border-strong); border-radius: 18px;
  padding: 24px; box-shadow: var(--shadow); animation: modal-in 0.22s cubic-bezier(0.2,0.9,0.3,1.1);
}
.modal.lg { max-width: 680px; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
.modal h3 { font-size: 16px; margin-bottom: 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ---------- auth page ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 410px; }
.auth-brand { text-align: center; margin-bottom: 26px; }
.auth-brand .brand-mark { width: 52px; height: 52px; border-radius: 14px; font-size: 24px; margin: 0 auto 14px; box-shadow: 0 10px 34px rgba(109,124,255,0.4); }
.auth-brand h1 { font-size: 24px; font-weight: 750; letter-spacing: 0.5px; }
.auth-brand p { color: var(--text-3); font-size: 13px; margin-top: 4px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border-radius: 12px; padding: 4px; margin-bottom: 20px; border: 1px solid var(--border); }
.auth-tab { padding: 8px; text-align: center; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--text-2); transition: all 0.16s; }
.auth-tab.active { background: var(--accent-grad); color: #fff; }

/* ---------- misc ---------- */
.chip { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); font-size: 11.5px; color: var(--text-2); margin: 0 6px 6px 0; font-family: var(--mono); }
.divider { height: 1px; background: var(--border); margin: 18px 0; border: none; }
.muted { color: var(--text-3); }
.small { font-size: 12px; }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; }.flex { display: flex; align-items: center; gap: 10px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clickable { cursor: pointer; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* latency bar */
.lat-bar { height: 4px; border-radius: 4px; background: rgba(255,255,255,0.07); width: 90px; overflow: hidden; }
.lat-bar > i { display: block; height: 100%; border-radius: 4px; background: var(--accent-grad); }

/* pagination */
.pager { display: flex; align-items: center; gap: 10px; justify-content: flex-end; margin-top: 14px; font-size: 12.5px; color: var(--text-2); }

/* quota progress */
.qbar { height: 5px; border-radius: 5px; background: rgba(255,255,255,0.07); overflow: hidden; min-width: 70px; }
.qbar > i { display: block; height: 100%; background: var(--accent-grad); border-radius: 5px; }

/* 统计卡带(pool secstat 同款):网格卡片 + 大数字 */
.secstat { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.secstat > .s {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.015));
  border: 1px solid var(--line, rgba(255,255,255,.08));
  border-radius: 12px; padding: 14px 16px 12px;
  transition: border-color .25s, transform .25s, box-shadow .25s;
}
.secstat > .s:hover { border-color: rgba(109,124,255,.5); transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.secstat > .s > .k { font-size: 11.5px; color: var(--text-2, rgba(255,255,255,.55)); letter-spacing: .4px; margin-bottom: 6px; }
.secstat > .s > .v { font-size: 22px; font-weight: 700; color: var(--text-1, #fff); font-variant-numeric: tabular-nums; line-height: 1.1; }
.secstat > .s > .v u { text-decoration: none; font-size: 12px; font-weight: 500; color: var(--text-2, rgba(255,255,255,.5)); margin-left: 3px; }
.secstat > .s > .mini12 { height: 30px; }

/* 渠道健康表:最近12次调用柱状图(pool .bars 同款) */
.bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 20px; }
.bars > i { display: block; width: 4px; border-radius: 1px 1px 0 0; background: var(--ok); min-height: 3px; }
.bars > i.bad { background: var(--bad); }

/* 渠道近况迷你柱状图(pool 同款) */
.mini12 { display: flex; align-items: flex-end; gap: 2px; height: 34px; }
.mini12 > i { display: block; width: 5px; border-radius: 2px 2px 0 0; background: var(--ok); min-height: 3px; }

/* 仪表盘 3 层额度圆环: 悬停时该层圆环单独放大 + 提亮, 其余层变暗
   .ring-hit 为透明加宽命中环, 保证放大位移后悬停区域稳定不抖动
   悬停详情直接显示在圆环中心 (Vue hoverRing → ringCenter) */
.quota-rings { display: block; cursor: default; }
.quota-rings .ring-g {
  transform-origin: 100px 100px;
  transform-box: view-box;
  transform: scale(1);
  opacity: 1;
  transition: transform .3s cubic-bezier(.22,1,.36,1), opacity .3s, filter .3s;
}
.quota-rings .ring-hit { pointer-events: stroke; }
.quota-rings.has-hover .ring-g:not(.hot) { opacity: .35; }
.quota-rings .ring-g:hover {
  transform: scale(1.1);
  opacity: 1;
  filter: drop-shadow(0 0 6px rgba(109,124,255,.45));
}
.quota-rings text { pointer-events: none; }

/* 账号池额度可视化: 模型行 + 进度条 + 数字 */
.qcell { min-width: 190px; }
.qrow { margin-bottom: 7px; }
.qrow:last-child { margin-bottom: 0; }
.qrow-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 3px; }
.qrow-model { font-family: var(--mono, monospace); font-size: 11px; color: var(--text-2); letter-spacing: 0.2px; }
.qrow-nums { font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.qrow-nums b { font-weight: 650; color: var(--text-1); }
.qrow-nums span { color: var(--text-3); }
.qbar-lg { position: relative; height: 7px; border-radius: 6px; background: rgba(255,255,255,0.07); overflow: hidden; }
.qbar-lg > i { display: block; height: 100%; border-radius: 6px; transition: width .45s cubic-bezier(.22,1,.36,1); }
.qbar-lg > i.lv-high { background: linear-gradient(90deg, #34d399, #10b981); }
.qbar-lg > i.lv-mid { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.qbar-lg > i.lv-low { background: linear-gradient(90deg, #f87171, #ef4444); }
.qbar-lg > i.lv-zero { background: rgba(248,113,113,0.35); }
.qrow-warn { font-size: 10.5px; color: var(--bad); margin-top: 2px; }

/* drag-over highlight for mailbox import */
.drag-over { border-color: rgba(109,124,255,0.6) !important; background: rgba(109,124,255,0.06) !important; }

.modal.xl { max-width: 1180px; }

/* ================= 庆祝弹窗(兑换成功) ================= */
.celebrate-mask {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(5,8,14,.72); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
}
.celebrate-card {
  position: relative; overflow: hidden;
  width: 320px; padding: 34px 28px 30px; text-align: center;
  background: linear-gradient(180deg, #161c26, #10151d);
  border: 1px solid rgba(109,124,255,.45); border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.04) inset;
  animation: celebrate-pop .5s cubic-bezier(.2,1.4,.4,1);
}
@keyframes celebrate-pop {
  0% { transform: scale(.6) translateY(30px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}
.celebrate-ring {
  width: 74px; height: 74px; margin: 0 auto 14px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #34d399, #10b981);
  box-shadow: 0 0 0 8px rgba(52,211,153,.14), 0 8px 26px rgba(16,185,129,.4);
  animation: celebrate-ring-pop .6s cubic-bezier(.2,1.6,.4,1) .1s both;
}
.celebrate-ring span { font-size: 34px; color: #fff; font-weight: 800; }
@keyframes celebrate-ring-pop {
  0% { transform: scale(0) rotate(-40deg); }
  100% { transform: scale(1) rotate(0); }
}
.celebrate-title { font-size: 17px; font-weight: 700; color: #fff; letter-spacing: 1px; }
.celebrate-amount {
  font-size: 34px; font-weight: 800; margin: 10px 0 4px;
  background: linear-gradient(90deg, #38bdf8, #34d399, #fbbf24);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: celebrate-amount-in .55s cubic-bezier(.2,1.3,.4,1) .15s both;
}
@keyframes celebrate-amount-in {
  0% { transform: translateY(14px) scale(.7); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
.celebrate-sub { font-size: 12.5px; color: rgba(255,255,255,.55); }
.celebrate-confetti {
  position: absolute; top: -12px; width: 7px; height: 12px;
  border-radius: 2px; opacity: .9;
  animation: confetti-fall 2.4s cubic-bezier(.3,.6,.7,1) infinite;
}
@keyframes confetti-fall {
  0% { transform: translateY(-16px) rotate(0) ; opacity: 1; }
  100% { transform: translateY(340px) rotate(340deg); opacity: 0; }
}
.celebrate-fade-enter-active, .celebrate-fade-leave-active { transition: opacity .3s; }
.celebrate-fade-enter-from, .celebrate-fade-leave-to { opacity: 0; }

/* ================= 全局动态效果 ================= */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.main > * { animation: fadeSlideUp .4s cubic-bezier(.22,1,.36,1) both; }
.card { transition: transform .25s cubic-bezier(.22,1,.36,1), box-shadow .25s, border-color .25s; }
.card.hover:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(0,0,0,.3); border-color: rgba(109,124,255,.45); }
.btn { transition: transform .15s, box-shadow .2s, background .2s, opacity .2s; }
.btn:active { transform: scale(.96); }
.btn.primary:hover { box-shadow: 0 4px 16px rgba(109,124,255,.4); }
.pill, .chip, .tag { transition: background .2s, color .2s; }
.tbl tbody tr { transition: background .18s; }
.spin { animation: zg-spin 1s linear infinite; }
@keyframes zg-spin { to { transform: rotate(360deg); } }
.stat-value, .secstat .v { animation: fadeSlideUp .5s cubic-bezier(.22,1,.36,1) both; }
.grid.cols-4 > .card { animation: fadeSlideUp .5s cubic-bezier(.22,1,.36,1) both; }
.grid.cols-4 > .card:nth-child(1) { animation-delay: .02s; }
.grid.cols-4 > .card:nth-child(2) { animation-delay: .08s; }
.grid.cols-4 > .card:nth-child(3) { animation-delay: .14s; }
.grid.cols-4 > .card:nth-child(4) { animation-delay: .2s; }
.grid.cols-4 > .card:nth-child(5) { animation-delay: .26s; }
.grid.cols-4 > .card:nth-child(6) { animation-delay: .32s; }
.grid.cols-4 > .card:hover .stat-value { text-shadow: 0 0 18px rgba(109,124,255,.5); }
.mono { font-family: var(--mono); overflow-wrap: anywhere; }
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52,211,153,.5); }
  50% { box-shadow: 0 0 0 6px rgba(52,211,153,0); }
}
.badge .dot, .pill.ok { animation: pulse-dot 2.4s ease-in-out infinite; }

/* ================= 渠道状态颜色:正常绿 / 冻结蓝 ================= */
.pill.ok { background: rgba(52,211,153,.14); color: #34d399; }
.pill.bad { background: rgba(248,113,113,.14); color: #f87171; }
.pill.info { background: rgba(56,189,248,.14); color: #38bdf8; }
.tag.ok { color: #34d399; }
.tag.bad { color: #f87171; }
.tag.info { color: #38bdf8; }
.tag.frozen, .z-badge .frozen { color: #38bdf8; }

/* ================= 请求日志页美化 ================= */
.logs-page .filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line, rgba(255,255,255,.08)); }
.logs-page .filters .input { width: auto; padding: 6px 10px; }
.logs-page table tbody tr:hover { background: rgba(109,124,255,.06); }

/* ============================================================
   ZGate 视觉升级层 v2 — 层次感 / 玻璃拟态 / 精致细节
   ============================================================ */

/* ---------- 全局底色与氛围光 ---------- */
body {
  background:
    radial-gradient(1200px 600px at 8% -5%, rgba(109, 124, 255, 0.16), transparent 55%),
    radial-gradient(1000px 550px at 100% 0%, rgba(160, 107, 255, 0.11), transparent 50%),
    radial-gradient(900px 900px at 45% 115%, rgba(56, 189, 248, 0.07), transparent 60%),
    #07090f;
  background-attachment: fixed;
}
body::before { display: none; }

/* ---------- 侧边栏:玻璃拟态 + 品牌氛围 ---------- */
.sidebar {
  background: linear-gradient(180deg, rgba(16, 19, 31, 0.85), rgba(10, 12, 20, 0.92));
  backdrop-filter: blur(20px) saturate(140%);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 1px 0 0 rgba(109, 124, 255, 0.08), 8px 0 32px rgba(0, 0, 0, 0.35);
}
.brand-mark {
  box-shadow: 0 6px 24px rgba(109, 124, 255, 0.5), inset 0 1px 0 rgba(255,255,255,.25);
}
.brand-name {
  background: linear-gradient(90deg, #f2f4ff, #b9c1ff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.nav-item { position: relative; border-radius: 12px; margin-bottom: 2px; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(109,124,255,0.22), rgba(160,107,255,0.08) 70%);
  border-color: rgba(109, 124, 255, 0.38);
  box-shadow: 0 4px 16px rgba(109, 124, 255, 0.18), inset 0 1px 0 rgba(255,255,255,.06);
}
.nav-item.active::before {
  content: "";
  position: absolute; left: -14px; top: 20%; bottom: 20%; width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent-grad);
  box-shadow: 0 0 12px rgba(109,124,255,.8);
}
.sidebar-foot {
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}

/* ---------- 顶栏 ---------- */
.topbar {
  background: rgba(8, 10, 17, 0.72);
  backdrop-filter: blur(22px) saturate(150%);
  border-bottom: 1px solid rgba(109, 124, 255, 0.12);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

/* ---------- 卡片:玻璃质感 + 顶部高光 + 立体描边 ---------- */
.card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012) 40%, rgba(255, 255, 255, 0.005)),
    rgba(13, 16, 26, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.055);
  backdrop-filter: blur(14px);
  border-radius: 18px;
  transition: transform .28s cubic-bezier(.22,1,.36,1), box-shadow .28s, border-color .28s;
}
.card.hover:hover {
  border-color: rgba(109, 124, 255, 0.42);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(109,124,255,.12),
              0 8px 40px rgba(109, 124, 255, 0.12);
}
.card-title { letter-spacing: .3px; font-weight: 650; }
.card-title svg { color: var(--accent); opacity: .9; }

/* ---------- 统计卡:渐变大数字 + 微光 ---------- */
.stat-value {
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #ffffff, #c9cffe);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 12px rgba(109, 124, 255, 0.18));
}
.stat-value.muted, .stat-value span.muted {
  -webkit-text-fill-color: var(--text-3);
  background: none;
  filter: none;
}
.card.hover:hover .stat-value {
  filter: drop-shadow(0 2px 18px rgba(109, 124, 255, 0.45));
}

/* ---------- 按钮:渐变描边质感 ---------- */
.btn { border-radius: 12px; font-weight: 600; backdrop-filter: blur(8px); }
.btn.primary {
  background: linear-gradient(135deg, #6d7cff 0%, #8d6bff 55%, #a06bff 100%);
  box-shadow: 0 6px 22px rgba(109, 124, 255, 0.38), inset 0 1px 0 rgba(255,255,255,.22);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.btn.primary:hover {
  filter: brightness(1.12);
  box-shadow: 0 8px 30px rgba(109, 124, 255, 0.55), inset 0 1px 0 rgba(255,255,255,.25);
}
.btn:not(.primary):hover {
  border-color: rgba(109, 124, 255, 0.45);
  background: rgba(109, 124, 255, 0.08);
}

/* ---------- 输入框:聚焦辉光 ---------- */
.input:focus {
  border-color: rgba(109, 124, 255, 0.6);
  box-shadow: 0 0 0 4px rgba(109, 124, 255, 0.16), 0 0 22px rgba(109, 124, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
}

/* ---------- 表格:精排密度 + 隔行渐变 + 悬停强调 ---------- */
.tbl th {
  padding: 13px 16px;
  font-size: 11px;
  letter-spacing: 1px;
  background: rgba(255, 255, 255, 0.028);
  border-bottom: 1px solid rgba(109, 124, 255, 0.14);
}
.tbl td { padding: 13px 16px; }
.tbl tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.014); }
.tbl tbody tr:hover {
  background: linear-gradient(90deg, rgba(109, 124, 255, 0.1), rgba(109, 124, 255, 0.035));
  box-shadow: inset 3px 0 0 var(--accent);
}
.table-wrap {
  border-radius: 16px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255,255,255,.04);
}

/* ---------- 徽章:毛玻璃胶囊 + 微光 ---------- */
.badge {
  padding: 3.5px 11px;
  border-radius: 99px;
  backdrop-filter: blur(6px);
  font-weight: 650;
  letter-spacing: .2px;
}
.badge.ok   { box-shadow: inset 0 0 0 1px rgba(52,211,153,.25), 0 0 14px rgba(52,211,153,.12); }
.badge.bad  { box-shadow: inset 0 0 0 1px rgba(248,113,113,.25), 0 0 14px rgba(248,113,113,.1); }
.badge.warn { box-shadow: inset 0 0 0 1px rgba(251,191,36,.25); }
.badge.info { box-shadow: inset 0 0 0 1px rgba(56,189,248,.25); }
.badge .dot { box-shadow: 0 0 8px currentColor; }

/* ---------- 弹窗与遮罩 ---------- */
.modal-backdrop {
  background: rgba(4, 5, 10, 0.72);
  backdrop-filter: blur(10px) saturate(130%);
}
.modal {
  background: linear-gradient(180deg, rgba(20, 24, 38, 0.97), rgba(13, 16, 27, 0.98));
  border: 1px solid rgba(109, 124, 255, 0.22);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6), 0 0 60px rgba(109, 124, 255, 0.08),
              inset 0 1px 0 rgba(255, 255, 255, 0.06);
  border-radius: 20px;
}

/* ---------- Toast:玻璃胶囊 + 状态色条 ---------- */
.toast {
  border-radius: 14px;
  padding: 12px 16px 12px 14px;
  background: linear-gradient(180deg, rgba(22, 26, 40, 0.95), rgba(15, 18, 30, 0.95));
  backdrop-filter: blur(18px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255,255,255,.06);
}
.toast.ok { border-left: 3px solid var(--ok); }
.toast.bad { border-left: 3px solid var(--bad); }

/* ---------- code-line / chip ---------- */
.code-line {
  background: linear-gradient(180deg, rgba(0,0,0,.4), rgba(0,0,0,.28));
  border-color: rgba(109, 124, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}
.chip {
  background: rgba(109, 124, 255, 0.08);
  border-color: rgba(109, 124, 255, 0.18);
  color: #aab3ff;
}

/* ---------- 主区标题:渐变大标题 ---------- */
.page-title {
  font-size: 23px;
  font-weight: 750;
  letter-spacing: .3px;
  background: linear-gradient(95deg, #f4f5ff 20%, #b5bdff 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- hero-balance 特殊氛围 ---------- */
.hero-balance {
  border-color: rgba(109, 124, 255, 0.3);
  box-shadow: 0 12px 44px rgba(0, 0, 0, 0.4), 0 0 60px rgba(109, 124, 255, 0.1),
              inset 0 1px 0 rgba(255,255,255,.08);
}

/* ---------- 仪表盘圆环:柔光 ---------- */
.quota-rings { filter: drop-shadow(0 6px 24px rgba(109, 124, 255, 0.14)); }

/* ---------- secstat 统计条:毛玻璃化 ---------- */
.secstat > .s {
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.015));
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 14px;
  box-shadow: 0 6px 22px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.05);
  backdrop-filter: blur(10px);
}
.secstat > .s:hover {
  border-color: rgba(109,124,255,.5);
  box-shadow: 0 10px 30px rgba(0,0,0,.35), 0 0 24px rgba(109,124,255,.1);
}

/* ---------- 动效:页面切换呼吸感 ---------- */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.main > * { animation: fadeSlideUp .45s cubic-bezier(.22,1,.36,1) both; }
.main > *:nth-child(2) { animation-delay: .05s; }
.main > *:nth-child(3) { animation-delay: .1s; }
.main > *:nth-child(4) { animation-delay: .15s; }

/* ---------- 滚动条:渐变拇指 ---------- */
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(109,124,255,.35), rgba(160,107,255,.25));
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(109,124,255,.6), rgba(160,107,255,.45));
  border: 2px solid transparent;
  background-clip: padding-box;
}

/* ================= 用户中心排行榜 ================= */
.lb-row {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 12px; border-radius: 12px;
  transition: background .2s;
  animation: fadeSlideUp .45s cubic-bezier(.22,1,.36,1) both;
}
.lb-row:hover { background: rgba(109, 124, 255, 0.06); }
.lb-row.me {
  background: linear-gradient(90deg, rgba(109,124,255,.14), rgba(109,124,255,.04));
  box-shadow: inset 0 0 0 1px rgba(109, 124, 255, 0.3);
}
.lb-row.me .lb-name { color: #c3cbff; font-weight: 700; }
.lb-rank {
  width: 34px; height: 34px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 10px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  font-weight: 750; font-size: 13px; color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.lb-rank.top1 { background: rgba(251,191,36,.12); border-color: rgba(251,191,36,.35); font-size: 18px; }
.lb-rank.top2 { background: rgba(203,213,225,.1); border-color: rgba(203,213,225,.3); font-size: 18px; }
.lb-rank.top3 { background: rgba(245,158,11,.1); border-color: rgba(245,158,11,.3); font-size: 18px; }
.lb-main { flex: 1; min-width: 0; }
.lb-name {
  font-weight: 600; font-size: 13.5px; color: var(--text);
  display: inline-flex; align-items: center; gap: 7px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lb-me-tag {
  font-size: 10px; padding: 1px 7px; border-radius: 99px;
  background: var(--accent-grad); color: #fff; font-weight: 700;
  flex-shrink: 0;
}
.lb-nums {
  font-size: 12.5px; color: var(--text-2);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.lb-nums b { color: var(--text); font-weight: 700; }
.lb-bar {
  height: 6px; border-radius: 5px; margin-top: 6px;
  background: rgba(255,255,255,.06); overflow: hidden;
}
.lb-bar > i { display: block; height: 100%; border-radius: 5px; }

/* ================= 移动端适配 ================= */
/* 侧边栏导航滚动容器:导航项多时不撑破 100vh */
.nav-scroll { overflow-y: auto; min-height: 0; }
.sidebar { overflow: hidden; }
.admin-mobilebar { display: none; }

@media (max-width: 720px) {
  .layout { flex-direction: column; }
  .sidebar {
    position: static; height: auto; width: 100%;
    flex-direction: row; align-items: center; padding: 10px 12px;
    overflow-x: auto; gap: 6px;
  }
  .sidebar .brand { padding: 0 8px 0 2px; }
  .sidebar .brand-sub, .sidebar .sidebar-foot { display: none; }
  .nav-scroll { display: flex; gap: 4px; overflow-x: auto; min-height: 0; }
  .nav-scroll .nav-item { white-space: nowrap; padding: 8px 12px; margin-bottom: 0; }
  .nav-item.active::before { display: none; }
  .admin-mobilebar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; border-bottom: 1px solid rgba(109,124,255,0.12);
    position: sticky; top: 0; z-index: 30;
    background: rgba(8, 10, 17, 0.85); backdrop-filter: blur(18px);
  }
  .main { padding: 16px 14px 40px; max-width: 100%; }
  .form-row { grid-template-columns: 1fr; }
  .modal { padding: 18px; }
  .stat-value { font-size: 24px; }
  .page-title { font-size: 19px; }
}
@media (max-width: 900px) {
  .grid[class*="grid-template"], .grid[style] { grid-template-columns: 1fr !important; }
}
