:root {
  --paper: #f7f6f3;
  --surface: #ffffff;
  --surface-2: #fbfaf7;
  --line: #eae7e0;
  --line-strong: #d9d4c9;
  --ink: #221f1b;
  --ink-2: #4b4740;
  --muted: #837e74;
  --accent: #a3522e;
  --accent-dark: #8a4424;
  --accent-soft: #f8eee7;
  --ok: #47661f;
  --ok-soft: #eef2e4;
  --warn: #96600f;
  --warn-soft: #f9f0dd;
  --danger: #9d3527;
  --danger-soft: #f9eae6;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(34, 31, 27, .03);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --side-w: 228px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent-soft); }

/* ---------- 登录 ---------- */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--paper);
}
.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 38px 34px 30px;
  box-shadow: 0 1px 2px rgba(34,31,27,.03), 0 16px 40px -32px rgba(34,31,27,.4);
}
.auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 26px; }
.auth-brand h1 { font-size: 17px; font-weight: 600; margin: 0; letter-spacing: .01em; }
.auth-brand p { margin: 1px 0 0; font-size: 12px; color: var(--muted); }
.auth-card h2 { font-size: 21px; font-weight: 600; margin: 0 0 4px; letter-spacing: .01em; }
.auth-card .sub { color: var(--muted); font-size: 13px; margin: 0 0 22px; }
.auth-note { margin-top: 18px; font-size: 12px; color: var(--muted); text-align: center; }

/* ---------- 骨架 ---------- */
.layout { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; }

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  color: var(--ink-2);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 18px 16px;
}
.brand .mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--accent);
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 13px;
  letter-spacing: -.02em;
  flex: none;
}
.brand .name { line-height: 1.25; min-width: 0; }
.brand .name strong { display: block; color: var(--ink); font-size: 14px; font-weight: 600; }
.brand .name span { font-size: 11px; color: var(--muted); letter-spacing: .04em; }

.nav { flex: 1; padding: 4px 10px 10px; overflow-y: auto; }
.nav-label {
  padding: 12px 10px 6px;
  font-size: 11px;
  letter-spacing: .1em;
  color: #a8a294;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  margin-bottom: 2px;
  border-radius: var(--radius-sm);
  color: #56514a;
  cursor: pointer;
  font-size: 13.5px;
  transition: background .12s ease, color .12s ease;
}
.nav-item:hover { background: #f5f3ee; color: var(--ink); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-dark); font-weight: 500; }
.nav-item svg { flex: none; opacity: .9; }
.nav-item.active svg { opacity: 1; }

.sidebar-foot { padding: 14px 18px 16px; border-top: 1px solid var(--line); }
.who { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.who strong { display: block; color: var(--ink); font-size: 13px; font-weight: 500; }
.logout {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0; font-size: 12.5px;
}
.logout:hover { color: var(--accent); }

/* 移动端抽屉 */
.drawer-mask {
  display: none;
  position: fixed; inset: 0;
  background: rgba(34, 31, 27, .32);
  z-index: 35;
}

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 58px;
  display: flex; align-items: center; gap: 12px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 16px; font-weight: 600; margin: 0; letter-spacing: .01em; }
.topbar .crumb { margin-left: auto; font-size: 12px; color: var(--muted); }
.menu-btn {
  display: none;
  width: 36px; height: 36px; flex: none;
  align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--ink-2); cursor: pointer;
  margin-left: -6px;
}
.menu-btn:hover { background: var(--surface-2); }

.content { padding: 24px 28px 56px; max-width: 1240px; width: 100%; }

