/* ==========================================================================
   GEO 后台设计系统（2026-10-26 改版：深色侧边栏 + 入口内标签页 + 右侧抽屉）
   - 设计令牌：颜色 / 圆角 / 阴影 / 间距统一在 :root
   - 布局：左侧深色导航 216px（整高吸顶）+ 右侧（顶栏 56px + 标签页条 + 内容区，最大 1360px）
   - 组件：页头 .page-head、卡片 .card（.flush 表格贴边）、指标 .kpi / .kpi-strip、工具条 .toolbar、
     表格、徽章 .badge、按钮 .btn、行内操作 .acts、表单、提示 .alert、空状态 .empty、抽屉 .drawer、流程 .flow
   - 兼容旧类名（.stat/.tag/.wip/.row/.grid/.badge.done 等），未改造的页面也能套用新视觉
   ========================================================================== */
:root {
  --primary: #2f54eb;
  --primary-hover: #1d39c4;
  --primary-soft: #f0f5ff;
  --primary-line: #adc6ff;
  --bg: #f3f4f7;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --ink: #111827;
  --ink-2: #374151;
  --muted: #6b7280;
  --faint: #9ca3af;
  --line: #e8eaef;
  --line-2: #f0f1f4;
  --ok: #16a34a;     --ok-soft: #ecfdf3;     --ok-line: #bbf7d0;
  --warn: #c2410c;   --warn-soft: #fff7ed;   --warn-line: #fed7aa;
  --danger: #dc2626; --danger-soft: #fef2f2; --danger-line: #fecaca;
  --info: #0369a1;   --info-soft: #f0f9ff;   --info-line: #bae6fd;
  --side: #0f172a; --side-2: #1e293b; --side-ink: #cbd5e1; --side-faint: #64748b;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, .16);
  --topbar-h: 56px;
  --sidebar-w: 216px;
  /* 旧变量名（模板内联样式仍在用） */
  --purple: var(--primary);
  --purple-soft: var(--primary-soft);
  --card: var(--surface);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
a.link { color: var(--primary); }
a.link:hover { text-decoration: underline; }
/* 表格里的标题链接用正文色，悬停才显示主色，避免满屏蓝色 */
.content td a:not(.btn):not(.tag):not(.act):not(.link) { color: var(--ink); font-weight: 500; }
.content td a:not(.btn):not(.tag):not(.act):not(.link):hover { color: var(--primary); text-decoration: underline; }
code, pre, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
pre { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.svg-ico { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none;
  stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* ── 整体布局 ─────────────────────────────────────────────────────────── */
.shell { display: flex; min-height: 100vh; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { flex: 1; min-width: 0; padding: 24px 28px 48px; }
.content > .page { max-width: 1360px; margin: 0 auto; }

/* ── 侧边栏（深色） ───────────────────────────────────────────────────── */
.sidebar { width: var(--sidebar-w); flex-shrink: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--side); color: var(--side-ink); padding: 14px 12px 16px; display: flex; flex-direction: column;
  scrollbar-width: thin; scrollbar-color: #334155 transparent; }
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; color: #fff;
  font-weight: 650; font-size: 15px; white-space: nowrap; }
.logo-mark { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: #fff;
  background: var(--primary); font-size: 13px; font-weight: 700; flex-shrink: 0; }
.sidebar .sec { font-size: 11.5px; color: var(--side-faint); padding: 14px 10px 4px; letter-spacing: .06em; }
.sidebar .item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin: 1px 0;
  border-radius: 8px; font-size: 13.5px; color: var(--side-ink); }
.sidebar .item .svg-ico { width: 17px; height: 17px; color: #94a3b8; }
.sidebar .item .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar .item:hover { background: var(--side-2); color: #fff; }
.sidebar .item.active { background: var(--primary); color: #fff; font-weight: 600; }
.sidebar .item.active .svg-ico { color: #fff; }
.sidebar .cnt { font-size: 11px; line-height: 18px; min-width: 20px; text-align: center; padding: 0 6px;
  border-radius: 9px; background: #334155; color: #e2e8f0; }
.sidebar .item.active .cnt { background: rgba(255, 255, 255, .25); }
.sidebar .cnt.hot { background: #f59e0b; color: #1f2937; }
.sidebar .dev { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--side-2); }
.sidebar .dev .item { color: #94a3b8; font-size: 13px; }

/* ── 顶栏与标签页条 ───────────────────────────────────────────────────── */
.topwrap { position: sticky; top: 0; z-index: 40; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar { height: var(--topbar-h); display: flex; align-items: center; gap: 14px; padding: 0 28px; }
.topbar .logo { display: none; align-items: center; gap: 8px; font-weight: 650; font-size: 15px; white-space: nowrap; }
.topbar .crumbs { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; color: var(--muted);
  font-size: 13px; white-space: nowrap; overflow: hidden; }
.topbar .crumbs a:hover { color: var(--primary); }
.topbar .crumbs b { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.topbar .crumbs .sep { color: #d1d5db; }
.topbar .notice { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ok);
  background: var(--ok-soft); padding: 3px 10px; border-radius: 999px; white-space: nowrap; cursor: help; }
.topbar .notice .svg-ico { width: 14px; height: 14px; }
.topbar .user { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.topbar .avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary); font-weight: 650; font-size: 13px; }
.topbar .pill, .topbar .user button { background: transparent; border: 1px solid var(--line); color: var(--ink-2);
  padding: 5px 12px; border-radius: 8px; font-size: 12.5px; cursor: pointer; font-family: inherit; }
.topbar .user button:hover, .topbar .pill:hover { background: var(--surface-2); }
.tabs-bar { display: flex; gap: 2px; padding: 0 20px; overflow-x: auto; scrollbar-width: none; }
.tabs-bar::-webkit-scrollbar { display: none; }
.tabs-bar a { padding: 10px 12px 9px; font-size: 13.5px; color: var(--muted); border-bottom: 2px solid transparent;
  white-space: nowrap; }
.tabs-bar a:hover { color: var(--ink); }
.tabs-bar a.on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.banner { padding: 9px 28px; font-size: 13px; border-bottom: 1px solid; }
.banner.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.banner.err { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }

/* 移动端菜单开关（复选框，无 JS） */
.navtoggle { display: none; }
.menu-btn { display: none; cursor: pointer; padding: 6px; margin-left: -6px; border-radius: 8px; color: var(--ink-2); }
.scrim { display: none; }

/* ── 页头 ─────────────────────────────────────────────────────────────── */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head .desc { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; max-width: 860px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
h1 { font-size: 22px; font-weight: 650; letter-spacing: -.01em; margin: 0 0 18px; line-height: 1.35; }
h1 .tag { vertical-align: middle; margin-left: 6px; }
h2 { font-size: 15px; font-weight: 600; margin: 0 0 14px; line-height: 1.4; }
h3 { font-size: 14px; font-weight: 600; margin: 16px 0 8px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
.text-ok { color: var(--ok); } .text-warn { color: var(--warn); } .text-danger { color: var(--danger); }

/* ── 卡片与栅格 ───────────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card > h2:first-child { margin-top: 0; }
.card .card-head { display: flex; align-items: center; justify-content: space-between; gap: 6px 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card .card-head h2 { margin: 0; white-space: nowrap; }
.card p:first-child { margin-top: 0; } .card p:last-child { margin-bottom: 0; }
.row > .card, .grid > .card { margin-bottom: 0; }
.grid { display: grid; gap: 16px; }
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row > .card { flex: 1; min-width: 260px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stack > * + * { margin-top: 16px; }
.section { margin-bottom: 16px; }

/* ── 指标卡（新 .kpi，兼容旧 .stat） ──────────────────────────────────── */
.kpis { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.kpi .k-label { color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.kpi .k-value { font-size: 26px; font-weight: 650; letter-spacing: -.02em; margin-top: 6px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi .k-value small { font-size: 13px; color: var(--faint); font-weight: 500; margin-left: 2px; }
.kpi .k-sub { color: var(--faint); font-size: 12px; margin-top: 4px; }
.stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat { display: flex; align-items: center; gap: 14px; }
.stat .ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 18px;
  background: var(--primary-soft) !important; color: var(--primary); flex-shrink: 0; }
.stat .v { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.25; }
.stat .l { color: var(--muted); font-size: 12.5px; }

/* ── 表格 ─────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 12.5px; background: var(--surface-2); white-space: nowrap;
  border-bottom: 1px solid var(--line); }
tr:first-child th:first-child { border-top-left-radius: 8px; } tr:first-child th:last-child { border-top-right-radius: 8px; }
tbody tr:hover td, table tr:hover > td { background: #fafbfd; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.kv th { width: 180px; background: transparent; font-size: 13px; }
tr.group-row td { background: var(--surface-2); color: var(--ink-2); font-size: 13px; padding: 6px 12px; }
table.compact th, table.compact td { padding: 7px 10px; }

/* ── 徽章与标签 ───────────────────────────────────────────────────────── */
.badge, .tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; line-height: 20px;
  padding: 0 8px; border-radius: 999px; white-space: nowrap; font-weight: 500;
  background: var(--line-2); color: var(--ink-2); border: 1px solid transparent; }
.tag { background: var(--primary-soft); color: var(--primary); border-radius: 6px; }
a.tag:hover { border-color: var(--primary-line); }
.badge.done, .badge.ok, .badge.success { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.badge.todo, .badge.info { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-line); }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.badge.danger, .badge.fail, .badge.err { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
.badge.neutral { background: var(--line-2); color: var(--muted); border-color: var(--line); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.plain::before { display: none; }

/* ── 按钮 ─────────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--primary); background: var(--primary); color: #fff;
  font: 500 13.5px/1 inherit; font-family: inherit; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.ghost, .btn.secondary { background: var(--surface); color: var(--ink-2); border-color: #dfe2e8; }
.btn.ghost:hover, .btn.secondary:hover { background: var(--surface-2); border-color: #d1d5db; }
.btn.danger { background: var(--surface); color: var(--danger); border-color: var(--danger-line); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn:disabled, .btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 14px; }

/* ── 表单 ─────────────────────────────────────────────────────────────── */
input, textarea, select { width: 100%; padding: 8px 11px; border: 1px solid #d1d5db; border-radius: var(--radius-sm);
  font: 13.5px/1.5 inherit; font-family: inherit; color: var(--ink); background: var(--surface);
  transition: border-color .15s, box-shadow .15s; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47, 84, 235, .15); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--primary); }
input[type=file] { padding: 6px; background: var(--surface-2); }
label { display: block; font-size: 13px; font-weight: 500; color: var(--ink-2); margin: 14px 0 6px; }
label.inline { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 400; }
.form-grid { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.hint { color: var(--faint); font-size: 12px; margin-top: 4px; }

/* ── 提示与空状态 ─────────────────────────────────────────────────────── */
.alert, .wip { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--radius-sm);
  font-size: 13px; margin-bottom: 16px; border: 1px solid var(--info-line); background: var(--info-soft); color: var(--info); }
.wip, .alert.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); border-style: solid; }
.alert.danger { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
.alert.ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.empty { text-align: center; padding: 32px 16px; color: var(--muted); font-size: 13.5px; }
.empty .svg-ico { width: 32px; height: 32px; color: var(--faint); margin-bottom: 8px; }
.result-box { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; }

/* ── 进度条 ───────────────────────────────────────────────────────────── */
.bar { height: 8px; background: var(--line-2); border-radius: 999px; overflow: hidden; min-width: 60px; }
.bar > i { display: block; height: 100%; background: var(--primary); border-radius: 999px; }

/* ── 控制台：旧步骤卡（兼容）与引擎 ─────────────────────────────────── */
.steps { display: grid; grid-template-columns: repeat(8, minmax(120px, 1fr)); gap: 12px; overflow-x: auto; margin-bottom: 16px; }
.step { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.step .n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary); font-size: 12px; font-weight: 650; margin-right: 6px; }
.step.is-done .n { background: var(--ok-soft); color: var(--ok); }
.step .t { font-weight: 600; font-size: 13.5px; }
.step .d { color: var(--muted); font-size: 12px; margin: 6px 0 10px; min-height: 36px; }
.engines { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.engine { border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 12px 14px; display: flex;
  justify-content: space-between; align-items: center; }
.engine .v { font-weight: 650; font-size: 18px; font-variant-numeric: tabular-nums; }

/* ── 流程条（工作台八步） ─────────────────────────────────────────────── */
.flow { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); padding: 4px 0 2px; }
.flow .st { position: relative; padding-right: 8px; display: block; }
.flow .st .c { position: relative; z-index: 1; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; background: var(--ok-soft); color: var(--ok); border: 1.5px solid #86efac; }
.flow .st .c .svg-ico { width: 14px; height: 14px; stroke-width: 2.5; }
.flow .st::before { content: ""; position: absolute; top: 12px; left: 26px; right: 0; height: 2px; background: var(--ok-line); }
.flow .st:last-child::before { display: none; }
.flow .st.todo .c { background: var(--surface); color: var(--faint); border-color: var(--line); }
.flow .st.todo::before { background: var(--line); }
.flow .st.now .c { background: var(--primary); color: #fff; border-color: var(--primary); }
.flow .st b { display: block; font-size: 13px; margin-top: 8px; font-weight: 600; }
.flow .st small { color: var(--muted); font-size: 12px; }
.flow .st.now b { color: var(--primary); }
.flow .st:hover b { color: var(--primary); }
.next-step { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 12px 14px;
  background: var(--primary-soft); border-radius: 10px; font-size: 13.5px; flex-wrap: wrap; }
.next-step > span { flex: 1; min-width: 200px; }
.next-step.done { background: var(--ok-soft); }

/* ── 指标条：一张卡里多个指标，竖线分隔 ───────────────────────────────── */
.card.kpi-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); padding: 0; overflow: hidden; }
.kpi-strip > .kpi { border: 0; border-right: 1px solid var(--line); border-radius: 0; box-shadow: none; }
.kpi-strip > .kpi:last-child { border-right: 0; }
.kpi-strip > a.kpi { display: block; color: inherit; }
.kpi-strip > a.kpi:hover { background: var(--surface-2); }

/* ── 贴边卡片 + 工具条 + 行内操作 ─────────────────────────────────────── */
.card.flush { padding: 0; overflow: hidden; }
.card.flush > .card-head { padding: 14px 18px; margin: 0; border-bottom: 1px solid var(--line); }
.card.flush > .table-wrap { margin: 0; padding: 0; }
.card.flush th:first-child, .card.flush td:first-child { padding-left: 18px; }
.card.flush th:last-child, .card.flush td:last-child { padding-right: 18px; }
.card.flush th { border-radius: 0 !important; }
.card.flush tr:last-child td { border-bottom: 0; }
.card.flush > .empty { padding: 40px 16px; }
.card.flush > .card-body { padding: 14px 18px; }
.card .card-foot { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap;
  padding: 12px 18px; border-top: 1px solid var(--line); background: var(--surface-2); }
.nowrap { white-space: nowrap; }
td.wrap { white-space: normal; }  /* 长文本列：手机端也允许换行 */
td.narrow { min-width: 0; }      /* 编号/日期/排名等短列做首列时 */
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 12px 18px; border-bottom: 1px solid var(--line); margin: 0; }
.toolbar input, .toolbar select { width: auto; height: 34px; padding: 0 10px; }
.toolbar input[type=search], .toolbar input[name=q] { width: 260px; }
.toolbar .grow { flex: 1; }
.toolbar .count { color: var(--muted); font-size: 13px; }
.acts { display: flex; gap: 14px; justify-content: flex-end; align-items: center; white-space: nowrap; }
.acts form { display: inline; margin: 0; }
.act { background: none; border: 0; padding: 0; font: inherit; font-size: 13px; color: var(--primary); cursor: pointer; }
.act:hover { text-decoration: underline; }
.act.danger { color: var(--danger); }
.act:disabled, .act[disabled], .act.disabled { color: var(--faint); cursor: not-allowed; text-decoration: none; }
th.r, td.r { text-align: right; }

/* ── 待办与动态列表 ───────────────────────────────────────────────────── */
.todo-list > a, .todo-list > div { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line-2); }
.todo-list > :last-child { border-bottom: 0; }
.todo-list > a:hover { background: var(--surface-2); }
.todo-list .ic { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; }
.todo-list .ic .svg-ico { width: 16px; height: 16px; }
.todo-list .ic.warn { background: var(--warn-soft); color: var(--warn); }
.todo-list .ic.danger { background: var(--danger-soft); color: var(--danger); }
.todo-list .ic.neutral { background: var(--line-2); color: var(--muted); }
.todo-list .ic.ok { background: var(--ok-soft); color: var(--ok); }
.todo-list .t { flex: 1; min-width: 0; }
.todo-list .t small { display: block; font-size: 12px; color: var(--muted); }

/* ── 右侧抽屉（新增 / 编辑） ──────────────────────────────────────────── */
.drawer[hidden] { display: none; }
.drawer { position: fixed; inset: 0; z-index: 80; }
.drawer .drawer-mask { position: absolute; inset: 0; background: rgba(15, 23, 42, .32); }
.drawer .drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); background: var(--surface);
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: drawer-in .18s ease-out; }
@keyframes drawer-in { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.drawer header { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.drawer header h3 { margin: 0; font-size: 16px; }
.drawer .x { background: none; border: 0; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.drawer .x:hover { background: var(--line-2); }
.drawer .drawer-body { flex: 1; overflow-y: auto; padding: 4px 22px 20px; }
.drawer .drawer-body > :nth-child(2) { margin-top: 14px; }  /* 第 1 个是隐藏的 csrf 输入 */
.drawer .drawer-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); }
body.drawer-open { overflow: hidden; }

/* ── 页内标签（长页面分区） ───────────────────────────────────────────── */
.ptabs { display: inline-flex; gap: 2px; padding: 3px; background: #e9ebf0; border-radius: 10px; margin-bottom: 16px;
  max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.ptabs [data-tab] { border: 0; background: transparent; padding: 6px 14px; border-radius: 8px; font: inherit;
  font-size: 13.5px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.ptabs [data-tab]:hover { color: var(--ink); }
.ptabs [data-tab].on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(15,23,42,.08); }
[data-panel][hidden] { display: none; }

/* ── 详情页：键值卡 ───────────────────────────────────────────────────── */
.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px 24px; }
.kv-grid .k { color: var(--muted); font-size: 12.5px; }
.kv-grid .v { margin-top: 2px; word-break: break-word; }

/* ── 开发中总览 ───────────────────────────────────────────────────────── */
.dev-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.dev-grid .card { margin: 0; }
.dev-grid ul { list-style: none; margin: 10px 0 0; padding: 0; }
.dev-grid li a { display: flex; align-items: center; gap: 8px; padding: 6px 0; color: var(--ink-2); }
.dev-grid li a:hover { color: var(--primary); }

/* ── 响应式 ───────────────────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .topbar .notice { display: none; }
  .stats, .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(4, minmax(120px, 1fr)); }
}
@media (max-width: 860px) {
  .topbar { padding: 0 14px; gap: 10px; }
  .topbar .logo { display: flex; flex: 1; }
  .topbar .crumbs, .hide-sm { display: none; }
  .menu-btn { display: inline-grid; place-items: center; }
  .tabs-bar { padding: 0 8px; }
  .banner { padding: 9px 16px; }
  .sidebar { position: fixed; z-index: 60; top: 0; left: 0; bottom: 0; height: auto; width: 248px;
    transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .navtoggle:checked ~ .shell .sidebar { transform: none; }
  .navtoggle:checked ~ .shell .scrim { display: block; position: fixed; inset: 0; z-index: 50; background: rgba(15, 23, 42, .4); }
  .content { padding: 16px 16px 40px; }
  h1 { font-size: 19px; }
  .card { padding: 16px; }
  .card.flush > .card-head, .toolbar { padding-left: 14px; padding-right: 14px; }
  .toolbar input[name=q] { width: 100%; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
  .grid, .stats, .engines, .cols-3, .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .cols-2 { grid-template-columns: minmax(0, 1fr) !important; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card.kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0; }
  .kpi-strip > .kpi:nth-child(2n) { border-right: 0; }
  .kpi-strip > .kpi { border-bottom: 1px solid var(--line); margin-bottom: -1px; }
  .kpi-strip > .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }  /* 末行下边线被 overflow 裁掉 */
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 16px; }
  .flow .st:nth-child(4)::before { display: none; }
  .row { flex-direction: column; }
  .row > * { min-width: 0 !important; }
  .card { overflow-x: auto; }
  table { min-width: 560px; }
  .card.flush td:not(:first-child):not(.wrap) { white-space: nowrap; }
  .card.flush td:first-child:not(.num):not(.narrow) { min-width: 180px; }
  .card.flush td.wrap { min-width: 220px; }
  .kpi .k-value { font-size: 22px; }
}
