/* ============================================
   NetcCheck 管理后台 · 亮色黑白极简风
   字体：站酷庆科黄油体（CDN 加载，失败回退系统字体）
   ============================================ */

:root {
  --bg: #f7f7f5;          /* 暖白背景 */
  --card: #ffffff;        /* 卡片 */
  --border: #e9e9e6;      /* 边框 */
  --border-strong: #d9d9d5;
  --text: #17171a;        /* 主文字 */
  --muted: #8a8a8e;       /* 次要文字 */
  --danger: #e5484d;      /* 仅用于危险操作 */
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(23, 23, 26, .05);
  --shadow-md: 0 8px 28px -10px rgba(23, 23, 26, .16);
  --shadow-lg: 0 20px 60px -20px rgba(23, 23, 26, .25);
  --font-cute: "ZCOOL QingKe HuangYou", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: Consolas, "Courier New", monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --hero-glow: rgba(23, 23, 26, .06);
  /* 派生色（深浅两套各自取值）：hover 面 / 次级面板 / 进度底 / 危险底 / 选择色 */
  --hover: #f2f2ef;
  --panel: #f0f0ed;
  --track: #f0f0ed;
  --danger-bg: #fdecec;
  --sel-fg: #fff;
  --focus-ring: rgba(23, 23, 26, .07);
  --glow-a: rgba(255, 255, 255, .95);
  --glow-b: rgba(26, 26, 28, .07);
  --nav-bg: rgba(247, 247, 245, .82);
  --doc-text: #4c4c52;
  --zebra: rgba(23, 23, 26, .028);
  --ink: #1a1a1c;
  --ink-fg: #e8e8e4;
  --code-line: #2c2c30;
  --code-chrome: #2c2c30;
  --row-hover: #fafaf7;
  --quota-bg: #fcfcfb;    /* 额度卡底：浅色近白；硬编码曾在深色下变刺眼白块（2026-10-03 修复） */
  --bar-a: #3a3a40;       /* 进度条填充渐变起：浅色近黑，与浅底强对比 */
  --bar-b: #17171a;       /* 进度条填充渐变止 */
  --btn-a: #2c2c31;
  --btn-b: #17171a;
  --btn-fg: #ffffff;
  --notice-bg: #1a1a1c;
  --notice-fg: #f4f4f2;
  --notice-chrome: #4a4a50;
  --notice-chrome-fg: #b9b9bd;
  --warn-bg: #fdf3d7;
  --warn-fg: #946c00;
  --chart-grid: #ececea;
  --chart-login: #17171a;
  --chart-register: #9a9aa0;
  --chart-recharge: #c4c4c9;
}

/* ---------- 深色模式 ---------- */
/* 与浅色同一套黑白极简语言：暖白 → 炭黑，卡片略浮起，文字降亮度防刺眼 */
html.dark {
  --bg: #131316;
  --card: #1b1b1f;
  --border: #2c2c31;
  --border-strong: #3a3a40;
  --text: #e8e8ea;
  --muted: #9a9aa2;
  --danger: #ff6b70;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 8px 28px -10px rgba(0, 0, 0, .55);
  --shadow-lg: 0 20px 60px -20px rgba(0, 0, 0, .7);
  --hover: #26262b;
  --panel: #222227;
  --track: #26262b;
  --danger-bg: #33201f;
  --sel-fg: #131316;
  --focus-ring: rgba(232, 232, 234, .12);
  --glow-a: rgba(255, 255, 255, .05);
  --glow-b: rgba(0, 0, 0, .5);
  --hero-glow: rgba(255, 255, 255, .06);
  --nav-bg: rgba(19, 19, 22, .78);
  --doc-text: #b9b9c1;
  --zebra: rgba(255, 255, 255, .045);
  --ink: #e8e8ea;
  --ink-fg: #17171a;
  --code-line: #3a3a40;
  --code-chrome: #26262b;
  --row-hover: #232328;
  --quota-bg: #222227;    /* 深色额度卡底：与 --panel 同阶，卡上 --text 亮字可读 */
  --bar-a: #c9c9d0;       /* 深色进度条：亮灰渐变（浅色=黑条/深色=亮条的对称语言），与 --track #26262b 强对比 */
  --bar-b: #71717a;
  --btn-a: #f2f2f4;
  --btn-b: #d9d9de;
  --btn-fg: #131316;
  --notice-bg: #222227;
  --notice-fg: #e8e8ea;
  --notice-chrome: #3a3a40;
  --notice-chrome-fg: #b9b9bd;
  --warn-bg: rgba(234, 179, 8, .14);
  --warn-fg: #e5c445;
  --chart-grid: #2c2c31;
  --chart-login: #e8e8ea;
  --chart-register: #9a9aa2;
  --chart-recharge: #71717a;
}

/* 主题切换过渡：背景/文字/边框柔和渐变（图片/阴影不参与，避免闪烁感） */
body, .card-panel, .modal, .sidebar, .topbar, input, select, textarea, table, th, td,
.badge, .stat, .btn, .nav-item, .site-nav, .auth-card, .price-card, .doc-table, .codeblock, .lang-tabs {
  transition: background-color .35s var(--ease), border-color .35s var(--ease), color .35s var(--ease);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.7 var(--font-cute);
  letter-spacing: .3px;
}

::selection { background: var(--text); color: var(--sel-fg); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }
::-webkit-scrollbar-track { background: transparent; }

.layout { display: flex; height: 100vh; }

/* ---------- 侧栏 ---------- */
.sidebar {
  width: 216px; flex-shrink: 0;
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 20px 14px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 8px 20px; font-size: 21px;
}
.logo-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; flex-shrink: 0;
  background: var(--text); color: var(--card);
  border-radius: 11px; font-size: 19px;
  box-shadow: var(--shadow-sm);
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 14px; margin-bottom: 4px;
  color: var(--muted); cursor: pointer; user-select: none;
  border-radius: 11px;
  transition: background .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.nav-item svg { flex-shrink: 0; opacity: .85; transition: transform .25s var(--ease); }
.nav-item:hover { color: var(--text); background: var(--hover); }
.nav-item:hover svg { transform: scale(1.08) rotate(-3deg); }
.nav-item.active {
  color: var(--card); background: var(--text);
  box-shadow: var(--shadow-md);
}
.nav-item.active svg { opacity: 1; }
.nav-item:active { transform: scale(.97); }
.sidebar-foot {
  margin-top: auto; padding: 16px 8px 0;
  display: flex; flex-direction: column; gap: 10px;
  border-top: 1px solid var(--border);
}

/* ---------- 主区 ---------- */
.main { flex: 1; overflow: auto; padding: 30px 34px; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
h2 { font-size: 23px; font-weight: normal; }
h3 { font-size: 17px; font-weight: normal; margin-bottom: 14px; }

/* 切页入场动画（JS 加 .entering 触发，子元素依次浮现） */
.tab-section.entering > * { animation: fade-up .45s var(--ease) both; }
.tab-section.entering > *:nth-child(2) { animation-delay: .05s; }
.tab-section.entering > *:nth-child(3) { animation-delay: .1s; }
.tab-section.entering > *:nth-child(4) { animation-delay: .15s; }
@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

.card-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px; margin-bottom: 20px;
  box-shadow: 0 1px 2px rgba(23, 23, 26, .04), 0 6px 18px -10px rgba(23, 23, 26, .07);
  overflow-x: auto; /* 窄屏下宽表格横向滚动，不撑破布局 */
}

/* ---------- 统计卡 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow-sm);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat .label { color: var(--muted); font-size: 14px; }
.stat .num { font-size: 32px; margin-top: 4px; }

/* ---------- 表单 ---------- */
input, select, textarea {
  background: var(--card);
  border: 1px solid var(--border-strong); color: var(--text);
  padding: 9px 12px; border-radius: 10px;
  font: inherit; font-size: 14px; outline: none;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--text);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
