/* ==========================================================================
   kiro-order 视觉原型样式表
   严格对齐《视觉原型需求.md》：颜色 §2.1 / 字号 §2.2 / 间距 §2.3 / 按钮 §3
   手机优先（390px 起），≥768 平板，≥1024 桌面
   ========================================================================== */

/* ---------- 设计变量 ---------- */
:root {
  /* 主色 */
  --c-primary: #2563eb;
  --c-primary-light: #eff6ff;
  --c-primary-dark: #1d4ed8;

  /* 文字 */
  --c-text: #111827;
  --c-text-sub: #6b7280;
  --c-text-weak: #9ca3af;

  /* 结构 */
  --c-border: #e5e7eb;
  --c-bg: #f9fafb;
  --c-card: #ffffff;

  /* 状态色 */
  --c-ok: #059669;
  --c-ok-bg: #ecfdf5;
  --c-info: #2563eb;
  --c-info-bg: #eff6ff;
  --c-warn: #d97706;
  --c-warn-bg: #fffbeb;
  --c-danger: #dc2626;
  --c-danger-bg: #fef2f2;
  --c-danger-border: #fecaca;
  --c-muted: #6b7280;
  --c-muted-bg: #f3f4f6;

  /* 圆角 §2.4 */
  --r-card: 12px;
  --r-ctrl: 8px;
  --r-tag: 6px;

  /* 字体 */
  --font: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* 安全区；--kb 键盘高度，visualViewport 写入 */
  --safe-b: env(safe-area-inset-bottom, 0px);
  --kb: 0px;

  /* 固定条高度 */
  --h-topbar: 56px;
  --h-tabbar: 56px;
  --h-actionbar: 64px;
}

/* ---------- 重置 ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 22px;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  /* 禁止横向滚动：验收标准 §13 第一条 */
  overflow-x: hidden;
}

button, input, textarea, select { font-family: inherit; }
button { cursor: pointer; border: none; background: none; padding: 0; }
a { color: var(--c-primary); text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }

/* 金额/数字等宽，避免跳动 §2.2 */
.num, .amount {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.mono { font-family: var(--font-mono); }

/* ==========================================================================
   字号工具类 §2.2
   ========================================================================== */
.t-page   { font-size: 20px; font-weight: 600; line-height: 28px; }
.t-sect   { font-size: 16px; font-weight: 600; line-height: 24px; }
.t-body   { font-size: 15px; font-weight: 400; line-height: 22px; }
.t-btn    { font-size: 15px; font-weight: 500; line-height: 20px; }
.t-sub    { font-size: 13px; font-weight: 400; line-height: 18px; color: var(--c-text-sub); }
.t-tag    { font-size: 12px; font-weight: 500; line-height: 16px; }
.t-amount { font-size: 17px; font-weight: 600; line-height: 24px; font-variant-numeric: tabular-nums; }
.t-cred   { font-size: 13px; font-weight: 400; line-height: 20px; font-family: var(--font-mono); }

.c-sub  { color: var(--c-text-sub); }
.c-weak { color: var(--c-text-weak); }
.c-ok   { color: var(--c-ok); }
.c-warn { color: var(--c-warn); }
.c-dang { color: var(--c-danger); }
.c-danger { color: var(--c-danger); }
.c-pri  { color: var(--c-primary); }

/* ==========================================================================
   布局骨架
   ========================================================================== */
.app { min-height: 100vh; }

/* 顶部栏 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--h-topbar);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 0 4px;
  background: var(--c-card);
  border-bottom: 1px solid var(--c-border);
}

.topbar__title {
  flex: 1;
  font-size: 17px;
  font-weight: 600;
  line-height: 24px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 左右占位，保证标题真正居中 */
.topbar__side {
  min-width: 56px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.topbar__side--right { justify-content: flex-end; }

/* 页面主体：给底部导航和吸底条留出空间 */
.page {
  padding: 16px;
  padding-bottom: calc(var(--h-tabbar) + var(--safe-b) + 24px);
}
.page--with-actionbar {
  padding-bottom: calc(var(--h-tabbar) + var(--h-actionbar) + var(--safe-b) + 24px);
}
.page--plain {
  padding-bottom: calc(var(--safe-b) + 24px);
}
.page--form {
  padding-bottom: calc(var(--h-actionbar) + var(--safe-b) + 24px + var(--kb));
}

.section { margin-bottom: 24px; }
.section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

/* ==========================================================================
   底部标签栏 §8.1（确认后为 4 个 tab）
   ========================================================================== */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 60;
  height: calc(var(--h-tabbar) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: flex;
  background: var(--c-card);
  border-top: 1px solid var(--c-border);
}

.tabbar__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--c-text-weak);
  /* 热区撑满，满足 44px */
  min-height: 44px;
}

.tabbar__item svg { width: 24px; height: 24px; }

/* 导航标签是规范里唯一允许 <12px 的地方 §8.1 */
.tabbar__brand {
  display: none;
  padding: 8px 12px 16px;
  font-size: 15px;
  font-weight: 600;
  color: var(--c-text);
}

