/* ===========================================================
   智慧加油站管理系统 · 组件与版式样式
   依赖 tokens.css（所有颜色/字号/间距/圆角/阴影/层级只引用变量）
   Product 寄存器 · 原生 HTML/CSS，无构建、无 CDN
   =========================================================== */

/* ---------- 0. Reset 与基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
h1, h2, h3, h4, p, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }

body {
  font-family: var(--font-sans);
  font-size: var(--fs-4);
  line-height: var(--lh-body);
  letter-spacing: var(--ls-cjk);
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* 数字统一等宽 + 小数点对齐（账本对齐栏） */
.num, .amount, .mono, td.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: var(--ls-numeric);
}
.amount, td.num { text-align: right; }

/* 拉丁全大写 */
.caps { letter-spacing: var(--ls-caps); }

/* SVG 图标三档 */
.icon { width: 20px; height: 20px; flex: 0 0 auto; display: inline-block; vertical-align: -0.15em; }
.icon--sm { width: 16px; height: 16px; }
.icon--lg { width: 24px; height: 24px; }
.icon use, .icon path { pointer-events: none; }

/* 图标 sprite 宿主：不占布局 */
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- 1. 通用排版 ---------- */
.h1 { font-size: var(--fs-7); line-height: var(--lh-title); font-weight: var(--fw-medium); }
.h2 { font-size: var(--fs-6); line-height: var(--lh-title); font-weight: var(--fw-medium); }
.h3 { font-size: var(--fs-5); line-height: var(--lh-title); font-weight: var(--fw-medium); }
.t-muted { color: var(--muted); }
.t-fg2  { color: var(--fg-2); }
.t-sm   { font-size: var(--fs-3); }
.t-xs   { font-size: var(--fs-2); }
.t-micro{ font-size: var(--fs-1); }

/* ---------- 2. 按钮：5 态 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 44px; padding: var(--s-2) var(--s-4);
  border-radius: var(--r-md); border: 1px solid transparent;
  font-size: var(--fs-3); font-weight: var(--fw-medium);
  background: var(--raised); color: var(--fg);
  transition: background-color var(--motion-fast) var(--ease),
              color var(--motion-fast) var(--ease),
              transform var(--motion-fast) var(--ease),
              box-shadow var(--motion-fast) var(--ease);
}
.btn:hover { background: var(--border); }
.btn:active { transform: scale(.98); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }

.btn--primary { background: var(--accent); color: var(--accent-on); }
.btn--primary:hover { background: var(--accent-hover); }
.btn--secondary { background: var(--surface); color: var(--fg); border-color: var(--border); }
.btn--secondary:hover { background: var(--raised); }
.btn--ghost { background: transparent; color: var(--fg-2); }
.btn--ghost:hover { background: var(--raised); }
.btn--danger { background: var(--danger); color: var(--surface); }
.btn--danger:hover { background: var(--danger); opacity: .9; }
.btn--sm { min-height: 36px; padding: var(--s-1) var(--s-3); font-size: var(--fs-2); }
.btn--block { width: 100%; }
.btn--icon { padding: var(--s-2); width: 44px; min-height: 44px; }

/* 按钮内 spinner */
.spinner {
  width: 16px; height: 16px; border-radius: var(--r-full);
  border: 2px solid currentColor; border-top-color: transparent;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 3. 表单 ---------- */
.field { display: flex; flex-direction: column; gap: var(--s-2); }
.field > label { font-size: var(--fs-3); color: var(--fg-2); font-weight: var(--fw-medium); }
.field__req { color: var(--danger); }
.input, .select {
  width: 100%; min-height: 44px; padding: var(--s-2) var(--s-3);
  background: var(--surface); color: var(--fg);
  border: 1px solid var(--border); border-radius: var(--r-md);
  font-size: var(--fs-4);
  transition: border-color var(--motion-fast) var(--ease), box-shadow var(--motion-fast) var(--ease);
}
.input::placeholder { color: var(--muted); }
.input:hover, .select:hover { border-color: var(--muted); }
.input:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-halo); }
.input[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--danger); }
.field__err { display: none; align-items: center; gap: var(--s-2); color: var(--danger); font-size: var(--fs-2); }
.field__err.is-on { display: flex; }
.field__err .icon { color: var(--danger); }

