/* ============================================================
   美业AI增长系统 · 后台设计系统
   品牌母本：官网 index.html（玉色 / 墨色 / 蔷薇 / 金色 / 米白）
   单一强调色：玉色 jade；墨色侧栏 + 衬线品牌字为决定性母题
   ============================================================ */

/* 防 FOUC：外壳挂载前隐藏页面，挂载后淡入（仅作用于带 data-nav 的应用页） */
body[data-nav] { opacity: 0; transition: opacity .22s ease; }
body[data-nav].app-ready { opacity: 1; }

:root {
  /* —— 画布 / 表面 —— */
  --bg: oklch(97.761% 0.0051 67.76);
  --surface: oklch(100% 0 0);
  --surface-2: oklch(98.6% 0.004 70);

  /* —— 文字 —— */
  --fg: oklch(20.618% 0.0304 302.18);
  --muted: oklch(46% 0.02 295);

  /* —— 边框 —— */
  --border: oklch(92.5% 0.008 80);
  --border-strong: oklch(87% 0.01 80);

  /* —— 强调（玉色）—— */
  --accent: oklch(60.557% 0.106 184.91);            /* 品牌玉：装饰/图标/图表/活跃色 */
  --accent-strong: oklch(51.09% 0.0861 186.4);      /* 功能玉：按钮填充/链接文字（白字对比 5.47:1） */
  --accent-soft: oklch(60.557% 0.106 184.91 / 0.12);
  --accent-ring: oklch(60.557% 0.106 184.91 / 0.35);

  /* —— 语义状态 —— */
  --success: oklch(50% 0.12 152);
  --success-soft: oklch(50% 0.12 152 / 0.14);
  --warning: oklch(68% 0.13 75);
  --warning-soft: oklch(68% 0.13 75 / 0.18);
  --danger: oklch(52% 0.19 25);
  --danger-soft: oklch(52% 0.19 25 / 0.12);

  /* —— 品牌点缀 —— */
  --rose: oklch(77.559% 0.0862 19.21);
  --gold: oklch(74.32% 0.1171 89.51);

  /* —— 墨色侧栏 —— */
  --sidebar-bg: oklch(20.618% 0.0304 302.18);
  --sidebar-border: oklch(100% 0 0 / 0.08);
  --sidebar-fg: oklch(78% 0.012 80);
  --sidebar-muted: oklch(62% 0.016 300);
  --sidebar-hover: oklch(100% 0 0 / 0.06);
  --sidebar-active: oklch(60.557% 0.106 184.91 / 0.16);
  --sidebar-active-fg: oklch(81% 0.125 184);

  /* —— 字体 —— */
  --font-display: "Cormorant Garamond", "Noto Serif SC", "Songti SC", "STSong", serif;
  --font-body: "DM Sans", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: "SFMono-Regular", "JetBrains Mono", Consolas, "Courier New", monospace;

  /* —— 阴影 / 圆角 —— */
  --shadow-sm: 0 1px 2px oklch(20% 0.02 302 / 0.05), 0 1px 3px oklch(20% 0.02 302 / 0.04);
  --shadow-md: 0 6px 24px oklch(20% 0.02 302 / 0.09);
  --radius: 14px;
  --radius-sm: 10px;

  --ease: cubic-bezier(0.23, 1, 0.32, 1);
}

[data-theme="dark"] {
  --bg: oklch(16.5% 0.02 302);
  --surface: oklch(21.5% 0.022 302);
  --surface-2: oklch(24% 0.022 302);
  --fg: oklch(92% 0.008 80);
  --muted: oklch(70% 0.014 300);
  --border: oklch(33% 0.02 300);
  --border-strong: oklch(40% 0.02 300);
  --accent: oklch(70% 0.11 185);
  --accent-strong: oklch(68% 0.10 185);
  --accent-soft: oklch(70% 0.11 185 / 0.16);
  --shadow-sm: 0 1px 2px oklch(0% 0 0 / 0.3);
  --shadow-md: 0 8px 28px oklch(0% 0 0 / 0.4);
}

/* ============ Reset ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; color: inherit; }
svg { display: block; }
::selection { background: var(--accent-soft); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* 细滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: oklch(60% 0.02 300 / 0.4); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: oklch(55% 0.02 300 / 0.55); }
::-webkit-scrollbar-track { background: transparent; }

/* ============ 应用骨架 ============ */
.app { display: flex; min-height: 100vh; }