input[type="datetime-local"].input {
  font-size: 16px;
  min-height: 48px;
}

.tabbar__item.is-active,
.tabbar__item.is-on { color: var(--c-primary); }

/* ==========================================================================
   按钮 §3
   ========================================================================== */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--r-ctrl);
  font-size: 15px;
  font-weight: 500;
  line-height: 20px;
  white-space: nowrap;
  transition: background-color .12s, transform .1s, border-color .12s;
  /* 保证热区：视觉 40px，通过伪元素外扩到 44px */
}

/* 热区外扩，不影响布局 §3.1 */
.btn::after {
  content: "";
  position: absolute;
  inset: -2px -2px;
  min-height: 44px;
}

.btn:active:not(:disabled) { transform: scale(.98); }

/* 尺寸 */
.btn--lg { height: 48px; padding: 0 24px; font-size: 16px; }
.btn--sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn--block { width: 100%; }

/* 主按钮 */
.btn--primary {
  background: var(--c-primary);
  color: #fff;
}
.btn--primary:active:not(:disabled) { background: var(--c-primary-dark); }

/* 次按钮 */
.btn--default {
  background: #fff;
  color: var(--c-text);
  border: 1px solid var(--c-border);
}
.btn--default:active:not(:disabled) { background: #f3f4f6; }

/* 文字按钮 */
.btn--text {
  background: none;
  color: var(--c-primary);
  padding: 0 8px;
  height: 36px;
}

/* 危险按钮：默认描边，不用实心红，防手滑 §3.2 */
.btn--danger {
  background: #fff;
  color: var(--c-danger);
  border: 1px solid var(--c-danger-border);
}
.btn--danger:active:not(:disabled) { background: var(--c-danger-bg); }

/* 实心红只出现在二次确认弹窗里 §3.2 */
.btn--danger-solid {
  background: var(--c-danger);
  color: #fff;
}
.btn--danger-solid:active:not(:disabled) { background: #b91c1c; }

/* 禁用态 */
.btn:disabled,
.btn.is-disabled {
  background: #f3f4f6 !important;
  color: var(--c-text-weak) !important;
  border-color: var(--c-border) !important;
  cursor: not-allowed;
  transform: none !important;
}

/* 加载态：宽度不变 §3.3 */
.btn.is-loading { pointer-events: none; }
.btn.is-loading .btn__label { visibility: hidden; }
.btn__spinner {
  position: absolute;
  width: 16px; height: 16px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 图标按钮：视觉 40，热区 44 */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-ctrl);
  color: var(--c-text);
}
.btn-icon svg { width: 20px; height: 20px; }
.btn-icon:active { background: #f3f4f6; }
.btn-icon:disabled { color: var(--c-text-weak); cursor: not-allowed; }

/* 按钮组：手机端纵向，主按钮在上 §3.4 */
.btn-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ==========================================================================
   吸底操作条
   ========================================================================== */
.actionbar {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(var(--h-tabbar) + var(--safe-b));
  z-index: 55;
  min-height: var(--h-actionbar);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--c-card);
  border-top: 1px solid var(--c-border);
}

/* 表单页没有 tabbar，直接贴底 */
.actionbar--bottom {
  bottom: var(--kb);
  padding-bottom: calc(12px + var(--safe-b));
}

.actionbar__info { flex: 1; min-width: 0; }
.actionbar__hint {
  font-size: 13px;
  line-height: 18px;
  color: var(--c-warn);
  margin-top: 2px;
}

/* ==========================================================================
   卡片 §4.1
   ========================================================================== */
.card {
  position: relative;
  background: var(--c-card);
  border-radius: var(--r-card);
  padding: 16px;
  margin-bottom: 12px;
  /* 靠间距区分，不靠边框 §2 */
  border: 1px solid transparent;
  transition: background-color .12s, border-color .12s;
}

.card:active { background: #fcfcfd; }

/* 选中态：浅底 + 左侧 3px 竖条 §4.5 */
.card.is-selected,
.card.is-sel {
  background: var(--c-primary-light);
  border-color: #bfdbfe;
}
.card.is-selected::before,
.card.is-sel::before {
  content: "";
  position: absolute;
  left: 0; top: 12px; bottom: 12px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--c-primary);
}

/* 导入预览的三色左边条 §6.2 */
.card--ok::before,
.card--warn::before,
.card--fail::before {
  content: "";
  position: absolute;
  left: 0; top: 12px; bottom: 12px;
  width: 3px;
  border-radius: 0 3px 3px 0;
}
.card--ok::before   { background: var(--c-ok); }
.card--warn::before { background: var(--c-warn); }
.card--fail::before { background: var(--c-danger); }
.card--fail { background: #fffbfb; }

.card__row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.card__main { flex: 1; min-width: 0; }

.card__title {
  font-size: 15px;
  font-weight: 500;
  line-height: 22px;
  word-break: break-all;
}

.card__meta {
  font-size: 13px;
  line-height: 18px;
  color: var(--c-text-sub);
  margin-top: 4px;
}

.card__money {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-top: 6px;
  font-size: 15px;
  line-height: 22px;
  font-variant-numeric: tabular-nums;
}

.card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}

/* 订单卡片：右列放状态和金额，金额右对齐成一列，竖着扫就能比价 */
.card--order .card__row { align-items: flex-start; }

.card__aside {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  text-align: right;
}

.card__amount {
  font-size: 17px;
  font-weight: 600;
  line-height: 24px;
  white-space: nowrap;
}

.card__amount-sub {
  font-size: 13px;
  line-height: 18px;
  color: var(--c-text-sub);
  white-space: nowrap;
}

/* 卡片底部：左侧元信息可省略，右侧「复制文案」固定不被挤掉 */
.card__foot .card__meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card__foot .btn--text { flex: none; margin-right: -4px; }

/* ==========================================================================
   状态标签
   ========================================================================== */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--r-tag);
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  white-space: nowrap;
}