/* 弹窗表单：三列网格，日期/长文本占整行 */
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-3) var(--s-4); }
.form-grid .field--full { grid-column: 1 / -1; }
.form-section-title {
  grid-column: 1 / -1; font-size: var(--fs-3); font-weight: var(--fw-medium);
  color: var(--fg-2); margin: var(--s-2) 0 0; padding-bottom: var(--s-1);
  border-bottom: 1px solid var(--border);
}
.field__suffix {
  position: absolute; right: var(--s-3); top: 50%; transform: translateY(-50%);
  font-size: var(--fs-2); color: var(--muted); pointer-events: none;
}
.field--has-suffix { position: relative; }
.field--has-suffix .input { padding-right: var(--s-8); }

/* 复选组：星期 / 支付方式，横向换行排列 */
.check-group { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); }
.check-item { display: inline-flex; align-items: center; gap: var(--s-1); font-size: var(--fs-3); color: var(--fg-2); }
.check-item input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); }

/* 多档梯度编辑器：行内两数字框 + 删除，底部加档 */
.tiers-editor { display: flex; flex-direction: column; gap: var(--s-2); }
.tier-row { display: flex; gap: var(--s-2); align-items: center; }
.tier-row .input { flex: 1; min-width: 0; }
.tier-add { align-self: flex-start; }

/* 角色权限清单：多列排布，分组标题通栏 */
.perm-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 18px; }
.perm-grid .perm-group-title { grid-column: 1 / -1; margin: 10px 0 2px; font-size: var(--fs-3); color: var(--muted); }

/* ---------- 4. 状态签：灯形 + 文字（信息不只靠颜色） ---------- */
.status {
  display: inline-flex; align-items: center; white-space: nowrap;
  font-size: var(--fs-2); padding: var(--s-1) var(--s-2);
  border-radius: var(--r-sm);
}
.status-dot {
  display: inline-block; width: 6px; height: 6px; flex: 0 0 auto;
  border-radius: var(--r-full); margin-right: var(--s-2);
  background: currentColor;
}
.status--success { color: var(--success); background: var(--success-soft); }
.status--warn    { color: var(--warn);    background: var(--warn-soft); }
.status--danger  { color: var(--danger);  background: var(--danger-soft); }
.status--info    { color: var(--info);    background: var(--info-soft); }
.status--muted   { color: var(--muted);   background: var(--raised); }

/* 涨跌（红涨绿跌，必带箭头） */
.trend--up   { color: var(--up); }
.trend--down { color: var(--down); }
.trend { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: var(--fs-3); }

/* ---------- 5. 卡片 / 面板 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-6);
}
.card--flat { border: 0; box-shadow: var(--elev-ring); }
.panel-title { font-size: var(--fs-3); color: var(--muted); font-weight: var(--fw-regular); }

/* ---------- 6. 表格 ---------- */
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-4); }
.table thead th {
  position: sticky; top: 0; z-index: var(--z-sticky);
  background: var(--surface); color: var(--muted);
  font-size: var(--fs-2); font-weight: var(--fw-regular); text-align: left;
  padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table tbody td { padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--border); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { cursor: pointer; transition: background-color var(--motion-fast) var(--ease); }
.table tbody tr:hover { background: var(--raised); }
.table tbody tr[aria-selected="true"] { background: var(--accent-soft); }
.table .num, .table .amount { white-space: nowrap; }
.table__ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 筛选条 */
.filterbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3);
  margin-bottom: var(--s-4);
}
.filterbar .input, .filterbar .select { width: auto; min-width: 140px; }
.filterbar__spacer { flex: 1 1 auto; }

/* ---------- 7. 五态：骨架 / 空 / 错误 ---------- */
.state-view { display: none; padding: var(--s-8) var(--s-4); }
.state-scope[data-state="loading"] .data-view,
.state-scope[data-state="empty"] .data-view,
.state-scope[data-state="error"] .data-view { display: none !important; }
.state-scope[data-state="loading"] .state-loading,
.state-scope[data-state="empty"] .state-empty,
.state-scope[data-state="error"] .state-error { display: flex; }
.state-loading, .state-empty, .state-error {
  flex-direction: column; align-items: center; justify-content: center;
  gap: var(--s-4); min-height: 240px; text-align: center;
}
.state-empty, .state-error { color: var(--muted); }
.state-empty .icon, .state-error .icon { color: var(--muted); width: 32px; height: 32px; }
.state-error .icon { color: var(--danger); }
.state-title { font-size: var(--fs-4); color: var(--fg-2); }
.state-desc { font-size: var(--fs-3); color: var(--muted); }