.app-body {
  flex: 1;
  min-width: 0;
  margin-left: 250px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.app-content {
  flex: 1;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 32px 56px;
}

/* ============ 侧栏 ============ */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 250px;
  background: var(--sidebar-bg);
  color: var(--sidebar-fg);
  display: flex;
  flex-direction: column;
  z-index: 40;
  overflow: hidden;
}
.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 28% at 50% -4%, oklch(60.557% 0.106 184.91 / 0.16), transparent 70%),
    radial-gradient(ellipse 50% 20% at 80% 8%, oklch(77.559% 0.0862 19.21 / 0.06), transparent 70%);
}
.brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 20px 20px 18px;
  border-bottom: 1px solid var(--sidebar-border);
}
.brand-mark { width: 34px; height: 34px; flex: none; color: var(--sidebar-active-fg); }
.brand-name {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: oklch(96% 0.006 80);
  line-height: 1.1;
}
.brand-sub {
  display: block;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--sidebar-muted);
  margin-top: 2px;
}
.nav {
  position: relative;
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px 16px;
}
.nav-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--sidebar-muted);
  padding: 18px 10px 6px;
  text-transform: uppercase;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 40px;
  padding: 0 11px;
  border-radius: 9px;
  color: var(--sidebar-fg);
  font-size: 14px;
  font-weight: 500;
  transition: background 160ms var(--ease), color 160ms var(--ease);
}
.nav-item .ic { width: 18px; height: 18px; flex: none; opacity: 0.82; }
.nav-item:hover { background: var(--sidebar-hover); color: oklch(92% 0.01 80); }
.nav-item.active {
  background: var(--sidebar-active);
  color: var(--sidebar-active-fg);
  font-weight: 600;
}
.nav-item.active .ic { opacity: 1; }
.sidebar-foot {
  position: relative;
  padding: 14px 16px 16px;
  border-top: 1px solid var(--sidebar-border);
}
.user-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  background: var(--sidebar-active);
  color: var(--sidebar-active-fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
}
.user-name { font-size: 13px; font-weight: 500; color: var(--sidebar-fg); }
.sidebar-version {
  font-size: 11px;
  color: var(--sidebar-muted);
  margin-top: 12px;
}

/* ============ 顶栏 ============ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 62px;
  padding: 0 28px;
  background: color-mix(in oklab, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.breadcrumb { font-size: 11.5px; color: var(--muted); margin-bottom: 1px; }
.topbar-title { font-size: 16px; font-weight: 600; letter-spacing: 0.01em; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.model-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted);
  background: var(--surface);
  white-space: nowrap;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); flex: none; }

.user-chip { display: flex; align-items: center; gap: 9px; padding-left: 4px; }
.user-chip .avatar {
  width: 30px; height: 30px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.user-chip .uname { font-size: 13px; font-weight: 500; }

/* ============ 图标按钮 ============ */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: none;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  transition: background 160ms var(--ease), color 160ms var(--ease), border-color 160ms var(--ease);
}
.icon-btn .ic { width: 18px; height: 18px; }
.icon-btn:hover { background: var(--accent-soft); color: var(--accent-strong); }
.icon-btn.on-dark { color: var(--sidebar-muted); }
.icon-btn.on-dark:hover { background: var(--sidebar-hover); color: var(--sidebar-active-fg); }

