@charset "UTF-8";
/* ==========================================================================
   NewAPI 中转计费系统 - 全局样式
   设计约束：零外链（无 CDN / 无外部字体 / 无图表库）、深色主题、移动端优先适配
   ========================================================================== */

/* ---------- 1. 设计变量 ---------- */
:root {
  --bg: #0f1115;
  --bg-soft: #13161c;
  --panel: #171a21;
  --panel-2: #1d212a;
  --panel-3: #232833;
  --border: #272c37;
  --border-soft: #1f242e;

  --text: #e7eaf0;
  --text-dim: #9aa4b5;
  --text-mute: #6b7484;

  --primary: #3b82f6;
  --primary-strong: #2563eb;
  --primary-soft: rgba(59, 130, 246, 0.14);

  --success: #22c55e;
  --success-soft: rgba(34, 197, 94, 0.14);
  --warn: #f59e0b;
  --warn-soft: rgba(245, 158, 11, 0.14);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.14);

  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  --sidebar-w: 216px;
  --header-h: 58px;

  /* 系统字体栈：不引入任何外部字体 */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
}

/* ---------- 2. 基础重置 ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
p { margin: 0 0 8px; }
img, svg { vertical-align: middle; }
button, input, select, textarea { font-family: inherit; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #303643; border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::selection { background: var(--primary-soft); }

.hidden { display: none !important; }
.muted { color: var(--text-dim); }
.dim { color: var(--text-mute); }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt8 { margin-top: 8px; }
.mt12 { margin-top: 12px; }
.mt16 { margin-top: 16px; }
.mt24 { margin-top: 24px; }
.gap8 { gap: 8px; }

/* ---------- 3. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition: background .15s, border-color .15s, opacity .15s;
  white-space: nowrap;
}
.btn:hover { background: var(--panel-3); border-color: #333a48; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; flex: none; }

.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-strong); border-color: var(--primary-strong); }
.btn-success { background: var(--success); border-color: var(--success); color: #06240f; }
.btn-success:hover { background: #16a34a; border-color: #16a34a; }
.btn-warn { background: var(--warn); border-color: var(--warn); color: #3a2404; }
.btn-warn:hover { background: #d97706; border-color: #d97706; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; border-color: #dc2626; }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--panel-2); }
.btn-sm { min-height: 30px; padding: 0 10px; font-size: 13px; }
.btn-sm svg { width: 14px; height: 14px; }
.btn-block { width: 100%; }
.btn-lg { min-height: 46px; font-size: 15px; }

/* ---------- 4. 表单控件 ---------- */
.field { margin-bottom: 14px; }
.field > label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--text-dim);
}
.field > label .req { color: var(--danger); margin-left: 2px; }
.input, .select, .textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 16px; /* 移动端 >=16px 防自动缩放 */
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder, .textarea::placeholder { color: var(--text-mute); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.textarea { min-height: 84px; resize: vertical; line-height: 1.6; }
.select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239aa4b5' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
}
.input-group { display: flex; gap: 8px; flex-wrap: wrap; }
.input-group .input, .input-group .select { flex: 1 1 160px; width: auto; }
.hint { margin-top: 5px; font-size: 12px; color: var(--text-mute); }

/* 开关 */
.switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex: none;
  cursor: pointer;
}
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute;
  inset: 0;
  background: #39404f;
  border-radius: 24px;
  transition: background .18s;
}
.switch .slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform .18s;
}
.switch input:checked + .slider { background: var(--success); }
.switch input:checked + .slider::before { transform: translateX(18px); }
.switch input:disabled + .slider { opacity: .5; cursor: not-allowed; }

/* 复选框行（系统设置用） */
.check-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
}
.check-row .cr-text strong { display: block; font-size: 14px; font-weight: 600; }
.check-row .cr-text span { font-size: 12px; color: var(--text-mute); }