/* 骨架行 */
.skeleton { width: 100%; }
.skel-row { display: flex; gap: var(--s-4); padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--border); }
.skel-bar {
  height: 14px; border-radius: var(--r-sm); background: var(--raised);
  animation: skelPulse 1.2s ease-in-out infinite;
}
@keyframes skelPulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }

/* ---------- 8. KPI 带 ---------- */
.kpi-band {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden;
}
.kpi { padding: var(--s-6); border-right: 1px solid var(--border); }
.kpi:last-child { border-right: 0; }
.kpi__label { font-size: var(--fs-3); color: var(--muted); }
.kpi__value { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: var(--fs-7); line-height: var(--lh-title); font-weight: var(--fw-medium); margin-top: var(--s-2); }
.kpi__value--hero { color: var(--fg); }
.kpi__foot { display: flex; align-items: center; gap: var(--s-2); margin-top: var(--s-2); }

/* ---------- 9. 概览：链路 + 趋势 + 待办 ---------- */
.grid-split { display: grid; grid-template-columns: 2fr 1fr; gap: var(--gap); align-items: start; }
.chain { display: flex; align-items: stretch; gap: var(--s-2); }
.chain__node { flex: 1; background: var(--bg); border-radius: var(--r-md); padding: var(--s-4); min-width: 0; }
.chain__node--accent { background: var(--accent-soft); }
.chain__label { font-size: var(--fs-2); color: var(--muted); }
.chain__value { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: var(--fs-5); font-weight: var(--fw-medium); margin-top: var(--s-2); }
.chain__amt { font-family: var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; font-size: var(--fs-3); margin-top: var(--s-1); }
.chain__arrow { display: flex; align-items: center; color: var(--muted); }

/* 趋势折线（纯 CSS/SVG，单色 accent，无渐变） */
.trend-chart { width: 100%; height: auto; display: block; }
.trend-table { width: 100%; border-collapse: collapse; margin-top: var(--s-4); font-size: var(--fs-1); }
.trend-table th, .trend-table td { padding: var(--s-1) var(--s-2); border-bottom: 1px solid var(--border); text-align: right; }
.trend-table th:first-child, .trend-table td:first-child { text-align: left; }

.todo-list { display: flex; flex-direction: column; }
.todo-item { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) 0; border-bottom: 1px solid var(--border); }
.todo-item:last-child { border-bottom: 0; }
.todo-item__grow { flex: 1; min-width: 0; }
.todo-item__title { font-size: var(--fs-3); }
.todo-item__meta { font-size: var(--fs-2); color: var(--muted); }

/* ---------- 10. 会员等级权益条 ---------- */
.tier-bar { display: flex; gap: var(--s-3); margin-bottom: var(--s-6); flex-wrap: wrap; }
.tier-chip { display: flex; align-items: center; gap: var(--s-2); background: var(--bg); border-radius: var(--r-md); padding: var(--s-2) var(--s-3); font-size: var(--fs-2); }
.tier-chip b { font-weight: var(--fw-medium); }