textarea { width: 100%; resize: vertical; font-family: var(--font-mono); }
.form-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 12px 0; }
.form-row label { font-size: 14px; color: var(--muted); }
.form-row label input[type="checkbox"] { margin-right: 5px; }

/* ---------- 勾选框：双主题统一自绘 ----------
   原生控件在暗色下选中=刺眼大色块、未选中=深底深框看不清，且表格内从未统一过样式。
   选中态沿用站点黑白语言：填充 var(--text)，对勾用 var(--card) 挖出——两主题自动反色。 */
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  margin: 0;
  border: 1.5px solid var(--border-strong);
  border-radius: 4px;
  background: var(--card);
  cursor: pointer;
  display: inline-block;
  vertical-align: -2px;
  flex: none;
  transition: background .15s ease, border-color .15s ease;
}
input[type="checkbox"]:hover { border-color: var(--text); }
input[type="checkbox"]:focus-visible { outline: 2px solid var(--border-strong); outline-offset: 2px; }
input[type="checkbox"]:checked { background: var(--text); border-color: var(--text); }
input[type="checkbox"]:checked::after {
  content: '';
  display: block;
  width: 100%;
  height: 100%;
  background: var(--card);
  clip-path: polygon(20% 52%, 36% 68%, 80% 22%, 88% 31%, 38% 82%, 13% 60%);
}
input[type="checkbox"]:indeterminate { background: var(--text); border-color: var(--text); }
input[type="checkbox"]:indeterminate::after {
  content: '';
  display: block;
  width: 60%;
  height: 1.5px;
  margin: 5.25px auto 0;
  background: var(--card);
}
input[type="checkbox"]:disabled { opacity: .35; cursor: not-allowed; }
th input[type="checkbox"], td input[type="checkbox"] { vertical-align: middle; }
.form-col { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-col label { font-size: 14px; color: var(--muted); }
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(180deg, var(--btn-a), var(--btn-b)); color: var(--btn-fg);
  border: 1px solid var(--btn-b);
  padding: 9px 18px; border-radius: 11px;
  cursor: pointer; font: inherit; font-size: 14px;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0) scale(.96); box-shadow: var(--shadow-sm); }
.btn.ghost {
  background: var(--card); color: var(--text); border: 1px solid var(--border-strong);
}
.btn.ghost:hover { border-color: var(--text); background: var(--card); }
.btn.danger { background: var(--card); color: var(--danger); border: 1px solid rgba(229, 72, 77, .45); }
.btn.danger:hover { background: var(--danger); color: var(--sel-fg); border-color: var(--danger); }
.btn.small { padding: 5px 11px; font-size: 13px; border-radius: 9px; }

/* ---------- 表格 ---------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--muted); font-size: 13px; white-space: nowrap; }
tbody tr { transition: background .18s var(--ease); }
tbody tr:hover td { background: var(--row-hover); }
.mono { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0; }
.muted { color: var(--muted); font-size: 13px; }
.err { color: var(--danger); font-size: 14px; margin: 8px 0; }
.acts { display: flex; gap: 6px; flex-wrap: wrap; }
.dev-more { flex: 0 0 auto; }
.dev-more summary { list-style: none; cursor: pointer; }
.dev-more summary::-webkit-details-marker { display: none; }
.dev-more summary::after { content: '▾'; font-size: 10px; margin-left: 4px; }
.dev-more[open] { flex: 1 0 100%; }
.dev-more[open] summary::after { content: '▴'; }
.dev-more-menu { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 6px; }
#tab-devs thead th:last-child, #tab-devs tbody td:last-child { min-width: 150px; }

/* 图表：图例 / 折线 / 条形 */
.chart-legend { display: flex; gap: 18px; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.chart-legend .lg { display: inline-block; width: 20px; border-top: 3px solid var(--chart-login); vertical-align: middle; margin-right: 6px; border-radius: 2px; }
.chart-legend .lg-register { border-top-color: var(--chart-register); }
.chart-legend .lg-recharge { border-top: 3px dashed var(--chart-recharge); }
.bar-row { display: flex; align-items: center; gap: 12px; padding: 7px 0; }
.bar-name { width: 150px; font-size: 13px; color: var(--muted); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { flex: 1; background: var(--track); border-radius: 6px; height: 12px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--bar-a), var(--bar-b)); border-radius: 6px; transition: width .9s var(--ease); }
.bar-num { width: 44px; font-size: 14px; }

/* ---------- 套餐额度卡（总览，双卡并排） ---------- */
.quota-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.quota-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px 14px; background: var(--quota-bg); }
.qc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.qc-name { font-size: 13.5px; color: var(--muted); }
.qc-big { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.qc-big b { font-size: 30px; line-height: 1; font-variant-numeric: tabular-nums; }
.qc-limit { font-size: 14px; color: var(--muted); }
.quota-card .bar-track { height: 12px; }
.qc-sub { margin-top: 10px; font-size: 12.5px; color: var(--muted); }
@media (max-width: 860px) {
  .quota-grid { grid-template-columns: 1fr; }
  .qc-big b { font-size: 26px; }
}
.bar-fill.warn { background: linear-gradient(90deg, #e5a13c, #d97b16); }
.bar-fill.full { background: linear-gradient(90deg, #ef6b6f, var(--danger)); }
.quota-warn { color: var(--danger); font-size: 12px; font-weight: bold; }

/* ---------- 徽章（黑白灰体系） ---------- */
.badge {
  display: inline-block; padding: 2px 11px; border-radius: 999px;
  font-size: 13px; white-space: nowrap;
  transition: transform .2s var(--ease);
}
tr:hover .badge { transform: scale(1.05); }
.badge.tag { background: var(--text); color: var(--card); }            /* 正常/未使用 */
.badge.gray { background: var(--panel); color: var(--muted); }              /* 已使用 */
.badge.void { background: transparent; color: var(--muted); border: 1px dashed var(--border-strong); text-decoration: line-through; } /* 作废 */
.badge.line { background: transparent; color: var(--text); border: 1px solid var(--text); }  /* 永久/普通标记 */
.badge.bad { background: var(--danger-bg); color: var(--danger); }              /* 封禁/停用/过期 */

/* ---------- 分页 ---------- */
.pager { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 14px; font-size: 14px; color: var(--muted); }
.pager-info { white-space: nowrap; }
.pager-size { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.pager-size select { width: auto; padding: 3px 8px; }
.pager-nav { display: inline-flex; gap: 8px; }
.pager .btn:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(23, 23, 26, .32);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; z-index: 50;
}
.modal-mask.show { display: flex; animation: mask-in .22s var(--ease) both; }
@keyframes mask-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px; width: 470px; max-width: 94vw; max-height: 88vh;
  overflow: auto; padding: 26px;
  box-shadow: var(--shadow-lg);
  animation: pop-in .32s var(--ease) both;
}
@keyframes pop-in {
  from { opacity: 0; transform: scale(.94) translateY(14px); }
  to   { opacity: 1; transform: none; }
}
.modal h3 { margin-bottom: 16px; font-size: 18px; }
.close-row { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
#card-result-keys { height: 230px; }

/* ---------- 登录页 ---------- */
#login-mask {
  position: fixed; inset: 0; background: var(--bg);
  background-image: radial-gradient(#e3e3df 1px, transparent 1px);
  background-size: 22px 22px;
  display: flex; align-items: center; justify-content: center; z-index: 100;
  overflow: hidden;
}
/* 柔光斑：左上提亮、右下沉稳，给点阵背景纵深（黑白体系内的灰阶光） */
#login-mask::before, #login-mask::after {
  content: ''; position: absolute; border-radius: 50%; pointer-events: none;
}
#login-mask::before {
  width: 620px; height: 620px; left: -180px; top: -180px;
  background: radial-gradient(circle, var(--glow-a), transparent 68%);
}
#login-mask::after {
  width: 720px; height: 720px; right: -220px; bottom: -240px;
  background: radial-gradient(circle, var(--glow-b), transparent 70%);
}
.login-box {
  width: 400px; padding: 0 36px 28px; margin-top: 30px;
  border-radius: 24px; position: relative; text-align: center;
  overflow: visible; /* 覆盖 .modal 的 overflow:auto：顶部 logo 半浮出卡片，不能被裁剪 */
  z-index: 1; /* 压过背景光斑伪元素（::after 按文档顺序会绘制在子元素之上） */
  box-shadow: var(--shadow-md), 0 28px 70px rgba(26, 26, 28, .12);
  animation: login-in .6s cubic-bezier(.2, .8, .25, 1) both;
}
@keyframes login-in {
  from { opacity: 0; transform: translateY(20px) scale(.96); }
  to { opacity: 1; transform: none; }
}
/* 品牌 logo 半浮出卡片顶部 */
.login-brand { position: absolute; left: 50%; top: 0; transform: translate(-50%, -50%); }
.login-brand .logo-mark {
  width: 62px; height: 62px; font-size: 34px; border-radius: 19px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 26px rgba(26, 26, 28, .18);
}
.login-welcome {
  font-family: inherit; font-size: 27px; font-weight: 400;
  margin: 44px 0 4px; letter-spacing: 1px;
}
.login-sub { color: var(--muted); font-size: 13.5px; margin: 0 0 22px; }
#login-form .form-col { text-align: left; margin-bottom: 12px; }
#login-form input {
  height: 44px; font-size: 15px; border-radius: 12px;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
#login-form input:focus {
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(26, 26, 28, .08);
  outline: none;
}
#login-form button[type="submit"] {
  height: 44px; font-size: 16px; margin-top: 6px;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
#login-form button[type="submit"]:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(26, 26, 28, .18); }
#login-form button[type="submit"]:active { transform: none; }
.login-foot {
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border);
  font-size: 13.5px; display: flex; flex-direction: column; gap: 7px;
}
.login-box h3 { text-align: center; display: none; }

