/* ============================================================
   API 聚合平台 · 设计系统
   风格基准：DeepSeek / Kimi 后台 —— 极简开发者工具感，拒绝商城感
   原则：白底、细边框、等宽数字、大量留白，信息密度优先
   ============================================================ */

:root {
  /* 顶栏与正文共用同一宽度，二者左边缘才能对齐。
     后台导航模块多（11 个），单页在 body 上覆盖成更宽的 --page-w。 */
  --page-w: 1180px;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --panel-2: #fbfcfd;
  --line: #e5e7eb;
  --line-soft: #eef0f3;
  --text: #14181f;
  --text-2: #4b5563;
  --muted: #8a919e;
  --brand: #1f6feb;
  --brand-2: #0b5ed7;
  --brand-soft: #eaf2ff;
  --ok: #12a150;
  --ok-soft: #e8f7ee;
  --warn: #d97706;
  --warn-soft: #fff7e8;
  --danger: #dc2626;
  --danger-soft: #fdecec;
  --purple: #7c3aed;
  --purple-soft: #f3ecff;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 12px rgba(16, 24, 40, .04);
  --mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Consolas, "Courier New", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 14px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: var(--page-w); margin: 0 auto; padding: 0 20px; height: 56px;
  display: flex; align-items: center; gap: 18px;
}
.logo { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 15px; letter-spacing: -.2px; flex: 0 0 auto; white-space: nowrap; }
.logo .dot {
  width: 22px; height: 22px; border-radius: 6px; flex: 0 0 22px;
  background: linear-gradient(135deg, #1f6feb, #6aa4ff);
  display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 800;
}
.topbar nav { display: flex; gap: 4px; margin-left: 8px; overflow-x: auto; scrollbar-width: none;
  flex: 0 1 auto; min-width: 0; }
.topbar nav::-webkit-scrollbar { display: none; }
.topbar nav a { white-space: nowrap; flex: 0 0 auto; }
.topbar nav a {
  padding: 6px 10px; border-radius: var(--radius-sm); color: var(--text-2);
  font-size: 13px; font-weight: 500;
}
.topbar nav a:hover { background: var(--line-soft); text-decoration: none; }
.topbar nav a.on { background: var(--brand-soft); color: var(--brand-2); }
.topbar .spacer { flex: 1; }
.who { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 8px;
  flex: 0 0 auto; white-space: nowrap; }
.who b { color: var(--text); font-weight: 600; }

/* 窄屏（1080 / 1366 这类笔记本）顶栏放不下「11 个模块 + 右侧入口」，两处调整：
   ① 收起「接口文档 / 配置助手」两个标签 —— 系统设置页里有同样的卡片入口，不算丢功能；
   ② 导航改成折行，而不是横向滚动：滚动条是隐藏的，用户根本看不出后面还藏着菜单
      （1080 宽下「用户管理 / 代理招商 / 交流社群 / 系统设置」会被滚出视野，等于没有）。 */
@media (max-width: 1320px) {
  .topbar-inner { height: auto; min-height: 56px; padding: 7px 20px; }
  .topbar nav { flex-wrap: wrap; overflow: visible; row-gap: 1px; }
  .who #link-docs, .who #link-setup { display: none; }
}

/* 后台顶栏现在只有「品牌 + 账号区」，13 个模块已经搬到左侧竖排（见下方 .layout）。
   这两条保留是为了压缩顶栏高度、并让 who 区在窄屏也能折行 —— 别再往后台顶栏加导航。 */
body.page-admin .topbar-inner { height: auto; min-height: 56px; padding: 7px 20px; }
body.page-admin .who { flex-wrap: wrap; justify-content: flex-end; row-gap: 4px; }

/* ---------------- 布局 ---------------- */
.wrap { max-width: var(--page-w); margin: 0 auto; padding: 22px 20px 72px; }
/* 后台：13 个模块 + 文档入口 + 用户区，横排在顶栏里根本放不下，所以改成左侧竖排，
   内容区不再受 --page-w 约束（它由 .layout 的两栏网格定宽）。
   下面这几条 body.page-admin 的覆盖必须留着 —— 有它们，.wrap 才不会被
   `.wrap { max-width: var(--page-w); margin: 0 auto }` 顶到侧栏右边去。 */
body.page-admin { --page-w: 1400px; }
body.page-admin .wrap { max-width: none; margin: 0; padding: 22px 0 56px; }

/* ---------------- 左侧竖排导航（后台） ----------------
   为什么改竖排：原来 13 个模块横排在顶栏，加到第 12 个就开始有入口被挤出视野
   （滚动条是隐藏的，用户根本不知道后面还有东西）。竖排既放得下、也符合后台操作习惯。

   两栏网格：固定 208px 侧栏 + 自适应内容。侧栏 position:sticky 常驻，
   滚长表格时菜单不跟着滚走。 */
.layout {
  max-width: var(--page-w); margin: 0 auto; padding: 0 20px;
  display: grid; grid-template-columns: 208px minmax(0, 1fr); gap: 22px;
  align-items: start;
}
.side { position: sticky; top: 70px; padding: 20px 0 40px; }
.main { min-width: 0; }      /* 没有它，内部的宽表格会把网格列撑破 */

.nav-group { margin-bottom: 2px; }
.nav-group-t {
  display: flex; align-items: center; gap: 6px; width: 100%;
  background: none; border: 0; cursor: pointer; text-align: left;
  font: inherit; font-size: 11.5px; font-weight: 700; letter-spacing: .4px;
  color: var(--muted); padding: 9px 10px 7px; border-radius: var(--radius-sm);
}
.nav-group-t:hover { color: var(--text-2); background: var(--line-soft); }
.nav-group-t .caret {
  margin-left: auto; width: 0; height: 0; border-left: 4px solid currentColor;
  border-top: 4px solid transparent; border-bottom: 4px solid transparent;
  transform: rotate(90deg); transition: transform .15s; opacity: .7;
}
.nav-group.closed .nav-group-t .caret { transform: rotate(0deg); }
.nav-group.closed .nav-group-b { display: none; }
.nav-group-b { display: block; }

.side nav a {
  display: block; position: relative;
  padding: 7px 10px 7px 18px; border-radius: var(--radius-sm);
  color: var(--text-2); font-size: 13px; font-weight: 500;
}
.side nav a:hover { background: var(--line-soft); text-decoration: none; }
.side nav a.on { background: var(--brand-soft); color: var(--brand-2); font-weight: 600; }
.side nav a.on::before {
  content: ''; position: absolute; left: 7px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 14px; border-radius: 2px; background: var(--brand);
}
/* 窄屏（笔记本 1366 及以下）：侧栏收窄，避免内容区被挤到放不下表格 */
@media (max-width: 1180px) {
  .layout { grid-template-columns: 176px minmax(0, 1fr); gap: 16px; }
}
/* 真·窄屏（平板/竖屏）：侧栏改成顶部横向可滚，不然内容区只剩一条缝 */
@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; padding: 12px 0 0; }
  .nav-group { display: inline-block; vertical-align: top; }
  .side nav a { padding-right: 14px; }
}