/* 会员分栏 */
.member-layout { display: grid; grid-template-columns: 1fr 1.35fr; gap: var(--gap); align-items: start; }
.member-list { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.member-row { display: flex; align-items: center; gap: var(--s-3); width: 100%; padding: var(--s-3) var(--s-4); border: 0; border-bottom: 1px solid var(--border); background: var(--surface); text-align: left; transition: background-color var(--motion-fast) var(--ease); }
.member-row:last-child { border-bottom: 0; }
.member-row:hover { background: var(--raised); }
.member-row[aria-selected="true"] { background: var(--accent-soft); }
.member-row__grow { flex: 1; min-width: 0; }
.member-row__name { font-size: var(--fs-3); }
.member-row__sub { font-size: var(--fs-2); color: var(--muted); }
.member-row__bal { font-family: var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; }

/* ---------- 11. Admin 骨架：侧栏 + 顶栏 + 主区 ---------- */
.admin-shell { min-height: 100vh; display: flex; }
.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-6) var(--s-4); border-bottom: 1px solid var(--border); }
.brand__mark { width: 32px; height: 32px; border-radius: var(--r-md); background: var(--accent); color: var(--accent-on); display: flex; align-items: center; justify-content: center; }
.brand__text { font-size: var(--fs-4); font-weight: var(--fw-medium); }
.brand__sub { font-size: var(--fs-1); color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: var(--s-1); padding: var(--s-4) var(--s-2); flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.nav__label { padding: 10px 12px 4px; font-size: 11px; color: var(--muted); letter-spacing: .06em; }
.nav__label:first-child { padding-top: 2px; }
.nav__item {
  display: flex; align-items: center; gap: var(--s-3); width: 100%;
  min-height: 44px; padding: var(--s-2) var(--s-3);
  border: 0; border-radius: var(--r-md); background: transparent;
  color: var(--fg-2); font-size: var(--fs-3); text-align: left;
  transition: background-color var(--motion-fast) var(--ease), color var(--motion-fast) var(--ease);
}
.nav__item:hover { background: var(--raised); }
.nav__item[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: var(--fw-medium); }
.nav__foot { padding: var(--s-4); border-top: 1px solid var(--border); font-size: var(--fs-2); color: var(--muted); }

.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: var(--s-4);
  padding: var(--s-3) var(--s-6); background: var(--surface);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: var(--z-sticky);
}
.topbar__title { font-size: var(--fs-5); font-weight: var(--fw-medium); }
.topbar__search { flex: 1; max-width: 360px; }
.topbar__spacer { flex: 1; }
.topbar__station { display: flex; align-items: center; gap: var(--s-2); font-size: var(--fs-3); color: var(--fg-2); }
.topbar__demo { display: flex; align-items: center; gap: var(--s-2); font-size: var(--fs-2); color: var(--muted); }
.topbar__demo .select { min-height: 36px; font-size: var(--fs-2); width: auto; }

.admin-content { padding: var(--s-6); max-width: var(--container); width: 100%; margin: 0 auto; }
.section { display: none; }
.section.is-active { display: block; animation: sectionIn var(--motion-base) var(--ease); }
@keyframes sectionIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.section__head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-4); margin-bottom: var(--s-6); }
.section__title { font-size: var(--fs-6); font-weight: var(--fw-medium); line-height: var(--lh-title); }
.section__desc { font-size: var(--fs-3); color: var(--muted); margin-top: var(--s-1); }
.stack { display: flex; flex-direction: column; gap: var(--gap); }

/* 弹窗内表单：两列网格排布，长内容/清单/分隔线占整行 */
.dialog-stack { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3) var(--s-4); }
.dialog-stack > :not(.field) { grid-column: 1 / -1; }
.dialog-stack .field--full { grid-column: 1 / -1; }

/* 移动端侧栏触发按钮（>1024 隐藏） */
.sidebar-toggle { display: none; }

/* ---------- 12. 抽屉（从右滑入）---------- */
/* 关闭态必须彻底退出命中测试：opacity:0 的元素照样会吞点击 */
.overlay { position: fixed; inset: 0; background: var(--fg); z-index: var(--z-overlay); opacity: 0; pointer-events: none; transition: opacity var(--motion-base) var(--ease); }
.overlay.is-open { opacity: .45; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: min(480px, 100vw);
  background: var(--surface); z-index: var(--z-modal);
  transform: translateX(100%); transition: transform var(--motion-base) var(--ease);
  display: flex; flex-direction: column; box-shadow: var(--elev-raised);
  pointer-events: none;
}
.drawer.is-open { transform: none; pointer-events: auto; }
.drawer__head { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-6); border-bottom: 1px solid var(--border); }
.drawer__head .h2 { flex: 1; }
.drawer__body { padding: var(--s-6); overflow-y: auto; flex: 1; }
.drawer__foot { padding: var(--s-4) var(--s-6); border-top: 1px solid var(--border); display: flex; gap: var(--s-3); justify-content: flex-end; }

/* 详情键值表 */
.kv { display: grid; grid-template-columns: 120px 1fr; gap: var(--s-3) var(--s-4); font-size: var(--fs-3); }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; }
.kv dd.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.divider { height: 1px; background: var(--border); margin: var(--s-6) 0; }