/* 不只靠颜色表意，带圆点辅助 */
.tag__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.tag--ok     { color: var(--c-ok);     background: var(--c-ok-bg); }
.tag--info   { color: var(--c-info);   background: var(--c-info-bg); }
.tag--warn   { color: var(--c-warn);   background: var(--c-warn-bg); }
.tag--danger { color: var(--c-danger); background: var(--c-danger-bg); }
.tag--muted  { color: var(--c-muted);  background: var(--c-muted-bg); }

.tag--outline {
  background: transparent;
  border: 1px solid var(--c-border);
  color: var(--c-text-sub);
}

/* 权限标签墙 §8.6 */
.tag-wall {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

/* ==========================================================================
   表单 §5.1
   ========================================================================== */
.field { margin-bottom: 16px; }

.field__label {
  display: block;
  font-size: 13px;
  line-height: 18px;
  color: var(--c-text-sub);
  margin-bottom: 6px;
}

.field__label .req { color: var(--c-danger); margin-left: 2px; }

/* 输入框字号必须 16px，否则 iOS 会缩放 §2.2 */
.input,
.textarea,
.select {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  font-size: 16px;
  line-height: 24px;
  color: var(--c-text);
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--r-ctrl);
  outline: none;
  transition: border-color .12s, box-shadow .12s;
  -webkit-appearance: none;
  appearance: none;
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.input::placeholder,
.textarea::placeholder { color: var(--c-text-weak); }

.textarea {
  min-height: 200px;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 22px;
}

/* 错误态：边框变红 + 下方红字 §5.1 */
.field.has-error .input,
.field.has-error .textarea {
  border-color: var(--c-danger);
}

.field__error {
  display: none;
  font-size: 13px;
  line-height: 18px;
  color: var(--c-danger);
  margin-top: 6px;
}
.field.has-error .field__error { display: block; }

.field__help {
  font-size: 13px;
  line-height: 18px;
  color: var(--c-text-sub);
  margin-top: 6px;
}

/* 带前缀的金额输入 */
.input-affix {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--r-ctrl);
  padding-left: 14px;
}
.input-affix:focus-within {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.input-affix__prefix {
  font-size: 16px;
  color: var(--c-text-sub);
  margin-right: 6px;
}
.input-affix .input {
  border: none;
  box-shadow: none !important;
  padding-left: 0;
}

/* 分段控件：选项 ≤4 用它，不用原生 select §5.1 */
.segmented {
  display: flex;
  background: var(--c-muted-bg);
  border-radius: var(--r-ctrl);
  padding: 3px;
  gap: 3px;
}

.segmented__item {
  flex: 1;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 500;
  color: var(--c-text-sub);
  transition: background-color .12s, color .12s;
}

.segmented__item.is-active,
.segmented__item.is-on {
  background: #fff;
  color: var(--c-text);
  box-shadow: 0 1px 2px rgba(17, 24, 39, .08);
}

.segmented__item:disabled { color: var(--c-text-weak); cursor: not-allowed; }

/* 抽屉选择器触发器（选项 ≥5 时用） */
.picker {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  font-size: 16px;
  text-align: left;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--r-ctrl);
  color: var(--c-text);
}
.picker.is-empty { color: var(--c-text-weak); }
.picker svg { width: 18px; height: 18px; color: var(--c-text-weak); flex-shrink: 0; }

/* 开关列表（权限设置用）§8.6 */
.switch-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--c-border);
}
.switch-row:last-child { border-bottom: none; }
.switch-row__main { flex: 1; min-width: 0; }
.switch-row__title { font-size: 15px; line-height: 22px; }
.switch-row__desc { font-size: 13px; line-height: 18px; color: var(--c-text-sub); margin-top: 2px; }