/* ---------- 提示 ---------- */
#toast {
  position: fixed; top: 22px; left: 50%;
  transform: translateX(-50%) translateY(-90px);
  background: var(--card); border: 1px solid var(--border);
  color: var(--text);
  padding: 11px 26px; border-radius: 999px; font-size: 14px;
  box-shadow: var(--shadow-md); z-index: 200;
  transition: transform .35s var(--ease);
  pointer-events: none; max-width: 80vw;
}
#toast.show { transform: translateX(-50%) translateY(0); }
#toast.err { border-color: rgba(229, 72, 77, .5); color: var(--danger); }

/* ---------- 实时刷新指示 ---------- */
#refresh-indicator {
  position: fixed; right: 16px; bottom: 14px; z-index: 30;
  font-size: 12px; color: var(--muted);
  background: var(--card); border: 1px solid var(--border);
  padding: 3px 12px; border-radius: 999px;
  box-shadow: var(--shadow-sm);
  opacity: 0; transition: opacity .4s var(--ease);
  pointer-events: none;
}
#refresh-indicator.on { opacity: .85; }
#refresh-indicator::before {
  content: ''; display: inline-block; width: 7px; height: 7px;
  background: #35b26b; border-radius: 50%; margin-right: 6px;
  animation: pulse 2s var(--ease) infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