/* ---------- 13. 居中 Modal（确认弹窗 + 焦点陷阱）---------- */
.modal {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -46%) scale(.98);
  width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 56px); background: var(--surface);
  border-radius: var(--r-lg); box-shadow: var(--elev-raised); z-index: var(--z-modal);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity var(--motion-base) var(--ease), transform var(--motion-base) var(--ease), visibility 0s linear var(--motion-base);
}
.modal.is-open { opacity: 1; transform: translate(-50%, -50%) scale(1); visibility: visible; pointer-events: auto; transition: opacity var(--motion-base) var(--ease), transform var(--motion-base) var(--ease), visibility 0s; }
.modal__body { padding: var(--s-6); overflow-y: auto; max-height: calc(100vh - 140px); }
.modal__title { font-size: var(--fs-5); font-weight: var(--fw-medium); }
.modal__desc { font-size: var(--fs-3); color: var(--muted); margin-top: var(--s-2); }
.modal__foot { padding: var(--s-4) var(--s-6); border-top: 1px solid var(--border); display: flex; gap: var(--s-3); justify-content: flex-end; }

/* ---------- 13b. 登录覆盖层（真实模式无 token 时阻断后台，不可点外部/Esc 关闭） ---------- */
.auth-gate {
  position: fixed; inset: 0; z-index: var(--z-modal);
  display: flex; align-items: center; justify-content: center;
  padding: var(--s-4); background: var(--bg);
}
.auth-gate[hidden] { display: none; }
.auth-gate__panel {
  width: min(420px, 100%); padding: var(--s-8);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--elev-raised);
}
.auth-gate__panel .login-desc { margin-bottom: var(--s-6); }

/* ---------- 14. Toast（全局宿主，z-toast）---------- */
.toast-host { position: fixed; top: var(--s-6); left: 50%; transform: translateX(-50%); z-index: var(--z-toast); display: flex; flex-direction: column; gap: var(--s-2); pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: var(--s-2);
  padding: var(--s-3) var(--s-4); background: var(--fg); color: var(--surface);
  border-radius: var(--r-md); box-shadow: var(--elev-raised); font-size: var(--fs-3);
  animation: toastIn var(--motion-base) var(--ease);
}
.toast--error { background: var(--danger); color: var(--surface); }
.toast--success { background: var(--success); color: var(--surface); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- 15. 分段控件 ---------- */
.segment { display: flex; gap: var(--s-1); background: var(--raised); border-radius: var(--r-md); padding: var(--s-1); overflow-x: auto; }
.segment__btn {
  flex: 1 0 auto; min-height: 36px; padding: var(--s-2) var(--s-3);
  border: 0; border-radius: var(--r-sm); background: transparent; color: var(--fg-2);
  font-size: var(--fs-3); white-space: nowrap;
  transition: background-color var(--motion-fast) var(--ease), color var(--motion-fast) var(--ease);
}
.segment__btn:hover { background: var(--border); }
.segment__btn[aria-pressed="true"] { background: var(--surface); color: var(--accent); font-weight: var(--fw-medium); box-shadow: var(--elev-ring); }

/* ---------- 15b. 报表区：左侧报表类型 + 主体 ---------- */
.rep-layout { display: flex; gap: var(--gap); margin-top: 16px; align-items: flex-start; }
.rep-side { flex: 0 0 168px; display: flex; flex-direction: column; gap: var(--s-1); }
.rep-side__btn {
  text-align: left; padding: var(--s-2) var(--s-3); border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--fg-2); font-size: var(--fs-3); white-space: nowrap;
  transition: background-color var(--motion-fast) var(--ease), color var(--motion-fast) var(--ease);
}
.rep-side__btn:hover { background: var(--border); }
.rep-side__btn[aria-pressed="true"] { background: var(--surface); color: var(--accent); font-weight: var(--fw-medium); box-shadow: var(--elev-ring); }
.rep-main { flex: 1 1 auto; min-width: 0; }
@media (max-width: 720px) {
  .rep-layout { flex-direction: column; }
  .rep-side { flex: 1 1 auto; width: 100%; flex-direction: row; flex-wrap: wrap; }
}

/* ---------- 16. H5 骨架：设备居中 + 底部 tab ---------- */
.h5-stage { min-height: 100vh; display: flex; justify-content: center; background: var(--bg); }
.h5-device {
  width: 100%; max-width: var(--container-h5); min-height: 100vh;
  background: var(--bg); position: relative;
  display: flex; flex-direction: column;
  border-left: 1px solid var(--border); border-right: 1px solid var(--border);
}
.h5-header { padding: var(--s-6) var(--s-4) var(--s-4); background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: var(--z-sticky); }
.h5-header__row { display: flex; align-items: center; gap: var(--s-3); }
.h5-header__title { font-size: var(--fs-5); font-weight: var(--fw-medium); flex: 1; }
.h5-body { flex: 1; padding: var(--s-4); padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
.h5-tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: var(--container-h5);
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--surface); border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom); z-index: var(--z-sticky);
}
.h5-tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-1);
  min-height: 56px; border: 0; background: transparent; color: var(--muted);
  font-size: var(--fs-1);
  transition: color var(--motion-fast) var(--ease);
}
.h5-tab[aria-current="page"] { color: var(--accent); font-weight: var(--fw-medium); }
.h5-tab:hover { color: var(--fg-2); }
.h5-screen { display: none; animation: sectionIn var(--motion-base) var(--ease); }
.h5-screen.is-active { display: block; }

