/* 售币统计系统 · 样式 */
:root {
  color-scheme: light;
  --plane: #f9f9f7;
  --surface: #fcfcfb;
  --surface-2: #f3f2ee;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --line: #e1e0d9;
  --baseline: #c3c2b7;
  --ring: rgba(11, 11, 11, .10);
  --accent: #2a78d6;
  --accent-ink: #ffffff;
  --accent-soft: rgba(42, 120, 214, .10);
  --s1: #2a78d6;
  --s2: #eb6834;
  --s3: #1baf7a;
  --s4: #eda100;
  --s5: #e87ba4;
  --good: #0ca30c;
  --good-text: #006300;
  --warn: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --shadow: 0 1px 2px rgba(11, 11, 11, .04), 0 8px 24px -16px rgba(11, 11, 11, .18);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-w: 232px;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --plane: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #222221;
    --ink: #ffffff;
    --ink-2: #c3c2b7;
    --muted: #898781;
    --line: #2c2c2a;
    --baseline: #383835;
    --ring: rgba(255, 255, 255, .10);
    --accent: #3987e5;
    --accent-ink: #ffffff;
    --accent-soft: rgba(57, 135, 229, .16);
    --s1: #3987e5;
    --s2: #d95926;
    --s3: #199e70;
    --s4: #c98500;
    --s5: #d55181;
    --good-text: #0ca30c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px -20px rgba(0, 0, 0, .7);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --plane: #0d0d0d;
  --surface: #1a1a19;
  --surface-2: #222221;
  --ink: #ffffff;
  --ink-2: #c3c2b7;
  --muted: #898781;
  --line: #2c2c2a;
  --baseline: #383835;
  --ring: rgba(255, 255, 255, .10);
  --accent: #3987e5;
  --accent-ink: #ffffff;
  --accent-soft: rgba(57, 135, 229, .16);
  --s1: #3987e5;
  --s2: #d95926;
  --s3: #199e70;
  --s4: #c98500;
  --s5: #d55181;
  --good-text: #0ca30c;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px -20px rgba(0, 0, 0, .7);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--plane);
  color: var(--ink);
  font: 15px/1.6 system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.i { flex: none; display: inline-block; vertical-align: -3px; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; font-size: .9em; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.inline { display: inline; }
.nowrap { white-space: nowrap; }
.tabular { font-variant-numeric: tabular-nums; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos { color: var(--good-text); }
.neg { color: var(--critical); }

/* 布局 */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex: none;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 18px 12px;
  background: var(--surface);
  border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; padding: 4px 10px 18px; font-weight: 650; font-size: 16px; letter-spacing: .01em; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--ink-2); font-size: 14px; text-decoration: none; }
.nav-item:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.nav-item.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-group-title { padding: 18px 10px 6px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sidebar-foot { margin-top: auto; padding: 12px 10px 4px; border-top: 1px solid var(--line); }
.who { display: flex; flex-direction: column; }
.who-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 14px 28px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 20; }
.page-title { font-size: 17px; font-weight: 650; margin: 0; letter-spacing: .01em; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.content { padding: 24px 28px 40px; width: 100%; max-width: 1280px; }
.content-narrow { max-width: 520px; margin: 0 auto; padding-top: 40px; }
.page-foot { margin-top: auto; padding: 18px 28px 28px; color: var(--muted); font-size: 12px; }
.only-mobile { display: none; }

/* 按钮 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: inherit; font-size: 14px; font-weight: 550; cursor: pointer; text-decoration: none;
  transition: background .15s ease, border-color .15s ease, opacity .15s ease; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { opacity: .9; background: var(--accent); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-danger-ghost { background: transparent; border-color: transparent; color: var(--critical); }
.btn-danger-ghost:hover { background: rgba(208, 59, 59, .10); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.xs { height: 26px; padding: 0 8px; font-size: 12px; border-radius: 6px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.icon-btn { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
  color: var(--ink-2); cursor: pointer; padding: 0; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }

/* 提示与状态 */
.banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 16px;
  background: var(--accent-soft); color: var(--ink); font-size: 13px; border-bottom: 1px solid var(--line); }
.flash { margin: 0 0 18px; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 14px; border: 1px solid var(--line); }
.flash-ok { background: rgba(12, 163, 12, .08); border-color: rgba(12, 163, 12, .35); color: var(--good-text); }
.flash-error { background: rgba(208, 59, 59, .08); border-color: rgba(208, 59, 59, .35); color: var(--critical); }
.notice { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; background: var(--surface-2);
  border: 1px solid var(--line); color: var(--ink-2); }
.notice-warn { background: rgba(250, 178, 25, .12); border-color: rgba(250, 178, 25, .45); color: var(--ink); }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 5px;
  font-size: 11px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.badge.good { background: rgba(12, 163, 12, .12); border-color: rgba(12, 163, 12, .4); color: var(--good-text); }
.badge.info { background: var(--accent-soft); border-color: rgba(42, 120, 214, .4); color: var(--accent); }
.badge.muted { color: var(--muted); }

/* 工具条与筛选 */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar .left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar .right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inline-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pills { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.pill { display: inline-flex; align-items: center; height: 28px; padding: 0 11px; border-radius: 7px; font-size: 13px;
  color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.pill:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.pill.is-active { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.range-note { font-size: 12px; color: var(--muted); }

/* 表单 */
.input, .select, textarea.input { height: 36px; padding: 0 10px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; }
textarea.input { height: auto; padding: 8px 10px; min-height: 72px; resize: vertical; }
.input:focus, .select:focus, textarea.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input-sm { height: 28px; font-size: 13px; padding: 0 8px; }
.select { padding-right: 26px; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 15px, calc(100% - 9px) 15px;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.select.input-sm { background-position: calc(100% - 14px) 11px, calc(100% - 9px) 11px; }
.form { display: flex; flex-direction: column; gap: 14px; }
.form-grid, .form-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field-label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field-hint { font-size: 12px; color: var(--muted); }
.cost-preview { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.field-check { flex-direction: row; align-items: flex-start; gap: 8px; cursor: pointer; }
.field-check input[type="checkbox"] { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.field-check .check-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }

/* 卡片与布局 */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-side { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 18px; overflow: hidden; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card-title { margin: 0; font-size: 14px; font-weight: 650; }
.card-extra { margin-left: auto; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.card > form, .card > .card-body, .card > .notice, .card > .card-pad { padding: 16px 18px; }
/* 表单本身当卡片用时（<form class="card">），内容缩进与卡片一致，标题栏通栏 */
form.card { display: flex; flex-direction: column; gap: 14px; padding: 16px 18px; }
form.card > .card-head { margin: -16px -18px 0; }
form.card > .field-hint { margin: 0; }
form.card > p, form.card > .form-actions, form.card > .key-row { padding: 0; margin: 0; }
.card > .table-wrap { padding: 0; }
/* 直接放在卡片里的内容（图表、段落、列表、键值表、步骤、代码块、按钮行）同样留出内边距，避免文字顶着边框 */
.card > p, .card > dl.kv, .card > dl.kv-inline,
.card > .key-row, .card > .form-actions { padding: 16px 18px; margin: 0; }
.card > p + p { padding-top: 0; }
/* 相邻的几块内容之间不叠加两份上内边距 */
.card > p + .key-row, .card > p + dl.kv, .card > p + dl.kv-inline,
.card > p + ol.steps, .card > p + .form-actions,
.card > .kv + .form-actions, .card > .key-row + .form-actions { padding-top: 0; }
.card > p + .chart { padding-top: 2px; }
.card > ol.steps { padding: 16px 18px 16px 38px; }
.card > .chart { padding: 16px 18px 12px; }
.card > .chart-caption { padding: 0 18px 16px; margin: 0; }
.card > pre.code-block { margin: 0 18px 16px; }
.card > .card-head + pre.code-block { margin-top: 16px; }
.card > p + pre.code-block { margin-top: 4px; }
.card > pre.code-block + pre.code-block { margin-top: 12px; }
.card > .feed { padding: 6px 18px; margin: 0; }
.card > .feed > .feed-item:first-child { padding-top: 10px; }
.kv { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px 12px; font-size: 13px; }
.kv dt, .kv-inline dt { color: var(--muted); margin: 0; }
.kv dd { margin: 0; word-break: break-all; }
.kv-inline { display: flex; gap: 6px; font-size: 13px; }
.kv-inline dd { margin: 0 12px 0 0; }

/* 指标块 */
.tiles, .tiles-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.tile { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow); min-width: 0; }
.tile-label { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; padding-right: 24px; }
.tile-value { margin-top: 6px; font-size: 23px; font-weight: 650; letter-spacing: -.01em; line-height: 1.25;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-hint { margin-top: 4px; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-icon { position: absolute; top: 12px; right: 12px; color: var(--muted); opacity: .8; }
.tile-good .tile-value { color: var(--good-text); }
.tile-bad .tile-value { color: var(--critical); }

/* 图表 */
/* 高度不再写死在这里：由 JS 按 data-height 设置（多显示器宽度/移动端才缩放），
   否则 SVG 按 240px 画、容器只有 220px，下半截会被卡片 overflow:hidden 裁掉 */
.chart { width: 100%; min-height: 140px; position: relative; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart-caption { font-size: 12px; color: var(--muted); margin-top: 6px; }
.chart-tip { position: absolute; pointer-events: none; z-index: 5; padding: 6px 9px; border-radius: 7px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  font-size: 12px; color: var(--ink); white-space: nowrap; transform: translate(-50%, -125%);
  opacity: 0; transition: opacity .08s ease; }
.chart-tip.on { opacity: 1; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); margin-bottom: 8px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend-note { font-size: 12px; color: var(--muted); }

/* 表格 */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: none; }
.table-compact th, .table-compact td { padding: 7px 10px; font-size: 13px; }
.table .cell-sub { display: block; font-size: 12px; color: var(--muted); }
.table th.num, .table td.num { text-align: right; }
.row-actions { text-align: right; white-space: nowrap; }
.row-actions > * { vertical-align: middle; }
.row-actions > * + * { margin-left: 4px; }
.icon-link { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px;
  border-radius: 6px; color: var(--ink-2); border: none; background: transparent; cursor: pointer; padding: 0; }
.icon-link:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.icon-link.danger:hover { background: rgba(208, 59, 59, .10); color: var(--critical); }

/* 平台色点 */
.plat-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; vertical-align: 1px; }
.plat-web { background: var(--s1); }
.plat-miniprogram { background: var(--s3); }
.plat-qqbot { background: var(--s2); }
.plat-other { background: var(--s4); }

/* 门店卡片 */
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.store-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; text-decoration: none; color: inherit; }
a.store-card:hover { border-color: var(--baseline); text-decoration: none; }
.store-card-head { display: flex; align-items: center; gap: 8px; }
.store-name { font-size: 15px; font-weight: 650; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.store-card-head .badge { margin-left: auto; }
.store-note { margin: 4px 0 0; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.store-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.metric { min-width: 0; }
.metric-label { font-size: 11px; color: var(--muted); }
.metric-value { font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.store-card-foot { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line);
  font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.store-card-foot .link { margin-left: auto; }

/* 空状态 */
.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty-icon { color: var(--baseline); margin-bottom: 10px; }
.empty-title { font-size: 15px; font-weight: 650; color: var(--ink); }
.empty-desc { font-size: 13px; margin: 4px 0 0; }
.empty-action { margin-top: 16px; }

/* 上报密钥 */
.key { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 5px 10px;
  border: 1px dashed var(--baseline); border-radius: 7px; background: var(--surface-2);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; color: var(--ink-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.key-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* 分页 */
.pager { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 14px 0 0; }
.pager-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 30px;
  padding: 0 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface);
  color: var(--ink-2); font-size: 13px; text-decoration: none; }
.pager-btn:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.pager-btn.is-current { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.pager-btn.is-disabled { opacity: .4; pointer-events: none; }
.pager-gap { color: var(--muted); font-size: 13px; }
.pager-total { margin-left: auto; font-size: 12px; color: var(--muted); }

/* 动态列表 */
.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.feed-item:last-child { border-bottom: none; }
.feed-main { min-width: 0; flex: 1; }
.feed-main strong { font-size: 13px; font-weight: 600; }
.feed-meta { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 步骤与代码 */
.steps { margin: 0; padding-left: 20px; font-size: 13px; color: var(--ink-2); display: flex; flex-direction: column; gap: 6px; }
.steps code { font-size: 12px; }
.code-block { margin: 0; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2);
  border: 1px solid var(--line); font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px; line-height: 1.55; overflow: auto; max-height: 420px; color: var(--ink-2); }
.link { color: var(--accent); }

/* 登录/注册/错误页 */
.auth-body { min-height: 100vh; background: var(--plane); }
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 28px 16px; }
.auth-brand { display: flex; align-items: center; gap: 9px; font-size: 17px; font-weight: 650; margin-bottom: 20px; }
.auth-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.auth-title { margin: 0; font-size: 19px; font-weight: 650; letter-spacing: -.01em; }
.auth-sub { margin: 4px 0 18px; font-size: 13px; color: var(--muted); }
.auth-alt { margin: 16px 0 0; font-size: 13px; color: var(--muted); text-align: center; }
.error-card { text-align: center; }
.error-code { font-size: 34px; font-weight: 700; letter-spacing: -.02em; margin-bottom: 6px; }
.error-desc { font-size: 14px; color: var(--ink-2); margin: 0 0 20px; }
.auth-foot { margin-top: 18px; font-size: 12px; color: var(--muted); }

/* 响应式 */
@media (max-width: 1080px) {
  .grid-side { grid-template-columns: minmax(0, 1fr); }
  .tiles, .tiles-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  :root { --sidebar-w: 100%; }
  .only-mobile { display: inline-flex; }
  .shell { display: block; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 264px; z-index: 60;
    transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow); }
  body.sidebar-open .sidebar { transform: none; }
  .sidebar-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 55; opacity: 0;
    pointer-events: none; transition: opacity .2s ease; }
  body.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
  .topbar { padding: 10px 16px; }
  .content { padding: 16px 16px 32px; }
  .page-foot { padding: 16px; }
  .grid-2, .form-grid, .form-grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  body { font-size: 14px; }
  .tiles, .tiles-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { padding: 12px; }
  .tile-value { font-size: 19px; }
  .store-grid { grid-template-columns: minmax(0, 1fr); }
  .store-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .toolbar .right { margin-left: 0; }
  .pills { width: 100%; overflow-x: auto; }
  .kv { grid-template-columns: 84px minmax(0, 1fr); }
  .card > form, .card > .card-body, .card > .notice, .card > .card-pad { padding: 14px; }
  .card > p, .card > dl.kv, .card > dl.kv-inline,
  .card > .key-row, .card > .form-actions { padding: 14px; }
  .card > ol.steps { padding: 14px 14px 14px 34px; }
  .card > .chart { padding: 14px 14px 10px; }
  .card > .chart-caption { padding: 0 14px 14px; }
  .card > pre.code-block { margin: 0 14px 14px; }
  .card > .card-head + pre.code-block { margin-top: 14px; }
  .card > .feed { padding: 4px 14px; }
  form.card { padding: 14px; }
  form.card > .card-head { margin: -14px -14px 0; }
  .card-head { padding: 12px 14px; }
  .auth-card { padding: 20px; }
  .table th, .table td { padding: 8px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}


/* 兼容别名 */
.toolbar-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.toolbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn-block { width: 100%; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-xs { height: 26px; padding: 0 8px; font-size: 12px; border-radius: 6px; }
.brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 620px) {
  .toolbar-left, .toolbar-right { margin-left: 0; width: 100%; }
  .btn-xs { height: 30px; padding: 0 10px; font-size: 13px; }
}
/* 辅助 */
.hide-xs {}
.sidebar-backdrop { display: none; }
.cs-toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 8px); z-index: 200;
  padding: 8px 14px; border-radius: 8px; background: var(--ink); color: var(--plane);
  font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .16s ease, transform .16s ease; }
.cs-toast.on { opacity: .95; transform: translate(-50%, 0); }
@media (max-width: 860px) { .sidebar-backdrop { display: block; } }
@media (max-width: 480px) { .hide-xs { display: none; } }
@media print {
  .sidebar, .topbar, .toolbar, .page-foot, .banner { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; break-inside: avoid; }
}