svg.spin { animation: rot .6s linear; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ---------- 通用确认弹窗 ---------- */
.modal-confirm { width: 400px; }
/* 确认/输入弹窗常叠在业务弹窗之上（如赠送确认叠在赠送弹窗上） */
#modal-confirm, #modal-input { z-index: 120; }
.confirm-icon {
  width: 46px; height: 46px; border-radius: 13px;
  background: var(--danger-bg); color: var(--danger);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.confirm-icon svg { display: block; }
.modal-confirm h3 { margin-bottom: 8px; }
.modal-confirm .close-row { margin-top: 24px; }
.modal-confirm #confirm-msg b { font-weight: bold; color: var(--danger); }
.modal-confirm .mono { font-size: 13px; }

/* ---------- 移动端顶栏（桌面隐藏） ---------- */
.mobile-top { display: none; }

/* ---------- 动效降级 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* ============================================
   移动端适配（≤860px：抽屉侧栏 / 弹性工具栏 / 贴底弹窗）
   ============================================ */
@media (max-width: 860px) {
  /* 抽屉遮罩 */
  body.drawer-open { overflow: hidden; }
  body.drawer-open::after {
    content: ''; position: fixed; inset: 0;
    background: rgba(23, 23, 26, .35); z-index: 55;
    animation: mask-in .2s var(--ease) both;
  }

  /* 顶栏 */
  .mobile-top {
    display: flex; align-items: center; gap: 12px;
    position: sticky; top: 0; z-index: 50;
    background: var(--card); border-bottom: 1px solid var(--border);
    padding: 9px 12px;
  }
  .mobile-logo { display: flex; align-items: center; gap: 8px; font-size: 18px; }
  .mobile-logo .logo-mark { width: 28px; height: 28px; font-size: 16px; border-radius: 9px; }

  /* 侧栏 → 抽屉 */
  .layout { display: block; height: auto; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 60;
    width: 236px; transform: translateX(-102%);
    transition: transform .28s var(--ease);
    box-shadow: none; overflow-y: auto;
  }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }

  /* 主区：收紧页边距与标题，同屏显示更多内容 */
  .main { padding: 12px 10px 40px; overflow: visible; }
  .topbar { flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
  h2 { font-size: 17px; }
  h3 { font-size: 15px; margin-bottom: 10px; }

  /* 统计卡：更矮更密 */
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat { padding: 10px 12px; border-radius: 10px; }
  .stat .label { font-size: 13px; }
  .stat .num { font-size: 20px; }

  /* 卡片与表格：压缩内边距与行高，提升每屏行数；单元格单行限宽截断（省略号防溢出重叠），
     长内容靠桌面端或编辑弹窗查看完整值；机器码/云变量值等设计为折行的列豁免 */
  .card-panel { padding: 10px 11px; border-radius: 11px; }
  table { font-size: 12px; }
  th, td { padding: 6px 6px; white-space: nowrap; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
  td[style*="word-break"] { white-space: normal; word-break: break-all; overflow: visible; }
  td:has(> .acts) { max-width: none; overflow: visible; }
  .badge { padding: 1px 8px; font-size: 12px; }

  /* 工具栏/表单行：内联定宽改弹性填充，窄屏不横向溢出（!important 覆盖内联样式） */
  .toolbar input, .toolbar select,
  .form-row input:not([type="checkbox"]), .form-row select {
    flex: 1 1 120px; width: auto !important; min-width: 0;
    padding: 7px 10px; font-size: 13px;
  }
  .toolbar, .form-row { gap: 7px; }
  .toolbar .btn { font-size: 13px; }

  /* 按钮：保留触控目标的同时压缩高度 */
  .btn { padding: 7px 13px; font-size: 13px; }
  .btn.small { padding: 5px 9px; font-size: 12px; }
  /* 行操作列不换行：避免多按钮堆成三行把行高撑到 3 倍；整表横向滚动查看 */
  .acts { gap: 4px; flex-wrap: nowrap; }
  .acts .btn { flex: 0 0 auto; white-space: nowrap; }

  /* 弹窗 → 贴底抽屉式 */
  .modal-mask { align-items: flex-end; }
  .modal {
    width: 100%; max-width: 100vw; max-height: 92vh;
    padding: 16px 13px 22px;
    border-radius: 18px 18px 0 0;
    animation: sheet-up .32s var(--ease) both;
  }
  .modal h3 { font-size: 16px; margin-bottom: 12px; }
  .form-col { margin-bottom: 10px; gap: 4px; }
  .close-row { margin-top: 12px; }
  @keyframes sheet-up {
    from { opacity: .5; transform: translateY(48px); }
    to   { opacity: 1; transform: none; }
  }
  .login-box { width: min(400px, 92vw); padding: 0 24px 22px; }
  .login-welcome { font-size: 24px; margin-top: 40px; }
  #login-mask::before, #login-mask::after { display: none; } /* 小屏收敛装饰，聚焦表单 */

  /* 其余 */
  .pager { justify-content: center; font-size: 13px; }
  .bar-name { width: 90px; }
  #toast { max-width: 92vw; font-size: 13px; text-align: center; }

  /* 通知面板：全宽贴在移动顶栏下方 */
  #notice-panel { left: 10px; right: 10px; width: auto; top: 58px; }
  .np-list { max-height: 52vh; }
  .modal-wide { width: 100%; max-width: 100vw; }
  /* 额度卡（总览）：移动端压缩大数字与间距 */
  .qc-big b { font-size: 21px; }
  .quota-card { padding: 12px; }
}

/* 小屏手机（≤480px）：在 860px 密度基础上进一步收紧 */
@media (max-width: 480px) {
  .main { padding: 10px 8px 36px; }
  .mobile-top { padding: 7px 10px; }
  .stat .num { font-size: 18px; }
  .card-panel { padding: 9px 9px; }
  th, td { padding: 5px 5px; }
  .modal { padding: 14px 11px 20px; }
  #notice-panel { top: 52px; }
}

/* ---------- 骨架屏：数据加载前的占位（切页零等待的视觉部分） ---------- */
.sk {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--panel) 25%, var(--bg) 45%, var(--panel) 65%);
  background-size: 200% 100%;
  animation: sk-shimmer 1.1s linear infinite;
}
td .sk { margin: 9px 0; }

/* ---------- 通知中心（铃铛 + 下拉面板） ---------- */
.bell-btn {
  position: relative; margin-left: auto;
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; flex-shrink: 0;
  background: none; border: none; cursor: pointer;
  color: var(--muted); border-radius: 10px;
  transition: background .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.bell-btn:hover { color: var(--text); background: var(--hover); }
.bell-btn:active { transform: scale(.94); }
.bell-btn svg { transition: transform .25s var(--ease); }
.bell-btn:hover svg { transform: rotate(-8deg); }
.bell-badge {
  position: absolute; top: -3px; right: -5px;
  min-width: 17px; height: 17px; padding: 0 4px;
  background: var(--danger); color: var(--sel-fg);
  border-radius: 999px; font-size: 10.5px; line-height: 17px;
  text-align: center; font-weight: bold;
  box-shadow: 0 0 0 2px var(--card);
}
#notice-panel {
  position: fixed; left: 16px; top: 70px; width: 356px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  z-index: 90; overflow: hidden;
  animation: fade-up .25s var(--ease) both;
}
.np-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
}
.np-head b { font-size: 15px; }
.np-head #np-meta { flex: 1; font-size: 12px; }
.np-list { max-height: 58vh; overflow-y: auto; }
.np-item {
  padding: 11px 14px; border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent;
}
.np-item:last-child { border-bottom: none; }
.np-item.warn { border-left-color: #eab308; }
.np-item.critical { border-left-color: var(--danger); }
.np-title { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: bold; }
.np-title .np-time { margin-left: auto; font-weight: normal; font-size: 12px; color: var(--muted); flex-shrink: 0; }
.np-content { font-size: 13px; color: var(--doc-text); margin-top: 4px; line-height: 1.7; word-break: break-word; white-space: pre-wrap; }
.np-empty { padding: 34px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.np-new {
  background: var(--text); color: var(--card);
  font-size: 10px; font-weight: normal; padding: 1px 6px;
  border-radius: 6px; flex-shrink: 0;
}
.badge.warn { background: var(--warn-bg); color: var(--warn-fg); }  /* 警告等级徽章 */
.modal-wide { width: min(680px, 94vw); }
.modal-wide table { margin-top: 4px; }

/* ---------- 平台公告条（主内容区顶部） ---------- */
#site-notice-bar {
  align-items: center; gap: 12px;
  background: var(--notice-bg); color: var(--notice-fg);
  border: 1px solid var(--border);
  padding: 10px 16px; font-size: 13px; line-height: 1.6;
  border-radius: var(--radius); margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
#site-notice-bar .sn-text { flex: 1; min-width: 0; word-break: break-all; }
#site-notice-bar .sn-hide {
  flex: 0 0 auto; background: transparent; color: var(--notice-chrome-fg);
  border: 1px solid var(--notice-chrome); border-radius: 999px;
  font: inherit; font-size: 12px; padding: 3px 12px; cursor: pointer;
  transition: color .2s, border-color .2s;
}
#site-notice-bar .sn-hide:hover { color: var(--notice-fg); border-color: var(--muted); }
@keyframes sk-shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}


/* ---------- 文本链接（.link：黑白极简，深浅主题自适应） ---------- */
a.link { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
a.link:hover { color: var(--muted); }

/* ---------- 主题切换按钮（幽灵图标钮，与铃铛同语言） ---------- */
.theme-toggle {
  width: 34px; height: 34px; padding: 0; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; border: none;
  background: transparent; color: var(--muted); cursor: pointer;
  transition: color .25s var(--ease), background-color .25s var(--ease), transform .3s var(--ease);
}
.theme-toggle:hover { color: var(--text); background: var(--hover); }
.theme-toggle:active { transform: scale(.9); }
.theme-toggle svg { width: 17px; height: 17px; transition: transform .45s var(--ease); }
.theme-toggle:hover svg { transform: rotate(30deg); }
.theme-toggle:active svg { transform: none; }

/* 主题切换：按钮外圈光晕 + 新图标弹出（页面扩散结束后播放） */
.theme-toggle { position: relative; }
.theme-toggle::after {
  content: '';
  position: absolute; inset: -5px; border-radius: 14px;
  border: 1px solid var(--theme-glow, var(--border-strong));
  opacity: 0; transform: scale(.72);
  pointer-events: none;
}
.theme-toggle.switching::after { animation: theme-ring .72s var(--ease) both; }
.theme-toggle.switching svg { animation: theme-icon-pop .62s var(--ease-spring) both; }
@keyframes theme-ring {
  0% { opacity: .85; transform: scale(.72); }
  55% { opacity: .35; }
  100% { opacity: 0; transform: scale(1.55); }
}
@keyframes theme-icon-pop {
  0% { opacity: 0; transform: rotate(-45deg) scale(.55); }
  65% { opacity: 1; transform: rotate(6deg) scale(1.08); }
  100% { opacity: 1; transform: none; }
}

/* 侧栏底部：用户信息 + 主题钮一行 */
.foot-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.foot-row #foot-user { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* View Transition 圆形扩散：new 在上、旧页静置在下；禁用默认淡入淡出防止双重动画 */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: 9999; }
html.dark::view-transition-old(root) { z-index: 1; }
html.dark::view-transition-new(root) { z-index: 9999; }
::view-transition-new(root) { will-change: clip-path, filter; }
/* 未揭开的旧画面轻微压暗，让圆形扩散更有层次 */
::view-transition-old(root) {
  animation: theme-old-dim .76s var(--ease) both;
  filter: blur(1.2px); /* 旧页轻微虚化，圆形边缘的对比更柔和 */
}
@keyframes theme-old-dim {
  from { opacity: 1; }
  to { opacity: .93; }
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; }
}