/* ---------- 17. H5 各屏 ---------- */
/* ① 登录 */
.login-brand { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-6); }
.login-brand__mark { width: 44px; height: 44px; border-radius: var(--r-md); background: var(--accent); color: var(--accent-on); display: flex; align-items: center; justify-content: center; }
.login-title { font-size: var(--fs-6); font-weight: var(--fw-medium); line-height: var(--lh-title); }
.login-desc { font-size: var(--fs-3); color: var(--muted); margin-top: var(--s-2); margin-bottom: var(--s-8); }
.login-form { display: flex; flex-direction: column; gap: var(--s-6); }

/* ② 站务概览 */
.hero-amount {
  background: var(--accent-soft); border-radius: var(--r-lg);
  padding: var(--s-6); text-align: left;
}
.hero-amount__label { font-size: var(--fs-3); color: var(--fg-2); }
.hero-amount__value { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: var(--fs-8); line-height: var(--lh-title); font-weight: var(--fw-medium); color: var(--fg); margin-top: var(--s-2); }
.hero-amount__sub { font-size: var(--fs-2); color: var(--muted); margin-top: var(--s-2); }
.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-2); margin-top: var(--s-4); }
.stat-box { min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s-3); text-align: center; }
.stat-box__label { font-size: var(--fs-1); color: var(--muted); }
.stat-box__value { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: var(--fs-6); font-weight: var(--fw-medium); margin-top: var(--s-1); }
.quick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-2); margin-top: var(--s-4); }
.quick-btn { min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-2); min-height: 72px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); color: var(--fg-2); font-size: var(--fs-2); }
.quick-btn:hover { background: var(--raised); }
.quick-btn .icon { color: var(--accent); }
.pump-status-list { display: flex; flex-direction: column; margin-top: var(--s-2); }
.pump-status-row { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) 0; border-bottom: 1px solid var(--border); }
.pump-status-row:last-child { border-bottom: 0; }
.pump-status-row__grow { flex: 1; }
.pump-status-row__amt { font-family: var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; }

/* ③ 加油订单 */
.filter-block { display: flex; flex-direction: column; gap: var(--s-3); margin-bottom: var(--s-4); }
.order-list { display: flex; flex-direction: column; }
.order-card { display: flex; flex-direction: column; gap: var(--s-2); width: 100%; text-align: left; padding: var(--s-4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); margin-bottom: var(--s-2); transition: background-color var(--motion-fast) var(--ease); }
.order-card:hover { background: var(--raised); }
.order-card__top { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }
.order-card__amt { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: var(--fs-5); font-weight: var(--fw-medium); }
.order-card__meta { display: flex; align-items: center; gap: var(--s-3); font-size: var(--fs-2); color: var(--muted); }
.order-card__time { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ④ 会员与收款 */
.member-hero { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s-6); }
.member-hero__phone { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: var(--fs-4); }
.member-hero__bal { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: var(--fs-8); font-weight: var(--fw-medium); line-height: var(--lh-title); margin-top: var(--s-2); }
.member-hero__meta { display: flex; gap: var(--s-4); margin-top: var(--s-3); font-size: var(--fs-3); color: var(--muted); }
.pay-methods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-2); }
.pay-method { min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-1); min-height: 56px; padding: var(--s-2); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); color: var(--fg-2); font-size: var(--fs-2); }
.pay-method:hover { background: var(--raised); }
.pay-method[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

/* ---------- 18. ActionSheet（底部弹层，H5 订单详情）---------- */
.sheet {
  position: fixed; left: 50%; bottom: 0; transform: translate(-50%, 100%);
  width: 100%; max-width: var(--container-h5);
  background: var(--surface); border-radius: var(--r-lg) var(--r-lg) 0 0;
  z-index: var(--z-modal); transition: transform var(--motion-base) var(--ease);
  box-shadow: var(--elev-raised); padding-bottom: env(safe-area-inset-bottom);
  pointer-events: none;
}
.sheet.is-open { transform: translate(-50%, 0); pointer-events: auto; }
.sheet__grab { width: 36px; height: 4px; border-radius: var(--r-full); background: var(--border); margin: var(--s-3) auto; }
.sheet__body { padding: var(--s-2) var(--s-6) var(--s-6); }

/* ---------- 18b. 快速买单（表单型，全走 token） ---------- */
.quickpay-launch {
  display: flex; align-items: center; gap: var(--s-6);
  background: var(--accent-soft); border-radius: var(--r-lg);
  padding: var(--s-6);
}
.quickpay-launch__text { flex: 1; min-width: 0; }
.quickpay-launch__title { font-size: var(--fs-5); font-weight: var(--fw-medium); }
.quickpay-launch__desc { font-size: var(--fs-3); color: var(--fg-2); margin-top: var(--s-1); }

.qp-form { display: flex; flex-direction: column; gap: var(--s-6); }
.qp-fieldset { border: 0; padding: 0; margin: 0; }
.qp-fieldset legend { font-size: var(--fs-3); color: var(--fg-2); font-weight: var(--fw-medium); margin-bottom: var(--s-3); }
.qp-pay { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s-2); }
.qp-member-card {
  display: flex; align-items: center; gap: var(--s-2);
  background: var(--accent-soft); color: var(--fg-2);
  border-radius: var(--r-md); padding: var(--s-3);
  font-size: var(--fs-2); margin-top: var(--s-1);
}
.qp-member-card[hidden] { display: none; }