/* ============ 按钮 ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 11px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform 160ms var(--ease), background 160ms var(--ease), border-color 160ms var(--ease), box-shadow 160ms var(--ease), color 160ms var(--ease);
  user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn .ic { width: 17px; height: 17px; }

.btn-primary {
  background: var(--accent-strong);
  color: #fff;
  box-shadow: 0 1px 2px oklch(51.09% 0.0861 186.4 / 0.35);
}
.btn-primary:hover { background: oklch(45.5% 0.082 186); box-shadow: 0 4px 14px oklch(51.09% 0.0861 186.4 / 0.32); }
.btn-primary:active { background: oklch(42.5% 0.08 186); }

.btn-secondary {
  background: var(--surface);
  color: var(--fg);
  border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--surface-2); border-color: var(--accent); color: var(--accent-strong); }

.btn-ghost {
  background: transparent;
  color: var(--muted);
}
.btn-ghost:hover { background: var(--accent-soft); color: var(--accent-strong); }

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover { background: oklch(46% 0.17 25); }

.btn-danger-ghost {
  background: transparent;
  color: var(--danger);
  border-color: oklch(52% 0.19 25 / 0.35);
}
.btn-danger-ghost:hover { background: var(--danger-soft); }

.btn-sm { min-height: 36px; padding: 0 14px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============ 卡片 ============ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 20px; }

/* ============ KPI ============ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.kpi-card {
  padding: 20px 20px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: border-color 180ms var(--ease), box-shadow 180ms var(--ease), transform 180ms var(--ease);
}
.kpi-card:hover {
  border-color: oklch(60.557% 0.106 184.91 / .42);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.kpi-label { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.kpi-value {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 600;
  line-height: 1.05;
  margin-top: 10px;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}
.kpi-value.accent { color: var(--accent-strong); }
.kpi-sub { font-size: 12px; color: var(--muted); margin-top: 7px; }
.kpi-delta { color: var(--success); font-weight: 600; }

/* ============ 次级统计条 ============ */
.stat-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  margin: 16px 0 20px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.stat-item { display: flex; align-items: baseline; gap: 8px; font-size: 13px; color: var(--muted); }
.stat-item b { font-family: var(--font-mono); font-size: 15px; font-weight: 600; color: var(--fg); font-variant-numeric: tabular-nums; }

/* ============ 图表卡片 ============ */
.chart-grid { display: grid; grid-template-columns: 1.9fr 1fr; gap: 16px; margin-bottom: 16px; }
.chart-grid.lower { grid-template-columns: 1.4fr 1fr; }
.chart-card { padding: 20px; }
.chart-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.chart-title { font-size: 15px; font-weight: 600; }
.chart-hint { font-size: 12px; color: var(--muted); }

/* ============ 图例 ============ */
.legend { display: flex; flex-direction: column; gap: 10px; }
.legend-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.legend-swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend-name { color: var(--fg); }
.legend-val { margin-left: auto; font-family: var(--font-mono); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.legend-pct { color: var(--muted); font-size: 12px; margin-left: 6px; }

/* ============ 状态列表 ============ */
.status-list { display: flex; flex-direction: column; }
.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
.status-row:last-child { border-bottom: 0; padding-bottom: 2px; }
.status-row .k { color: var(--muted); }
.status-row .v { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-variant-numeric: tabular-nums; }
.status-row .v.ok { color: var(--success); }

/* ============ 徽标 ============ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.badge-success { color: oklch(42% 0.11 152); background: var(--success-soft); }
.badge-warning { color: oklch(46% 0.11 70); background: var(--warning-soft); }
.badge-danger { color: oklch(45% 0.17 25); background: var(--danger-soft); }
.badge-neutral { color: var(--muted); background: oklch(50% 0.01 300 / 0.09); }
.badge-accent { color: oklch(42% 0.09 185); background: var(--accent-soft); }
.badge-gold { color: oklch(44% 0.09 85); background: oklch(74.32% 0.1171 89.51 / 0.22); }

/* ============ 表单 ============ */
.field { margin-bottom: 16px; }
.label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg);
  margin-bottom: 7px;
}
.label .req { color: var(--danger); margin-left: 2px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.input, .select, .textarea {
  width: 100%;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  font-size: 14px;
  color: var(--fg);
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}
.textarea { padding: 11px 13px; min-height: 88px; resize: vertical; line-height: 1.6; }
.input::placeholder, .textarea::placeholder { color: oklch(68% 0.01 300); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--accent); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* ============ 表格 ============ */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding: 11px 16px;
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
}
.table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tbody tr { transition: background 140ms var(--ease); }
.table tbody tr:hover { background: var(--accent-soft); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.table-actions { display: inline-flex; align-items: center; gap: 4px; }
.link-btn {
  border: 0;
  background: none;
  padding: 5px 8px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-strong);
  transition: background 140ms var(--ease);
}
.link-btn:hover { background: var(--accent-soft); }
.link-btn.danger { color: var(--danger); }
.link-btn.danger:hover { background: var(--danger-soft); }
.link-btn.neutral { color: var(--muted); }
.link-btn.neutral:hover { background: oklch(50% 0.01 300 / 0.08); }