/* ---------- 5. 卡片 / 面板 ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.card-head h3 { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.card-head h3 svg { width: 17px; height: 17px; color: var(--primary); }
.card-head .card-desc { font-size: 12px; color: var(--text-mute); font-weight: 400; }
.grid { display: grid; gap: 16px; }
.section-title { font-size: 13px; color: var(--text-dim); margin: 0 0 10px; }

/* ---------- 6. 数据卡片（统计） ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.stat {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
}
.stat::after {
  content: "";
  position: absolute;
  right: -18px;
  top: -18px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary-soft);
}
.stat .stat-label {
  font-size: 12px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}
.stat .stat-label svg { width: 15px; height: 15px; }
.stat .stat-value {
  margin-top: 6px;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: .3px;
  position: relative;
  word-break: break-all;
}
.stat .stat-sub { margin-top: 3px; font-size: 12px; color: var(--text-mute); position: relative; }
.stat.blue::after { background: var(--primary-soft); }
.stat.blue .stat-label svg { color: var(--primary); }
.stat.green::after { background: var(--success-soft); }
.stat.green .stat-label svg { color: var(--success); }
.stat.orange::after { background: var(--warn-soft); }
.stat.orange .stat-label svg { color: var(--warn); }
.stat.red::after { background: var(--danger-soft); }
.stat.red .stat-label svg { color: var(--danger); }
.stat.purple::after { background: rgba(168, 85, 247, .14); }
.stat.purple .stat-label svg { color: #a855f7; }
.stat.teal::after { background: rgba(20, 184, 166, .14); }
.stat.teal .stat-label svg { color: #14b8a6; }

/* ---------- 7. 表格 ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 640px;
}
table.tbl th, table.tbl td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}
table.tbl th {
  color: var(--text-dim);
  font-weight: 500;
  font-size: 12px;
  background: var(--panel-2);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}
table.tbl tbody tr:hover { background: rgba(255, 255, 255, .022); }
table.tbl tbody tr:last-child td { border-bottom: none; }
table.tbl td.num, table.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl .cell-main { color: var(--text); }
table.tbl .cell-sub { display: block; font-size: 12px; color: var(--text-mute); }

/* ---------- 8. 徽标 / 标签 ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 12px;
  line-height: 1.7;
  background: var(--panel-3);
  color: var(--text-dim);
  white-space: nowrap;
}
.badge.blue { background: var(--primary-soft); color: #7db0fb; }
.badge.green { background: var(--success-soft); color: #5fd98d; }
.badge.orange { background: var(--warn-soft); color: #fbbf5c; }
.badge.red { background: var(--danger-soft); color: #f98a8a; }
.badge.gray { background: #2a303c; color: var(--text-dim); }
.badge.purple { background: rgba(168, 85, 247, .14); color: #c893fd; }

/* ---------- 9. Toast ---------- */
#toastBox {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  width: min(92vw, 460px);
}
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--panel-3);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
  box-shadow: var(--shadow);
  animation: toast-in .22s ease;
}
.toast svg { width: 17px; height: 17px; flex: none; }
.toast.ok svg { color: var(--success); }
.toast.err svg { color: var(--danger); }
.toast.warn svg { color: var(--warn); }
.toast.info svg { color: var(--primary); }
.toast.out { animation: toast-out .2s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-10px); } }

/* ---------- 10. 弹窗 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 11, .68);
  backdrop-filter: blur(2px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}
.modal {
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: modal-in .18s ease;
  padding-bottom: env(safe-area-inset-bottom);
}
.modal.wide { max-width: 660px; }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border-soft);
}
.modal-head h3 { font-size: 15px; }
.modal-close {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: var(--text-dim);
  border-radius: 6px; cursor: pointer; font-size: 20px; line-height: 1;
}
.modal-close:hover { background: var(--panel-3); color: var(--text); }
.modal-body { padding: 16px 18px; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px 16px;
  flex-wrap: wrap;
}
.modal-foot .btn { flex: 1 1 auto; min-width: 92px; }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }

/* 键值展示（查看完整 Key / 调用示例） */
.kv-box {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 13px;
  word-break: break-all;
  color: #b9e0ff;
}