/* 大号金额输入：数字等宽、数字键盘友好、账本对齐栏 */
.qp-amount {
  display: flex; align-items: baseline; gap: var(--s-2);
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); padding: var(--s-3) var(--s-4);
  transition: border-color var(--motion-fast) var(--ease), box-shadow var(--motion-fast) var(--ease);
}
.qp-amount:hover { border-color: var(--muted); }
.qp-amount:focus-within { border-color: var(--accent); box-shadow: var(--focus-halo); }
.qp-amount__sign { font-family: var(--font-mono); font-size: var(--fs-6); color: var(--muted); }
.qp-amount__input {
  flex: 1; min-width: 0; border: 0; outline: none; background: transparent;
  color: var(--fg); font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: var(--fs-8); line-height: 1.2;
}
.qp-amount__input::placeholder { color: var(--muted); }

/* H5 快捷入口 4 枚：2×2，触控目标 >=44px */
.quick-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.quick-btn--accent { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); font-weight: var(--fw-medium); }

/* ---------- 19. 入口跳转页 ---------- */
.entry { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: var(--s-6); }
.entry__card { width: 100%; max-width: 640px; }
.entry__brand { display: flex; align-items: center; gap: var(--s-3); }
.entry__mark { width: 44px; height: 44px; border-radius: var(--r-md); background: var(--accent); color: var(--accent-on); display: flex; align-items: center; justify-content: center; }
.entry__title { font-size: var(--fs-7); font-weight: var(--fw-medium); line-height: var(--lh-title); margin-top: var(--s-6); }
.entry__desc { font-size: var(--fs-4); color: var(--muted); margin-top: var(--s-3); max-width: 52ch; }
.entry__links { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); margin-top: var(--s-8); }
.entry__link { display: flex; flex-direction: column; gap: var(--s-2); padding: var(--s-6); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); color: var(--fg); text-decoration: none; transition: border-color var(--motion-fast) var(--ease), transform var(--motion-fast) var(--ease); }
.entry__link:hover { border-color: var(--accent); transform: translateY(-2px); }
.entry__link:active { border-color: var(--accent); background: var(--accent-soft); transform: translateY(0); }
.entry__link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.entry__link .icon { color: var(--accent); }
.entry__link-title { font-size: var(--fs-5); font-weight: var(--fw-medium); }
.entry__link-desc { font-size: var(--fs-3); color: var(--muted); }
.entry__foot { margin-top: var(--s-8); font-size: var(--fs-2); color: var(--muted); border-top: 1px solid var(--border); padding-top: var(--s-4); }