/* ---------------- 品牌图标 ----------------
   没有 LOGO 图片时是字母/汉字占位；配了图片就换成 <img>（加 has-img 去掉渐变底色，
   否则透明底 PNG 会压在一块蓝底上，很难看）。 */
.logo .dot img, .gate .brand .dot img, .brand-preview .dot img {
  width: 100%; height: 100%; object-fit: contain; display: block; border-radius: inherit;
}
.logo .dot.has-img, .gate .brand .dot.has-img { background: none; }
.logo-sub { color: var(--muted); font-weight: 500; margin-left: 6px; }

/* ---------------- 页脚（ICP 备案 / 公安备案 / 版权） ----------------
   ⚠️ 后台的页脚必须放在 .wrap 之外：setupTabs 把「最后一个 page-head 到容器末尾」
   整段算作最后一个模块的切片，页脚留在 .wrap 里会跟着那个模块一起被切掉。
   用户端 / 分销商后台同理。 */
.site-footer {
  max-width: var(--page-w); margin: 0 auto; padding: 20px 20px 30px;
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 4px 10px; color: var(--muted); font-size: 12px; line-height: 1.9;
}
body.page-admin .site-footer { max-width: none; margin: 0; padding: 18px 0 0; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--brand); text-decoration: none; }
.site-footer .sep { color: var(--line); }
/* 一条都没有时整个页脚不渲染（不留一条空白横线） */
.site-footer:empty { display: none; }
/* 登录页：.gate 是 place-items:center 的满屏网格，页脚靠绝对定位钉在底部 */
.gate-footer { position: absolute; left: 0; right: 0; bottom: 18px; max-width: none; border-top: 0; padding: 0 20px; }