/* ---------- 11. 登录页 ---------- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
  background:
    radial-gradient(900px 480px at 50% -10%, rgba(59, 130, 246, .13), transparent 70%),
    var(--bg);
}
.auth-box { width: 100%; max-width: 420px; }
.auth-brand { text-align: center; margin-bottom: 22px; }
.auth-logo {
  width: 52px; height: 52px;
  margin: 0 auto 10px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: #fff;
}
.auth-logo svg { width: 28px; height: 28px; }
.auth-brand h1 { font-size: 20px; letter-spacing: .5px; }
.auth-brand p { margin: 4px 0 0; font-size: 13px; color: var(--text-mute); }
.auth-card {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 18px;
}
.tabs button {
  flex: 1;
  min-height: 36px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.tabs button.active { background: var(--primary); color: #fff; font-weight: 500; }
.auth-alt {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 12px; font-size: 13px; color: var(--text-dim); flex-wrap: wrap; gap: 8px;
}
.auth-foot { margin-top: 16px; text-align: center; font-size: 12px; color: var(--text-mute); }
.devcode {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px dashed #3b4250;
  border-radius: var(--radius-sm);
  background: #1a1e26;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.7;
}
.devcode b { color: var(--warn); font-family: var(--mono); font-size: 15px; letter-spacing: 2px; }
.countdown { color: var(--text-mute); }

/* ---------- 12. 后台布局 ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  flex: none;
  background: var(--panel);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 30;
}
.sidebar .brand {
  display: flex; align-items: center; gap: 9px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-soft);
  flex: none;
}
.sidebar .brand .b-logo {
  width: 30px; height: 30px; flex: none;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.sidebar .brand .b-logo svg { width: 17px; height: 17px; }
.sidebar .brand .b-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar .brand .b-sub { font-size: 11px; color: var(--text-mute); }
.nav { padding: 8px; flex: 1; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 11px;
  margin-bottom: 2px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: background .14s, color .14s;
}
.nav-item svg { width: 17px; height: 17px; flex: none; }
.nav-item:hover { background: var(--panel-2); color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: #8ab8fd; font-weight: 500; }
.nav-item .nav-dot {
  margin-left: auto;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  display: inline-flex; align-items: center; justify-content: center;
}
.sidebar .side-foot { padding: 10px; border-top: 1px solid var(--border-soft); flex: none; }
.side-user {
  display: flex; align-items: center; gap: 9px;
  padding: 8px; border-radius: var(--radius-sm);
  background: var(--panel-2); margin-bottom: 8px;
}
.side-user .avatar {
  width: 30px; height: 30px; flex: none;
  border-radius: 50%;
  background: var(--primary-soft);
  color: #8ab8fd;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
}
.side-user .su-info { min-width: 0; flex: 1; }
.side-user .su-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user .su-mail { font-size: 11px; color: var(--text-mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--header-h);
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--panel);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar .tb-title { font-size: 15px; font-weight: 600; }
.topbar .tb-spacer { flex: 1; }
.topbar .tb-bal {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--panel-2);
  font-size: 13px;
}
.topbar .tb-bal b { color: var(--success); font-variant-numeric: tabular-nums; }
.content {
  flex: 1;
  padding: 18px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
  min-width: 0;
}
.page { display: none; }
.page.active { display: block; animation: page-in .18s ease; }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.page-head { margin-bottom: 16px; }
.page-head h2 { font-size: 18px; }
.page-head p { margin: 4px 0 0; font-size: 13px; color: var(--text-mute); }

/* 移动端汉堡按钮 */
.menu-btn { display: none; }

/* ---------- 13. 调用示例条 ---------- */
.apibox {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.apibox .kv-box { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.apibox .kv-box .kv-text { flex: 1; min-width: 0; word-break: break-all; }
.copy-btn {
  flex: none;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text-dim);
  border-radius: 6px;
  min-height: 28px;
  padding: 0 9px;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
}
.copy-btn:hover { color: var(--text); border-color: #3a4252; }
.copy-btn svg { width: 13px; height: 13px; }
.notice-strip {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  border: 1px solid rgba(59, 130, 246, .22);
  color: #93bbfb;
  font-size: 12.5px;
  line-height: 1.6;
}
.notice-strip svg { width: 15px; height: 15px; flex: none; margin-top: 2px; }
.notice-strip.warn { background: var(--warn-soft); border-color: rgba(245,158,11,.22); color: #f6c377; }
.notice-strip.danger { background: var(--danger-soft); border-color: rgba(239,68,68,.22); color: #f79a9a; }

/* ---------- 14. 图表（内联 SVG 手写柱状图） ---------- */
.chart { width: 100%; overflow: visible; }
.chart svg { width: 100%; height: auto; display: block; }
.chart-legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-dim); margin-bottom: 6px; flex-wrap: wrap; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; }

/* ---------- 15. 模型卡片 ---------- */
.model-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.model-card {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--panel-2);
  padding: 14px;
}
.model-card .mc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.model-card .mc-name { font-size: 14px; font-weight: 600; font-family: var(--mono); word-break: break-all; }
.model-card .mc-display { font-size: 12px; color: var(--text-dim); }
.model-card .mc-desc { font-size: 12.5px; color: var(--text-mute); line-height: 1.6; min-height: 20px; margin-bottom: 10px; }
.mc-prices { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; margin-bottom: 10px; }
.mc-prices span { color: var(--text-dim); }
.mc-prices b { color: var(--text); font-variant-numeric: tabular-nums; }
.mc-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--text-mute); margin-bottom: 10px; }
.mc-note { display: flex; gap: 6px; }
.mc-note .input { min-height: 36px; font-size: 13px; }