.switch {
  position: relative;
  flex-shrink: 0;
  width: 48px;
  height: 30px;
  border-radius: 15px;
  background: #d1d5db;
  transition: background-color .16s;
  /* 热区 */
  margin: 7px 0;
}
.switch::before {
  content: "";
  position: absolute;
  inset: -7px;
}
.switch__knob {
  position: absolute;
  top: 3px; left: 3px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform .16s;
}
.switch.is-on { background: var(--c-primary); }
.switch.is-on .switch__knob { transform: translateX(18px); }
.switch.is-locked { opacity: .5; cursor: not-allowed; }

/* ==========================================================================
   勾选框 / 单选框 §4.5
   ========================================================================== */
.checkbox,
.radio {
  position: relative;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #d1d5db;
  background: #fff;
  transition: background-color .12s, border-color .12s;
}
.checkbox { border-radius: 6px; }
.radio    { border-radius: 50%; }

/* 热区扩到 44 §4.5 */
.checkbox::before,
.radio::before {
  content: "";
  position: absolute;
  inset: -10px;
}

.checkbox svg { width: 16px; height: 16px; color: #fff; opacity: 0; }

.checkbox.is-checked,
.checkbox.is-on {
  background: var(--c-primary);
  border-color: var(--c-primary);
}
.checkbox.is-checked svg,
.checkbox.is-on svg { opacity: 1; }

.radio.is-checked,
.radio.is-on { border-color: var(--c-primary); border-width: 7px; }

.checkbox.is-disabled,
.radio.is-disabled {
  background: var(--c-muted-bg);
  border-color: var(--c-border);
  cursor: not-allowed;
}

/* 单选行：点整行即选中 §4.5 */
.radio-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--r-ctrl);
  margin-bottom: 8px;
  text-align: left;
  width: 100%;
}
.radio-row.is-active,
.radio-row.is-on { border-color: var(--c-primary); background: var(--c-primary-light); }
.radio-row__main { flex: 1; min-width: 0; }

/* ==========================================================================
   搜索框 §4.3
   ========================================================================== */
.search {
  position: relative;
  display: flex;
  align-items: center;
  height: 44px;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--r-ctrl);
  padding: 0 8px 0 12px;
  margin-bottom: 12px;
}

.search svg { width: 18px; height: 18px; color: var(--c-text-weak); flex-shrink: 0; }

.search__input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: none;
  outline: none;
  background: none;
  font-size: 16px;
  padding: 0 8px;
  color: var(--c-text);
}
.search__input::placeholder { color: var(--c-text-weak); }

/* 清除按钮热区 44 §4.3 */
.search__clear {
  display: flex;
  width: 44px; height: 44px;
  align-items: center;
  justify-content: center;
  margin-right: -8px;
  color: var(--c-text-weak);
}

/* 搜索命中高亮 §4.3 */
mark, .hl {
  background: #fde68a;
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}

/* ==========================================================================
   筛选栏 §4.4
   ========================================================================== */
.filterbar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}
.filterbar::-webkit-scrollbar { display: none; }

.filterbar__btn {
  position: relative;
  flex-shrink: 0;
  height: 40px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--r-ctrl);
  font-size: 14px;
  color: var(--c-text);
  white-space: nowrap;
}
.filterbar__btn svg { width: 15px; height: 15px; color: var(--c-text-sub); }
.filterbar__btn.is-active {
  border-color: var(--c-primary);
  color: var(--c-primary);
  background: var(--c-primary-light);
}

/* 已选条件数角标 §4.4 */
.filterbar__badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--c-danger);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
}

/* 快捷状态标签墙 §4.4 */
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  margin-bottom: 12px;
  padding-bottom: 2px;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  flex-shrink: 0;
  min-height: 36px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 18px;
  font-size: 14px;
  color: var(--c-text-sub);
  white-space: nowrap;
}
.chip.is-active,
.chip.is-on {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: #fff;
}
.chip__count { font-size: 12px; opacity: .75; }

/* 已选条件回显，可单独移除 §4.4 */
.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.active-filters__item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px 5px 10px;
  background: var(--c-primary-light);
  color: var(--c-primary);
  border-radius: var(--r-tag);
  font-size: 13px;
}
.active-filters__x {
  width: 20px; height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.active-filters__x::before { content: ""; position: absolute; inset: -10px; }

/* ==========================================================================
   列表头（含「选择」入口）§4.5
   ========================================================================== */
.listhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.listhead__count { font-size: 13px; color: var(--c-text-sub); }

/* 多选模式的顶部栏 */
.selectbar {
  position: sticky;
  top: var(--h-topbar);
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 4px;
  margin: 0 -16px 10px;
  padding-left: 4px;
  padding-right: 8px;
  background: var(--c-primary-light);
  border-bottom: 1px solid #bfdbfe;
}
.selectbar__count {
  flex: 1;
  font-size: 15px;
  font-weight: 500;
  color: var(--c-text);
}

/* ==========================================================================
   底部抽屉 §4.4
   ========================================================================== */
.sheet-mask {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(17, 24, 39, .45);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.sheet-mask.is-open { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 101;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: var(--c-card);
  border-radius: 16px 16px 0 0;
  transform: translateY(100%);
  transition: transform .24s cubic-bezier(.32, .72, 0, 1);
}
.sheet.is-open { transform: translateY(0); }

.sheet__head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px;
  border-bottom: 1px solid var(--c-border);
}
.sheet__title { flex: 1; font-size: 16px; font-weight: 600; }

.sheet__body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
}

