/* ============ Lumen 设计体系（深色极客风） ============ */
:root {
  --bg: #0a0a0a;
  --bg2: #101010;
  --card: #141414;
  --card-hover: #181818;
  --inset: #0c0c0c;
  --line: #262626;
  --line-strong: #333;
  --fg: #f0f0f0;
  --muted: #8a8a8a;
  --dim: #5a5a5a;
  --accent: #f0f0f0;
  --ok: #34d399;
  --bad: #f87171;
  --blue: #7aa2ff;
  --violet: #b48cff;
  --amber: #e8b45a;
  --radius: 12px;
  font-size: 14px;
}
.wordmark { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-weight: 600; letter-spacing: -0.5px; }
.wordmark .cursor { color: var(--dim); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.mono { font-family: ui-monospace, Menlo, monospace; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* ---- 基础控件（home/redeem 共用，保持兼容） ---- */
input, select {
  background: var(--inset);
  border: 1px solid var(--line);
  color: var(--fg);
  border-radius: 8px;
  padding: 9px 12px;
  transition: border-color .15s, box-shadow .15s;
}
input:focus { outline: none; border-color: var(--muted); box-shadow: 0 0 0 3px rgba(255,255,255,.06); }
button {
  border: none; border-radius: 8px; cursor: pointer;
  padding: 9px 14px; color: var(--fg); background: #20242e;
  transition: background .15s, opacity .15s, transform .05s;
}
button:hover { background: #283041; }
button:active { transform: translateY(1px); }
button.primary { background: var(--fg); color: var(--bg); font-weight: 600; }
button.primary:hover { background: #fff; }
button:disabled { opacity: .55; cursor: default; }
button.ghost-btn {
  background: transparent; border: 1px solid var(--line);
  text-decoration: none; color: var(--fg);
  padding: 6px 12px; border-radius: 8px;
}
button.ghost-btn:hover { border-color: var(--muted); background: rgba(255,255,255,.03); }
button.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 7px; background: transparent; border: 1px solid var(--line); }
button.sm:hover { border-color: var(--muted); }
.danger-btn { background: rgba(248,113,113,.12); color: var(--bad); font-weight: 600; }
.danger-btn:hover { background: rgba(248,113,113,.22); }
.icon-btn { background: transparent; font-size: 18px; padding: 2px 8px; color: var(--muted); }
.icon-btn:hover { color: var(--fg); background: transparent; }

pre {
  background: var(--inset); border: 1px solid var(--line); border-radius: 8px;
  padding: 12px; font-size: 12px; overflow-x: auto; margin-top: 8px; color: #a8b3cf;
}
code { font-family: ui-monospace, Menlo, monospace; background: var(--inset); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; font-size: 12px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 10px; line-height: 1.6; }
.hint a { color: var(--muted); border-bottom: 1px solid var(--line); }
.msg { min-height: 18px; color: var(--bad); font-size: 13px; }
.msg.ok { color: var(--ok); }

/* ---- 徽章 / 状态点 ---- */
.badge { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 12px; }
.badge.on { background: rgba(52,201,142,.15); color: var(--ok); }
.badge.off { background: rgba(239,100,97,.15); color: var(--bad); }
.badge.warn { background: rgba(244,162,21,.16); color: #d99a1f; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex-shrink: 0; }
.dot.on { background: var(--ok); box-shadow: 0 0 10px var(--ok); animation: pulse 2s infinite; }
.dot.off { background: var(--bad); }
@keyframes pulse { 50% { box-shadow: 0 0 4px var(--ok); } }

/* 计费方式徽章 */
.mode-badge {
  display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 11.5px;
  border: 1px solid var(--line); color: var(--muted); white-space: nowrap;
}
.mode-badge.m-window { color: var(--amber); border-color: rgba(232,180,90,.35); background: rgba(232,180,90,.08); }
.mode-badge.m-count  { color: var(--blue);  border-color: rgba(122,162,255,.35); background: rgba(122,162,255,.08); }
.mode-badge.m-token  { color: var(--violet);border-color: rgba(180,140,255,.35); background: rgba(180,140,255,.08); }
.mode-badge.m-period { color: #2dd4bf;      border-color: rgba(45,212,191,.35);  background: rgba(45,212,191,.08); }

/* ============ 登录页 ============ */
.auth-wrap {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 22px; padding: 24px;
  background:
    radial-gradient(600px 400px at 20% 0%, rgba(122,162,255,.07), transparent 60%),
    radial-gradient(500px 380px at 85% 90%, rgba(180,140,255,.06), transparent 60%),
    var(--bg);
}
.auth-card {
  width: 420px; max-width: 94vw;
  background: var(--card);
  border: 1px solid var(--line); border-radius: 16px;
  padding: 36px 34px 30px;
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
  animation: rise .4s cubic-bezier(.2,.7,.3,1);
}
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.auth-brand { display: flex; align-items: baseline; gap: 10px; margin-bottom: 26px; }
.auth-brand .wordmark { font-size: 27px; }
.brand-sub { color: var(--muted); font-size: 13px; }
.auth-card .field span, .modal .field span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.field { display: block; margin-bottom: 14px; }
.field input { width: 100%; }
form { display: flex; flex-direction: column; gap: 4px; }
.btn-block { width: 100%; padding: 10px; margin-top: 4px; font-size: 14px; }
.tabs { display: flex; gap: 6px; background: var(--inset); border: 1px solid var(--line); border-radius: 10px; padding: 4px; margin-bottom: 18px; }
.tab { flex: 1; padding: 7px 0; background: transparent; color: var(--muted); border-radius: 7px; font-size: 13px; }
.tab:hover { background: transparent; color: var(--fg); }
.tab.active { background: var(--card-hover); color: var(--fg); border: 1px solid var(--line-strong); }
.auth-hint { text-align: center; margin-top: 16px; }
.auth-foot { color: var(--dim); font-size: 12px; letter-spacing: 1px; }

/* ============ 控制台骨架：侧边栏 + 主区 ============ */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 200px; flex-shrink: 0;
  display: flex; flex-direction: column;
  border-right: 1px solid var(--line);
  padding: 20px 14px;
  position: sticky; top: 0; height: 100vh;
  background: linear-gradient(180deg, var(--bg), var(--bg2));
}
.side-brand { display: flex; align-items: baseline; gap: 8px; padding: 0 10px 22px; }
.side-brand .wordmark { font-size: 19px; }
.side-brand i { font-style: normal; color: var(--dim); font-size: 12px; }
.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 9px;
  color: var(--muted); text-decoration: none; font-size: 13.5px;
  transition: background .15s, color .15s;
}
.nav a svg { width: 16px; height: 16px; fill: currentColor; stroke: currentColor; opacity: .9; }
.nav a:hover { background: rgba(255,255,255,.04); color: var(--fg); }
.nav a.active { background: rgba(255,255,255,.07); color: var(--fg); }
.side-foot { border-top: 1px solid var(--line); padding-top: 14px; display: flex; align-items: center; gap: 10px; }
.me-block { flex: 1; min-width: 0; }
.me-block b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-block span { font-size: 11.5px; }

.main { flex: 1; min-width: 0; padding: 26px 32px 60px; max-width: 1280px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-head h1 { font-size: 21px; letter-spacing: -.3px; }
.page-head .muted { font-size: 13px; margin-top: 3px; }

.page { animation: fadein .25s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } }

/* ---- 卡片与统计 ---- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card h2 { font-size: 13.5px; color: var(--muted); font-weight: 600; margin-bottom: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; display: flex; flex-direction: column; gap: 6px;
  transition: border-color .15s;
}
.stat-card:hover { border-color: var(--line-strong); }
.stat-card.gw { cursor: pointer; }
.s-label { color: var(--muted); font-size: 12px; }
.s-val { font-size: 26px; font-family: ui-monospace, Menlo, monospace; letter-spacing: -1px; }
.s-val-sm { font-size: 17px; }
.s-note { font-size: 12px; }
.gw-line { display: flex; align-items: center; gap: 8px; }

.big-status { font-size: 17px; margin-bottom: 12px; display: flex; align-items: center; gap: 9px; }
.kv { display: flex; justify-content: space-between; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13px; }
.kv:first-of-type { margin-top: 8px; }
.kv span { color: var(--muted); }
.code-out {
  background: var(--inset); border: 1px dashed var(--dim); border-radius: 8px;
  padding: 10px 12px; margin: 8px 0;
  font-family: ui-monospace, Menlo, monospace; font-size: 14px;
  word-break: break-all; color: var(--fg);
}
.code-text { cursor: pointer; border-bottom: 1px dashed var(--dim); }
.code-text:hover { text-decoration: underline; }
.copy-buyer { margin-left: 8px; vertical-align: middle; }
.big-code { font-size: 19px; text-align: center; padding: 18px; user-select: all; letter-spacing: .5px; }
.center-hint { text-align: center; padding: 18px 0 8px; }

/* ---- 表格 ---- */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; color: var(--dim); font-weight: 500; padding: 7px 8px; border-bottom: 1px solid var(--line); font-size: 12px; }
.tbl td { padding: 9px 8px; border-bottom: 1px solid rgba(38,38,38,.55); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background .1s; }
.tbl tbody tr:hover { background: rgba(255,255,255,.02); }
.danger-text { color: var(--bad); }

/* ---- 额度进度条 ---- */
.pbar { height: 5px; background: var(--inset); border: 1px solid var(--line); border-radius: 99px; overflow: hidden; margin: 6px 0 4px; }
.pbar-in { height: 100%; background: linear-gradient(90deg, var(--ok), #7ce8bd); border-radius: 99px; transition: width .3s; }
.pbar-in.soft { background: linear-gradient(90deg, var(--amber), #f3d49a); }
.pbar-in[style*="width:100%"] { background: var(--bad); }

/* ---- 分段切换（天数） ---- */
.seg { display: inline-flex; background: var(--inset); border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.seg button { background: transparent; padding: 5px 14px; font-size: 12.5px; color: var(--muted); border-radius: 6px; }
.seg button.on { background: var(--card-hover); color: var(--fg); border: 1px solid var(--line-strong); }
.seg button:hover:not(.on) { background: transparent; color: var(--fg); }

/* ---- 图表（CSS 柱状） ---- */
.chart { min-height: 150px; display: flex; align-items: stretch; }
.chart.empty-chart { align-items: center; justify-content: center; }
.chart-cols { display: flex; flex: 1; align-items: flex-end; gap: 6px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 160px; }
.chart-bar { width: 70%; max-width: 34px; min-height: 3px; background: linear-gradient(180deg, var(--blue), rgba(122,162,255,.25)); border-radius: 4px 4px 2px 2px; transition: height .4s ease; }
.chart-col:hover .chart-bar { background: linear-gradient(180deg, #a5beff, rgba(122,162,255,.4)); }
.chart-val { font-size: 10.5px; color: var(--muted); font-family: ui-monospace, Menlo, monospace; }
.chart-day { font-size: 10px; color: var(--dim); }
.chart-sm .chart-col { height: 120px; }

/* ---- 弹窗 ---- */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0,0,0,.62); backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 7vh 20px 40px;
  animation: fadein .18s ease;
  overflow-y: auto;
}
.modal {
  width: 560px; max-width: 100%;
  background: var(--card); border: 1px solid var(--line-strong); border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
  animation: rise .22s cubic-bezier(.2,.7,.3,1);
}
.modal-sm { width: 440px; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line); font-size: 15px;
}
.modal-body { padding: 18px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); }
.row-common { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* 计费方式四选一（2×2） */
.billing-seg { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.billing-seg button {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  background: var(--inset); border: 1px solid var(--line);
  padding: 11px 12px; border-radius: 10px; text-align: left;
}
.billing-seg button b { font-size: 13.5px; }
.billing-seg button i { font-style: normal; font-size: 11px; color: var(--dim); line-height: 1.45; }
.billing-seg button:hover { border-color: var(--line-strong); background: var(--inset); }
.billing-seg button.on { border-color: var(--fg); background: var(--card-hover); }
.billing-seg button.on b { color: var(--fg); }
.billing-seg button.on i { color: var(--muted); }
.mode-field p.hint { margin-top: -6px; }

/* 快捷额度 chips */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; align-items: center; }
.chips-x { width: 8px; display: inline-block; }
.chips button {
  background: var(--inset); border: 1px solid var(--line); color: var(--muted);
  padding: 4px 12px; font-size: 12px; border-radius: 99px;
}
.chips button:hover { color: var(--fg); border-color: var(--muted); background: var(--inset); }
.chips button.on { color: var(--fg); border-color: var(--fg); }
.chips .seg { margin-right: 4px; }

/* 官方套餐九宫格 */
.plan-grid { display: grid; grid-template-columns: auto repeat(3, 1fr); gap: 6px; max-width: 720px; }
.pg-hd { font-size: 12px; color: var(--dim); align-self: center; text-align: center; padding-bottom: 2px; }
.pg-row { font-size: 13px; color: var(--muted); font-weight: 600; align-self: center; font-family: ui-monospace, Menlo, monospace; }
.plan-cell {
  display: flex; flex-direction: column; gap: 3px; align-items: flex-start;
  background: var(--inset); border: 1px solid var(--line);
  padding: 9px 11px; border-radius: 10px; text-align: left;
}
.plan-cell b { font-size: 13px; }
.plan-cell i { font-style: normal; font-size: 11px; color: var(--dim); font-family: ui-monospace, Menlo, monospace; }
.plan-cell:hover { border-color: var(--line-strong); background: var(--inset); }
.plan-cell.on { border-color: var(--ok); box-shadow: 0 0 0 1px var(--ok) inset; }
.plan-cell .pg-dep, .plan-cell .pg-cur { font-style: normal; font-size: 10px; vertical-align: middle; padding: 0 5px; border-radius: 99px; margin-left: 4px; }
.plan-cell .pg-dep { color: var(--dim); border: 1px solid var(--line); }
.plan-cell .pg-cur { color: var(--ok); border: 1px solid rgba(52,201,142,.4); }
.plan-detail {
  margin-top: 12px; padding: 10px 14px; line-height: 1.7;
  background: var(--inset); border: 1px dashed var(--line-strong); border-radius: 10px;
}
.plan-detail a { color: var(--muted); }
@media (max-width: 640px) { .plan-grid { grid-template-columns: auto repeat(3, minmax(96px, 1fr)); gap: 4px; } }

.adv { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin-top: 4px; }
.adv summary { cursor: pointer; color: var(--muted); font-size: 13px; user-select: none; }
.adv summary:hover { color: var(--fg); }
.adv > div, .adv > label { margin-top: 12px; }

.models-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.model-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--inset); border: 1px solid var(--line); border-radius: 99px;
  padding: 3px 10px; font-size: 12px; cursor: pointer; user-select: none;
}
.model-chip input { width: auto; margin: 0; accent-color: var(--accent); }

/* ---- Toast ---- */
.toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 99; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.toast {
  background: #1d2129; border: 1px solid var(--line-strong); color: var(--fg);
  padding: 9px 18px; border-radius: 10px; font-size: 13px;
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
  opacity: 0; transform: translateY(8px); transition: all .25s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.ok { border-color: rgba(52,201,142,.4); }
.toast.bad { border-color: rgba(248,113,113,.45); }

/* ---- redeem 页兼容（原有类保持） ---- */
.redeem-wrap { display: flex; justify-content: center; padding-top: 10vh; }
/* 公开工具页（redeem/key/download）统一导航 */
.pubnav { display: flex; justify-content: space-between; align-items: center; max-width: 1160px; margin: 0 auto; padding: 24px 32px 0; flex-wrap: wrap; gap: 8px; }
.pubnav .wordmark { font-size: 18px; color: var(--fg); text-decoration: none; }
.pubnav .links a { color: var(--muted); text-decoration: none; margin-left: 24px; font-size: 13px; }
.pubnav .links a:hover { color: var(--fg); }
@media (max-width: 640px) { .pubnav { padding: 18px 20px 0; } .pubnav .links a { margin-left: 16px; } }
.redeem-card { width: 860px; max-width: 94vw; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 44px 52px; }
.redeem-card h1 { font-size: 20px; margin-bottom: 6px; }
.redeem-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.redeem-result { margin-top: 18px; }
.kvline { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; background: var(--inset); border-radius: 8px; margin-bottom: 8px; font-size: 13px; }
.kvline b { font-family: ui-monospace, Menlo, monospace; color: var(--fg); word-break: break-all; text-align: right; }
.copy { font-size: 12px; color: var(--accent); cursor: pointer; user-select: none; }

/* ---- 请求明细页 ---- */
.head-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.req-key-sel { background: var(--inset); border: 1px solid var(--line); color: var(--fg); border-radius: 9px; padding: 6px 10px; font-size: 12.5px; max-width: 100%; }
.req-key-sel:focus { outline: none; border-color: var(--line-strong); }
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.tbl-wrap .tbl { min-width: max-content; }
.pager { display: flex; align-items: center; gap: 8px; padding-top: 14px; flex-wrap: wrap; }
.pager .pg-info { color: var(--muted); font-size: 12.5px; margin-right: auto; }
.pager button:disabled { opacity: .4; cursor: not-allowed; }

/* ---- 响应式 ---- */
@media (max-width: 1020px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
/* ---- 移动端适配地基（WD-265，基准 390×844；≤760px 主断点 ---- */
@keyframes mslide { from { opacity: .5; transform: translateY(28px); } }
@media (max-width: 760px) {
  /* 输入控件字号 ≥16px，防 iOS Safari 聚焦缩放 */
  input, select, textarea { font-size: 16px; }

  /* 触控目标：主导航/弹窗主按钮 ≥40px，次要按钮/表格行内按钮 ≥32px */
  .nav a, .modal-foot button, button.primary, .btn-block { min-height: 40px; }
  .nav a { display: flex; align-items: center; }
  button:not(.primary):not(.btn-block), .modal-foot button:not(.primary),
  .tbl button, .tbl a.ghost-btn, .ghost-btn, .icon-btn { min-height: 32px; }
  .pubnav .links a { display: inline-flex; align-items: center; min-height: 32px; }

  /* 导航两行化 + sticky：第一行 品牌+用户+登出，第二行 页面入口横滑 */
  .shell { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto;
    position: sticky; top: 0; z-index: 40;
    flex-direction: row; flex-wrap: wrap; align-items: center;
    gap: 6px 10px;
    padding: 10px 12px; border-right: none; border-bottom: 1px solid var(--line);
  }
  .side-brand { padding: 0; }
  .side-foot {
    order: 2; flex: 1; justify-content: flex-end;
    margin-left: auto; border-top: none; padding-top: 0; gap: 8px;
  }
  .me-block span { display: none; }
  .nav {
    order: 3; flex: 0 0 100%; width: 100%;
    flex-direction: row; overflow-x: auto;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
    padding-bottom: 2px; gap: 2px;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 6px 10px; white-space: nowrap; font-size: 13px; }
  .main { padding: 16px 14px 50px; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .billing-seg { grid-template-columns: 1fr; }
  .row-common { grid-template-columns: 1fr; }

  /* 弹窗 → 底部抽屉：主体可滚动，底部按钮固定可视 */
  .overlay { align-items: flex-end; padding: 0; }
  .modal {
    width: 100%; max-width: 100%;
    max-height: 88dvh;
    display: flex; flex-direction: column;
    border-radius: 14px 14px 0 0;
    animation: mslide .24s cubic-bezier(.2,.7,.3,1);
  }
  .modal-body { overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .modal-foot { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }

  /* WD-266 信息页表格/筛选/图表移动端适配 */
  .tbl-wrap { margin: 0 -4px; padding: 0 4px; } /* 滚动容器贴边，留出滚动余量 */
  .chart { max-width: 100%; overflow: hidden; }
  .chart-col { min-width: 0; }
  .plan-grid { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .seg button { min-height: 32px; }
  .head-tools { width: 100%; }
  .head-tools .req-key-sel { flex: 1 1 140px; min-height: 36px; }
  .head-tools .seg { flex: 0 0 auto; }

  /* WD-267 请求详情弹窗 kv 行：窄屏长值（模型名/路径等不可断串）换行，防抽屉横向溢出 */
  .kv { flex-wrap: wrap; }
  .kv b { min-width: 0; word-break: break-all; text-align: right; }

  /* WD-269 公共页（redeem/key）：表单一行可容、超长换到第二行；结果 kv 行允许换行防溢出 */
  .redeem-card form[style*="flex-direction:row"] { flex-wrap: wrap; }
  .redeem-card form input { min-width: 0; flex: 1 1 180px; }
  .redeem-card form button { flex-shrink: 0; }
  .redeem-wrap { padding-top: 4vh; }
  .kvline { flex-wrap: wrap; gap: 2px 10px; }
  .kvline span { flex-shrink: 0; }
  .kvline b { min-width: 0; flex: 1 1 100%; text-align: left; }
  pre { max-width: 100%; }
}

/* ---- 移动端第二断点 ≤480px：进一步收紧留白 ---- */
@media (max-width: 480px) {
  .auth-card { padding: 26px 20px 24px; }
  .redeem-card { padding: 26px 18px; max-width: 100vw; border-radius: 0; border-left: none; border-right: none; }
  .main { padding: 14px 10px 50px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .modal-foot { flex-wrap: wrap; }
  .modal-foot button { flex: 1; }
  .pubnav { padding: 14px 12px 0; }
  .pubnav .links a { margin-left: 14px; }
}

/* ---- 管理后台·总览柱状图（原生 div/CSS，无图表库） ---- */
.bar-chart { display: flex; align-items: flex-end; gap: 12px; height: 180px; padding-top: 6px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; min-width: 0; }
.bar-col .bar { width: 100%; max-width: 56px; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px; opacity: .85; transition: opacity .15s; }
.bar-col:hover .bar { opacity: 1; }
.bar-col .bar-num { font-size: 11px; color: var(--muted); font-family: ui-monospace, Menlo, monospace; }
.bar-col .bar-label { font-size: 11px; color: var(--muted); font-family: ui-monospace, Menlo, monospace; }

/* 卖家平台 M3：总览邀请链接行 */
.invite-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.invite-row .code-text { border-bottom: none; padding: 6px 10px; background: var(--inset); border-radius: 7px; user-select: all; }
/* 非活跃 key 行置灰 */
tr.dead td { opacity: .45; }