/* ---------- 16. 列表行（Key 管理 / 移动端卡片化） ---------- */
.key-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.key-row .kr-main { flex: 1 1 200px; min-width: 0; }
.key-row .kr-name { font-size: 14px; font-weight: 500; }
.key-row .kr-key { font-family: var(--mono); font-size: 12.5px; color: var(--text-dim); word-break: break-all; }
.key-row .kr-sub { font-size: 12px; color: var(--text-mute); margin-top: 2px; }
.key-row .kr-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* 移动端卡片列表（表格转卡片） */
.card-list { display: none; }
.cl-item {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  padding: 12px;
  margin-bottom: 10px;
}
.cl-item .cl-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 3px 0; }
.cl-item .cl-row .cl-k { color: var(--text-mute); flex: none; }
.cl-item .cl-row .cl-v { text-align: right; word-break: break-all; min-width: 0; }
.cl-item .cl-title { font-size: 14px; font-weight: 600; margin-bottom: 6px; word-break: break-all; }
.cl-item .cl-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.cl-item .cl-actions .btn { flex: 1 1 84px; }

/* ---------- 17. 分页 / 空态 / 加载 ---------- */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-dim);
}
.pager .btn { min-width: 40px; }
.empty {
  padding: 34px 16px;
  text-align: center;
  color: var(--text-mute);
  font-size: 13px;
}
.empty svg { width: 40px; height: 40px; opacity: .35; display: block; margin: 0 auto 10px; }
.loading {
  padding: 30px;
  text-align: center;
  color: var(--text-mute);
  font-size: 13px;
}
.loading .spin {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin-right: 8px;
  vertical-align: -3px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 筛选栏 */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; align-items: flex-end; }
.filters .f-item { display: flex; flex-direction: column; gap: 4px; }
.filters .f-item label { font-size: 12px; color: var(--text-dim); }
.filters .input, .filters .select { min-height: 38px; font-size: 14px; width: auto; min-width: 130px; }
.filters .btn { min-height: 38px; }