/* ---------- 20. 响应式 ---------- */
@media (max-width: 1023px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: var(--z-modal); transform: translateX(-100%); transition: transform var(--motion-base) var(--ease); }
  .sidebar.is-open { transform: none; }
  .sidebar-toggle { display: inline-flex; }
  .admin-content { padding: var(--s-4); }
  .grid-split, .member-layout { grid-template-columns: 1fr; align-items: stretch; }
  .kpi-band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(2) { border-right: 0; }
  .kpi:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
}
@media (max-width: 767px) {
  .kpi-band { grid-template-columns: 1fr 1fr; }
  .kpi { padding: var(--s-4); }
  .kpi__value { font-size: var(--fs-6); }
  .chain { flex-direction: column; }
  .chain__arrow { transform: rotate(90deg); justify-content: center; }
  .entry__links { grid-template-columns: 1fr; }
  .topbar__station, .topbar__demo span { display: none; }
  .h5-device { border-left: 0; border-right: 0; }
  .form-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 400px) {
  .form-grid { grid-template-columns: 1fr; }
  .stat-box__value { font-size: var(--fs-5); }
  .hero-amount__value { font-size: var(--fs-7); }
}

/* 无障碍：仅当无其他可见焦点样式时保留全局（tokens.css 已定义 :focus-visible） */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ---------- 优惠汇总（收银台试算结果） ---------- */
.qp-summary {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--s-3) var(--s-4);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.qp-summary__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: var(--fs-2);
  color: var(--fg-2);
}
.qp-summary__row b { font-variant-numeric: tabular-nums; }
.qp-summary__cut { color: var(--danger); }
.qp-summary__row--total {
  border-top: 1px dashed var(--border);
  padding-top: var(--s-2);
  color: var(--fg);
  font-weight: 600;
}
.qp-summary__row--total b { font-size: var(--fs-4); color: var(--accent); }
.qp-summary__items { display: flex; flex-wrap: wrap; gap: 6px; }
.qp-summary__tag {
  font-size: var(--fs-1);
  line-height: 1.5;
  color: var(--fg-2);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 2px 8px;
}

/* 券 / 积分两列并排，窄屏自动叠成单列 */
.qp-discount-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-3);
}
@media (max-width: 560px) {
  .qp-discount-grid { grid-template-columns: 1fr; }
}

/* ---------- 营销中心门户 ---------- */
.mkt-section { margin-bottom: var(--s-6); }
.mkt-section__title { font-size: var(--fs-4); font-weight: var(--fw-medium); margin-bottom: var(--s-3); }
.mkt-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-3); }
@media (max-width: 980px) { .mkt-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 680px) { .mkt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mkt-card {
  display: flex; align-items: flex-start; gap: var(--s-3); width: 100%; text-align: left;
  padding: var(--s-4); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); cursor: pointer; transition: background-color var(--motion-fast) var(--ease), border-color var(--motion-fast) var(--ease);
}
.mkt-card:hover { background: var(--raised); border-color: var(--muted); }
.mkt-card__icon {
  flex: 0 0 40px; width: 40px; height: 40px; border-radius: var(--r-md);
  background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center;
}
.mkt-card__icon .icon { width: 22px; height: 22px; }
.mkt-card__body { min-width: 0; }
.mkt-card__name { font-size: var(--fs-3); font-weight: var(--fw-medium); }
.mkt-card__desc { font-size: var(--fs-2); color: var(--muted); margin-top: 2px; line-height: var(--lh-body); }
.mkt-card--off { opacity: .55; cursor: not-allowed; }
.mkt-card--off:hover { background: var(--surface); border-color: var(--border); }

/* ---------- 短信营销 ---------- */
.sms-layout { display: grid; grid-template-columns: 180px 1fr; gap: var(--s-5); align-items: start; }
@media (max-width: 760px) { .sms-layout { grid-template-columns: 1fr; } }
.sms-side { display: flex; flex-direction: column; gap: var(--s-1); }
.sms-side__item {
  text-align: left; padding: var(--s-2) var(--s-3); border: 0; border-radius: var(--r-md);
  background: transparent; color: var(--fg-2); font-size: var(--fs-3); cursor: pointer;
}
.sms-side__item:hover { background: var(--raised); }
.sms-side__item[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: var(--fw-medium); }
.sms-notice { background: var(--raised); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s-4); font-size: var(--fs-2); color: var(--fg-2); line-height: var(--lh-body); margin-bottom: var(--s-4); }
.sms-notice ol { margin: var(--s-2) 0 0; padding-left: var(--s-5); display: flex; flex-direction: column; gap: var(--s-1); }