.sheet__foot {
  flex-shrink: 0;
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  padding-bottom: calc(12px + var(--safe-b));
  border-top: 1px solid var(--c-border);
}
.sheet__foot .btn { flex: 1; }

/* 抽屉里的筛选分组 */
.fgroup { margin-bottom: 20px; }
.fgroup__title {
  font-size: 13px;
  color: var(--c-text-sub);
  margin-bottom: 8px;
}
.fgroup__wall {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.fgroup__opt {
  min-height: 38px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--r-ctrl);
  font-size: 14px;
  color: var(--c-text);
}
.fgroup__opt.is-active {
  border-color: var(--c-primary);
  background: var(--c-primary-light);
  color: var(--c-primary);
  font-weight: 500;
}

/* 抽屉里的单选列表（选择器用） */
.sheet-list__item {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--c-border);
  font-size: 16px;
  text-align: left;
  color: var(--c-text);
}
.sheet-list__item:last-child { border-bottom: none; }
.sheet-list__item.is-active,
.sheet-list__item.is-on { color: var(--c-primary); font-weight: 500; }
.sheet-list__item svg { width: 20px; height: 20px; margin-left: auto; }

/* ==========================================================================
   确认弹窗 §9.3
   ========================================================================== */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(17, 24, 39, .5);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s;
}
.modal-mask.is-open { opacity: 1; pointer-events: auto; }

.modal {
  width: 100%;
  max-width: 420px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: var(--c-card);
  border-radius: var(--r-card);
  /* 弹窗是允许用阴影的唯一场景 §2.4 */
  box-shadow: 0 20px 48px rgba(17, 24, 39, .24);
  transform: translateY(12px) scale(.98);
  transition: transform .18s;
}
.modal-mask.is-open .modal { transform: none; }

.modal__head { padding: 20px 20px 0; }
.modal__title { font-size: 16px; font-weight: 600; line-height: 24px; }

.modal__body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 20px 0;
  font-size: 15px;
  line-height: 22px;
}

.modal__foot {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 风险提示条 §9.3 */
.notice {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--r-ctrl);
  font-size: 14px;
  line-height: 20px;
  margin: 12px 0;
}
.notice svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; }
.notice--warn   { background: var(--c-warn-bg);   color: #92400e; }
.notice--danger { background: var(--c-danger-bg); color: #991b1b; }
.notice--info   { background: var(--c-info-bg);   color: #1e40af; }
.notice--ok     { background: var(--c-ok-bg);     color: #065f46; }

/* 影响摘要清单 §9.4 */
.impact {
  background: var(--c-bg);
  border-radius: var(--r-ctrl);
  padding: 12px;
  margin: 12px 0;
}
.impact__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  line-height: 24px;
}
.impact__row dt { color: var(--c-text-sub); }
.impact__row dd { margin: 0; font-weight: 500; font-variant-numeric: tabular-nums; }

.impact__list {
  max-height: 160px;
  overflow-y: auto;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--c-border);
  font-size: 13px;
  line-height: 20px;
  color: var(--c-text-sub);
  font-family: var(--font-mono);
}

/* ==========================================================================
   Toast §10
   ========================================================================== */
.toast-layer {
  position: fixed;
  top: calc(var(--h-topbar) + 16px);
  left: 16px; right: 16px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  max-width: 400px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--c-text);
  color: #fff;
  border-radius: var(--r-ctrl);
  font-size: 15px;
  line-height: 20px;
  box-shadow: 0 8px 24px rgba(17, 24, 39, .2);
  pointer-events: auto;
  animation: toast-in .2s ease-out;
}
.toast.is-out { animation: toast-out .18s ease-in forwards; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-10px); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateY(-10px); }
}

.toast__text { flex: 1; min-width: 0; }
.toast__action {
  flex-shrink: 0;
  color: #93c5fd;
  font-weight: 500;
  font-size: 15px;
  padding: 4px 2px;
  position: relative;
}
.toast__action::before { content: ""; position: absolute; inset: -12px; }