/* ---------- 18. 充值 ---------- */
.balance-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 20px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(59,130,246,.16), rgba(139,92,246,.12));
  border: 1px solid rgba(59,130,246,.24);
}
.balance-hero .bh-num { font-size: 34px; font-weight: 700; letter-spacing: .5px; font-variant-numeric: tabular-nums; }
.balance-hero .bh-label { font-size: 13px; color: var(--text-dim); }
.qr-box {
  text-align: center;
  padding: 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
}
.qr-box img { max-width: 220px; width: 100%; border-radius: 6px; background: #fff; }
.qr-box .qr-tip { font-size: 12px; color: var(--text-mute); margin-top: 8px; word-break: break-all; }
.amount-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.amount-chips button {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text-dim);
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
}
.amount-chips button.active { border-color: var(--primary); background: var(--primary-soft); color: #8ab8fd; }

/* ---------- 19. 公告 ---------- */
.ann-item {
  padding: 14px 16px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  margin-bottom: 10px;
}
.ann-item.pinned { border-color: rgba(245, 158, 11, .35); background: rgba(245, 158, 11, .06); }
.ann-item .ann-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.ann-item .ann-title { font-size: 14px; font-weight: 600; }
.ann-item .ann-time { font-size: 12px; color: var(--text-mute); margin-left: auto; }
.ann-item .ann-body { font-size: 13px; color: var(--text-dim); white-space: pre-wrap; line-height: 1.7; }

/* ---------- 20. 移动端适配 ---------- */
@media (max-width: 900px) {
  .apibox { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    height: 100vh;
    width: 250px;
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: var(--shadow);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .sidebar.open { transform: none; }
  .sidebar-mask {
    position: fixed; inset: 0;
    background: rgba(5, 7, 11, .6);
    z-index: 25;
  }
  .menu-btn {
    display: inline-flex;
    align-items: center; justify-content: center;
    width: 40px; height: 40px;
    border: 1px solid var(--border);
    background: var(--panel-2);
    color: var(--text);
    border-radius: var(--radius-sm);
    cursor: pointer;
    flex: none;
  }
  .menu-btn svg { width: 20px; height: 20px; }
  .main { width: 100%; }
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar .tb-title { font-size: 14px; }
  .content { padding: 12px; padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
  .card { padding: 13px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat { padding: 12px; }
  .stat .stat-value { font-size: 19px; }

  /* 表格 → 卡片列表 */
  .table-only { display: none !important; }
  .card-list { display: block; }

  /* 触控尺寸 */
  .btn { min-height: 44px; padding: 0 15px; }
  .btn-sm { min-height: 36px; }
  .input, .select, .textarea { font-size: 16px; min-height: 44px; }
  .mc-note .input { min-height: 40px; }
  .copy-btn { min-height: 34px; }
  .nav-item { min-height: 44px; }
  .tabs button { min-height: 40px; }
  .amount-chips button { min-height: 40px; }
  .modal { max-width: 100%; border-radius: 12px; }
  .modal-foot .btn { flex: 1 1 100px; }
  .filters .input, .filters .select { min-height: 44px; width: 100%; }
  .filters .f-item { flex: 1 1 140px; }
  .filters .btn { flex: 1 1 100%; min-height: 44px; }
  .pager .btn { min-height: 44px; }
  .balance-hero .bh-num { font-size: 28px; }
}

@media (max-width: 400px) {
  .stat-grid { grid-template-columns: 1fr; }
}

/* 大屏优化 */
@media (min-width: 1400px) {
  .content { max-width: 1320px; }
}

/* ============================================================
   联系客服 / 在线留言（登录页入口 + 右下角悬浮按钮）
   ============================================================ */
.auth-service { margin: 16px 0 0; }
.auth-service .btn { min-height: 46px; font-weight: 600; }
.auth-service .hint { margin-top: 8px; }

.service-fab {
  position: fixed;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary); color: #fff;
  border: none; cursor: pointer; z-index: 60;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
  transition: transform .15s ease, background .15s ease;
}
.service-fab:hover { background: var(--primary-strong); }
.service-fab:active { transform: scale(.94); }

.svc-notice {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; margin-bottom: 14px;
  background: var(--primary-soft); border-radius: var(--radius-sm);
  color: var(--text); line-height: 1.65; font-size: 13px;
}
.svc-notice svg { flex: 0 0 20px; margin-top: 2px; color: var(--primary); }

.svc-block { margin-bottom: 18px; }
.svc-block h4 { margin: 0 0 10px; font-size: 14px; color: var(--text); }
.svc-block h4 small { color: var(--text-mute); font-weight: 400; margin-left: 6px; font-size: 12px; }

.svc-item {
  display: flex; gap: 12px; align-items: center;
  padding: 12px 14px; margin-bottom: 8px; min-height: 58px;
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); text-decoration: none;
}
.svc-item:hover { border-color: var(--primary); background: var(--panel-3); }
.svc-item svg { flex: 0 0 20px; color: var(--primary); }
.svc-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.svc-txt b { font-size: 14px; font-weight: 600; word-break: break-all; }
.svc-txt small { color: var(--text-mute); font-size: 12px; }

.svc-hours {
  display: flex; gap: 8px; align-items: center;
  color: var(--text-dim); font-size: 13px; margin-bottom: 14px;
}
.svc-hours svg { color: var(--text-mute); }

.svc-faq {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 6px; background: var(--panel-2);
}
.svc-faq summary {
  padding: 11px 14px; cursor: pointer; font-size: 13px;
  color: var(--text); min-height: 44px; display: flex; align-items: center;
}
.svc-faq p { margin: 0; padding: 0 14px 12px; color: var(--text-dim); font-size: 13px; line-height: 1.7; }

/* 管理员手机端待办：一键放行大按钮 */
.todo-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; margin-bottom: 8px;
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.todo-item .ti-main { min-width: 0; }
.todo-item .ti-main b { display: block; font-size: 14px; word-break: break-all; }
.todo-item .ti-main small { color: var(--text-mute); font-size: 12px; }
.todo-item .btn { min-height: 44px; flex: 0 0 auto; padding: 0 16px; }

@media (max-width: 768px) {
  .service-fab { right: 14px; width: 52px; height: 52px; }
  .svc-item { min-height: 64px; }
  .svc-txt b { font-size: 15px; }
  .todo-item { flex-wrap: wrap; }
  .todo-item .btn { flex: 1 1 100%; }
}