/* ---------- 代登录提示条 ---------- */
.imp-bar {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 28px;
  background: var(--accent-soft);
  border-bottom: 1px solid #eddbcf;
  color: var(--accent-dark);
  font-size: 12.5px;
  flex-wrap: wrap;
}
.imp-bar strong { color: var(--accent-dark); font-weight: 600; }
.imp-bar svg { flex: none; }
.imp-bar .btn {
  margin-left: auto;
  background: #fff;
  border-color: #e6d2c4;
  color: var(--accent-dark);
  font-size: 12.5px;
  height: 28px;
}
.imp-bar .btn:hover { background: #fffaf6; border-color: #d9bda9; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.card + .card { margin-top: 16px; }
.card-hd {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.card-hd h3 { margin: 0; font-size: 14.5px; font-weight: 600; }
.card-hd p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.card-bd { padding: 20px; }
.card-bd.tight { padding: 0; }

/* ---------- 统计 ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px 15px;
  min-width: 0;
}
.stat .k { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .v { font-size: 26px; font-weight: 600; letter-spacing: -.01em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 2px; }
/* 可点击的指标卡：保持外观不变，悬停时边框加深提示可点 */
.stat--link { display: block; color: inherit; text-decoration: none; transition: border-color .15s ease, background-color .15s ease; }
.stat--link:hover { border-color: var(--line-strong); background-color: #fdfbf6; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: #c9c3b6; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: #f3f1ea; border-color: transparent; }
.btn-danger { color: var(--danger); border-color: #ecd2cc; background: #fdf7f5; }
.btn-danger:hover { background: var(--danger-soft); border-color: #ddc0b8; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn-icon { width: 30px; height: 30px; padding: 0; }
.btn-file { position: relative; overflow: hidden; }
.btn-file input[type=file] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0;
}

/* ---------- 表单 ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; }
.field .hint, .hint { font-size: 11.5px; color: var(--muted); margin-top: 5px; line-height: 1.55; }
.input, .textarea, .select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 8px 11px;
  font-size: 13.5px;
  outline: none;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(163, 82, 46, .09);
}
.textarea { min-height: 84px; resize: vertical; line-height: 1.6; }
.input::placeholder, .textarea::placeholder { color: #b3aca0; }

/* ---------- 开关 ---------- */
.switch { position: relative; display: inline-block; width: 38px; height: 21px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch span {
  position: absolute; inset: 0; cursor: pointer;
  background: #dad5ca; border-radius: 99px;
  transition: background .16s ease;
}
.switch span::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 17px; height: 17px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.16);
  transition: transform .16s ease;
}
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(17px); }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left;
  font-weight: 500;
  font-size: 12px;
  color: var(--muted);
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  white-space: nowrap;
}
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fcfbf8; }
.table .num { font-variant-numeric: tabular-nums; }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ---------- 标签 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px;
  border-radius: 99px;
  font-size: 12px;
  line-height: 1.7;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge.ok { color: var(--ok); background: var(--ok-soft); border-color: #e0e7d3; }
.badge.off { color: var(--muted); background: #f4f2ec; border-color: #e8e4da; }
.badge.warn { color: var(--warn); background: var(--warn-soft); border-color: #efdfc2; }
.badge.danger { color: var(--danger); background: var(--danger-soft); border-color: #f0d6d0; }
.badge.ch { font-size: 11.5px; padding: 1px 8px; }
.ch-badges { display: flex; gap: 5px; flex-wrap: wrap; }

.chip.taglist { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  font-size: 12px;
  background: var(--surface-2);
}
.chip button { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 0; line-height: 1; }
.chip button:hover { color: var(--danger); }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(34, 31, 27, .36);
  display: grid; place-items: center;
  padding: 24px;
  animation: fade .12s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 100%; max-width: 640px;
  max-height: calc(100vh - 48px);
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px -28px rgba(34, 31, 27, .45);
  display: flex; flex-direction: column;
  animation: pop .14s ease;
}
@keyframes pop { from { transform: translateY(6px); opacity: .6; } to { transform: none; opacity: 1; } }
.modal-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.modal-hd h3 { margin: 0; font-size: 15px; font-weight: 600; }
.modal-bd { padding: 20px; overflow-y: auto; }
.modal-ft {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 20px; border-top: 1px solid var(--line);
}
.modal-bd .sub { color: var(--muted); font-size: 12.5px; margin: 0 0 14px; }

/* ---------- 提示 ---------- */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%);
  background: #26231e; color: #f6f2e9;
  padding: 9px 16px; border-radius: 99px;
  font-size: 13px; z-index: 200;
  box-shadow: 0 10px 28px -12px rgba(0,0,0,.45);
  animation: rise .18s ease;
  max-width: 86vw;
}
@keyframes rise { from { transform: translate(-50%, 8px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

.empty { padding: 48px 20px; text-align: center; color: var(--muted); font-size: 13px; }
.empty .big { font-size: 15px; color: var(--ink-2); margin-bottom: 4px; }

/* ---------- 其他 ---------- */
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.pill-tabs { display: inline-flex; background: #f0eee7; border-radius: 99px; padding: 3px; gap: 2px; max-width: 100%; overflow-x: auto; }
.pill-tabs button {
  border: 0; background: transparent; padding: 5px 14px; border-radius: 99px;
  font-size: 12.5px; color: var(--ink-2); cursor: pointer; white-space: nowrap;
}
.pill-tabs button.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(34,31,27,.1); }

.notice {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--warn-soft);
  border: 1px solid #efdfc2;
  color: #6f4a12;
  font-size: 12.5px;
  line-height: 1.65;
}
.notice strong { color: #5a3c0e; }
.notice svg { flex: none; margin-top: 2px; }
.notice.info { background: var(--surface-2); border-color: var(--line); color: var(--ink-2); }
.notice.info strong { color: var(--ink); }
.notice.error { background: var(--danger-soft); border-color: #f0d6d0; color: #7a2b22; }
.notice.error strong { color: #6b241c; }
.notice + .card, .notice + .split, .notice + .notice { margin-top: 16px; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: stretch; }
.split > .card { display: flex; flex-direction: column; }
.split > .card > .card-bd { flex: 1; }
.split > .card + .card { margin-top: 0; }

.ch-title { display: inline-flex; align-items: center; gap: 7px; }
.ch-title svg { color: var(--accent); }

/* ---------- 趋势柱状图 ---------- */
.trend { display: flex; gap: 10px; align-items: flex-end; padding: 6px 2px 0; }
.trend-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.trend-track {
  height: 132px;
  display: flex; align-items: flex-end;
  border-bottom: 1px solid var(--line);
  border-top: 1px dashed #ece8df;
}
.trend-bar {
  width: 100%;
  background: var(--accent);
  border-radius: 3px 3px 0 0;
  min-height: 2px;
  transition: height .2s ease;
}
.trend-bar.zero { background: #ece8de; }
.trend-x { font-size: 11px; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.trend-meta { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-top: 8px; }

/* ---------- 商品封面 ---------- */
.cover-row { display: flex; gap: 14px; align-items: flex-start; }
.cover-preview {
  width: 96px; height: 96px; flex: none;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  display: grid; place-items: center;
  overflow: hidden;
  color: #b7ae9e;
}
.cover-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-preview .uploading { font-size: 11.5px; color: var(--muted); }
.cover-side { flex: 1; min-width: 0; }
.cover-side .row { margin-top: 8px; }

/* ---------- 富文本 ---------- */
.rich {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  overflow: hidden;
}
.rich > textarea { border: 0; border-radius: 0; min-height: 240px; }
.rich.ready > textarea { display: none; }
.rich-toolbar { border-bottom: 1px solid var(--line); background: var(--surface-2); }
.rich [data-mount] { height: 260px; overflow-y: auto; }
.rich .w-e-toolbar { background: var(--surface-2); border-bottom: 0; }
.rich .w-e-text-container { background: #fff; }
.rich .w-e-text-container [data-slate-editor] { padding: 12px 14px; }
.rich .w-e-text-placeholder { top: 12px; left: 14px; font-style: normal; color: #b3aca0; }

/* ---------- 渠道配置 ---------- */
.channel-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- 审核块 ---------- */
.audit-blocks { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.audit-block { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 14px 15px; }
.audit-block-hd { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ch-label { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 13.5px; }
.ch-label svg { color: var(--accent); }

.mode-opt {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease;
}
.mode-opt + .mode-opt { margin-top: 8px; }
.mode-opt input { margin: 3px 0 0; accent-color: var(--accent); flex: none; }
.mode-opt > span { min-width: 0; }
.mode-opt strong { display: block; font-size: 13px; font-weight: 600; }
.mode-opt.on { border-color: #dcc4b4; background: var(--accent-soft); }
.mode-opt:hover { border-color: var(--line-strong); }

/* ---------- 订单 / 开放接口 ---------- */
.kv { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.kv-item { padding: 11px 16px 11px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.kv-item:nth-child(even) { padding-left: 16px; border-left: 1px solid var(--line); }
.kv-k { font-size: 11.5px; color: var(--muted); }
.kv-v { font-size: 13.5px; margin-top: 3px; word-break: break-all; }
.kv-v.mono { font-size: 12.5px; }

.sync-badges { display: flex; gap: 6px; flex-wrap: wrap; }

.cred-row { display: flex; align-items: center; gap: 8px; }
.cred {
  flex: 1; min-width: 0;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  font-family: var(--mono);
  font-size: 13px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.code {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.75;
  overflow-x: auto;
  white-space: pre;
  color: var(--ink-2);
  margin: 0;
}
.steps-list { margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--ink-2); line-height: 1.95; }
.steps-list code { font-family: var(--mono); font-size: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: 1px 4px; }
.legend { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); }

/* ================= 响应式 ================= */

@media (max-width: 1120px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
  .audit-blocks { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
  .kv-item:nth-child(even) { padding-left: 0; border-left: 0; }
}

@media (max-width: 980px) {
  .form-grid { grid-template-columns: 1fr; }

  /* 侧栏变抽屉 */
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 272px;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: 0 0 0 1px var(--line), 24px 0 48px -32px rgba(34,31,27,.35);
  }
  .sidebar.open { transform: none; }
  .drawer-mask.show { display: block; }
  .menu-btn { display: inline-flex; }
  body.no-scroll { overflow: hidden; }

  .topbar { padding: 0 16px; height: 56px; }
  .topbar h1 { font-size: 15.5px; }
  .imp-bar { padding: 9px 16px; }
  .content { padding: 16px 16px 48px; }
  .card-hd { padding: 14px 16px; }
  .card-bd { padding: 16px; }
}

@media (max-width: 760px) {
  /* 表格变卡片列表 */
  .table-wrap { overflow: visible; }
  table.table, .table tbody, .table tr { display: block; width: 100%; }
  .table thead { display: none; }
  .table tr {
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
  }
  .table tr:last-child { border-bottom: 0; }
  .table tbody tr:hover { background: transparent; }
  .table td {
    display: block;
    position: relative;
    padding: 4px 0 4px 84px;
    border: 0;
    text-align: left !important;
    overflow-wrap: anywhere;
  }
  .table td::before {
    content: attr(data-label);
    position: absolute;
    left: 0;
    top: 4px;
    width: 74px;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.7;
  }
  .table td[data-label=""] { padding-left: 0; }
  .table td[data-label=""]::before { display: none; }
  .table td[colspan] { padding-left: 0; }
  .table .actions { justify-content: flex-start; flex-wrap: wrap; }
  .table .num { font-variant-numeric: tabular-nums; }

  /* 卡片头部与筛选行换行 */
  .card-hd { align-items: flex-start; }
  .card-hd .row { flex-wrap: wrap; gap: 8px; width: 100%; }
  .card-hd .row .input,
  .card-hd .row .select { width: auto !important; flex: 1 1 132px; min-width: 0; }
  .card-hd .row .btn-icon { width: 40px; height: 38px; flex: none; }
  .card-hd > .btn, .card-hd > a.btn { flex: none; }
  .card-hd > div:last-child { width: 100%; }

  .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat { padding: 13px 14px 12px; }
  .stat .v { font-size: 21px; margin-top: 4px; }

  .modal-mask { padding: 0; align-items: stretch; }
  .modal {
    max-width: none !important;
    width: 100%;
    min-height: 100vh;
    max-height: none;
    border-radius: 0;
    border: 0;
  }
  .modal-hd, .modal-bd, .modal-ft { padding-left: 16px; padding-right: 16px; }
  .modal-ft { position: sticky; bottom: 0; background: #fff; }

  .trend-track { height: 100px; }
  .trend { gap: 6px; }
  .trend-x { font-size: 10px; }

  .cover-row { flex-direction: column; }
  .cover-preview { width: 100%; height: 160px; }

  .topbar .crumb { display: none; }
  .card-hd h3 { font-size: 14px; }

  .auth-card { padding: 28px 22px 24px; border-radius: 12px; }
  .empty { padding: 34px 16px; }
}

@media (max-width: 420px) {
  .content { padding: 12px 12px 40px; }
  .topbar { padding: 0 12px; }
  .table tr { padding: 11px 12px; }
  .table td::before { width: 70px; }
  .btn { height: 32px; padding: 0 12px; }
}

/* ---- 多小程序：顶部切换器 ---- */
.app-switch { display: flex; align-items: center; gap: 8px; margin-left: auto; margin-right: 12px; color: var(--muted, #857e72); }
.app-switch svg { flex: none; }
.app-switch select {
  height: 32px; border: 1px solid #e5dfd4; border-radius: 8px; background: #fff;
  padding: 0 10px; font-size: 13px; color: #1f1d1a; max-width: 220px;
}
@media (max-width: 720px) {
  .app-switch { margin-left: 0; margin-right: 0; }
  .app-switch select { max-width: 140px; }
}

/* ---- 多小程序：卡片列表 ---- */
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.app-card { border: 1px solid #eae4d9; border-radius: 12px; padding: 14px; background: #fff; position: relative; }
.app-card.current { border-color: #a3522e; box-shadow: 0 0 0 3px rgba(163, 82, 46, .08); }
.app-card__hd { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.app-card__hd strong { font-size: 15px; }
.app-card__kv { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 3px 0; }
.app-card__kv span { color: #857e72; flex: none; }
.app-card__kv b { font-weight: 500; text-align: right; word-break: break-all; }
.app-card__tag { margin-top: 8px; font-size: 12px; color: #a3522e; }
.app-card .row { display: flex; gap: 8px; flex-wrap: wrap; }

/* 新增账号：内联新建商户 */
.nm-box { display: none; grid-column: 1 / -1; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.nm-box.show { display: grid; }
@media (max-width: 720px) { .nm-box.show { grid-template-columns: 1fr; } }
.app-card__ch { margin: 6px 0 2px; }
.app-card__stat { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: #857e72; margin: 4px 0 2px; }
.app-card__stat span { white-space: nowrap; }

/* 商户详情弹窗 */
.msum { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
@media (max-width: 720px) { .msum { grid-template-columns: repeat(2, 1fr); } }
.msum__i { background: #faf8f4; border: 1px solid #eee7db; border-radius: 10px; padding: 10px 12px; }
.msum__i b { display: block; font-size: 17px; color: #1f1d1a; }
.msum__i span { font-size: 12px; color: #857e72; }
.msec { margin-top: 20px; }
.msec__hd { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.msec__hd strong { font-size: 13.5px; }
.msec .table-wrap { border: 1px solid #eae4d9; border-radius: 10px; }
.nmu-box { display: none; grid-template-columns: 1fr 1fr 1fr auto; gap: 10px; align-items: end; background: #faf8f4; border: 1px dashed #e0d7c7; border-radius: 10px; padding: 12px; margin-bottom: 12px; }
.nmu-box.show { display: grid; }
@media (max-width: 720px) {
  .msum { grid-template-columns: repeat(2, 1fr); }
  .nmu-box, .nmu-box.show { grid-template-columns: 1fr; }
}

/* 小程序详情 */
.abox { border: 1px solid #eae4d9; border-radius: 10px; padding: 12px 14px; background: #fff; }
.abox + .abox { margin-top: 0; }
.abox__t { display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 13.5px; margin-bottom: 8px; }
.akv { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; padding: 3px 0; }
.akv span { color: #857e72; flex: none; }
.akv b { font-weight: 500; text-align: right; word-break: break-all; }

/* 账号选择器 */
.acc-pick { display: grid; gap: 8px; }
.acc-pick__i {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  width: 100%; text-align: left; padding: 10px 12px; cursor: pointer;
  border: 1px solid #eae4d9; border-radius: 10px; background: #fff; font: inherit;
}
.acc-pick__i:hover { border-color: #a3522e; background: #fdf8f4; }
.acc-pick__i strong { font-size: 13.5px; color: #1f1d1a; }
.acc-pick__i span { font-size: 12px; color: #857e72; }

/* 我的小程序：平台图标 */
.app-ic { display: inline-flex; align-items: center; gap: 4px; color: #a3522e; }
.app-card__hd .app-ic { margin-right: 2px; }

/* 复选项 */
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.chk input { width: 14px; height: 14px; }

/* 小程序工作台：返回入口 + 当前小程序名 */
.nav-item--back { color: #857e72; margin-bottom: 8px; }
.nav-app {
  display: flex; align-items: center; gap: 6px;
  margin: 0 0 10px; padding: 8px 10px; border-radius: 8px;
  background: #f7f3ec; font-size: 13px; font-weight: 600; color: #1f1d1a;
}

/* 订单全链路时间线 */
.tl { position: relative; margin: 4px 0 0; padding-left: 18px; }
.tl::before { content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.tl-item { position: relative; padding: 8px 0 12px; }
.tl-dot {
  position: absolute; left: -16px; top: 13px; width: 9px; height: 9px; border-radius: 50%;
  background: #cfc6b6; border: 2px solid #fff; box-shadow: 0 0 0 1px #e2dacd;
}
.tl-item.ok .tl-dot { background: #2f7d4f; }
.tl-item.danger .tl-dot { background: #b03a2e; }
.tl-body { min-width: 0; }
.tl-top { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13px; }
.tl-top b { font-weight: 600; }
.tl-time { margin-left: auto; font-size: 11.5px; color: var(--muted); font-family: var(--mono); }
.tl-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.tl-msg { font-size: 12.5px; color: #57524a; margin-top: 3px; word-break: break-all; }
.tl-item .raw { margin-top: 6px; }

/* 原始报文 */
.raw { border: 1px solid var(--line); border-radius: 8px; background: #fbf9f5; }
.raw > summary {
  cursor: pointer; padding: 6px 10px; font-size: 12px; color: #6b655c; user-select: none;
  list-style: none;
}
.raw > summary::-webkit-details-marker { display: none; }
.raw > summary::before { content: '▸ '; color: #a3522e; }
.raw[open] > summary::before { content: '▾ '; }
.pre {
  margin: 0; padding: 10px 12px; border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 11.5px; line-height: 1.6; color: #3f3b35;
  white-space: pre-wrap; word-break: break-all; max-height: 320px; overflow: auto;
}
a.link { color: #a3522e; text-decoration: none; }
a.link:hover { text-decoration: underline; }