.toast svg { width: 18px; height: 18px; flex-shrink: 0; }
.toast--ok svg   { color: #6ee7b7; }
.toast--err svg  { color: #fca5a5; }

/* ==========================================================================
   空状态 / 骨架屏 §4.8
   ========================================================================== */
.empty {
  padding: 48px 24px;
  text-align: center;
}
.empty__text {
  font-size: 15px;
  color: var(--c-text-sub);
  margin-bottom: 16px;
}

.skeleton {
  background: var(--c-card);
  border-radius: var(--r-card);
  padding: 16px;
  margin-bottom: 12px;
}
.sk-line {
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(90deg, #f3f4f6 25%, #e9ebee 37%, #f3f4f6 63%);
  background-size: 400% 100%;
  animation: sk 1.2s ease infinite;
  margin-bottom: 10px;
}
.sk-line:last-child { margin-bottom: 0; }
@keyframes sk {
  0%   { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* ==========================================================================
   统计卡（工作台）§8.2
   ========================================================================== */
.stat-hero {
  display: flex;
  gap: 16px;
  background: var(--c-card);
  border-radius: var(--r-card);
  padding: 20px 16px;
  margin-bottom: 12px;
}
.stat-hero__item { flex: 1; min-width: 0; }
.stat-hero__label { font-size: 13px; color: var(--c-text-sub); margin-bottom: 4px; }
.stat-hero__value {
  font-size: 28px;
  font-weight: 600;
  line-height: 34px;
  font-variant-numeric: tabular-nums;
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--c-border);
  border-radius: var(--r-card);
  overflow: hidden;
  margin-bottom: 12px;
}
.stat-grid__item {
  background: var(--c-card);
  padding: 14px 16px;
  text-align: left;
}
.stat-grid__label { font-size: 13px; color: var(--c-text-sub); margin-bottom: 2px; }
.stat-grid__value {
  font-size: 17px;
  font-weight: 600;
  line-height: 24px;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   详情页：字段行与凭证 §5.2
   ========================================================================== */
.dl { background: var(--c-card); border-radius: var(--r-card); padding: 4px 16px; margin-bottom: 12px; }

.dl__row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--c-border);
}
.dl__row:last-child { border-bottom: none; }
.dl__key {
  flex-shrink: 0;
  width: 88px;
  font-size: 14px;
  line-height: 22px;
  color: var(--c-text-sub);
}
.dl__val {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  line-height: 22px;
  word-break: break-all;
}

/* 凭证行 */
.cred {
  padding: 13px 0;
  border-bottom: 1px solid var(--c-border);
}
.cred:last-child { border-bottom: none; }
.cred__label { font-size: 13px; color: var(--c-text-sub); margin-bottom: 6px; }
.cred__line {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cred__value {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 20px;
  word-break: break-all;
}
.cred__value.is-masked { letter-spacing: 1px; }

/* TOTP §5.2 */
.totp {
  display: flex;
  align-items: center;
  gap: 12px;
}
.totp__code {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 2px;
  font-variant-numeric: tabular-nums;
}
.totp__ring {
  position: relative;
  width: 28px; height: 28px;
  flex-shrink: 0;
}
.totp__ring svg { width: 28px; height: 28px; transform: rotate(-90deg); }
.totp__ring circle { fill: none; stroke-width: 3; }
.totp__ring .bg { stroke: var(--c-border); }
.totp__ring .fg {
  stroke: var(--c-primary);
  stroke-linecap: round;
  transition: stroke-dashoffset .95s linear, stroke .3s;
}
.totp__ring.is-urgent .fg { stroke: var(--c-warn); }
.totp__sec {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--c-text-sub);
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   步骤条 §6.1
   ========================================================================== */
.steps {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  font-size: 13px;
  line-height: 18px;
}
.steps__item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--c-text-weak);
}
.steps__num {
  width: 20px; height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--c-muted-bg);
  color: var(--c-text-sub);
  font-size: 12px;
  font-weight: 600;
}
.steps__item.is-active,
.steps__item.is-on { color: var(--c-text); font-weight: 500; }
.steps__item.is-active .steps__num,
.steps__item.is-on .steps__num { background: var(--c-primary); color: #fff; }
.steps__item.is-done .steps__num { background: var(--c-ok); color: #fff; }
.steps__sep { flex: 1; height: 1px; background: var(--c-border); min-width: 8px; }

/* ==========================================================================
   账单分组卡 §8.5
   ========================================================================== */
.bill-card {
  background: var(--c-card);
  border-radius: var(--r-card);
  margin-bottom: 12px;
  overflow: hidden;
}
.bill-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
}
.bill-card__date { font-size: 15px; font-weight: 600; }
.bill-card__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  padding: 0 16px 14px;
}
.bill-card__cell { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; line-height: 22px; }
.bill-card__cell dt { color: var(--c-text-sub); }
.bill-card__cell dd { margin: 0; font-weight: 500; font-variant-numeric: tabular-nums; }
.bill-card__body {
  display: none;
  border-top: 1px solid var(--c-border);
  padding: 12px 16px;
  background: var(--c-bg);
}
.bill-card.is-open .bill-card__body { display: block; }

/* ==========================================================================
   兑换页（客户侧）§8.4
   ========================================================================== */
.redeem-page {
  min-height: 100vh;
  background: var(--c-bg);
  padding: 0 16px;
  padding-bottom: calc(32px + var(--safe-b));
}
.redeem-head {
  padding: 48px 0 32px;
  text-align: center;
}
.redeem-head__title { font-size: 22px; font-weight: 600; margin-bottom: 6px; }
.redeem-head__sub { font-size: 14px; color: var(--c-text-sub); }

.redeem-box {
  background: var(--c-card);
  border-radius: var(--r-card);
  padding: 20px 16px;
  max-width: 440px;
  margin: 0 auto;
}

/* 兑换码大输入框 §8.4 */
.code-input {
  width: 100%;
  height: 56px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 1px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-ctrl);
  outline: none;
  color: var(--c-text);
  text-transform: uppercase;
}
.code-input:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.code-input::placeholder { color: var(--c-text-weak); letter-spacing: 1px; font-weight: 400; }