/* 后台「品牌与备案」里的预览块 */
.brand-preview {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border: 1px dashed var(--line);
  border-radius: var(--radius-sm); background: var(--panel-2);
}
.brand-preview .dot {
  width: 30px; height: 30px; border-radius: 8px; flex: 0 0 30px;
  background: linear-gradient(135deg, #1f6feb, #6aa4ff);
  display: grid; place-items: center; color: #fff; font-size: 14px; font-weight: 800;
}
.brand-preview .dot.has-img { background: none; }
label.field > span.field-desc {
  font-weight: 400; color: var(--muted); font-size: 11.5px;
  margin: 4px 0 0; line-height: 1.5;
}

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-12 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
@media (max-width: 940px) { .g2,.g3,.g4,.g-21,.g-12 { grid-template-columns: minmax(0,1fr); } }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
/* 顶栏导航 = 分模块切换：非当前模块整片隐藏，一次只显示一个模块。
   用独立的 .tab-hide 而不是 .hidden —— 后者归「功能开关 / 展开收起」用
   （交流社群开关、用户详情面板等），和分模块混用会互相覆盖。 */
.tab-hide { display: none !important; }
/* 一次只显示一个模块时，模块之间的 30px 分隔间距就多余了（否则切到任何模块，
   标题上方都会凭空多出一段空白）。HTML 里写的是行内 margin-top，用 !important 覆盖。 */
.wrap.tabbed > .page-head { margin-top: 0 !important; }
.page-head h1 { margin: 0; font-size: 20px; letter-spacing: -.3px; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px;
}
.card.tight { padding: 0; overflow: hidden; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-h h3 { margin: 0; font-size: 14px; font-weight: 650; letter-spacing: -.1px; }
.card-h .sub { font-size: 12px; color: var(--muted); font-weight: 400; }
.card.tight .card-h { padding: 16px 18px 12px; margin: 0; border-bottom: 1px solid var(--line-soft); }

/* ---------------- 指标 ---------------- */
.metric { padding: 16px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.metric .k { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.metric .v { font-family: var(--mono); font-size: 24px; font-weight: 650; letter-spacing: -.5px; margin-top: 6px; }
.metric .v.sm { font-size: 19px; }
.metric .d { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.metric.ok .v { color: var(--ok); }
.metric.danger .v { color: var(--danger); }
.metric.brand .v { color: var(--brand); }

/* ---------------- 进度 ---------------- */
.bar { height: 8px; border-radius: 99px; background: var(--line-soft); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brand); border-radius: 99px; transition: width .45s cubic-bezier(.2,.7,.3,1); }
.bar.warn > i { background: linear-gradient(90deg, #f59e0b, #d97706); }
.bar.danger > i { background: linear-gradient(90deg, #f87171, #dc2626); }

.ring { position: relative; width: 168px; height: 168px; margin: 4px auto 0; }
.ring svg { transform: rotate(-90deg); }
.ring .mid { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .mid .pct { font-family: var(--mono); font-size: 30px; font-weight: 700; letter-spacing: -1px; }
.ring .mid .lbl { font-size: 11.5px; color: var(--muted); }

/* ---------------- 表格 ---------------- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line-soft); }
th { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: none; background: var(--panel-2); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbfc; }
td.num, th.num { text-align: right; font-family: var(--mono); }
.table-scroll { overflow: auto; max-height: 460px; }
.table-scroll table { min-width: 640px; }

/* ---------------- 徽标 ---------------- */
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 99px;
  font-size: 11.5px; font-weight: 600; line-height: 1.7; white-space: nowrap; }
.tag.gray  { background: var(--line-soft); color: var(--text-2); }
.tag.blue  { background: var(--brand-soft); color: var(--brand-2); }
.tag.green { background: var(--ok-soft); color: var(--ok); }
.tag.amber { background: var(--warn-soft); color: var(--warn); }
.tag.red   { background: var(--danger-soft); color: var(--danger); }
.tag.purple{ background: var(--purple-soft); color: var(--purple); }

/* ---------------- 按钮 ---------------- */
button, .btn {
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  padding: 8px 15px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: #fff; color: var(--text);
  transition: all .16s;
}
button:hover, .btn:hover { border-color: #cfd4dc; background: #fafbfc; text-decoration: none; }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
button.primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
button.danger { background: #fff; border-color: #f3c6c6; color: var(--danger); }
button.danger:hover { background: var(--danger-soft); }
button.amber { background: var(--warn); border-color: var(--warn); color: #fff; }
button.amber:hover { filter: brightness(.94); }
button.sm { padding: 5px 11px; font-size: 12px; }
button.link { border: 0; background: none; color: var(--brand); padding: 4px 6px; }
button.link:hover { background: var(--brand-soft); }

/* ---------------- 表单 ---------------- */
label.field { display: block; margin-bottom: 13px; }
label.field > span { display: block; font-size: 12px; color: var(--text-2); font-weight: 600; margin-bottom: 5px; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%; font: inherit; font-size: 13px; padding: 8px 11px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31,111,235,.12); }
select { padding-right: 26px; }

input[type=range] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; cursor: grab;
}
input[type=range]:disabled { cursor: not-allowed; }
input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 99px; background: var(--line-soft); }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff;
  border: 2px solid var(--brand); margin-top: -6px; box-shadow: 0 1px 3px rgba(0,0,0,.18); transition: transform .12s;
}
input[type=range]::-webkit-slider-thumb:hover { transform: scale(1.12); }
input[type=range]:disabled::-webkit-slider-thumb { border-color: #cbd0d8; background: #f2f4f7; }

.switch { position: relative; display: inline-flex; gap: 8px; align-items: center; font-size: 13px; }
.switch input[type=checkbox] {
  -webkit-appearance: none; appearance: none; width: 38px; height: 21px; border-radius: 99px;
  background: #d6dbe3; position: relative; cursor: pointer; transition: background .18s; flex: 0 0 38px;
}
.switch input[type=checkbox]::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: left .18s;
}
.switch input[type=checkbox]:checked { background: var(--ok); }
.switch input[type=checkbox]:checked::after { left: 19px; }
.switch input[type=checkbox]:disabled { opacity: .45; cursor: not-allowed; }

/* ---------------- 明细抽屉行（渠道模型下钻） ---------------- */
tr.sub-row > td { background: var(--panel-2); padding: 0; }
tr.sub-row table { min-width: 0; font-size: 12.5px; }
tr.sub-row table th { background: transparent; }
tr.sub-row table td, tr.sub-row table th { padding: 6px 12px; }
tr.sub-row table tbody tr:hover { background: transparent; }

/* ---------------- 社群卡片 ---------------- */
.qr-card { text-align: center; }
.qr-card img { width: 100%; max-width: 200px; border-radius: 8px; border: 1px solid var(--line); background: #fff; }

/* ---------------- 供应占比手动调整 ---------------- */
.share-layer + .share-layer { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 12px; }
.share-layer-h { display: flex; align-items: center; gap: 9px; margin-bottom: 7px; }
.share-row {
  display: grid; grid-template-columns: minmax(150px, 220px) minmax(120px, 1fr) 92px 116px;
  gap: 14px; align-items: center; padding: 7px 0;
}
.share-row + .share-row { border-top: 1px solid var(--line-soft); }
.share-row.off { opacity: .5; }
.share-name { display: flex; align-items: center; gap: 7px; font-size: 13px; min-width: 0; }
.share-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-row input[type=range] { width: 100%; }
.share-num {
  width: 92px !important; padding: 5px 8px !important; text-align: right;
  font-family: var(--mono); font-size: 12.5px;
}
.share-pct { text-align: right; font-size: 12.5px; }
.share-pct b { font-family: var(--mono); }
.sbar { height: 6px; border-radius: 99px; background: var(--line-soft); margin-top: 5px; overflow: hidden; }
.sbar > i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }

/* ---------------- 滑竿行 ---------------- */
.slider-row { padding: 14px 0; border-bottom: 1px dashed var(--line-soft); }
.slider-row:last-child { border-bottom: 0; }
.slider-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.slider-head .t { font-size: 13px; font-weight: 600; }
.slider-head .v { font-family: var(--mono); font-size: 15px; font-weight: 650; color: var(--brand); }
.slider-meta { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); font-family: var(--mono); }
.ticks { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); font-family: var(--mono); margin-top: 2px; }

/* ---------------- 提示条 ---------------- */
.note { display: flex; gap: 9px; padding: 11px 13px; border-radius: var(--radius-sm); font-size: 12.5px; line-height: 1.65; }
.note.blue { background: var(--brand-soft); color: #17427e; }
.note.green{ background: var(--ok-soft); color: #0a5c30; }
.note.amber{ background: var(--warn-soft); color: #7c4a03; }
.note.red  { background: var(--danger-soft); color: #8f1d1d; }
.note code { font-family: var(--mono); background: rgba(0,0,0,.05); padding: 1px 5px; border-radius: 4px; }

/* ---------------- 步骤条 ---------------- */
.steps { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.step .n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--line-soft); color: var(--muted); font-size: 11.5px; font-family: var(--mono); }
.step.on { color: var(--brand); } .step.on .n { background: var(--brand); color: #fff; }
.step.done { color: var(--ok); } .step.done .n { background: var(--ok); color: #fff; }
.step-sep { flex: 1; min-width: 18px; height: 1px; background: var(--line); }

/* ---------------- 拖拽区 ---------------- */
.drop {
  border: 1.5px dashed #cbd3de; border-radius: var(--radius); background: var(--panel-2);
  padding: 34px 20px; text-align: center; transition: all .18s; cursor: pointer;
}
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-soft); }
.drop .big { font-size: 26px; line-height: 1; margin-bottom: 8px; }
.drop .t { font-weight: 650; margin-bottom: 3px; }
.drop .s { font-size: 12px; color: var(--muted); }

/* ---------------- 代码块 ---------------- */
pre.code {
  font-family: var(--mono); font-size: 12px; line-height: 1.7; background: #0f172a; color: #d6e2f0;
  padding: 13px 15px; border-radius: var(--radius-sm); overflow: auto; margin: 0;
}
pre.code.light { background: var(--panel-2); color: var(--text-2); border: 1px solid var(--line); }
code.inline { font-family: var(--mono); font-size: 12.5px; background: var(--line-soft); padding: 2px 6px; border-radius: 4px; }

/* ---------------- 登录层 ---------------- */
.gate { position: fixed; inset: 0; background: var(--bg); display: grid; place-items: center; z-index: 200; padding: 20px; }
.gate .box { width: 100%; max-width: 380px; }
.gate .brand { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 20px; }
.gate .brand .dot { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg,#1f6feb,#6aa4ff);
  display: grid; place-items: center; color: #fff; font-weight: 800; }
.gate .brand b { font-size: 16px; }
.tabs { display: flex; gap: 3px; background: var(--line-soft); padding: 3px; border-radius: var(--radius-sm); margin-bottom: 16px; }
.tabs button { flex: 1; border: 0; background: none; padding: 7px; font-size: 13px; color: var(--text-2); border-radius: 4px; }
.tabs button.on { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.quick button { font-size: 11.5px; font-family: var(--mono); padding: 3px 9px; }

/* ---------------- 其它 ---------------- */
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.small { font-size: 12px; }
.hr { height: 1px; background: var(--line-soft); margin: 14px 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.center { text-align: center; }
.r { text-align: right; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); font-size: 13px; }
.hidden { display: none !important; }

.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(10px);
  background: #10151d; color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 13px;
  box-shadow: 0 8px 24px rgba(0,0,0,.2); opacity: 0; pointer-events: none; transition: all .25s; z-index: 500;
  max-width: min(560px, 90vw);
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: #9b1c1c; }
.toast.ok { background: #0d6c37; }

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

/* ---------------- 弹窗（上游对接配置用） ----------------
   项目里原本只有 prompt()，但上游配置有 5 个字段、还含一个密钥输入框，
   用 prompt 既难填（密钥会明文显示在系统弹窗里）又没法「填完直接测一下」。 */
.ovl {
  position: fixed; inset: 0; background: rgba(16,21,29,.45);
  display: none; align-items: flex-start; justify-content: center;
  padding: 56px 16px; overflow: auto; z-index: 600;
}
.ovl.on { display: flex; }
.ovl-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  width: min(660px, 100%); padding: 20px 22px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.ovl-h { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.ovl-h h3 { margin: 0; font-size: 16px; }
.ovl-h .spacer { flex: 1; }

/* 竖向排布的表单堆栈（field 之间留 12px） */
.stack { display: grid; gap: 12px; margin-top: 14px; }
.stack .field { margin: 0; }

/* 连通性状态徽标 */
.up-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; vertical-align: 1px; margin-right: 5px; }
.up-dot.ok { background: #0d6c37; }
.up-dot.bad { background: #9b1c1c; }
.up-dot.never { background: #b9bec7; }
.mono-sm { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }

/* ============================================================
   收款弹窗（套餐 / 加油包 / 继续支付 / 申请开票 共用同一套样式）
   金额和订单号是这一屏的主角 —— 用户要照着这两样去付款，所以字号给足。
   手续费口径：标价即含、平台承担 → 页面上**不出现**「到账 = 支付 − 手续费」这类提示。
   ============================================================ */
.pm-amount { text-align: center; padding: 4px 0 14px; }
.pm-money {
  font-family: var(--mono); font-size: 30px; font-weight: 700;
  letter-spacing: -1px; line-height: 1.25;
}
.pm-no { font-family: var(--mono); font-weight: 650; letter-spacing: .2px; }
.pm-label { font-size: 12.5px; color: var(--muted); margin: 4px 0 8px; font-weight: 600; }

.pm-channels { display: grid; gap: 9px; }
.pm-ch {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--panel); cursor: pointer; text-align: left;
  font: inherit; color: inherit; transition: border-color .15s, background .15s;
}
.pm-ch:hover { border-color: #c3cfe3; background: var(--panel-2); }
.pm-ch.on { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 2px rgba(31,111,235,.12); }
.pm-ch[disabled] { opacity: .5; cursor: not-allowed; }
.pm-ch .ic {
  width: 26px; height: 26px; border-radius: 6px; flex: none;
  display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff;
}
.pm-ch .ic.wechat { background: #07c160; }
.pm-ch .ic.alipay { background: #1677ff; }
.pm-ch .ic.bank   { background: #5b6472; }
.pm-ch .tx { flex: 1; min-width: 0; }
.pm-ch .tx b { display: block; font-size: 13.5px; }
.pm-ch .tx span { display: block; font-size: 12px; color: var(--muted); line-height: 1.5; }
.pm-ch .chk { flex: none; color: var(--brand); font-size: 13px; }

.pm-qr { text-align: center; padding: 6px 0 2px; }
.pm-qr img {
  width: 200px; height: 200px; object-fit: contain; padding: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
}

.pm-kv { display: grid; gap: 7px; font-size: 13px; }
.pm-kv .r { display: flex; gap: 10px; }
.pm-kv .k { color: var(--muted); width: 82px; flex: none; }
.pm-kv .v { font-family: var(--mono); word-break: break-all; }

/* 左侧导航的待办角标（未处理的收款笔数）。
   用绝对定位而不是把 <a> 改成 flex —— 导航项是 display:block，
   改成 flex 会连带影响所有条目的文字排版，为一个角标不值当。 */
.side nav a .nav-badge {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  min-width: 17px; height: 17px; padding: 0 5px; border-radius: 99px;
  background: var(--danger); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 17px; text-align: center;
}