.app-select { position: relative; display: inline-block; min-width: 210px; }
.app-select .as-input {
  width: 100%; padding-right: 26px;
  background: var(--card); border: 1px solid var(--border-strong); color: var(--text);
  cursor: pointer;
}
.app-select .as-input::placeholder { color: var(--muted); }
.app-select-open .as-input { border-color: var(--text); }
.app-select-open .as-dd { display: block; }   /* render 只清 inline display，展开态由 open 类接管（缺此规则下拉永远显示不出来） */
.as-dd {
  display: none; position: absolute; top: calc(100% + 4px); left: 0; z-index: 60;
  min-width: 100%; max-height: min(300px, 45dvh); overflow: auto;
  background: var(--card); border: 1px solid var(--border-strong); border-radius: 12px;
  box-shadow: var(--shadow-md); padding: 4px;
}
.as-item { padding: 8px 10px; border-radius: 8px; font-size: 13.5px; color: var(--text); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.as-item:hover, .as-item.hi { background: var(--hover); }
.as-item.hi { outline: 1px solid var(--border-strong); }
.as-empty { padding: 10px; color: var(--muted); font-size: 13px; text-align: center; }

/* ---------- 可搜索软件下拉（AppSelect） ---------- */
@media (max-width: 860px) {
  .app-select {
    flex: 1 1 100%; min-width: 0; width: 100%;   /* 独占一行，随 toolbar 弹性流 */
  }
  .app-select .as-input { padding: 9px 12px; font-size: 14px; }  /* 触控目标 ≥40px 高 */
  .as-dd {
    position: fixed;                               /* 脱离 toolbar 裁剪，贴视口 */
    left: 10px; right: 10px; width: auto; min-width: 0;
    max-height: 50dvh; z-index: 80;
  }
  .as-item { padding: 11px 12px; font-size: 14px; } /* 行高加大便于点选 */
}


/* 软件编辑弹窗：分组表单（状态与注册/验证与安全/注入与更新/自助解绑） */
.app-fsec { border: 1px solid var(--border, #e5e5e2); border-radius: 10px; padding: 10px 12px; margin-top: 12px; }
.app-fsec-title { font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--muted, #8a8a86); margin-bottom: 8px; }
.app-fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; align-items: center; }
.app-fgrid label { display: flex; align-items: center; gap: 6px; margin: 0; white-space: nowrap; }
.app-fgrid .app-fpair { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.app-fgrid .app-fpair label { margin: 0; }
.app-fgrid .app-fpair input { width: 72px; }
@media (max-width: 640px) { .app-fgrid { grid-template-columns: 1fr; } .app-fgrid label { white-space: normal; } }

/* 软件编辑弹窗：安全体检 */
.sec-audit {
  margin-top: 14px; padding: 14px; border: 1px solid var(--border-strong);
  border-radius: 14px; background: var(--panel);
}
.sec-audit-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sec-audit h4 { margin: 2px 0 3px; font-size: 15px; }
.sec-audit-head p { margin: 0; max-width: 560px; font-size: 12px; line-height: 1.55; }
.sec-audit-kicker { font-size: 10px; font-weight: 700; letter-spacing: .14em; color: var(--muted); }
.sec-score {
  display: flex; align-items: baseline; justify-content: flex-end; gap: 4px;
  min-width: 78px; font-size: 30px; font-weight: 800; line-height: 1;
}
.sec-score b { font-weight: 800; }
.sec-score span { font-size: 11px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.sec-score.good b { color: #16a34a; }
.sec-score.ok b { color: var(--warn-fg); }
.sec-score.low b { color: var(--danger); }
.sec-meter { height: 6px; margin: 10px 0 12px; overflow: hidden; border-radius: 99px; background: var(--border); }
.sec-meter span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--text); transition: width .3s var(--ease), background .3s var(--ease); }
.sec-meter span.good { background: #16a34a; }
.sec-meter span.ok { background: var(--warn-fg); }
.sec-meter span.low { background: var(--danger); }
.sec-issues { display: grid; gap: 7px; }
.sec-issue {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 9px 11px; border: 1px solid var(--border); border-left: 3px solid var(--border-strong);
  border-radius: 10px; background: var(--card);
}
.sec-issue.critical { border-left-color: var(--danger); background: var(--danger-bg); }
.sec-issue.high { border-left-color: var(--warn-fg); background: var(--warn-bg); }
.sec-issue.medium { border-left-color: var(--border-strong); }
.sec-issue-copy { min-width: 0; }
.sec-issue-copy b { font-size: 13px; }
.sec-issue-copy p { margin: 2px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.sec-issue .btn { flex: 0 0 auto; white-space: nowrap; }
.sec-ok { padding: 10px 12px; border-radius: 10px; background: var(--card); color: #16a34a; font-size: 13px; }
.sec-more { justify-self: start; }
.sec-audit-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.sec-confirm-list { margin: 8px 0 0 18px; padding: 0; line-height: 1.8; }
@media (max-width: 600px) {
  .sec-audit-head { gap: 8px; }
  .sec-score { font-size: 26px; min-width: 64px; }
  .sec-issue { flex-direction: column; gap: 8px; }
  .sec-issue .btn { align-self: flex-start; }
}

/* ---------- 定价页在线支付弹窗（易支付 V2） ---------- */
.buy-tabs { display: flex; gap: 6px; margin-bottom: 16px; border-bottom: 1px solid var(--border, #e5e5e2); padding-bottom: 8px; }
.buy-tab {
  flex: 1; padding: 8px 0; border: none; background: transparent; color: var(--muted, #8a8a86);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; border-radius: 8px; transition: color .2s, background .2s;
}
.buy-tab.active { color: var(--text, #1a1a1a); background: var(--hover, #f0f0ed); }
.buy-durations { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-top: 4px; }
.buy-duration {
  border: 1px solid var(--border-strong, #d8d8d4); border-radius: 12px; padding: 12px 10px; text-align: center;
  cursor: pointer; background: var(--card, #fff); transition: border-color .2s, box-shadow .2s; font: inherit;
}
.buy-duration b { display: block; font-size: 15px; }
.buy-duration span { display: block; margin-top: 3px; font-size: 13px; color: var(--muted, #8a8a86); }
.buy-duration .d-price { font-size: 16px; font-weight: 700; color: var(--text, #1a1a1a); margin-top: 6px; }
.buy-duration .d-unit { font-size: 12px; font-weight: 400; color: var(--muted, #8a8a86); }
.buy-duration .d-save { display: inline-block; margin-top: 4px; font-size: 11px; color: #fff; background: #16a34a; border-radius: 6px; padding: 1px 6px; }
.buy-duration.sel { border-color: var(--text, #1a1a1a); box-shadow: 0 0 0 1px var(--text, #1a1a1a) inset; }
.buy-duration:disabled { opacity: .45; cursor: not-allowed; }
.pay-methods { display: grid; grid-template-columns: 1fr; gap: 8px; }
.pay-method {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: 1px solid var(--border-strong, #d8d8d4); border-radius: 12px; padding: 12px 14px; text-align: left;
  cursor: pointer; background: var(--card, #fff); font: inherit; transition: border-color .2s, box-shadow .2s;
}
.pay-method:hover { border-color: var(--text, #1a1a1a); }
.pay-method b { font-size: 14.5px; }
.pay-method .muted { font-size: 12.5px; }
#pay-qr canvas, #pay-qr img { border-radius: 10px; border: 1px solid var(--border, #e5e5e2); max-width: 240px; }
@media (max-width: 520px) { .buy-durations { grid-template-columns: 1fr; } }

/* ============================================================
   管理后台视觉升级（2026-10-23）
   仅作用于 body.admin-body，避免影响前台公开页
   ============================================================ */

/* 正文系统字体；标题、品牌、大数字保留展示字体 */
body.admin-body { font-family: var(--font-body); letter-spacing: 0; }
body.admin-body h2,
body.admin-body h3,
body.admin-body .logo,
body.admin-body .mobile-logo,
body.admin-body .stat .num,
body.admin-body .qc-big b,
body.admin-body .login-welcome,
body.admin-body .section-title {
  font-family: var(--font-cute);
  letter-spacing: .3px;
}

body.admin-body .main {
  padding: 32px 38px 44px;
  background:
    radial-gradient(900px 420px at 88% -8%, var(--hover), transparent 68%),
    var(--bg);
}

/* ---------- 侧栏 ---------- */
body.admin-body .sidebar {
  background: linear-gradient(180deg, var(--card) 0%, color-mix(in srgb, var(--card) 94%, var(--bg)) 100%);
  box-shadow: 1px 0 0 var(--border), 18px 0 44px -42px rgba(0, 0, 0, .35);
  overflow-y: auto;
  scrollbar-width: none;
}
body.admin-body .sidebar::-webkit-scrollbar { display: none; }
body.admin-body .logo { padding-bottom: 18px; }
body.admin-body .logo .logo-mark { box-shadow: 0 8px 18px -10px rgba(0, 0, 0, .45); }
body.admin-body .nav-item { font-size: 14px; border-radius: 12px; padding: 10px 13px; }
body.admin-body .nav-item:hover { transform: translateX(2px); }
body.admin-body .nav-item.active { box-shadow: 0 12px 26px -16px rgba(23, 23, 26, .55); }
body.admin-body .nav-item.active svg { transform: scale(1.04); }
body.admin-body .sidebar-foot { padding: 14px 4px 0; }
body.admin-body .foot-row {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 8px;
  gap: 5px;
}
body.admin-body .foot-row::before {
  content: '';
  width: 7px; height: 7px; flex: 0 0 auto;
  border-radius: 50%;
  background: #35b26b;
  box-shadow: 0 0 0 3px rgba(53, 178, 107, .12);
}
body.admin-body .foot-row #foot-user { font-size: 12px; }
body.admin-body .sidebar-foot #btn-logout { width: 100%; justify-content: center; }

/* ---------- 顶栏 ---------- */
body.admin-body .topbar {
  padding-bottom: 14px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  gap: 10px;
}
body.admin-body .topbar h2 { font-size: 25px; }
body.admin-body .topbar h2::before {
  content: 'NETCCHECK CONSOLE';
  display: block;
  margin-bottom: 4px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 400;
  letter-spacing: .18em;
  color: var(--muted);
}
body.admin-body .topbar .btn svg { transition: transform .45s var(--ease); }
body.admin-body .topbar .btn:hover svg { transform: rotate(180deg); }

/* ---------- 卡片 / 总览 ---------- */
body.admin-body .card-panel {
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 1px 2px rgba(23, 23, 26, .03), 0 18px 44px -36px rgba(23, 23, 26, .35);
}
body.admin-body .card-panel > h3:first-child { margin-bottom: 14px; }
body.admin-body #plan-quota-panel > .card-panel > h3 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px dashed var(--border);
}
body.admin-body #plan-quota-panel > .card-panel > h3 .btn {
  margin-left: auto;
  float: none !important;
}
body.admin-body #plan-quota-panel .card-panel .card-panel {
  background: var(--panel);
  border: 0;
  box-shadow: none;
  padding: 16px;
  border-radius: 12px;
}

body.admin-body .quota-grid { gap: 14px; margin-top: 0; }
body.admin-body .quota-card {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  padding: 16px 18px 15px;
  background: linear-gradient(180deg, var(--quota-bg), color-mix(in srgb, var(--quota-bg) 94%, var(--hover)));
  transition: transform .3s var(--ease-spring), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
body.admin-body .quota-card::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(260px circle at 100% 0%, var(--hover), transparent 72%);
  opacity: 0;
  transition: opacity .3s var(--ease);
  pointer-events: none;
}
body.admin-body .quota-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}
body.admin-body .quota-card:hover::before { opacity: 1; }
body.admin-body .quota-card > * { position: relative; z-index: 1; }
body.admin-body .quota-card .bar-track { height: 8px; }
body.admin-body .qc-name { letter-spacing: .2px; }
body.admin-body .qc-big b { font-size: 32px; letter-spacing: .5px; }

/* ---------- 统计卡 ---------- */
body.admin-body .stat {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  padding: 18px 18px 16px;
  transition: transform .3s var(--ease-spring), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
body.admin-body .stat::before {
  content: '';
  position: absolute; left: 18px; top: 0;
  width: 32px; height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--text);
  opacity: .72;
  transition: width .3s var(--ease), opacity .3s var(--ease);
}
body.admin-body .stat::after {
  content: '';
  position: absolute; right: -36px; bottom: -46px;
  width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, var(--hover), transparent 70%);
  opacity: 0;
  transition: opacity .3s var(--ease);
  pointer-events: none;
}
body.admin-body .stat:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}
body.admin-body .stat:hover::before { width: 58px; opacity: 1; }
body.admin-body .stat:hover::after { opacity: 1; }
body.admin-body .stat > * { position: relative; z-index: 1; }
body.admin-body .stat .label { font-size: 13px; letter-spacing: .2px; }
body.admin-body .stat .num { font-size: 34px; margin-top: 6px; letter-spacing: .5px; }

/* ---------- 按钮 / 工具栏 / 表单 ---------- */
body.admin-body .btn {
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  transition: transform .18s var(--ease), box-shadow .2s var(--ease), background .2s, border-color .2s;
}
body.admin-body .btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -16px rgba(23, 23, 26, .55); }
body.admin-body .btn:active { transform: scale(.97); }
body.admin-body .btn:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

body.admin-body .toolbar {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 14px;
}
body.admin-body input, body.admin-body select, body.admin-body textarea { border-radius: 10px; }
body.admin-body input:hover, body.admin-body select:hover, body.admin-body textarea:hover { border-color: var(--border-strong); }
body.admin-body input::placeholder, body.admin-body textarea::placeholder { color: var(--muted); }

/* ---------- 表格 / 分页 ---------- */
body.admin-body .card-panel table { border-collapse: separate; border-spacing: 0; }
body.admin-body th {
  padding: 9px 12px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--muted);
  background: var(--panel);
}
body.admin-body td { padding: 10px 12px; }
body.admin-body tbody td[colspan] {
  padding: 38px 16px !important;
  text-align: center;
  color: var(--muted);
  background: var(--panel);
}
body.admin-body .pager {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}
body.admin-body .badge { font-size: 12px; padding: 2px 9px; letter-spacing: .1px; }

/* 概览/列表顶部的统计条 → 轻量胶囊 */
body.admin-body .chart-legend { gap: 8px; flex-wrap: wrap; }
body.admin-body .chart-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  font-size: 12px;
}
body.admin-body .chart-legend .lg {
  width: 6px; height: 6px; margin-right: 0;
  border: 0; border-radius: 50%;
  background: var(--text);
}
body.admin-body .chart-legend .lg-register { background: var(--muted); }
body.admin-body .chart-legend .lg-recharge { background: var(--border-strong); }

/* ---------- 弹窗 / 登录 ---------- */
body.admin-body .modal { border-radius: 18px; box-shadow: var(--shadow-lg); }
body.admin-body .modal > h3:first-child { padding-bottom: 12px; border-bottom: 1px solid var(--border); }
body.admin-body .modal:not(.login-box) .close-row { padding-top: 14px; border-top: 1px solid var(--border); }
body.admin-body #login-mask { background-image: radial-gradient(var(--border-strong) 1px, transparent 1px); background-size: 22px 22px; }
body.admin-body #login-mask::before { background: radial-gradient(circle, var(--hero-glow), transparent 68%); }
body.admin-body .login-box { border: 1px solid var(--border-strong); }

/* ---------- 入场动效 ---------- */
@keyframes admin-card-in {
  from { opacity: 0; transform: translateY(12px) scale(.985); }
  to { opacity: 1; transform: none; }
}
body.admin-body .tab-section.entering .stat,
body.admin-body .tab-section.entering .quota-card {
  animation: admin-card-in .45s var(--ease) both;
}
body.admin-body .tab-section.entering .stat:nth-child(2),
body.admin-body .tab-section.entering .quota-card:nth-child(2) { animation-delay: .05s; }
body.admin-body .tab-section.entering .stat:nth-child(3),
body.admin-body .tab-section.entering .quota-card:nth-child(3) { animation-delay: .1s; }
body.admin-body .tab-section.entering .stat:nth-child(4),
body.admin-body .tab-section.entering .quota-card:nth-child(4) { animation-delay: .15s; }
body.admin-body .tab-section.entering .stat:nth-child(5) { animation-delay: .2s; }
body.admin-body .tab-section.entering .stat:nth-child(6) { animation-delay: .25s; }

@media (max-width: 860px) {
  body.admin-body .main { padding: 14px 10px 40px; }
  body.admin-body .topbar { margin-bottom: 14px; padding-bottom: 10px; }
  body.admin-body .topbar h2 { font-size: 21px; }
  body.admin-body .topbar h2::before { font-size: 8.5px; }
  body.admin-body .card-panel { padding: 12px; border-radius: 13px; }
  body.admin-body .stat { padding: 12px; border-radius: 12px; }
  body.admin-body .stat::before { left: 12px; }
  body.admin-body .stat .num { font-size: 24px; }
  body.admin-body .quota-card { padding: 13px; }
  body.admin-body .quota-grid { gap: 10px; }
  body.admin-body .toolbar { padding: 8px; }
  body.admin-body .toolbar > span[style*="flex:1"] { display: none; }
  body.admin-body .toolbar .btn { flex: 1 1 calc(50% - 4px); }
  body.admin-body tbody td[colspan] { text-align: left; padding: 28px 14px !important; }
  body.admin-body .pager { gap: 6px; }
  body.admin-body .pager > span,
  body.admin-body .pager > label { white-space: nowrap; font-size: 12px; }
  body.admin-body .pager .btn { white-space: nowrap; padding: 6px 10px; font-size: 12px; }
  body.admin-body .sidebar { background: var(--card); }
}

/* ---------- 注入构建：详情 / 策略编辑 ---------- */
.dagcfg-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.dagcfg-kicker { font-family: var(--font-mono); font-size: 9px; letter-spacing: .16em; color: var(--muted); }
.dagcfg-head h3 { margin: 3px 0 0; }
.dag-info-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px; margin-bottom: 16px; overflow: hidden;
  border: 1px solid var(--border); border-radius: 11px; background: var(--border);
}
.dag-info-item { min-width: 0; padding: 10px 12px; background: var(--panel); }
.dag-info-label { display: block; margin-bottom: 3px; color: var(--muted); font-size: 11px; }
.dag-info-value { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 12.5px; word-break: break-all; }
.dag-info-value .mono { font-size: 11.5px; }
.dag-info-value .btn { flex: none; white-space: nowrap; min-width: 46px; padding: 5px 9px; }
.dagcfg-section { padding: 14px; border: 1px solid var(--border); border-radius: 12px; }
.dagcfg-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.dagcfg-section-head h4 { margin: 0; font-size: 14px; }
.dagcfg-section-head .muted { font-size: 11.5px; }
.dagcfg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.dagcfg-grid .form-col { margin-bottom: 0; }
.dagcfg-grid .form-col label { font-size: 12px; }
.dag-check {
  display: flex; align-items: center; gap: 8px; min-height: 38px;
  padding: 8px 10px; border: 1px dashed var(--border-strong); border-radius: 9px;
  color: var(--muted); font-size: 12.5px; cursor: pointer;
}
.dag-check input { flex: none; }
.dagcfg-note { margin: 12px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.65; }
.dagcfg-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: nowrap; margin-top: 16px; }
.dagcfg-actions-left { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; flex: 1 1 auto; min-width: 0; }
.dagcfg-actions-right { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; flex: 0 0 auto; }
.dagcfg-actions .btn { white-space: nowrap; }
.dag-policy-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.dag-policy-tags .badge { padding: 1px 7px; font-size: 10px; }
.dag-expire-soft { color: var(--muted); font-size: 11.5px; }
#dag-tbody td:last-child, #tab-dag .doc-table th:last-child { min-width: 76px; }
#dag-tbody td:nth-child(2) { min-width: 100px; }
#dag-tbody .btn { white-space: nowrap; }
@media (max-width: 640px) {
  .dagcfg-head { align-items: center; }
  .dag-info-grid, .dagcfg-grid { grid-template-columns: 1fr; }
  .dagcfg-actions { flex-wrap: wrap; }
  .dagcfg-actions-left, .dagcfg-actions-right { width: 100%; }
  .dagcfg-actions-left { flex-wrap: wrap; }
  .dagcfg-actions-right { justify-content: flex-end; }
  .dagcfg-actions-left .btn, .dagcfg-actions-right .btn { flex: 1 1 120px; justify-content: center; }
}

/* ============================================================
   统一文本链接 / 选择框（2026-10-24）
   ============================================================ */

/* 文本链接：全站统一为「正文色 + 细下划线」，仅按钮/导航/页脚等容器链接例外。
   这样文档正文、后台提示、定价页客服邮箱等超链接视觉一致，不再出现有的蓝、有的黑、有的无下划线。 */
a:not(.btn) {
  color: var(--text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, currentColor 55%, transparent);
  transition: color .18s var(--ease), text-decoration-color .18s var(--ease);
}
a:not(.btn):visited { color: var(--text); }
a:not(.btn):hover {
  color: var(--muted);
  text-decoration-color: currentColor;
}
a:not(.btn):focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
  border-radius: 2px;
}
/* 容器型链接保持无下划线：导航、页脚、侧栏、分页、按钮 */
.btn,
a.nav-logo,
a.login-link,
.nav-links a,
.nav-cta a.login-link,
.footer-inner a,
.docs-side a,
.pager a {
  text-decoration: none;
}
.btn:hover,
a.nav-logo:hover,
a.login-link:hover,
.nav-links a:hover,
.nav-cta a.login-link:hover,
.footer-inner a:hover,
.docs-side a:hover,
.pager a:hover {
  text-decoration: none;
}

/* 原生 select 统一外观：自绘箭头、点击热区、主题色自适应 */
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238a8a8e' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px 14px;
  padding-right: 38px;
  min-height: 40px;
  line-height: 1.4;
  cursor: pointer;
  text-overflow: ellipsis;
  touch-action: manipulation;
}
select:hover { border-color: var(--text); }
select:disabled { opacity: .55; cursor: not-allowed; }
select option { background: var(--card); color: var(--text); }
select[multiple] {
  background-image: none;
  padding-right: 12px;
  min-height: 120px;
}
select::-ms-expand { display: none; }

/* 手机端：16px 防止 iOS 聚焦缩放；46px 触控高度；筛选/表单选择框占满可用宽度 */
@media (max-width: 860px) {
  select,
  body.admin-body select,
  body.admin-body .toolbar select,
  body.admin-body .form-row select,
  body.admin-body .form-col select,
  body.admin-body .modal select {
    min-height: 46px;
    font-size: 16px;
    padding: 11px 40px 11px 13px;
    border-radius: 12px;
  }
  .form-col select,
  .modal select {
    width: 100%;
  }
  input[type="checkbox"],
  input[type="radio"] {
    width: 20px;
    height: 20px;
  }
}
@media (max-width: 640px) {
  .toolbar select,
  .form-row select,
  .form-col select,
  .modal select,
  body.admin-body .toolbar select {
    flex: 1 1 100%;
    width: 100% !important;
    min-width: 0 !important;
  }
}

/* ---------- 控制台顶栏：尊享体验倒计时（跨标签常驻） ---------- */
.trial-pill {
  /* 初始隐藏由 HTML 的 inline display:none 负责；这里必须是 flex，
     否则 JS 把 inline display 清空后会回落到 none，永远显示不出来 */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 14px 10px;
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  color: var(--accent, #2563eb);
  background: rgba(37, 99, 235, .10);
  border: 1px solid rgba(37, 99, 235, .28);
  transition: background .18s ease, border-color .18s ease;
}
.trial-pill b { font-variant-numeric: tabular-nums; }
.trial-pill:hover { background: rgba(37, 99, 235, .16); }
.trial-pill.warn {
  color: #b45309;
  background: rgba(245, 158, 11, .12);
  border-color: rgba(245, 158, 11, .38);
}
.trial-pill.warn:hover { background: rgba(245, 158, 11, .2); }
.dark .trial-pill { color: #93c5fd; background: rgba(96, 165, 250, .14); border-color: rgba(96, 165, 250, .32); }
.dark .trial-pill.warn { color: #fcd34d; background: rgba(245, 158, 11, .16); border-color: rgba(245, 158, 11, .36); }

/* 移动端顶栏里的紧凑样式 */
.mobile-top .trial-pill.mob {
  margin: 0 6px;
  padding: 4px 8px;
  font-size: 11.5px;
  font-weight: 600;
  gap: 4px;
  border-radius: 999px;
}
@media (min-width: 861px) {
  .mobile-top .trial-pill.mob { display: none !important; }
}

/* ===== 移动端可用性补丁（2026-10-26） =====
   目标：① 触控目标 ≥ 40px；② iOS 聚焦不缩放；③ 表格操作列常驻可见；
        ④ 弹窗长表单的保存按钮吸底；⑤ 复选框/开关行可点区域加大。 */
@media (max-width: 860px) {
  /* ① 输入类控件 16px：低于 16px 时 iOS Safari 聚焦会自动放大页面 */
  input, select, textarea, .as-input, .toolbar input, .toolbar select {
    font-size: 16px !important;
  }
  input[type="datetime-local"], input[type="date"] { min-height: 44px; }

  /* ② 按钮触控目标 */
  .btn { min-height: 42px; padding: 9px 14px; }
  .btn.small { min-height: 36px; padding: 7px 12px; font-size: 13px; }
  .acts { gap: 6px; }
  .acts .btn { min-height: 36px; }
  .bell-btn { min-width: 42px; min-height: 42px; }
  .pager .btn { min-height: 36px; min-width: 38px; }
  .toolbar > .btn, .toolbar > button { flex: 1 1 calc(50% - 6px); }

  /* ③ 表格：容器横向滚动（.card-panel 已有 overflow-x），操作列吸附右侧常驻 */
  table { min-width: 620px; }
  #tab-devs table { min-width: 760px; }
  #tab-devs thead th:last-child,
  #tab-devs tbody td:last-child {
    position: sticky; right: 0; z-index: 2;
    background: var(--card);
    box-shadow: -8px 0 10px -10px rgba(0, 0, 0, .45);
  }
  #tab-devs tbody tr:hover td:last-child { background: var(--card); }
  .card-panel > table { margin: 0; }

  /* ④ 弹窗：内容可滚，底部按钮吸底，长表单不用滚到底找保存
     注意：登录框必须排除——它的 logo 是半浮出卡片的（top:-50%），一旦 overflow 变成 auto 就会被裁成半个 */
  .modal:not(.login-box) { overflow-y: auto; overscroll-behavior: contain; }
  .modal.login-box { overflow: visible; }
  .close-row {
    position: sticky; bottom: -1px; z-index: 3;
    background: var(--card);
    padding: 10px 0 2px; margin-top: 10px;
    box-shadow: 0 -10px 14px -12px rgba(0, 0, 0, .4);
  }
  .close-row .btn { flex: 1 1 0; justify-content: center; }

  /* ⑤ 表单行改竖向：标签在上、控件占满整行，避免挤压 */
  .form-row { flex-direction: column; align-items: stretch; }
  .form-row > label { margin-bottom: 2px; }

  /* ⑥ 复选框 / 开关行：整行可点，勾选框本身加大 */
  .app-fgrid label { min-height: 40px; }
  input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; }

  /* ⑦ 长标题与路径类文本不撑破布局 */
  .topbar h2 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mono, .dag-info-value { word-break: break-all; }
}

@media (max-width: 480px) {
  .btn { min-height: 44px; }
  .btn.small { min-height: 38px; }
  .stat-grid { gap: 7px; }
}

/* ===== 窄屏表格卡片化（≤640px）===== */
@media (max-width: 640px) {
  .card-panel > table.m-cards { min-width: 0; width: 100%; }
  table.m-cards thead { display: none; }
  table.m-cards tbody, table.m-cards tr, table.m-cards td { display: block; width: auto; }
  table.m-cards tr {
    padding: 10px 12px; margin-bottom: 10px;
    border: 1px solid var(--border); border-radius: 12px; background: var(--panel);
  }
  table.m-cards tr:last-child { margin-bottom: 0; }
  table.m-cards td {
    display: flex; gap: 10px; align-items: baseline;
    border: 0; padding: 3px 0; max-width: none; white-space: normal; overflow: visible;
  }
  table.m-cards td::before {
    content: attr(data-label);
    flex: 0 0 78px; color: var(--muted); font-size: 12px; line-height: 1.6;
  }
  table.m-cards td[colspan] { display: block; }
  table.m-cards td[colspan]::before { content: none; }
  table.m-cards td:has(> .acts) { display: block; padding-top: 6px; }
  table.m-cards td:has(> .acts)::before { display: block; margin-bottom: 4px; flex: none; }
  table.m-cards .acts { flex-wrap: wrap; gap: 6px; }
  table.m-cards .acts .btn { flex: 1 1 auto; justify-content: center; }
  /* 卡片模式下关掉开发者表的吸附列 */
  #tab-devs table.m-cards thead th:last-child,
  #tab-devs table.m-cards tbody td:last-child {
    position: static; box-shadow: none; background: transparent;
  }
}

/* ===== 手机端：分页重排 + 字号收一档（2026-10-26） ===== */
@media (max-width: 640px) {
  /* 分页两行：第一行「信息 + 每页」，第二行整宽翻页按钮（grid 保证不换行错位） */
  .pager {
    display: grid; grid-template-columns: 1fr auto; align-items: center;
    gap: 6px 10px; margin-top: 10px; font-size: 12px;
  }
  .pager-info { grid-column: 1; font-size: 12px; white-space: normal; line-height: 1.5; }
  .pager-size { grid-column: 2; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; white-space: nowrap; }
  /* 选择器要压过 body.admin-body select 的 46px 触控高度与 16px 字号（那条规则特异性更高） */
  body.admin-body .pager .pager-size select,
  .pager .pager-size select {
    height: 32px !important; min-height: 32px !important; line-height: 30px;
    padding: 0 22px 0 8px !important; border-radius: 8px;
    font-size: 13px !important;
  }
  .pager-nav { grid-column: 1 / -1; display: flex; gap: 8px; }
  .pager-nav .btn { flex: 1 1 0; min-height: 36px; font-size: 13px; justify-content: center; }
  .pager .btn:disabled { opacity: .45; }

  /* 字号整体收一档（保持正文可读，控件不再显大） */
  body.admin-body .topbar h2 { font-size: 18px; }
  body.admin-body .stat .num { font-size: 20px; }
  body.admin-body .card-panel { padding: 10px; }
  table.m-cards td { font-size: 12.5px; padding: 3px 0; }
  table.m-cards td::before { font-size: 11.5px; flex-basis: 70px; }
  .badge { font-size: 11px; padding: 1px 7px; }
  .btn.small { font-size: 12.5px; }
  .muted { font-size: 12px; }
  select { font-size: 13.5px !important; }
}

/* ===== 卡片模式：勾选框定位到卡片右上角 ===== */
@media (max-width: 640px) {
  table.m-cards tr { position: relative; }
  table.m-cards td:has(> input[type="checkbox"]),
  table.m-cards td:has(> label input[type="checkbox"]) {
    position: absolute; top: 8px; right: 10px;
    padding: 0; margin: 0; width: auto !important; display: block;
  }
  table.m-cards td:has(> input[type="checkbox"])::before,
  table.m-cards td:has(> label input[type="checkbox"])::before { content: none; }
  table.m-cards td input[type="checkbox"] { width: 22px; height: 22px; }
  /* 卡片第一行给右上角勾选框留位置 */
  table.m-cards td:first-child { padding-right: 34px; }
}