.redeem-card {
  background: var(--c-card);
  border-radius: var(--r-card);
  padding: 16px;
  margin-bottom: 12px;
}
.redeem-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--c-border);
}
.redeem-card__idx { font-size: 13px; color: var(--c-text-sub); }

/* 客户侧验证码更大 §8.4 */
.redeem-totp {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 4px;
  line-height: 40px;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   杂项
   ========================================================================== */
.row { display: flex; align-items: center; gap: 8px; }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.mt-4 { margin-top: 4px; }  .mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.hidden { display: none !important; }
.text-right { text-align: right; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.modal__foot-hint {
  font-size: 13px;
  line-height: 18px;
  color: var(--c-warn);
  text-align: center;
}
.modal__foot-hint:empty { display: none; }

.search__icon svg { width: 18px; height: 18px; color: var(--c-text-weak); }

/* 「我的」入口列表 */
.navlist {
  background: var(--c-card);
  border-radius: var(--r-card);
  overflow: hidden;
  margin-bottom: 12px;
}
.navlist__item {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  text-align: left;
  font-size: 15px;
  color: var(--c-text);
  border-bottom: 1px solid var(--c-border);
}
.navlist__item:last-child { border-bottom: none; }
.navlist__item svg { width: 20px; height: 20px; color: var(--c-text-sub); }
.navlist__chev { margin-left: auto; color: var(--c-text-weak); }

.me-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0 16px;
}
.me-head__avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--c-primary-light);
  color: var(--c-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 18px;
}
.me-head__name { font-size: 16px; font-weight: 600; line-height: 24px; }

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.pager__size {
  min-height: 40px;
  font-size: 14px;
  padding: 8px 10px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-ctrl);
  background: #fff;
}
.pager__btns { display: flex; align-items: center; gap: 8px; }

.bill-month {
  background: var(--c-card);
  border-radius: var(--r-card);
  padding: 16px;
  margin-bottom: 16px;
}
.bill-month__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
  margin-top: 12px;
}
.bill-month__cell { display: flex; justify-content: space-between; font-size: 14px; }
.bill-month__cell dt { color: var(--c-text-sub); }
.bill-month__cell dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 500; text-align: right; }

.tabs-line {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--c-border);
}
.tabs-line__item {
  flex-shrink: 0;
  height: 44px;
  padding: 0 12px;
  font-size: 15px;
  color: var(--c-text-sub);
  border-bottom: 2px solid transparent;
}
.tabs-line__item.is-active { color: var(--c-primary); border-bottom-color: var(--c-primary); font-weight: 500; }

/* 折叠区 */
.collapse__toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  color: var(--c-primary);
  padding: 10px 0;
}
.collapse__toggle svg { width: 16px; height: 16px; transition: transform .16s; }
.collapse.is-open .collapse__toggle svg { transform: rotate(180deg); }
.collapse__body { display: none; }
.collapse.is-open .collapse__body { display: block; }

/* 代码预览块（导出预览用）§7.3 */
.codeblock {
  background: #111827;
  color: #e5e7eb;
  border-radius: var(--r-ctrl);
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 20px;
  overflow-x: auto;
  white-space: pre;
  -webkit-overflow-scrolling: touch;
}

/* 原文查看 */
.rawblock {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-ctrl);
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 20px;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 240px;
  overflow-y: auto;
}

/* 兑换文案预览：保留换行，长网址和兑换码不撑破容器 */
.copytext {
  margin: 0;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-ctrl);
  padding: 12px;
  font-family: var(--font);
  font-size: 14px;
  line-height: 22px;
  color: var(--c-text);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 46vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* 角标 */
.badge-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--c-danger);
  vertical-align: top;
}

/* 加载更多 §4.7 */
.loadmore {
  width: 100%;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--r-ctrl);
  font-size: 15px;
  color: var(--c-text-sub);
  margin-top: 4px;
}

/* 登录页 */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px;
  background: var(--c-bg);
}
.login-box {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  background: var(--c-card);
  border-radius: var(--r-card);
  padding: 28px 20px;
}
.login-title { font-size: 22px; font-weight: 600; margin-bottom: 4px; }
.login-sub { font-size: 14px; color: var(--c-text-sub); margin-bottom: 24px; }