/* ============ 页面头 ============ */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h2 { font-family: var(--font-display); font-size: 26px; font-weight: 600; letter-spacing: 0.01em; }
.page-head .sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.page-actions { display: flex; align-items: center; gap: 10px; }

/* ============ 工具条 ============ */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.toolbar .search { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.toolbar .search .ic {
  position: absolute;
  left: 13px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--muted); pointer-events: none;
}
.toolbar .search .input { padding-left: 38px; }

/* ============ 空状态 ============ */
.empty {
  text-align: center;
  padding: 56px 20px;
  color: var(--muted);
}
.empty .ic { width: 34px; height: 34px; margin: 0 auto 14px; opacity: 0.5; }
.empty .t { font-family: var(--font-display); font-size: 20px; color: var(--fg); margin-bottom: 6px; }
.empty .d { font-size: 13px; }

/* ============ 移动端底部 Tab ============ */
.mobile-tab {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 35;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.mobile-tab a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 2px;
  border-radius: 10px;
  font-size: 11px;
  color: var(--muted);
  min-height: 48px;
  justify-content: center;
}
.mobile-tab a .ic { width: 20px; height: 20px; }
.mobile-tab a.active { color: var(--accent-strong); font-weight: 600; }

.sidebar-scrim {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 38;
  background: oklch(0% 0 0 / 0.45);
  backdrop-filter: blur(2px);
}

/* ============ 响应式 ============ */
@media (max-width: 900px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .chart-grid, .chart-grid.lower { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform 220ms var(--ease); width: 264px; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-scrim.show { display: block; }
  .app-body { margin-left: 0; }
  .app-content { padding: 20px 16px 92px; }
  .topbar { padding: 0 16px; }
  .mobile-tab { display: flex; }
  .user-chip .uname { display: none; }
  .model-pill { display: none; }
  .menu-btn { display: inline-flex; }
}
@media (min-width: 769px) {
  .menu-btn { display: none; }
}

/* ============ 通用工具 ============ */
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.serif { font-family: var(--font-display); }
.ic { flex: none; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.row { display: flex; align-items: center; }
.spread { justify-content: space-between; }
.gap-2 { gap: 12px; }
.hidden { display: none !important; }

/* 入场动效 */
.fade-up { animation: fadeUp 420ms var(--ease) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ============ 抽屉 ============ */
.drawer-scrim {
  position: fixed; inset: 0; z-index: 60;
  background: oklch(0% 0 0 / .4);
  backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none;
  transition: opacity 200ms var(--ease);
}
.drawer-scrim.show { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 440px; max-width: 94vw;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  z-index: 61;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 240ms var(--ease);
}
.drawer.open { transform: translateX(0); }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.drawer-head h3 { font-size: 16px; font-weight: 600; }
.drawer-body { flex: 1; overflow-y: auto; padding: 22px; }
.drawer-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

/* ============ 分段控件 ============ */
.seg {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 3px; gap: 2px;
}
.seg button {
  border: 0; background: transparent;
  padding: 8px 16px; border-radius: 8px;
  font-size: 13.5px; font-weight: 500; color: var(--muted);
  transition: all 160ms var(--ease); min-height: 34px;
}
.seg button:hover { color: var(--fg); }
.seg button.active {
  background: var(--surface); color: var(--accent-strong);
  box-shadow: var(--shadow-sm); font-weight: 600;
}

/* ============ 标签 ============ */
.tag {
  display: inline-flex; align-items: center;
  height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; white-space: nowrap;
  background: oklch(50% 0.01 300 / .08); color: var(--muted);
}
.tag.accent { background: var(--accent-soft); color: oklch(42% 0.09 185); }
.tag.gold { background: oklch(74.32% 0.1171 89.51 / .2); color: oklch(44% 0.09 85); }
.tag.warn { background: var(--warning-soft); color: oklch(46% 0.11 70); }

/* ============ 步进器 ============ */
.stepper { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--border-strong); border-radius: 9px; overflow: hidden; }
.stepper button { width: 30px; height: 30px; border: 0; background: transparent; color: var(--muted); font-size: 15px; display: flex; align-items: center; justify-content: center; }
.stepper button:hover { background: var(--accent-soft); color: var(--accent-strong); }
.stepper .q { min-width: 28px; text-align: center; font-family: var(--font-mono); font-size: 13.5px; font-weight: 600; }