/* 演示身份切换 */
.role-switch {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ==========================================================================
   平板 ≥768px §11
   ========================================================================== */
@media (min-width: 768px) {
  .page { padding: 20px 24px; }

  /* 卡片两列 */
  .card-list--grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .card-list--grid .card { margin-bottom: 0; }

  .stat-grid { grid-template-columns: repeat(4, 1fr); }

  /* 弹窗按钮改并排，主按钮在右 §3.4 */
  .modal__foot { flex-direction: row-reverse; }
  .modal__foot .btn { flex: 1; }
}

/* ==========================================================================
   桌面 ≥1024px §11
   ========================================================================== */
@media (min-width: 1024px) {
  body { font-size: 14px; }

  /* 有底部导航时：左侧固定栏 + 右侧内容。不能把 topbar/page/tabbar 排成一行 */
  .app { display: block; min-height: 100vh; }
  .app:has(.tabbar) .tabbar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: 200px;
    height: 100vh;
    flex-direction: column;
    flex-shrink: 0;
    padding: 16px 12px;
    border-top: none;
    border-right: 1px solid var(--c-border);
    gap: 4px;
    order: 0;
    overflow-y: auto;
    z-index: 70;
  }
  .app:has(.tabbar) .tabbar__brand { display: block; }
  .app:has(.tabbar) .topbar,
  .app:has(.tabbar) .page,
  .app:has(.tabbar) .page--plain,
  .app:has(.tabbar) .page--form,
  .app:has(.tabbar) .page--with-actionbar {
    margin-left: 200px;
  }
  .app:has(.tabbar) .actionbar,
  .app:has(.tabbar) .actionbar--bottom {
    left: 200px;
  }

  .tabbar__item {
    flex: 0 0 auto;
    flex-direction: row;
    justify-content: flex-start;
    gap: 10px;
    height: 44px;
    padding: 0 12px;
    border-radius: var(--r-ctrl);
  }
  .tabbar__item.is-active,
  .tabbar__item.is-on { background: var(--c-primary-light); }
  .tabbar__label { font-size: 15px; line-height: 20px; }

  .app__main { flex: 1; min-width: 0; }

  .page,
  .page--with-actionbar,
  .page--form {
    max-width: 1180px;
    padding: 24px;
    padding-bottom: 96px;
  }

  .topbar { padding: 0 24px; }
  .topbar__title { text-align: left; font-size: 20px; }
  .topbar__side { min-width: 0; }

  .actionbar,
  .actionbar--bottom {
    bottom: var(--kb);
    left: 200px;
    padding-bottom: 12px;
  }

  .toast-layer {
    top: 20px;
    left: auto;
    right: 24px;
    width: 400px;
    align-items: flex-end;
  }

  /* 桌面端表格 §4.2 */
  .table-wrap {
    background: var(--c-card);
    border-radius: var(--r-card);
    overflow: hidden;
  }
  .table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
  }
  .table th {
    position: sticky;
    top: var(--h-topbar);
    z-index: 10;
    background: var(--c-bg);
    font-size: 13px;
    font-weight: 500;
    line-height: 18px;
    color: var(--c-text-sub);
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--c-border);
    white-space: nowrap;
  }
  .table th.is-sortable { cursor: pointer; }
  .table th .sort-ico { opacity: .4; margin-left: 2px; }
  .table th.is-sorted .sort-ico { opacity: 1; color: var(--c-primary); }
  .table td {
    font-size: 14px;
    line-height: 20px;
    padding: 12px;
    border-bottom: 1px solid var(--c-border);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .table tbody tr:last-child td { border-bottom: none; }
  .table tbody tr:hover { background: #fcfcfd; }
  .table tbody tr.is-selected { background: var(--c-primary-light); }
  .table .col-check { width: 44px; }
  .table .col-amount { text-align: right; font-variant-numeric: tabular-nums; }
  /* 操作列：宽度固定，行内按钮不随摘要变长被挤走 */
  .table .col-act { width: 96px; text-align: right; overflow: visible; }

  /* 手机卡片在桌面隐藏，表格在手机隐藏 */
  .only-mobile { display: none !important; }

  .btn:hover:not(:disabled) { filter: brightness(.97); }
  .btn-icon:hover { background: #f3f4f6; }

  /* 筛选抽屉在桌面改为居中弹窗 */
  .sheet {
    left: 50%;
    right: auto;
    bottom: auto;
    top: 50%;
    width: 520px;
    max-height: 80vh;
    border-radius: var(--r-card);
    transform: translate(-50%, -46%) scale(.98);
    opacity: 0;
    box-shadow: 0 20px 48px rgba(17, 24, 39, .24);
  }
  .sheet.is-open { transform: translate(-50%, -50%); opacity: 1; }
  .sheet__foot { padding-bottom: 12px; }
}

@media (max-width: 1023px) {
  .only-desktop { display: none !important; }
}

/* 打印：兑换页要能正常打印/截图 §8.4 */
@media print {
  .topbar, .tabbar, .actionbar, .toast-layer { display: none !important; }
  body { background: #fff; }
}

/* 降低动效（无障碍） */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
