/* ============================================================
   QMind 商城设计系统 · 完整组件库
   brandPrefix: mall
   单一品牌色相(品牌紫) + 状态色仅作语义色
   双主题：data-theme="light" (默认) / data-theme="dark"
   ============================================================ */

:root {
  /* —— 语义别名（浅色）—— */
  --mall-background: #f5f6fa;
  --mall-foreground: #1f2736;
  --mall-card: #ffffff;
  --mall-card-foreground: #1f2736;
  --mall-popover: #ffffff;
  --mall-popover-foreground: #1f2736;
  --mall-primary: #5947ad;
  --mall-primary-foreground: #ffffff;
  /* soft 底上的主色文字。浅色下 soft 底极淡，与 primary 同值即可 */
  --mall-primary-on-soft: #5947ad;
  --mall-muted: #f0f2f7;
  --mall-muted-foreground: #626e80;
  --mall-border: #d8dce6;
  --mall-input: #d8dce6;
  --mall-ring: #3f56d9;

  /* —— 圆角刻度 —— */
  --mall-radius-sm: 6px;
  --mall-radius-md: 10px;
  --mall-radius-lg: 14px;
  --mall-radius-pill: 999px;

  /* —— 品牌紫色阶 —— */
  --mall-primary-solid: #5947ad;
  --mall-primary-soft: #f0edf9;
  --mall-primary-soft-hover: #e7e1f4;
  --mall-primary-soft-border: #e2dcf4;
  --mall-primary-hover: #6a55b8;
  --mall-primary-grad-a: #714ea3;
  --mall-primary-grad-b: #4948a5;
  --mall-primary-hover-grad-a: #7b58b0;
  --mall-primary-hover-grad-b: #5554b5;

  /* —— 状态色(浅底 + 深字成对)—— */
  --mall-success: #1f7a53;
  --mall-success-soft: #ddf6e7;
  --mall-success-soft-hover: #c9eed7;
  --mall-success-soft-border: #b9e6cb;
  --mall-warning: #8a5f06;
  --mall-warning-soft: #fff4cf;
  --mall-warning-soft-hover: #fbeab4;
  --mall-warning-soft-border: #f3e3a4;
  --mall-danger: #b53b3b;
  --mall-danger-soft: #fde4e4;
  --mall-danger-soft-hover: #f8d5d5;
  --mall-danger-soft-border: #f5c2c2;
  --mall-info: #315baf;
  --mall-info-soft: #e4ecff;
  --mall-info-soft-hover: #d3e0fd;
  --mall-info-soft-border: #c8d6f7;

  /* —— 中性面 —— */
  --mall-surface: #ffffff;
  --mall-surface-muted: #f0f2f7;
  --mall-surface-sunken: #ebedf3;
  --mall-border-soft: #e5e8ef;
  --mall-border-strong: #c6cbd6;

  /* —— 半透明层 / 玻璃面 —— */
  --mall-navbar-bg: rgba(255, 255, 255, 0.92);
  --mall-overlay: rgba(15, 18, 25, 0.5);
  --mall-glass-border: rgba(255, 255, 255, 0.3);
  --mall-glass-fill: rgba(255, 255, 255, 0.12);
  --mall-glass-fill-hover: rgba(255, 255, 255, 0.2);
  --mall-glass-fill-strong: rgba(255, 255, 255, 0.9);

  /* —— 效果层（阴影 / 光环）—— */
  --mall-shadow-card: 0 1px 2px rgba(41, 48, 71, 0.04), 0 2px 8px rgba(41, 48, 71, 0.05);
  --mall-shadow-card-hover: 0 2px 4px rgba(41, 48, 71, 0.06), 0 12px 28px rgba(41, 48, 71, 0.10);
  --mall-shadow-pop: 0 18px 55px rgba(41, 48, 71, 0.14);
  --mall-shadow-inset-tab: 0 1px 3px rgba(41, 48, 71, 0.08);
  --mall-ring-soft: rgba(89, 71, 173, 0.14);
  --mall-ring-danger: rgba(181, 59, 59, 0.18);
  --mall-glow-brand-sm: 0 4px 12px rgba(73, 72, 165, 0.20);
  --mall-glow-brand-md: 0 6px 16px rgba(73, 72, 165, 0.28);
  --mall-glow-brand-xs: 0 2px 6px rgba(73, 72, 165, 0.20);
  --mall-glow-mark: 0 6px 16px rgba(82, 66, 163, 0.28);
  --mall-row-hover: rgba(240, 237, 249, 0.35);

  /* —— 字体栈 —— */
  --mall-font-body: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  --mall-font-mono: "Cascadia Code", "JetBrains Mono", ui-monospace, Consolas, monospace;

  /* —— 字阶 8 档 —— */
  --mall-text-page-title: 24px;
  --mall-text-section-title: 20px;
  --mall-text-card-title: 16px;
  --mall-text-product: 14.5px;
  --mall-text-body: 14px;
  --mall-text-helper: 13.5px;
  --mall-text-badge: 12.5px;
  --mall-text-micro: 11.5px;

  /* —— 间距 8 档 —— */
  --mall-space-1: 4px;
  --mall-space-2: 8px;
  --mall-space-3: 12px;
  --mall-space-4: 16px;
  --mall-space-5: 20px;
  --mall-space-6: 24px;
  --mall-space-7: 32px;
  --mall-space-8: 48px;
  --mall-space-9: 64px;

  /* —— 行高 —— */
  --mall-leading-tight: 1.2;
  --mall-leading-snug: 1.4;
  --mall-leading-normal: 1.55;
}

/* ============================================================
   深色主题
   由 theme.js 解析 system / light / dark 后写入 html[data-theme]
   ============================================================ */
[data-theme="dark"] {
  color-scheme: dark;

  /* —— 表面层：整体提亮一档，bg→card 的相对亮度差从 61% 拉到 138% —— */
  --mall-background: #12141a;
  --mall-foreground: #e8ebf2;
  --mall-card: #1f232c;
  --mall-card-foreground: #e8ebf2;
  --mall-popover: #262b36;
  --mall-popover-foreground: #e8ebf2;

  /* —— 主色：比浅色主题的 #5947ad 提亮是必须的（深底上原色仅 2.5:1），
         但不应提到 #a394f0 那么亮。取能过 WCAG AA 的最暗一档 —— */
  --mall-primary: #8f7ee6;            /* 卡片 4.72:1 · 页面底 5.52:1 */
  --mall-primary-foreground: #ffffff;
  /* soft 底会抬高背景亮度，同色文字只有 3.86:1，故 soft 底上单独用亮一档 */
  --mall-primary-on-soft: #b3a5f5;    /* soft 底 5.89:1 · 卡片 7.20:1 */

  --mall-muted: #282d38;
  --mall-muted-foreground: #98a2b6;
  --mall-border: #3a4150;
  --mall-input: #3a4150;
  --mall-ring: #8f7ee6;

  --mall-primary-solid: #6354b8;      /* 白字 6.02:1 */
  --mall-primary-soft: rgba(143, 126, 230, 0.14);
  --mall-primary-soft-hover: rgba(143, 126, 230, 0.22);
  --mall-primary-soft-border: rgba(143, 126, 230, 0.30);
  --mall-primary-hover: #a394f0;
  --mall-primary-grad-a: #6d5ec0;
  --mall-primary-grad-b: #5a4fae;
  --mall-primary-hover-grad-a: #7b6bd0;
  --mall-primary-hover-grad-b: #675bbd;

  --mall-success: #57c98a;
  --mall-success-soft: rgba(87, 201, 138, 0.13);
  --mall-success-soft-hover: rgba(87, 201, 138, 0.21);
  --mall-success-soft-border: rgba(87, 201, 138, 0.28);
  --mall-warning: #e0b341;
  --mall-warning-soft: rgba(224, 179, 65, 0.13);
  --mall-warning-soft-hover: rgba(224, 179, 65, 0.21);
  --mall-warning-soft-border: rgba(224, 179, 65, 0.28);
  --mall-danger: #f2777a;
  --mall-danger-soft: rgba(242, 119, 122, 0.13);
  --mall-danger-soft-hover: rgba(242, 119, 122, 0.21);
  --mall-danger-soft-border: rgba(242, 119, 122, 0.30);
  --mall-info: #7ba7f7;
  --mall-info-soft: rgba(123, 167, 247, 0.13);
  --mall-info-soft-hover: rgba(123, 167, 247, 0.21);
  --mall-info-soft-border: rgba(123, 167, 247, 0.28);

  --mall-surface: #1f232c;
  --mall-surface-muted: #282d38;
  --mall-surface-sunken: #0e1015;
  /* 边框同步提亮：这是让表格 / 卡片边界"看得见"的关键，不只是卡片变亮 */
  --mall-border-soft: #303643;
  --mall-border-strong: #4a5262;

  --mall-navbar-bg: rgba(18, 20, 26, 0.90);
  --mall-overlay: rgba(0, 0, 0, 0.62);
  --mall-glass-border: rgba(255, 255, 255, 0.16);
  --mall-glass-fill: rgba(255, 255, 255, 0.07);
  --mall-glass-fill-hover: rgba(255, 255, 255, 0.14);
  --mall-glass-fill-strong: rgba(255, 255, 255, 0.9);

  --mall-shadow-card: 0 1px 2px rgba(0, 0, 0, 0.40), 0 2px 8px rgba(0, 0, 0, 0.28);
  --mall-shadow-card-hover: 0 2px 4px rgba(0, 0, 0, 0.42), 0 12px 28px rgba(0, 0, 0, 0.46);
  --mall-shadow-pop: 0 18px 55px rgba(0, 0, 0, 0.58);
  --mall-shadow-inset-tab: 0 1px 3px rgba(0, 0, 0, 0.42);
  --mall-ring-soft: rgba(143, 126, 230, 0.26);
  --mall-ring-danger: rgba(242, 119, 122, 0.28);
  --mall-glow-brand-sm: 0 4px 12px rgba(0, 0, 0, 0.34);
  --mall-glow-brand-md: 0 6px 16px rgba(0, 0, 0, 0.42);
  --mall-glow-brand-xs: 0 2px 6px rgba(0, 0, 0, 0.34);
  --mall-glow-mark: 0 6px 16px rgba(0, 0, 0, 0.40);
  /* 表面提亮后，行悬停需要略强的着色才看得出来 */
  --mall-row-hover: rgba(143, 126, 230, 0.09);
}

/* ============================================================
   基础
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { min-width: 320px; }
body {
  min-height: 100vh;
  color: var(--mall-foreground);
  background: var(--mall-background);
  font-family: var(--mall-font-body);
  font-size: var(--mall-text-body);
  line-height: var(--mall-leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.2s ease, color 0.2s ease;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
img, svg { display: block; max-width: 100%; }
svg.icon { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
svg.icon-sm { width: 14px; height: 14px; }
svg.icon-md { width: 16px; height: 16px; }
svg.icon-lg { width: 20px; height: 20px; }
svg.icon-xl { width: 24px; height: 24px; }

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ============================================================
   字阶工具类
   ============================================================ */
.mall-t-page-title { font-size: var(--mall-text-page-title); font-weight: 700; line-height: var(--mall-leading-tight); letter-spacing: -0.01em; }
.mall-t-section { font-size: var(--mall-text-section-title); font-weight: 700; line-height: var(--mall-leading-tight); letter-spacing: -0.005em; }
.mall-t-card { font-size: var(--mall-text-card-title); font-weight: 600; line-height: var(--mall-leading-snug); }
.mall-t-product { font-size: var(--mall-text-product); font-weight: 600; line-height: var(--mall-leading-snug); }
.mall-t-body { font-size: var(--mall-text-body); }
.mall-t-helper { font-size: var(--mall-text-helper); color: var(--mall-muted-foreground); }
.mall-t-badge { font-size: var(--mall-text-badge); font-weight: 500; }
.mall-t-micro { font-size: var(--mall-text-micro); color: var(--mall-muted-foreground); }
.mall-t-mono { font-family: var(--mall-font-mono); }
.mall-t-eyebrow { font-size: var(--mall-text-micro); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mall-muted-foreground); }

/* ============================================================
   渐变与品牌色
   ============================================================ */
.mall-gradient-primary { background: linear-gradient(135deg, var(--mall-primary-grad-a), var(--mall-primary-grad-b)); }
.mall-text-primary { color: var(--mall-primary); }
.mall-bg-primary-soft { background: var(--mall-primary-soft); }
.mall-border-primary-soft { border-color: var(--mall-primary-soft-border); }

/* ============================================================
   按钮 4 个变体 × 3 个尺寸
   ============================================================ */
.mall-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  border-radius: var(--mall-radius-sm);
  font-size: var(--mall-text-body);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.08s ease;
  user-select: none;
  border: 1px solid transparent;
}
.mall-btn:focus-visible { outline: 2px solid var(--mall-ring); outline-offset: 2px; }
.mall-btn:active { transform: translateY(1px); }
.mall-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.mall-btn-sm { height: 30px; padding: 0 12px; font-size: var(--mall-text-helper); }
.mall-btn-lg { height: 44px; padding: 0 22px; font-size: 15px; }
.mall-btn-block { width: 100%; }
.mall-btn-icon { width: 36px; padding: 0; }
.mall-btn-icon.mall-btn-sm { width: 30px; }
.mall-btn-icon.mall-btn-lg { width: 44px; }

.mall-btn-primary { background: linear-gradient(135deg, var(--mall-primary-grad-a), var(--mall-primary-grad-b)); color: var(--mall-primary-foreground); box-shadow: var(--mall-glow-brand-sm); }
.mall-btn-primary:hover { background: linear-gradient(135deg, var(--mall-primary-hover-grad-a), var(--mall-primary-hover-grad-b)); box-shadow: var(--mall-glow-brand-md); }
.mall-btn-primary:active { box-shadow: var(--mall-glow-brand-xs); }

.mall-btn-secondary { background: var(--mall-primary-soft); color: var(--mall-primary-on-soft); border-color: var(--mall-primary-soft-border); }
.mall-btn-secondary:hover { background: var(--mall-primary-soft-hover); }
.mall-btn-secondary.is-active { background: linear-gradient(135deg, var(--mall-primary-grad-a), var(--mall-primary-grad-b)); color: var(--mall-primary-foreground); border-color: transparent; box-shadow: var(--mall-glow-brand-sm); }

.mall-btn-ghost { background: transparent; color: var(--mall-foreground); }
.mall-btn-ghost:hover { background: var(--mall-muted); }

.mall-btn-outline { background: var(--mall-surface); color: var(--mall-foreground); border-color: var(--mall-border); }
.mall-btn-outline:hover { border-color: var(--mall-border-strong); background: var(--mall-surface-muted); }

.mall-btn-danger { background: var(--mall-danger-soft); color: var(--mall-danger); border-color: var(--mall-danger-soft-border); }
.mall-btn-danger:hover { background: var(--mall-danger-soft-hover); }

.mall-btn-success { background: var(--mall-success-soft); color: var(--mall-success); border-color: var(--mall-success-soft-border); }
.mall-btn-success:hover { background: var(--mall-success-soft-hover); }

/* ============================================================
   返回（Back）—— 统一组件
   图标固定为 arrow-left，hover 时图标左移 2px
   ============================================================ */
.mall-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px 0 8px;
  border-radius: var(--mall-radius-pill);
  color: var(--mall-muted-foreground);
  font-size: var(--mall-text-helper);
  font-weight: 600;
  line-height: 1;
  transition: background 0.16s ease, color 0.16s ease;
}
.mall-back > svg { flex: none; transition: transform 0.18s cubic-bezier(0.4, 0, 0.2, 1); }
.mall-back:hover { background: var(--mall-muted); color: var(--mall-foreground); }
.mall-back:hover > svg { transform: translateX(-2px); }
.mall-back:focus-visible { outline: 2px solid var(--mall-ring); outline-offset: 2px; }

/* 无气泡的纯文字返回 */
.mall-back-plain { padding: 0; background: none; border-radius: var(--mall-radius-sm); }
.mall-back-plain:hover { background: none; color: var(--mall-primary); }

/* 圆形图标返回 */
.mall-back-round {
  width: 32px;
  height: 32px;
  padding: 0;
  justify-content: center;
  border: 1px solid var(--mall-border-soft);
  background: var(--mall-surface);
  color: var(--mall-muted-foreground);
}
.mall-back-round:hover { border-color: var(--mall-border-strong); background: var(--mall-surface-muted); color: var(--mall-foreground); }

/* 页面级返回（带分隔线的面包屑式） */
.mall-back-crumb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 0 12px;
  font-size: var(--mall-text-helper);
  color: var(--mall-muted-foreground);
}
.mall-back-crumb a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; transition: color 0.16s; }
.mall-back-crumb a > svg { transition: transform 0.18s cubic-bezier(0.4, 0, 0.2, 1); }
.mall-back-crumb a:hover { color: var(--mall-primary); }
.mall-back-crumb a:hover > svg { transform: translateX(-2px); }

/* ============================================================
   主题切换器
   ============================================================ */
.mall-theme-cycle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--mall-border-soft);
  background: var(--mall-surface);
  color: var(--mall-muted-foreground);
  transition: color 0.16s, border-color 0.16s, background 0.16s;
}
.mall-theme-cycle:hover { color: var(--mall-primary-on-soft); border-color: var(--mall-primary-soft-border); background: var(--mall-primary-soft); }
.mall-theme-cycle:focus-visible { outline: 2px solid var(--mall-ring); outline-offset: 2px; }
.mall-theme-cycle > svg { display: none; }
.mall-theme-cycle[data-current="light"] > .i-light,
.mall-theme-cycle[data-current="dark"] > .i-dark,
.mall-theme-cycle[data-current="system"] > .i-system { display: block; }

/* ============================================================
   表单
   ============================================================ */
.mall-field { display: flex; flex-direction: column; gap: 6px; }
.mall-label { font-size: var(--mall-text-helper); font-weight: 600; color: var(--mall-foreground); }
.mall-label-required::after { content: " *"; color: var(--mall-danger); }
.mall-help { font-size: var(--mall-text-badge); color: var(--mall-muted-foreground); }
.mall-error { font-size: var(--mall-text-badge); color: var(--mall-danger); }

.mall-input,
.mall-select,
.mall-textarea {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  background: var(--mall-surface);
  border: 1px solid var(--mall-border);
  border-radius: var(--mall-radius-sm);
  font-size: var(--mall-text-body);
  color: var(--mall-foreground);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.mall-textarea { height: auto; min-height: 88px; padding: 10px 12px; line-height: var(--mall-leading-snug); resize: vertical; }
.mall-select { padding-right: 32px; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236e7a8f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: right 10px center; background-size: 14px; appearance: none; }
[data-theme="dark"] .mall-select { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2398a2b6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>"); }
.mall-input::placeholder, .mall-textarea::placeholder { color: var(--mall-muted-foreground); }
.mall-input:hover:not(:focus), .mall-select:hover:not(:focus), .mall-textarea:hover:not(:focus) { border-color: var(--mall-border-strong); }
.mall-input:focus, .mall-select:focus, .mall-textarea:focus { outline: none; border-color: var(--mall-primary); box-shadow: 0 0 0 3px var(--mall-ring-soft); }
.mall-input:disabled, .mall-select:disabled, .mall-textarea:disabled { background: var(--mall-muted); color: var(--mall-muted-foreground); cursor: not-allowed; }

.mall-input-lg { height: 44px; font-size: 15px; }
.mall-input-error { border-color: var(--mall-danger); }
.mall-input-error:focus { box-shadow: 0 0 0 3px var(--mall-ring-danger); }

.mall-input-group { position: relative; }
.mall-input-group .mall-input { padding-left: 36px; }
.mall-input-group .mall-input-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--mall-muted-foreground); pointer-events: none; }
.mall-input-group .mall-input-action { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }

/* —— 开关 —— */
.mall-switch { position: relative; display: inline-block; width: 36px; height: 20px; flex: none; cursor: pointer; }
.mall-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.mall-switch-track { position: absolute; inset: 0; border-radius: 10px; background: var(--mall-border-strong); transition: background 0.2s; }
.mall-switch-thumb { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.2s; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); }
.mall-switch input:checked ~ .mall-switch-track { background: var(--mall-primary-solid); }
.mall-switch input:checked ~ .mall-switch-thumb { transform: translateX(16px); }
.mall-switch input:focus-visible ~ .mall-switch-track { outline: 2px solid var(--mall-ring); outline-offset: 2px; }

/* ============================================================
   卡片
   ============================================================ */
.mall-card {
  background: var(--mall-card);
  border: 1px solid var(--mall-border-soft);
  border-radius: var(--mall-radius-md);
  box-shadow: var(--mall-shadow-card);
}
.mall-card-pad { padding: 20px; }
.mall-card-pad-lg { padding: 28px; }
.mall-card-header { padding: 18px 20px; border-bottom: 1px solid var(--mall-border-soft); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mall-card-body { padding: 20px; }
.mall-card-footer { padding: 14px 20px; border-top: 1px solid var(--mall-border-soft); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mall-card-title { font-size: var(--mall-text-card-title); font-weight: 600; }

/* ============================================================
   徽标 (badge)
   ============================================================ */
.mall-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 9px;
  border-radius: var(--mall-radius-sm);
  font-size: var(--mall-text-badge);
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}
.mall-badge-dot { padding-left: 6px; }
.mall-badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.mall-badge-primary { background: var(--mall-primary-soft); color: var(--mall-primary-on-soft); border: 1px solid var(--mall-primary-soft-border); }
.mall-badge-success { background: var(--mall-success-soft); color: var(--mall-success); border: 1px solid var(--mall-success-soft-border); }
.mall-badge-warning { background: var(--mall-warning-soft); color: var(--mall-warning); border: 1px solid var(--mall-warning-soft-border); }
.mall-badge-danger  { background: var(--mall-danger-soft);  color: var(--mall-danger);  border: 1px solid var(--mall-danger-soft-border); }
.mall-badge-info    { background: var(--mall-info-soft);    color: var(--mall-info);    border: 1px solid var(--mall-info-soft-border); }
.mall-badge-neutral { background: var(--mall-muted); color: var(--mall-muted-foreground); border: 1px solid var(--mall-border-soft); }
.mall-badge-outline { background: transparent; color: var(--mall-muted-foreground); border: 1px solid var(--mall-border); }

.mall-badge-lg { height: 28px; padding: 0 12px; font-size: 13px; }

/* ============================================================
   状态点
   ============================================================ */
.mall-status { display: inline-flex; align-items: center; gap: 6px; font-size: var(--mall-text-badge); font-weight: 500; }
.mall-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--mall-muted-foreground); }
.mall-status-ok::before { background: var(--mall-success); }
.mall-status-pending::before { background: var(--mall-warning); }
.mall-status-bad::before { background: var(--mall-danger); }
.mall-status-info::before { background: var(--mall-info); }

/* ============================================================
   表格
   ============================================================ */
.mall-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.mall-table th, .mall-table td { padding: 12px 16px; border-bottom: 1px solid var(--mall-border-soft); font-size: var(--mall-text-helper); text-align: left; vertical-align: middle; }
.mall-table th { font-weight: 600; color: var(--mall-muted-foreground); background: var(--mall-surface-muted); font-size: var(--mall-text-micro); letter-spacing: 0.06em; text-transform: uppercase; }
.mall-table th:first-child { border-top-left-radius: var(--mall-radius-md); }
.mall-table th:last-child { border-top-right-radius: var(--mall-radius-md); }
.mall-table tr:last-child td { border-bottom: 0; }
.mall-table tbody tr:hover { background: var(--mall-row-hover); }
.mall-table td a { color: var(--mall-primary); }
.mall-table td a:hover { text-decoration: underline; }
.mall-table-card { background: var(--mall-card); border: 1px solid var(--mall-border-soft); border-radius: var(--mall-radius-md); overflow: hidden; box-shadow: var(--mall-shadow-card); }
.mall-table-card .mall-table th { background: var(--mall-surface-muted); }

/* ============================================================
   导航
   ============================================================ */
.mall-navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  padding: 0 32px;
  background: var(--mall-navbar-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--mall-border-soft);
}
.mall-navbar-brand { display: inline-flex; align-items: center; gap: 10px; }
.mall-navbar-brand-mark { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--mall-primary-grad-a), var(--mall-primary-grad-b)); box-shadow: var(--mall-glow-mark); font-weight: 800; font-style: italic; font-size: 17px; }
.mall-navbar-brand-text { display: grid; line-height: 1.1; }
.mall-navbar-brand-text strong { font-size: 15px; font-weight: 750; letter-spacing: 0.005em; }
.mall-navbar-brand-text small { font-size: 10.5px; font-weight: 600; color: var(--mall-muted-foreground); margin-top: 2px; }

.mall-navbar-links { display: flex; align-items: center; gap: 4px; }
.mall-navbar-links a { padding: 7px 12px; border-radius: 8px; color: var(--mall-muted-foreground); font-size: 13.5px; font-weight: 600; transition: color 0.16s ease, background 0.16s ease; }
.mall-navbar-links a:hover { color: var(--mall-foreground); background: var(--mall-muted); }
.mall-navbar-links a.is-active { color: var(--mall-primary-on-soft); background: var(--mall-primary-soft); }

.mall-navbar-right { display: inline-flex; align-items: center; gap: 10px; }
.mall-avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--mall-primary-soft); color: var(--mall-primary-on-soft); font-weight: 700; font-size: 13px; border: 1px solid var(--mall-primary-soft-border); }
.mall-mobile-menu { display: none; position: relative; }
.mall-mobile-menu summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px; border: 1px solid var(--mall-border); border-radius: var(--mall-radius-sm); font-size: 13px; font-weight: 600; cursor: pointer; }
.mall-mobile-menu summary::-webkit-details-marker { display: none; }
.mall-mobile-menu-panel { position: absolute; top: calc(100% + 10px); right: 0; width: 220px; display: grid; gap: 4px; padding: 8px; border: 1px solid var(--mall-border-soft); border-radius: var(--mall-radius-md); background: var(--mall-popover); box-shadow: var(--mall-shadow-pop); }
.mall-mobile-menu-panel a { padding: 10px 12px; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--mall-muted-foreground); }
.mall-mobile-menu-panel a:hover, .mall-mobile-menu-panel a.is-active { color: var(--mall-primary-on-soft); background: var(--mall-primary-soft); }

@media (max-width: 760px) {
  .mall-navbar { height: 56px; padding: 0 14px; gap: 12px; }
  .mall-navbar-links, .mall-admin-link, .mall-greeting, .mall-navbar-right > .mall-avatar { display: none; }
  .mall-navbar-right { gap: 6px; }
  .mall-mobile-menu { display: block; }
  .mall-navbar-brand-text small { display: none; }
  .mall-container, .mall-container-sm, .mall-container-xs { padding-left: 16px; padding-right: 16px; }
}

/* ============================================================
   布局容器
   ============================================================ */
.mall-container { max-width: 1280px; margin: 0 auto; padding: 0 32px; }
.mall-container-sm { max-width: 880px; margin: 0 auto; padding: 0 32px; }
.mall-container-xs { max-width: 480px; margin: 0 auto; padding: 0 32px; }
.mall-stack { display: flex; flex-direction: column; }
.mall-stack-2 { display: flex; flex-direction: column; gap: 8px; }
.mall-stack-3 { display: flex; flex-direction: column; gap: 12px; }
.mall-stack-4 { display: flex; flex-direction: column; gap: 16px; }
.mall-stack-6 { display: flex; flex-direction: column; gap: 24px; }
.mall-row { display: flex; align-items: center; }
.mall-row-2 { display: flex; align-items: center; gap: 8px; }
.mall-row-3 { display: flex; align-items: center; gap: 12px; }
.mall-row-4 { display: flex; align-items: center; gap: 16px; }
.mall-row-between { display: flex; align-items: center; justify-content: space-between; }
.mall-spacer { flex: 1; }

/* ============================================================
   提示
   ============================================================ */
.mall-alert { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--mall-radius-sm); border: 1px solid; font-size: var(--mall-text-helper); }
.mall-alert svg { flex-shrink: 0; margin-top: 2px; }
.mall-alert-info { background: var(--mall-info-soft); color: var(--mall-info); border-color: var(--mall-info-soft-border); }
.mall-alert-success { background: var(--mall-success-soft); color: var(--mall-success); border-color: var(--mall-success-soft-border); }
.mall-alert-warning { background: var(--mall-warning-soft); color: var(--mall-warning); border-color: var(--mall-warning-soft-border); }
.mall-alert-danger { background: var(--mall-danger-soft); color: var(--mall-danger); border-color: var(--mall-danger-soft-border); }

/* ============================================================
   标签页 (Tabs)
   ============================================================ */
.mall-tabs { display: flex; gap: 2px; padding: 4px; background: var(--mall-muted); border-radius: var(--mall-radius-md); }
.mall-tab { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 7px; color: var(--mall-muted-foreground); font-size: var(--mall-text-helper); font-weight: 600; transition: color 0.16s, background 0.16s; }
.mall-tab:hover { color: var(--mall-foreground); }
.mall-tab.is-active { background: var(--mall-surface); color: var(--mall-primary); box-shadow: var(--mall-shadow-inset-tab); }
.mall-tab:focus-visible { outline: 2px solid var(--mall-ring); outline-offset: 1px; }

.mall-tab-underline { display: flex; gap: 4px; border-bottom: 1px solid var(--mall-border-soft); }
.mall-tab-underline .mall-tab { height: 38px; border-radius: 0; border-bottom: 2px solid transparent; }
.mall-tab-underline .mall-tab.is-active { background: transparent; color: var(--mall-primary); border-bottom-color: var(--mall-primary); box-shadow: none; }

/* ============================================================
   分页
   ============================================================ */
.mall-pager { display: inline-flex; gap: 4px; }
.mall-pager a, .mall-pager span { min-width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; padding: 0 10px; border-radius: 7px; font-size: var(--mall-text-helper); color: var(--mall-muted-foreground); border: 1px solid var(--mall-border-soft); background: var(--mall-surface); }
.mall-pager a:hover { color: var(--mall-primary); border-color: var(--mall-primary-soft-border); }
.mall-pager .is-current { background: var(--mall-primary-solid); color: #fff; border-color: var(--mall-primary-solid); }

/* ============================================================
   进度条
   ============================================================ */
.mall-progress { height: 6px; background: var(--mall-muted); border-radius: 999px; overflow: hidden; }
.mall-progress-bar { height: 100%; background: linear-gradient(90deg, var(--mall-primary-grad-a), var(--mall-primary-grad-b)); border-radius: 999px; transition: width 0.3s ease; }

/* ============================================================
   空状态
   ============================================================ */
.mall-empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 56px 24px; text-align: center; color: var(--mall-muted-foreground); }
.mall-empty-icon { width: 56px; height: 56px; border-radius: 16px; background: var(--mall-primary-soft); color: var(--mall-primary-on-soft); display: grid; place-items: center; }

/* ============================================================
   Markdown 正文排版（.md-body）
   ------------------------------------------------------------
   插件详情正文 = 插件作者自带的 .md 文档，内容格式不可控。
   因此这里只定义「渲染规范」，不定义内容结构 —— 任何合法
   Markdown 渲染出来都好看，且不会反过来要求插件必须提供
   截图 / 版本历史 / 特性列表等结构化内容。
   ============================================================ */
.md-body {
  font-size: 15px;
  line-height: 1.8;
  color: var(--mall-foreground);
  overflow-wrap: break-word;
}
.md-body > *:first-child { margin-top: 0; }
.md-body > *:last-child { margin-bottom: 0; }

/* — 标题：四级足够，h5/h6 与 h4 同规格避免层级塌陷 — */
.md-body h1, .md-body h2, .md-body h3,
.md-body h4, .md-body h5, .md-body h6 {
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--mall-foreground);
}
.md-body h1 { font-size: 24px; margin: 36px 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--mall-border-soft); }
.md-body h2 { font-size: 19px; margin: 32px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--mall-border-soft); }
.md-body h3 { font-size: 16px; margin: 26px 0 10px; }
.md-body h4, .md-body h5, .md-body h6 { font-size: 14.5px; margin: 22px 0 8px; color: var(--mall-foreground); }
/* 首个标题不带上边距，避免与文档容器顶部打架 */
.md-body > h1:first-child, .md-body > h2:first-child { margin-top: 0; }

/* — 段落与列表 — */
.md-body p { margin: 0 0 14px; }
.md-body ul, .md-body ol { margin: 0 0 14px; padding-left: 24px; }
.md-body li { margin: 4px 0; }
.md-body li > ul, .md-body li > ol { margin: 4px 0; }
.md-body ul { list-style: disc; }
.md-body ol { list-style: decimal; }
.md-body li::marker { color: var(--mall-muted-foreground); }
.md-body strong { font-weight: 700; }
.md-body em { font-style: italic; }
.md-body del { color: var(--mall-muted-foreground); }

/* — 链接 — */
.md-body a { color: var(--mall-primary); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.md-body a:hover { color: var(--mall-primary-hover); }

/* — 行内代码 — */
.md-body code {
  font-family: var(--mall-font-mono);
  font-size: 0.875em;
  padding: 0.15em 0.4em;
  border-radius: 4px;
  background: var(--mall-muted);
  color: var(--mall-foreground);
  border: 1px solid var(--mall-border-soft);
}

/* — 代码块 — */
.md-body pre {
  margin: 0 0 16px;
  padding: 16px 18px;
  border-radius: var(--mall-radius-md);
  background: var(--mall-surface-muted);
  border: 1px solid var(--mall-border-soft);
  overflow-x: auto;
  line-height: 1.65;
}
.md-body pre code {
  padding: 0;
  background: none;
  border: 0;
  font-size: 13px;
  color: var(--mall-foreground);
  white-space: pre;
}

/* — 引用 — */
.md-body blockquote {
  margin: 0 0 16px;
  padding: 12px 16px;
  border-left: 3px solid var(--mall-primary);
  background: var(--mall-primary-soft);
  border-radius: 0 var(--mall-radius-sm) var(--mall-radius-sm) 0;
  color: var(--mall-foreground);
}
.md-body blockquote > *:last-child { margin-bottom: 0; }

/* — 表格（Markdown 表格是插件参数说明的常用载体）— */
.md-body table {
  width: 100%;
  margin: 0 0 18px;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--mall-border-soft);
  border-radius: var(--mall-radius-md);
  overflow: hidden;
  font-size: 14px;
}
.md-body th, .md-body td { padding: 10px 14px; border-bottom: 1px solid var(--mall-border-soft); text-align: left; vertical-align: top; }
.md-body th { background: var(--mall-surface-muted); font-weight: 600; font-size: 13px; color: var(--mall-foreground); }
.md-body tr:last-child td { border-bottom: 0; }

/* — 图片：自适应，圆角，不撑破容器 — */
.md-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 18px 0;
  border-radius: var(--mall-radius-md);
  border: 1px solid var(--mall-border-soft);
  background: var(--mall-surface-muted);
}

/* — 分割线 — */
.md-body hr { height: 1px; border: 0; background: var(--mall-border-soft); margin: 28px 0; }

/* — 任务列表 checkbox — */
.md-body input[type="checkbox"] { margin-right: 6px; accent-color: var(--mall-primary-solid); }

/* — 键盘按键 — */
.md-body kbd {
  display: inline-block;
  padding: 2px 7px;
  font-family: var(--mall-font-mono);
  font-size: 12px;
  border-radius: 5px;
  background: var(--mall-surface-muted);
  border: 1px solid var(--mall-border);
  border-bottom-width: 2px;
  color: var(--mall-foreground);
}

/* ============================================================
   工具：分割线 / 隐藏
   ============================================================ */
.mall-divider { height: 1px; background: var(--mall-border-soft); margin: 16px 0; }
.mall-hidden { display: none !important; }
.mall-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mall-text-center { text-align: center; }
.mall-text-right { text-align: right; }



/* ============================================================
   页面段 · c-home
   ============================================================ */

/* 工具栏与固定宽度卡片使用同一列宽，避免搜索框落在卡片区之外。 */
  .cs-toolbar, .cs-grid { width: 1040px; max-width: 100%; }
  @media (max-width: 1103px) { .cs-toolbar, .cs-grid { width: 830px; } }
  @media (max-width: 893px) { .cs-toolbar, .cs-grid { width: 620px; } }
  @media (max-width: 683px) { .cs-toolbar, .cs-grid { width: 410px; } }

  .cs-toolbar { position: sticky; top: 60px; z-index: 90; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 20px 0 14px; background: var(--mall-navbar-bg); backdrop-filter: blur(20px); }
  .cs-tabs { display: flex; gap: 2px; padding: 4px; background: var(--mall-muted); border-radius: var(--mall-radius-md); }
  .cs-tab { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 14px; border-radius: 7px; font-size: 13.5px; font-weight: 600; color: var(--mall-muted-foreground); transition: color .16s, background .16s; }
  .cs-tab .icon { width: 15px; height: 15px; }
  .cs-tab:hover { color: var(--mall-foreground); }
  .cs-tab.is-active { color: var(--mall-primary-foreground); background: linear-gradient(135deg, var(--mall-primary-grad-a), var(--mall-primary-grad-b)); box-shadow: var(--mall-glow-brand-sm); }
  .cs-search { position: relative; width: 260px; margin-left: auto; }
  .cs-search .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--mall-muted-foreground); pointer-events: none; }
  .cs-search input { width: 100%; height: 34px; padding: 0 12px 0 34px; border-radius: var(--mall-radius-sm); border: 1px solid var(--mall-border); background: var(--mall-surface); font-size: 13.5px; color: var(--mall-foreground); transition: border-color .16s, box-shadow .16s; }
  .cs-search input:focus { outline: none; border-color: var(--mall-primary); box-shadow: 0 0 0 3px var(--mall-ring-soft); }

  @media (max-width: 760px) {
    .cs-toolbar { top: 56px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding-top: 14px; }
    .cs-tabs { width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: thin; }
    .cs-tab { flex: none; height: 38px; white-space: nowrap; }
    .cs-search { width: 100%; margin-left: 0; }
    .cs-search input { height: 40px; }
  }

  /* —— 卡片几何：与线上 mall/static/style.css 一致，勿改 —— */
  .cs-grid { display: grid; grid-template-columns: repeat(auto-fill, 200px); justify-content: start; align-items: start; gap: 10px; }
  .cs-card { width: 200px; height: 300px; background: var(--mall-card); border: 1px solid var(--mall-border-soft); border-radius: 12px; overflow: hidden; box-shadow: var(--mall-shadow-card); transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; display: flex; flex-direction: column; }
  .cs-card:hover { transform: translateY(-2px); box-shadow: var(--mall-shadow-card-hover); border-color: var(--mall-primary-soft-border); }
  .cs-card-cover { position: relative; height: 112px; flex: 0 0 112px; display: grid; place-items: center; overflow: hidden; border-radius: 11px 11px 0 0; color: #fff; font-size: 17px; font-weight: 800; line-height: 1.35; letter-spacing: .02em; text-align: center; text-shadow: 0 2px 8px rgba(0,0,0,.2); padding: 0 8px; }
  .cs-card-cover-badges { position: absolute; top: 8px; right: 8px; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
  .cs-card-body { padding: 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; min-height: 0; }
  .cs-card-title-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
  .cs-card-title { font-size: 14px; font-weight: 750; line-height: 20px; color: var(--mall-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cs-card-title-row .mall-badge { flex: none; }
  .cs-card-meta { display: flex; gap: 6px; align-items: center; }
  .cs-card-desc { margin-top: 4px; font-size: 12px; line-height: 18px; min-height: 54px; color: var(--mall-muted-foreground); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .cs-card-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 10px; border-top: 1px dashed var(--mall-border-soft); margin-top: auto; }
  .cs-card-price { font-size: 14px; font-weight: 800; color: var(--mall-primary); }
  .cs-card-price-free { color: var(--mall-success); }
  .cs-card-action { font-size: 12px; font-weight: 600; color: var(--mall-primary); }
  .cs-section-title { font-size: 17px; font-weight: 700; margin: 32px 0 14px; display: flex; align-items: center; gap: 8px; }
  @media (max-width: 560px) {
    .cs-toolbar, .cs-grid { width: 100%; }
    .cs-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .cs-card { width: auto; }
  }



/* ============================================================
   页面段 · c-product
   ============================================================ */

.cs-detail { display: grid; grid-template-columns: 1fr 320px; gap: 40px; align-items: start; padding: 8px 0 64px; }
  @media (max-width: 960px) { .cs-detail { grid-template-columns: 1fr; } }

  /* 封面：有头图时用 <img>（同首页卡片），无头图时渐变 + 文字 */
  .cs-doc-head { display: flex; align-items: center; gap: 16px; padding-bottom: 20px; border-bottom: 1px solid var(--mall-border-soft); margin-bottom: 8px; }
  .cs-doc-cover { width: 64px; height: 64px; flex: none; border-radius: var(--mall-radius-md); display: grid; place-items: center; color: #fff; font-size: 20px; font-weight: 800; letter-spacing: .02em; box-shadow: var(--mall-shadow-card); overflow: hidden; }
  .cs-doc-cover img { width: 100%; height: 100%; object-fit: cover; }
  .cs-doc-head-main { min-width: 0; }
  .cs-doc-head h1 { font-size: 28px; font-weight: 750; letter-spacing: -0.02em; line-height: 1.25; }
  .cs-doc-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

  .cs-buy { position: sticky; top: 88px; background: var(--mall-card); border: 1px solid var(--mall-border-soft); border-radius: var(--mall-radius-md); padding: 22px; box-shadow: var(--mall-shadow-card); }
  .cs-buy-price { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
  .cs-buy-price .now { font-size: 30px; font-weight: 750; color: var(--mall-primary); letter-spacing: -0.02em; }
  .cs-buy-price .free { font-size: 30px; font-weight: 750; color: var(--mall-success); }
  .cs-buy-actions { display: grid; gap: 8px; margin-top: 18px; }
  .cs-buy-info { padding-top: 16px; border-top: 1px solid var(--mall-border-soft); margin-top: 18px; display: grid; gap: 12px; }
  .cs-buy-info .r { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
  .cs-buy-info .r .k { color: var(--mall-muted-foreground); flex: none; }
  .cs-buy-info .r .v { color: var(--mall-foreground); font-weight: 500; text-align: right; word-break: break-all; }
  .cs-owned { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--mall-radius-sm); background: var(--mall-success-soft); border: 1px solid var(--mall-success-soft-border); color: var(--mall-success); font-size: 13px; margin-bottom: 16px; }
  .cs-owned svg { flex: none; margin-top: 1px; }
  /* 购买卡：授权码选择 + 线下付款说明 */
  .cs-buy-field { margin-top: 16px; display: grid; gap: 6px; }
  .cs-buy-note { margin-top: 14px; font-size: 12.5px; line-height: 1.7; color: var(--mall-muted-foreground); }



/* ============================================================
   页面段 · c-login
   ============================================================ */

.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 40px 24px; background:
    radial-gradient(1000px 500px at 50% -10%, var(--mall-primary-soft), transparent 70%), var(--mall-background); }
  .auth-card { width: 100%; max-width: 400px; background: var(--mall-card); border: 1px solid var(--mall-border-soft); border-radius: var(--mall-radius-lg); box-shadow: var(--mall-shadow-pop); padding: 32px; }
  .auth-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 22px; }
  .auth-card h1 { font-size: 21px; font-weight: 750; text-align: center; letter-spacing: -0.01em; }
  .auth-card .sub { font-size: 13px; color: var(--mall-muted-foreground); text-align: center; margin-top: 6px; margin-bottom: 24px; }
  .auth-field { margin-bottom: 14px; }
  .auth-field label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; }
  .auth-links { display: flex; align-items: center; justify-content: space-between; font-size: 13px; margin: 14px 0 20px; }
  .auth-switch { text-align: center; font-size: 13px; color: var(--mall-muted-foreground); margin-top: 20px; }
  .auth-back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--mall-muted-foreground); margin-bottom: 14px; }
  .auth-back:hover { color: var(--mall-primary); }
  .auth-back:hover svg { transform: translateX(-2px); }
  .auth-back svg { transition: transform .18s cubic-bezier(.4,0,.2,1); }



/* ============================================================
   页面段 · c-reset
   ============================================================ */

.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 40px 24px; background:
    radial-gradient(1000px 500px at 50% -10%, var(--mall-primary-soft), transparent 70%), var(--mall-background); }
  .auth-card { width: 100%; max-width: 400px; background: var(--mall-card); border: 1px solid var(--mall-border-soft); border-radius: var(--mall-radius-lg); box-shadow: var(--mall-shadow-pop); padding: 32px; }
  .auth-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 22px; }
  .auth-card h1 { font-size: 21px; font-weight: 750; text-align: center; letter-spacing: -0.01em; }
  .auth-card .sub { font-size: 13px; color: var(--mall-muted-foreground); text-align: center; margin-top: 6px; margin-bottom: 24px; }
  .auth-field { margin-bottom: 14px; }
  .auth-field label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; }
  .auth-links { display: flex; align-items: center; justify-content: space-between; font-size: 13px; margin: 14px 0 20px; }
  .auth-switch { text-align: center; font-size: 13px; color: var(--mall-muted-foreground); margin-top: 20px; }
  .auth-back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--mall-muted-foreground); margin-bottom: 14px; }
  .auth-back:hover { color: var(--mall-primary); }
  .auth-back:hover svg { transform: translateX(-2px); }
  .auth-back svg { transition: transform .18s cubic-bezier(.4,0,.2,1); }

  .auth-wrap { align-content: start; gap: 28px; }
  .auth-state { display: grid; gap: 8px; justify-items: center; }
  .auth-state-label { font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--mall-muted-foreground); }
  .auth-alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--mall-radius-sm); background: var(--mall-danger-soft); border: 1px solid var(--mall-danger-soft-border); color: var(--mall-danger); font-size: 13px; margin-bottom: 18px; }
  .auth-alert svg { flex: none; margin-top: 1px; }



/* ============================================================
   页面段 · c-orders
   ============================================================ */

.acc-main { min-width: 0; padding: 24px 0 64px; }
  .acc-head { margin-bottom: 18px; }
  .acc-head h1 { font-size: 22px; font-weight: 750; letter-spacing: -0.015em; }
  .acc-head .sub { font-size: 13px; color: var(--mall-muted-foreground); margin-top: 4px; }
  .order-table tr[hidden] { display: none; }

  @media (max-width: 640px) {
    .acc-main { padding-top: 18px; }
    .order-tabs { overflow-x: auto; flex-wrap: nowrap; }
    .order-tabs .mall-tab { flex: none; min-height: 38px; white-space: nowrap; }
    .order-table-card { border: 0; box-shadow: none; background: transparent; overflow: visible; }
    .order-table thead { display: none; }
    .order-table, .order-table tbody, .order-table tr, .order-table td { display: block; width: 100%; }
    .order-table tbody { display: grid; gap: 12px; }
    .order-table tr { padding: 12px 14px; border: 1px solid var(--mall-border-soft); border-radius: var(--mall-radius-md); background: var(--mall-card); box-shadow: var(--mall-shadow-card); }
    .order-table td { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 10px; align-items: start; padding: 7px 0; border: 0; text-align: left; overflow-wrap: anywhere; }
    .order-table td::before { content: attr(data-label); color: var(--mall-muted-foreground); font-size: 12px; font-weight: 600; }
    .order-table td:last-child { padding-top: 10px; }
    .order-table td:last-child .mall-btn { width: 100%; min-height: 40px; }
  }

  /* 授权卡片：上层概要，下层折叠展开插件列表。两层互不污染。 */
  .lic-card { padding: 0; overflow: hidden; margin-bottom: 12px; background: var(--mall-card); border: 1px solid var(--mall-border-soft); border-radius: var(--mall-radius-md); box-shadow: var(--mall-shadow-card); }
  .lic-row { display: flex; align-items: center; gap: 16px; padding: 14px 20px; }
  .lic-row + .lic-row { border-top: 1px solid var(--mall-border-soft); }
  .lic-info { flex: 1; min-width: 0; }
  .lic-code-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
  .lic-code { font-family: var(--mall-font-mono); font-size: 14.5px; font-weight: 700; letter-spacing: 0.02em; word-break: break-all; }
  .lic-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; font-size: 12.5px; color: var(--mall-muted-foreground); }
  .lic-meta .sep { color: var(--mall-border-strong); }
  .lic-actions { display: flex; gap: 8px; flex: none; }

  /* 折叠的插件列表（默认关闭，不占空间） */
  .lic-fold { padding: 12px 20px 16px; background: var(--mall-surface-muted); border-top: 1px solid var(--mall-border-soft); }
  .lic-fold summary { cursor: pointer; font-size: 13px; color: var(--mall-primary); font-weight: 600; user-select: none; padding: 4px 0; list-style: none; display: inline-flex; align-items: center; gap: 6px; }
  .lic-fold summary::-webkit-details-marker { display: none; }
  .lic-fold summary::before { content: '▶'; font-size: 9px; transition: transform .16s; color: var(--mall-primary); }
  .lic-fold[open] summary::before { transform: rotate(90deg); }
  .lic-fold[open] summary { margin-bottom: 10px; }
  .lic-plugins { display: flex; flex-wrap: wrap; gap: 6px; }
  .lic-plugin { font-size: 12.5px; padding: 4px 10px; border-radius: 999px; background: var(--mall-surface); color: var(--mall-foreground); border: 1px solid var(--mall-border); }
  .lic-plugin.is-inactive { color: var(--mall-muted-foreground); background: var(--mall-muted); border-color: var(--mall-border-soft); text-decoration: line-through; text-decoration-color: var(--mall-muted-foreground); }
  .lic-plugins-empty { font-size: 12.5px; color: var(--mall-muted-foreground); padding: 2px 0; }
  .lic-plugins-empty a { color: var(--mall-primary); text-decoration: none; }
  .lic-plugins-empty a:hover { text-decoration: underline; }
  .lic-empty { font-size: 12.5px; color: var(--mall-muted-foreground); padding: 4px 0; }

  /* 绑定授权码输入区 */
  .lic-bind-form { display: flex; gap: 10px; }
  .lic-bind-form input { flex: 1; font-family: var(--mall-font-mono); letter-spacing: 0.02em; }

  /* 解绑确认 dialog（原生 <dialog>，零依赖） */
  .lic-dialog { padding: 0; border: 0; border-radius: var(--mall-radius-lg); box-shadow: var(--mall-shadow-pop); background: var(--mall-popover); max-width: 420px; width: calc(100% - 40px); color: var(--mall-foreground); }
  .lic-dialog::backdrop { background: var(--mall-overlay); backdrop-filter: blur(3px); }
  .lic-dialog .modal-head { padding: 18px 22px 4px; font-size: 16px; font-weight: 700; }
  .lic-dialog .modal-body { padding: 8px 22px 16px; font-size: 13.5px; color: var(--mall-muted-foreground); }
  .lic-dialog menu { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 22px; border-top: 1px solid var(--mall-border-soft); margin: 0; background: var(--mall-surface); }

  @media (max-width: 640px) {
    .lic-row { flex-wrap: wrap; }
    .lic-actions { width: 100%; justify-content: flex-end; padding-top: 4px; }
    .lic-bind-form { flex-wrap: wrap; }
    .lic-bind-form input { flex: 1 1 100%; }
  }

  .profile-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--mall-border-soft); }
  .profile-row:last-child { border-bottom: 0; }
  .profile-row .k { font-size: 13px; color: var(--mall-muted-foreground); }
  .profile-row .v { font-size: 14px; font-weight: 500; margin-top: 3px; }



/* ============================================================
   页面段 · a-login
   ============================================================ */

.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 40px 24px; background:
    radial-gradient(1000px 500px at 50% -10%, var(--mall-primary-soft), transparent 70%), var(--mall-background); }
  .auth-card { width: 100%; max-width: 400px; background: var(--mall-card); border: 1px solid var(--mall-border-soft); border-radius: var(--mall-radius-lg); box-shadow: var(--mall-shadow-pop); padding: 32px; }
  .auth-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 22px; }
  .auth-card h1 { font-size: 21px; font-weight: 750; text-align: center; letter-spacing: -0.01em; }
  .auth-card .sub { font-size: 13px; color: var(--mall-muted-foreground); text-align: center; margin-top: 6px; margin-bottom: 24px; }
  .auth-field { margin-bottom: 14px; }
  .auth-field label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; }
  .auth-links { display: flex; align-items: center; justify-content: space-between; font-size: 13px; margin: 14px 0 20px; }
  .auth-switch { text-align: center; font-size: 13px; color: var(--mall-muted-foreground); margin-top: 20px; }
  .auth-back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--mall-muted-foreground); margin-bottom: 14px; }
  .auth-back:hover { color: var(--mall-primary); }
  .auth-back:hover svg { transform: translateX(-2px); }
  .auth-back svg { transition: transform .18s cubic-bezier(.4,0,.2,1); }

  .auth-admin-tag { display: flex; align-items: center; justify-content: center; gap: 6px; margin-bottom: 22px; }



/* ============================================================
   页面段 · a-invite
   ============================================================ */

.adm-topbar { position: sticky; top: 0; z-index: 100; display: flex; align-items: center; gap: 20px; height: 56px; padding: 0 20px; background: var(--mall-navbar-bg); backdrop-filter: blur(20px); border-bottom: 1px solid var(--mall-border-soft); }
  .adm-topbar-brand { display: inline-flex; align-items: center; gap: 10px; font-size: 14.5px; }
  .adm-topbar-right { display: inline-flex; align-items: center; gap: 10px; margin-left: auto; }
  .adm-mobile-menu { display: none; position: relative; }
  .adm-mobile-menu summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px; border: 1px solid var(--mall-border); border-radius: var(--mall-radius-sm); font-size: 13px; font-weight: 600; cursor: pointer; }
  .adm-mobile-menu summary::-webkit-details-marker { display: none; }
  .adm-mobile-menu-panel { position: absolute; top: calc(100% + 10px); right: 0; width: 220px; display: grid; gap: 4px; padding: 8px; border: 1px solid var(--mall-border-soft); border-radius: var(--mall-radius-md); background: var(--mall-popover); box-shadow: var(--mall-shadow-pop); }
  .adm-mobile-menu-panel a { padding: 10px 12px; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--mall-muted-foreground); }
  .adm-mobile-menu-panel a:hover, .adm-mobile-menu-panel a.is-active { color: var(--mall-primary-on-soft); background: var(--mall-primary-soft); }

  .adm-shell { display: grid; grid-template-columns: 216px 1fr; align-items: start; min-height: calc(100vh - 56px); }
  .adm-side { position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto; padding: 16px 12px; background: var(--mall-surface); border-right: 1px solid var(--mall-border-soft); }
  .adm-side-label { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mall-muted-foreground); padding: 0 10px; margin-bottom: 8px; }
  .adm-side-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; font-size: 13.5px; font-weight: 500; color: var(--mall-muted-foreground); transition: color .16s, background .16s; }
  .adm-side-link:hover { color: var(--mall-foreground); background: var(--mall-muted); }
  .adm-side-link.is-active { color: var(--mall-primary-on-soft); background: var(--mall-primary-soft); font-weight: 600; }
  .adm-main { padding: 24px 28px 64px; min-width: 0; }

  .adm-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
  .adm-page-head .sub { font-size: 13px; color: var(--mall-muted-foreground); margin-top: 4px; }
  .adm-card { background: var(--mall-card); border: 1px solid var(--mall-border-soft); border-radius: var(--mall-radius-md); box-shadow: var(--mall-shadow-card); }
  .adm-card-head { padding: 16px 20px; border-bottom: 1px solid var(--mall-border-soft); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .adm-card-head h3 { font-size: 15px; font-weight: 700; }
  .adm-card-body { padding: 20px; }
  .adm-grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; }
  @media (max-width: 1100px) { .adm-grid-2 { grid-template-columns: 1fr; } }
  @media (max-width: 820px) {
    .adm-topbar { gap: 10px; padding: 0 14px; }
    .adm-topbar-search, .adm-topbar-right > .mall-back, .adm-topbar-right > .mall-avatar { display: none; }
    .adm-mobile-menu { display: block; }
    .adm-shell { grid-template-columns: 1fr; }
    .adm-side { display: none; }
    .adm-main { padding-left: 16px; padding-right: 16px; }
  }

  .batch-bar { display: none; align-items: center; gap: 12px; padding: 10px 16px; margin-bottom: 12px; border-radius: var(--mall-radius-sm); background: var(--mall-primary-soft); border: 1px solid var(--mall-primary-soft-border); font-size: 13.5px; }
  .batch-bar.is-on { display: flex; }
  .batch-bar .mall-btn { margin-left: auto; }

  .modal-mask { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; padding: 24px; background: var(--mall-overlay); backdrop-filter: blur(3px); }
  .modal-mask.is-open { display: flex; }
  .modal { width: 100%; max-width: 560px; max-height: 82vh; display: flex; flex-direction: column; background: var(--mall-popover); border: 1px solid var(--mall-border-soft); border-radius: var(--mall-radius-lg); box-shadow: var(--mall-shadow-pop); }
  .modal-head { padding: 18px 22px; border-bottom: 1px solid var(--mall-border-soft); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .modal-head h3 { font-size: 16px; font-weight: 700; }
  .modal-body { padding: 20px 22px; overflow-y: auto; }
  .modal-foot { padding: 14px 22px; border-top: 1px solid var(--mall-border-soft); display: flex; justify-content: flex-end; gap: 10px; }

  .alloc-row { display: grid; grid-template-columns: 1fr 200px; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--mall-border-soft); }
  .alloc-row[hidden] { display: none; }
  .alloc-row:last-child { border-bottom: 0; }
  .alloc-row .who { min-width: 0; }
  .alloc-row .who .n { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .alloc-row .who .m { font-size: 12px; color: var(--mall-muted-foreground); margin-top: 2px; }

  .dropzone { display: grid; place-items: center; gap: 10px; padding: 40px 24px; border: 2px dashed var(--mall-border); border-radius: var(--mall-radius-md); background: var(--mall-surface-muted); text-align: center; cursor: pointer; transition: border-color .16s, background .16s; }
  .dropzone:hover { border-color: var(--mall-primary); background: var(--mall-primary-soft); }
  .dropzone .big { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--mall-primary-soft); color: var(--mall-primary-on-soft); }
  .dropzone.is-filled { border-style: solid; border-color: var(--mall-success-soft-border); background: var(--mall-success-soft); }

  .adm-table-scroll { overflow-x: auto; overscroll-behavior-inline: contain; }
  .adm-table-scroll .mall-table { min-width: 980px; }
  .row-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; white-space: nowrap; }
  .row-more { position: relative; }
  .row-more summary { list-style: none; }
  .row-more summary::-webkit-details-marker { display: none; }
  .row-more-panel { position: absolute; z-index: 20; top: calc(100% + 6px); right: 0; min-width: 128px; padding: 6px; border: 1px solid var(--mall-border-soft); border-radius: var(--mall-radius-sm); background: var(--mall-popover); box-shadow: var(--mall-shadow-pop); }
  .row-more-panel .mall-btn { width: 100%; justify-content: flex-start; }

  .form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .form-grid .full { grid-column: 1 / -1; }
  @media (max-width: 820px) { .form-grid { grid-template-columns: 1fr; } }
  .field label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; }
  .field .hint { font-size: 12px; color: var(--mall-muted-foreground); margin-top: 5px; }

  .inv-code { font-family: var(--mall-font-mono); font-size: 30px; font-weight: 700; letter-spacing: 0.1em; text-align: center; padding: 22px 16px; border-radius: var(--mall-radius-md); background: var(--mall-surface-muted); border: 1px dashed var(--mall-border); }
  .inv-meta { text-align: center; font-size: 13px; color: var(--mall-muted-foreground); margin-top: 12px; }
  .inv-meta strong { color: var(--mall-warning); font-variant-numeric: tabular-nums; }
  .inv-steps { margin: 0; padding-left: 20px; font-size: 13.5px; line-height: 1.9; color: var(--mall-muted-foreground); }



/* ============================================================
   页面段 · a-products
   ============================================================ */

.adm-topbar { position: sticky; top: 0; z-index: 100; display: flex; align-items: center; gap: 20px; height: 56px; padding: 0 20px; background: var(--mall-navbar-bg); backdrop-filter: blur(20px); border-bottom: 1px solid var(--mall-border-soft); }
  .adm-topbar-brand { display: inline-flex; align-items: center; gap: 10px; font-size: 14.5px; }
  .adm-topbar-right { display: inline-flex; align-items: center; gap: 10px; margin-left: auto; }
  .adm-mobile-menu { display: none; position: relative; }
  .adm-mobile-menu summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px; border: 1px solid var(--mall-border); border-radius: var(--mall-radius-sm); font-size: 13px; font-weight: 600; cursor: pointer; }
  .adm-mobile-menu summary::-webkit-details-marker { display: none; }
  .adm-mobile-menu-panel { position: absolute; top: calc(100% + 10px); right: 0; width: 220px; display: grid; gap: 4px; padding: 8px; border: 1px solid var(--mall-border-soft); border-radius: var(--mall-radius-md); background: var(--mall-popover); box-shadow: var(--mall-shadow-pop); }
  .adm-mobile-menu-panel a { padding: 10px 12px; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--mall-muted-foreground); }
  .adm-mobile-menu-panel a:hover, .adm-mobile-menu-panel a.is-active { color: var(--mall-primary-on-soft); background: var(--mall-primary-soft); }

  .adm-shell { display: grid; grid-template-columns: 216px 1fr; align-items: start; min-height: calc(100vh - 56px); }
  .adm-side { position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto; padding: 16px 12px; background: var(--mall-surface); border-right: 1px solid var(--mall-border-soft); }
  .adm-side-label { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mall-muted-foreground); padding: 0 10px; margin-bottom: 8px; }
  .adm-side-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; font-size: 13.5px; font-weight: 500; color: var(--mall-muted-foreground); transition: color .16s, background .16s; }
  .adm-side-link:hover { color: var(--mall-foreground); background: var(--mall-muted); }
  .adm-side-link.is-active { color: var(--mall-primary-on-soft); background: var(--mall-primary-soft); font-weight: 600; }
  .adm-main { padding: 24px 28px 64px; min-width: 0; }

  .adm-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
  .adm-page-head .sub { font-size: 13px; color: var(--mall-muted-foreground); margin-top: 4px; }
  .adm-card { background: var(--mall-card); border: 1px solid var(--mall-border-soft); border-radius: var(--mall-radius-md); box-shadow: var(--mall-shadow-card); }
  .adm-card-head { padding: 16px 20px; border-bottom: 1px solid var(--mall-border-soft); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .adm-card-head h3 { font-size: 15px; font-weight: 700; }
  .adm-card-body { padding: 20px; }
  .adm-grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; }
  @media (max-width: 1100px) { .adm-grid-2 { grid-template-columns: 1fr; } }
  @media (max-width: 820px) {
    .adm-topbar { gap: 10px; padding: 0 14px; }
    .adm-topbar-search, .adm-topbar-right > .mall-back, .adm-topbar-right > .mall-avatar { display: none; }
    .adm-mobile-menu { display: block; }
    .adm-shell { grid-template-columns: 1fr; }
    .adm-side { display: none; }
    .adm-main { padding-left: 16px; padding-right: 16px; }
  }

  .batch-bar { display: none; align-items: center; gap: 12px; padding: 10px 16px; margin-bottom: 12px; border-radius: var(--mall-radius-sm); background: var(--mall-primary-soft); border: 1px solid var(--mall-primary-soft-border); font-size: 13.5px; }
  .batch-bar.is-on { display: flex; }
  .batch-bar .mall-btn { margin-left: auto; }

  .modal-mask { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; padding: 24px; background: var(--mall-overlay); backdrop-filter: blur(3px); }
  .modal-mask.is-open { display: flex; }
  .modal { width: 100%; max-width: 560px; max-height: 82vh; display: flex; flex-direction: column; background: var(--mall-popover); border: 1px solid var(--mall-border-soft); border-radius: var(--mall-radius-lg); box-shadow: var(--mall-shadow-pop); }
  .modal-head { padding: 18px 22px; border-bottom: 1px solid var(--mall-border-soft); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .modal-head h3 { font-size: 16px; font-weight: 700; }
  .modal-body { padding: 20px 22px; overflow-y: auto; }
  .modal-foot { padding: 14px 22px; border-top: 1px solid var(--mall-border-soft); display: flex; justify-content: flex-end; gap: 10px; }

  .alloc-row { display: grid; grid-template-columns: 1fr 200px; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--mall-border-soft); }
  .alloc-row[hidden] { display: none; }
  .alloc-row:last-child { border-bottom: 0; }
  .alloc-row .who { min-width: 0; }
  .alloc-row .who .n { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .alloc-row .who .m { font-size: 12px; color: var(--mall-muted-foreground); margin-top: 2px; }

  .dropzone { display: grid; place-items: center; gap: 10px; padding: 40px 24px; border: 2px dashed var(--mall-border); border-radius: var(--mall-radius-md); background: var(--mall-surface-muted); text-align: center; cursor: pointer; transition: border-color .16s, background .16s; }
  .dropzone:hover { border-color: var(--mall-primary); background: var(--mall-primary-soft); }
  .dropzone .big { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--mall-primary-soft); color: var(--mall-primary-on-soft); }
  .dropzone.is-filled { border-style: solid; border-color: var(--mall-success-soft-border); background: var(--mall-success-soft); }

  .adm-table-scroll { overflow-x: auto; overscroll-behavior-inline: contain; }
  .adm-table-scroll .mall-table { min-width: 980px; }
  .row-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; white-space: nowrap; }
  .row-more { position: relative; }
  .row-more summary { list-style: none; }
  .row-more summary::-webkit-details-marker { display: none; }
  .row-more-panel { position: absolute; z-index: 20; top: calc(100% + 6px); right: 0; min-width: 128px; padding: 6px; border: 1px solid var(--mall-border-soft); border-radius: var(--mall-radius-sm); background: var(--mall-popover); box-shadow: var(--mall-shadow-pop); }
  .row-more-panel .mall-btn { width: 100%; justify-content: flex-start; }

  .form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .form-grid .full { grid-column: 1 / -1; }
  @media (max-width: 820px) { .form-grid { grid-template-columns: 1fr; } }
  .field label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; }
  .field .hint { font-size: 12px; color: var(--mall-muted-foreground); margin-top: 5px; }



/* ============================================================
   页面段 · a-product-import
   ============================================================ */

.adm-topbar { position: sticky; top: 0; z-index: 100; display: flex; align-items: center; gap: 20px; height: 56px; padding: 0 20px; background: var(--mall-navbar-bg); backdrop-filter: blur(20px); border-bottom: 1px solid var(--mall-border-soft); }
  .adm-topbar-brand { display: inline-flex; align-items: center; gap: 10px; font-size: 14.5px; }
  .adm-topbar-right { display: inline-flex; align-items: center; gap: 10px; margin-left: auto; }
  .adm-mobile-menu { display: none; position: relative; }
  .adm-mobile-menu summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px; border: 1px solid var(--mall-border); border-radius: var(--mall-radius-sm); font-size: 13px; font-weight: 600; cursor: pointer; }
  .adm-mobile-menu summary::-webkit-details-marker { display: none; }
  .adm-mobile-menu-panel { position: absolute; top: calc(100% + 10px); right: 0; width: 220px; display: grid; gap: 4px; padding: 8px; border: 1px solid var(--mall-border-soft); border-radius: var(--mall-radius-md); background: var(--mall-popover); box-shadow: var(--mall-shadow-pop); }
  .adm-mobile-menu-panel a { padding: 10px 12px; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--mall-muted-foreground); }
  .adm-mobile-menu-panel a:hover, .adm-mobile-menu-panel a.is-active { color: var(--mall-primary-on-soft); background: var(--mall-primary-soft); }

  .adm-shell { display: grid; grid-template-columns: 216px 1fr; align-items: start; min-height: calc(100vh - 56px); }
  .adm-side { position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto; padding: 16px 12px; background: var(--mall-surface); border-right: 1px solid var(--mall-border-soft); }
  .adm-side-label { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mall-muted-foreground); padding: 0 10px; margin-bottom: 8px; }
  .adm-side-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; font-size: 13.5px; font-weight: 500; color: var(--mall-muted-foreground); transition: color .16s, background .16s; }
  .adm-side-link:hover { color: var(--mall-foreground); background: var(--mall-muted); }
  .adm-side-link.is-active { color: var(--mall-primary-on-soft); background: var(--mall-primary-soft); font-weight: 600; }
  .adm-main { padding: 24px 28px 64px; min-width: 0; }

  .adm-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
  .adm-page-head .sub { font-size: 13px; color: var(--mall-muted-foreground); margin-top: 4px; }
  .adm-card { background: var(--mall-card); border: 1px solid var(--mall-border-soft); border-radius: var(--mall-radius-md); box-shadow: var(--mall-shadow-card); }
  .adm-card-head { padding: 16px 20px; border-bottom: 1px solid var(--mall-border-soft); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .adm-card-head h3 { font-size: 15px; font-weight: 700; }
  .adm-card-body { padding: 20px; }
  .adm-grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; }
  @media (max-width: 1100px) { .adm-grid-2 { grid-template-columns: 1fr; } }
  @media (max-width: 820px) {
    .adm-topbar { gap: 10px; padding: 0 14px; }
    .adm-topbar-search, .adm-topbar-right > .mall-back, .adm-topbar-right > .mall-avatar { display: none; }
    .adm-mobile-menu { display: block; }
    .adm-shell { grid-template-columns: 1fr; }
    .adm-side { display: none; }
    .adm-main { padding-left: 16px; padding-right: 16px; }
  }

  .batch-bar { display: none; align-items: center; gap: 12px; padding: 10px 16px; margin-bottom: 12px; border-radius: var(--mall-radius-sm); background: var(--mall-primary-soft); border: 1px solid var(--mall-primary-soft-border); font-size: 13.5px; }
  .batch-bar.is-on { display: flex; }
  .batch-bar .mall-btn { margin-left: auto; }

  .modal-mask { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; padding: 24px; background: var(--mall-overlay); backdrop-filter: blur(3px); }
  .modal-mask.is-open { display: flex; }
  .modal { width: 100%; max-width: 560px; max-height: 82vh; display: flex; flex-direction: column; background: var(--mall-popover); border: 1px solid var(--mall-border-soft); border-radius: var(--mall-radius-lg); box-shadow: var(--mall-shadow-pop); }
  .modal-head { padding: 18px 22px; border-bottom: 1px solid var(--mall-border-soft); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .modal-head h3 { font-size: 16px; font-weight: 700; }
  .modal-body { padding: 20px 22px; overflow-y: auto; }
  .modal-foot { padding: 14px 22px; border-top: 1px solid var(--mall-border-soft); display: flex; justify-content: flex-end; gap: 10px; }

  .alloc-row { display: grid; grid-template-columns: 1fr 200px; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--mall-border-soft); }
  .alloc-row[hidden] { display: none; }
  .alloc-row:last-child { border-bottom: 0; }
  .alloc-row .who { min-width: 0; }
  .alloc-row .who .n { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .alloc-row .who .m { font-size: 12px; color: var(--mall-muted-foreground); margin-top: 2px; }

  .dropzone { display: grid; place-items: center; gap: 10px; padding: 40px 24px; border: 2px dashed var(--mall-border); border-radius: var(--mall-radius-md); background: var(--mall-surface-muted); text-align: center; cursor: pointer; transition: border-color .16s, background .16s; }
  .dropzone:hover { border-color: var(--mall-primary); background: var(--mall-primary-soft); }
  .dropzone .big { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--mall-primary-soft); color: var(--mall-primary-on-soft); }
  .dropzone.is-filled { border-style: solid; border-color: var(--mall-success-soft-border); background: var(--mall-success-soft); }

  .adm-table-scroll { overflow-x: auto; overscroll-behavior-inline: contain; }
  .adm-table-scroll .mall-table { min-width: 980px; }
  .row-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; white-space: nowrap; }
  .row-more { position: relative; }
  .row-more summary { list-style: none; }
  .row-more summary::-webkit-details-marker { display: none; }
  .row-more-panel { position: absolute; z-index: 20; top: calc(100% + 6px); right: 0; min-width: 128px; padding: 6px; border: 1px solid var(--mall-border-soft); border-radius: var(--mall-radius-sm); background: var(--mall-popover); box-shadow: var(--mall-shadow-pop); }
  .row-more-panel .mall-btn { width: 100%; justify-content: flex-start; }

  .form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .form-grid .full { grid-column: 1 / -1; }
  @media (max-width: 820px) { .form-grid { grid-template-columns: 1fr; } }
  .field label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; }
  .field .hint { font-size: 12px; color: var(--mall-muted-foreground); margin-top: 5px; }

  .imp-wrap { display: grid; grid-template-columns: 1fr 220px; gap: 28px; align-items: start; }
  @media (max-width: 900px) { .imp-wrap { grid-template-columns: 1fr; } }
  .imp-fields { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .imp-fields .full { grid-column: 1 / -1; }
  @media (max-width: 640px) { .imp-fields { grid-template-columns: 1fr; } }

  .pv-card { width: 220px; padding: 0; overflow: hidden; background: var(--mall-card); border: 1px solid var(--mall-border-soft); border-radius: var(--mall-radius-md); box-shadow: var(--mall-shadow-card); }
  .pv-cover { height: 112px; display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 800; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.2); padding: 0 8px; text-align: center; }
  .pv-body { padding: 12px; }
  .pv-body .name { font-size: 14px; font-weight: 750; line-height: 20px; }
  .pv-body .meta { font-size: 12px; color: var(--mall-muted-foreground); margin-top: 4px; }

  /* 主操作常驻视口底部。
     注意：这里必须是 fixed，不能是 sticky —— .imp-bar 位于文档末尾，
     sticky 要等元素本身滚进视口才生效，等于「必须翻到底才能看见按钮」，
     而上传入口在页面顶部，上传完按钮不在手边，正是要修的问题。 */
  .imp-bar { position: fixed; left: 216px; right: 0; bottom: 0; z-index: 95; display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 28px; background: var(--mall-navbar-bg); backdrop-filter: blur(20px); border-top: 1px solid var(--mall-border-soft); box-shadow: 0 -6px 20px rgba(15, 18, 32, .08); }
  .imp-bar .imp-tip { margin-right: auto; font-size: 12.5px; color: var(--mall-muted-foreground); }
  @media (max-width: 820px) { .imp-bar { left: 0; padding: 12px 16px; } .adm-main { padding-left: 16px; padding-right: 16px; } }
  /* 底栏常驻后为内容让位，避免最后一屏被遮住（覆盖 A_CSS 的 64px） */
  .adm-main { padding: 24px 28px 104px; }

  /* 上传完成态：与下方「已自动填充」的表单状态保持一致 */
  .dropzone.is-filled .big { background: var(--mall-success-soft); color: var(--mall-success); }
  .dropzone.is-filled { display: flex; justify-content: flex-start; padding: 18px 20px; text-align: left; }
  .dropzone-copy { display: grid; gap: 4px; }



/* ============================================================
   页面段 · a-product-edit
   ============================================================ */

.adm-topbar { position: sticky; top: 0; z-index: 100; display: flex; align-items: center; gap: 20px; height: 56px; padding: 0 20px; background: var(--mall-navbar-bg); backdrop-filter: blur(20px); border-bottom: 1px solid var(--mall-border-soft); }
  .adm-topbar-brand { display: inline-flex; align-items: center; gap: 10px; font-size: 14.5px; }
  .adm-topbar-right { display: inline-flex; align-items: center; gap: 10px; margin-left: auto; }
  .adm-mobile-menu { display: none; position: relative; }
  .adm-mobile-menu summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px; border: 1px solid var(--mall-border); border-radius: var(--mall-radius-sm); font-size: 13px; font-weight: 600; cursor: pointer; }
  .adm-mobile-menu summary::-webkit-details-marker { display: none; }
  .adm-mobile-menu-panel { position: absolute; top: calc(100% + 10px); right: 0; width: 220px; display: grid; gap: 4px; padding: 8px; border: 1px solid var(--mall-border-soft); border-radius: var(--mall-radius-md); background: var(--mall-popover); box-shadow: var(--mall-shadow-pop); }
  .adm-mobile-menu-panel a { padding: 10px 12px; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--mall-muted-foreground); }
  .adm-mobile-menu-panel a:hover, .adm-mobile-menu-panel a.is-active { color: var(--mall-primary-on-soft); background: var(--mall-primary-soft); }

  .adm-shell { display: grid; grid-template-columns: 216px 1fr; align-items: start; min-height: calc(100vh - 56px); }
  .adm-side { position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto; padding: 16px 12px; background: var(--mall-surface); border-right: 1px solid var(--mall-border-soft); }
  .adm-side-label { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mall-muted-foreground); padding: 0 10px; margin-bottom: 8px; }
  .adm-side-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; font-size: 13.5px; font-weight: 500; color: var(--mall-muted-foreground); transition: color .16s, background .16s; }
  .adm-side-link:hover { color: var(--mall-foreground); background: var(--mall-muted); }
  .adm-side-link.is-active { color: var(--mall-primary-on-soft); background: var(--mall-primary-soft); font-weight: 600; }
  .adm-main { padding: 24px 28px 64px; min-width: 0; }

  .adm-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
  .adm-page-head .sub { font-size: 13px; color: var(--mall-muted-foreground); margin-top: 4px; }
  .adm-card { background: var(--mall-card); border: 1px solid var(--mall-border-soft); border-radius: var(--mall-radius-md); box-shadow: var(--mall-shadow-card); }
  .adm-card-head { padding: 16px 20px; border-bottom: 1px solid var(--mall-border-soft); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .adm-card-head h3 { font-size: 15px; font-weight: 700; }
  .adm-card-body { padding: 20px; }
  .adm-grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; }
  @media (max-width: 1100px) { .adm-grid-2 { grid-template-columns: 1fr; } }
  @media (max-width: 820px) {
    .adm-topbar { gap: 10px; padding: 0 14px; }
    .adm-topbar-search, .adm-topbar-right > .mall-back, .adm-topbar-right > .mall-avatar { display: none; }
    .adm-mobile-menu { display: block; }
    .adm-shell { grid-template-columns: 1fr; }
    .adm-side { display: none; }
    .adm-main { padding-left: 16px; padding-right: 16px; }
  }

  .batch-bar { display: none; align-items: center; gap: 12px; padding: 10px 16px; margin-bottom: 12px; border-radius: var(--mall-radius-sm); background: var(--mall-primary-soft); border: 1px solid var(--mall-primary-soft-border); font-size: 13.5px; }
  .batch-bar.is-on { display: flex; }
  .batch-bar .mall-btn { margin-left: auto; }

  .modal-mask { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; padding: 24px; background: var(--mall-overlay); backdrop-filter: blur(3px); }
  .modal-mask.is-open { display: flex; }
  .modal { width: 100%; max-width: 560px; max-height: 82vh; display: flex; flex-direction: column; background: var(--mall-popover); border: 1px solid var(--mall-border-soft); border-radius: var(--mall-radius-lg); box-shadow: var(--mall-shadow-pop); }
  .modal-head { padding: 18px 22px; border-bottom: 1px solid var(--mall-border-soft); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .modal-head h3 { font-size: 16px; font-weight: 700; }
  .modal-body { padding: 20px 22px; overflow-y: auto; }
  .modal-foot { padding: 14px 22px; border-top: 1px solid var(--mall-border-soft); display: flex; justify-content: flex-end; gap: 10px; }

  .alloc-row { display: grid; grid-template-columns: 1fr 200px; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--mall-border-soft); }
  .alloc-row[hidden] { display: none; }
  .alloc-row:last-child { border-bottom: 0; }
  .alloc-row .who { min-width: 0; }
  .alloc-row .who .n { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .alloc-row .who .m { font-size: 12px; color: var(--mall-muted-foreground); margin-top: 2px; }

  .dropzone { display: grid; place-items: center; gap: 10px; padding: 40px 24px; border: 2px dashed var(--mall-border); border-radius: var(--mall-radius-md); background: var(--mall-surface-muted); text-align: center; cursor: pointer; transition: border-color .16s, background .16s; }
  .dropzone:hover { border-color: var(--mall-primary); background: var(--mall-primary-soft); }
  .dropzone .big { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--mall-primary-soft); color: var(--mall-primary-on-soft); }
  .dropzone.is-filled { border-style: solid; border-color: var(--mall-success-soft-border); background: var(--mall-success-soft); }

  .adm-table-scroll { overflow-x: auto; overscroll-behavior-inline: contain; }
  .adm-table-scroll .mall-table { min-width: 980px; }
  .row-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; white-space: nowrap; }
  .row-more { position: relative; }
  .row-more summary { list-style: none; }
  .row-more summary::-webkit-details-marker { display: none; }
  .row-more-panel { position: absolute; z-index: 20; top: calc(100% + 6px); right: 0; min-width: 128px; padding: 6px; border: 1px solid var(--mall-border-soft); border-radius: var(--mall-radius-sm); background: var(--mall-popover); box-shadow: var(--mall-shadow-pop); }
  .row-more-panel .mall-btn { width: 100%; justify-content: flex-start; }

  .form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .form-grid .full { grid-column: 1 / -1; }
  @media (max-width: 820px) { .form-grid { grid-template-columns: 1fr; } }
  .field label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; }
  .field .hint { font-size: 12px; color: var(--mall-muted-foreground); margin-top: 5px; }

  .profile-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--mall-border-soft); }
  .profile-row:last-child { border-bottom: 0; }
  .profile-row .k { font-size: 13px; color: var(--mall-muted-foreground); }
  .profile-row .v { font-size: 14px; font-weight: 500; margin-top: 3px; }



/* ============================================================
   页面段 · a-orders
   ============================================================ */

.adm-topbar { position: sticky; top: 0; z-index: 100; display: flex; align-items: center; gap: 20px; height: 56px; padding: 0 20px; background: var(--mall-navbar-bg); backdrop-filter: blur(20px); border-bottom: 1px solid var(--mall-border-soft); }
  .adm-topbar-brand { display: inline-flex; align-items: center; gap: 10px; font-size: 14.5px; }
  .adm-topbar-right { display: inline-flex; align-items: center; gap: 10px; margin-left: auto; }
  .adm-mobile-menu { display: none; position: relative; }
  .adm-mobile-menu summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px; border: 1px solid var(--mall-border); border-radius: var(--mall-radius-sm); font-size: 13px; font-weight: 600; cursor: pointer; }
  .adm-mobile-menu summary::-webkit-details-marker { display: none; }
  .adm-mobile-menu-panel { position: absolute; top: calc(100% + 10px); right: 0; width: 220px; display: grid; gap: 4px; padding: 8px; border: 1px solid var(--mall-border-soft); border-radius: var(--mall-radius-md); background: var(--mall-popover); box-shadow: var(--mall-shadow-pop); }
  .adm-mobile-menu-panel a { padding: 10px 12px; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--mall-muted-foreground); }
  .adm-mobile-menu-panel a:hover, .adm-mobile-menu-panel a.is-active { color: var(--mall-primary-on-soft); background: var(--mall-primary-soft); }

  .adm-shell { display: grid; grid-template-columns: 216px 1fr; align-items: start; min-height: calc(100vh - 56px); }
  .adm-side { position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto; padding: 16px 12px; background: var(--mall-surface); border-right: 1px solid var(--mall-border-soft); }
  .adm-side-label { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mall-muted-foreground); padding: 0 10px; margin-bottom: 8px; }
  .adm-side-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; font-size: 13.5px; font-weight: 500; color: var(--mall-muted-foreground); transition: color .16s, background .16s; }
  .adm-side-link:hover { color: var(--mall-foreground); background: var(--mall-muted); }
  .adm-side-link.is-active { color: var(--mall-primary-on-soft); background: var(--mall-primary-soft); font-weight: 600; }
  .adm-main { padding: 24px 28px 64px; min-width: 0; }

  .adm-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
  .adm-page-head .sub { font-size: 13px; color: var(--mall-muted-foreground); margin-top: 4px; }
  .adm-card { background: var(--mall-card); border: 1px solid var(--mall-border-soft); border-radius: var(--mall-radius-md); box-shadow: var(--mall-shadow-card); }
  .adm-card-head { padding: 16px 20px; border-bottom: 1px solid var(--mall-border-soft); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .adm-card-head h3 { font-size: 15px; font-weight: 700; }
  .adm-card-body { padding: 20px; }
  .adm-grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; }
  @media (max-width: 1100px) { .adm-grid-2 { grid-template-columns: 1fr; } }
  @media (max-width: 820px) {
    .adm-topbar { gap: 10px; padding: 0 14px; }
    .adm-topbar-search, .adm-topbar-right > .mall-back, .adm-topbar-right > .mall-avatar { display: none; }
    .adm-mobile-menu { display: block; }
    .adm-shell { grid-template-columns: 1fr; }
    .adm-side { display: none; }
    .adm-main { padding-left: 16px; padding-right: 16px; }
  }

  .batch-bar { display: none; align-items: center; gap: 12px; padding: 10px 16px; margin-bottom: 12px; border-radius: var(--mall-radius-sm); background: var(--mall-primary-soft); border: 1px solid var(--mall-primary-soft-border); font-size: 13.5px; }
  .batch-bar.is-on { display: flex; }
  .batch-bar .mall-btn { margin-left: auto; }

  .modal-mask { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; padding: 24px; background: var(--mall-overlay); backdrop-filter: blur(3px); }
  .modal-mask.is-open { display: flex; }
  .modal { width: 100%; max-width: 560px; max-height: 82vh; display: flex; flex-direction: column; background: var(--mall-popover); border: 1px solid var(--mall-border-soft); border-radius: var(--mall-radius-lg); box-shadow: var(--mall-shadow-pop); }
  .modal-head { padding: 18px 22px; border-bottom: 1px solid var(--mall-border-soft); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .modal-head h3 { font-size: 16px; font-weight: 700; }
  .modal-body { padding: 20px 22px; overflow-y: auto; }
  .modal-foot { padding: 14px 22px; border-top: 1px solid var(--mall-border-soft); display: flex; justify-content: flex-end; gap: 10px; }

  .alloc-row { display: grid; grid-template-columns: 1fr 200px; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--mall-border-soft); }
  .alloc-row[hidden] { display: none; }
  .alloc-row:last-child { border-bottom: 0; }
  .alloc-row .who { min-width: 0; }
  .alloc-row .who .n { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .alloc-row .who .m { font-size: 12px; color: var(--mall-muted-foreground); margin-top: 2px; }

  .dropzone { display: grid; place-items: center; gap: 10px; padding: 40px 24px; border: 2px dashed var(--mall-border); border-radius: var(--mall-radius-md); background: var(--mall-surface-muted); text-align: center; cursor: pointer; transition: border-color .16s, background .16s; }
  .dropzone:hover { border-color: var(--mall-primary); background: var(--mall-primary-soft); }
  .dropzone .big { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--mall-primary-soft); color: var(--mall-primary-on-soft); }
  .dropzone.is-filled { border-style: solid; border-color: var(--mall-success-soft-border); background: var(--mall-success-soft); }

  .adm-table-scroll { overflow-x: auto; overscroll-behavior-inline: contain; }
  .adm-table-scroll .mall-table { min-width: 980px; }
  .row-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; white-space: nowrap; }
  .row-more { position: relative; }
  .row-more summary { list-style: none; }
  .row-more summary::-webkit-details-marker { display: none; }
  .row-more-panel { position: absolute; z-index: 20; top: calc(100% + 6px); right: 0; min-width: 128px; padding: 6px; border: 1px solid var(--mall-border-soft); border-radius: var(--mall-radius-sm); background: var(--mall-popover); box-shadow: var(--mall-shadow-pop); }
  .row-more-panel .mall-btn { width: 100%; justify-content: flex-start; }

  .form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .form-grid .full { grid-column: 1 / -1; }
  @media (max-width: 820px) { .form-grid { grid-template-columns: 1fr; } }
  .field label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; }
  .field .hint { font-size: 12px; color: var(--mall-muted-foreground); margin-top: 5px; }

  .chk { width: 15px; height: 15px; accent-color: var(--mall-primary); cursor: pointer; }
  .alloc-row { align-items: start; grid-template-columns: 1fr 268px; }
  .alloc-lic { display: flex; flex-direction: column; gap: 6px; }
  .alloc-lic select, .alloc-lic input[type="text"] { font-size: 12px; height: 30px; font-family: var(--mall-font-mono); }
  .alloc-bind { display: flex; align-items: flex-start; gap: 6px; font-size: 11.5px; color: var(--mall-muted-foreground); line-height: 1.45; cursor: pointer; }
  .alloc-bind input { margin-top: 2px; flex: none; }
  .alloc-hint { font-size: 11.5px; color: var(--mall-warning); }
  @media (max-width: 640px) {
    .alloc-row { grid-template-columns: 1fr; }
    .modal-mask { padding: 12px; align-items: flex-end; }
    .modal { max-height: 90vh; border-radius: var(--mall-radius-lg) var(--mall-radius-lg) 0 0; }
    .adm-card-head { align-items: stretch; flex-direction: column; }
    .adm-card-head .mall-row-2 { flex-wrap: wrap; }
    .adm-card-head .mall-input { width: 100% !important; min-height: 40px; }
  }


/* ============================================================
   页面段 · 封面徽标与图片封面（products 卡片，实施时从原型内联样式收敛为类）
   ============================================================ */
.cs-card-cover-img { padding: 0; }
.cs-card-cover-img img { width: 100%; height: 100%; object-fit: cover; }
.cs-cover-badge {
  display: inline-flex; align-items: center; height: 20px; padding: 0 8px;
  border-radius: var(--mall-radius-sm); font-size: 11.5px; font-weight: 600; line-height: 1;
  background: rgba(255, 255, 255, 0.22); color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35); backdrop-filter: blur(6px);
}
.cs-cover-badge-owned { background: rgba(31, 122, 83, 0.78); }
.tab-page[hidden] { display: none; }

/* ============================================================
   页面段 · 详情页补充（doc-head 图片封面 + tags 徽标行）
   ============================================================ */
.cs-doc-cover-img { padding: 0; }
.cs-doc-cover-img img { width: 100%; height: 100%; object-fit: cover; }
.cs-doc-tags { display: flex; flex-wrap: wrap; gap: 6px; padding: 14px 0 0; border-bottom: 1px solid var(--mall-border-soft); margin-bottom: 16px; padding-bottom: 14px; }

/* ============================================================
   页面段 · B 端桥接与侧栏底部（实施新增）
   后端 StatusCSS/RoleCSS 取值 ok/bad/warn 与 role-*，桥接到设计系统语义色，
   模板保留 {{.StatusCSS}} 表达式，避免每个模板写 if 链
   ============================================================ */
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: var(--mall-radius-sm); font-size: 12.5px; font-weight: 500; line-height: 1; white-space: nowrap; }
.badge.ok { background: var(--mall-success-soft); color: var(--mall-success); border: 1px solid var(--mall-success-soft-border); }
.badge.bad { background: var(--mall-danger-soft); color: var(--mall-danger); border: 1px solid var(--mall-danger-soft-border); }
.badge.warn { background: var(--mall-warning-soft); color: var(--mall-warning); border: 1px solid var(--mall-warning-soft-border); }
.badge.role-admin { background: var(--mall-warning-soft); color: var(--mall-warning); border: 1px solid var(--mall-warning-soft-border); }
.badge.role-operator { background: var(--mall-info-soft); color: var(--mall-info); border: 1px solid var(--mall-info-soft-border); }
.badge.role-ops { background: var(--mall-success-soft); color: var(--mall-success); border: 1px solid var(--mall-success-soft-border); }
.badge.role-biz { background: var(--mall-primary-soft); color: var(--mall-primary); border: 1px solid var(--mall-primary-soft-border); }
.badge.role-user, .badge.role-service { background: var(--mall-muted); color: var(--mall-muted-foreground); border: 1px solid var(--mall-border-soft); }

.adm-side-foot { margin-top: auto; padding: 12px 10px 2px; border-top: 1px solid var(--mall-border-soft); }
.adm-side-foot .who { display: flex; align-items: center; gap: 8px; padding: 0 2px 10px; }
.adm-side-foot .who .nm { font-size: 12.5px; font-weight: 600; color: var(--mall-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-side-foot .who .badge { flex: none; }
.adm-side-foot button { width: 100%; height: 30px; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--mall-muted-foreground); border: 1px solid var(--mall-border); background: var(--mall-surface); transition: color .15s, border-color .15s; }
.adm-side-foot button:hover { color: var(--mall-danger); border-color: var(--mall-danger); }
.adm-side { display: flex; flex-direction: column; }

.inv-steps { color: var(--mall-muted-foreground); font-size: 14px; line-height: 1.9; padding-left: 20px; }

.adm-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px 20px; }

.alloc-result { grid-column: 1 / -1; font-size: 12.5px; min-height: 4px; }
.alloc-result:empty { display: none; }

.has-imp-bar .adm-main { padding-bottom: 120px; }

/* ============================================================
   页面段 · 平台软件（software.html，license 型商品大卡）
   ============================================================ */
.sw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.sw-card { display: flex; flex-direction: column; background: var(--mall-card); border: 1px solid var(--mall-border-soft); border-radius: var(--mall-radius-md); overflow: hidden; box-shadow: var(--mall-shadow-card); transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.sw-card:hover { transform: translateY(-2px); box-shadow: var(--mall-shadow-card-hover); border-color: var(--mall-primary-soft-border); }
.sw-cover { height: 130px; display: grid; place-items: center; color: #fff; font-size: 22px; font-weight: 800; letter-spacing: .04em; text-shadow: 0 2px 8px rgba(0,0,0,.25); overflow: hidden; }
.sw-cover img { width: 100%; height: 100%; object-fit: cover; }
.sw-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.sw-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sw-title { font-size: 16px; font-weight: 700; color: var(--mall-foreground); }
.sw-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.sw-desc { font-size: 13px; line-height: 20px; color: var(--mall-muted-foreground); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 40px; }
.sw-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 10px; border-top: 1px dashed var(--mall-border-soft); margin-top: auto; }

/* ============================================================
   页面段 · 软件详情（software_detail.html：hero + SKU 购买卡）
   ============================================================ */
.swd-hero { display: flex; gap: 24px; align-items: center; padding: 28px 0 24px; border-bottom: 1px solid var(--mall-border-soft); margin-bottom: 20px; flex-wrap: wrap; }
.swd-cover { width: 120px; height: 120px; flex: none; border-radius: var(--mall-radius-lg); display: grid; place-items: center; color: #fff; font-size: 26px; font-weight: 800; letter-spacing: .04em; text-shadow: 0 2px 10px rgba(0,0,0,.28); box-shadow: var(--mall-glow-brand-sm); }
.swd-head h1 { font-size: 28px; font-weight: 750; letter-spacing: -0.02em; }
.swd-desc { margin-top: 8px; font-size: 15px; color: var(--mall-foreground); }
.swd-head .mall-t-helper { margin-top: 10px; max-width: 640px; line-height: 1.7; }
.swd-sku-list { display: grid; gap: 12px; margin-top: 14px; }
.swd-sku { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px; border: 1px solid var(--mall-border-soft); border-radius: var(--mall-radius-md); background: var(--mall-surface); }
.swd-sku:hover { border-color: var(--mall-primary-soft-border); }
.swd-sku-name { font-size: 14.5px; font-weight: 650; }
.swd-sku-meta { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.swd-sku-act { display: flex; align-items: center; gap: 12px; flex: none; }
.swd-sku-price { font-size: 18px; font-weight: 800; color: var(--mall-primary); }
/* ── 在线支付页（前台设计语言，与原型 c-pay 一致）── */
.pay-wrap { min-height: calc(100vh - 64px); display: grid; place-items: center; padding: 40px 24px; }
.pay-card { width: 100%; max-width: 430px; background: var(--mall-card); border: 1px solid var(--mall-border-soft); border-radius: var(--mall-radius-lg); box-shadow: var(--mall-shadow-pop); padding: 28px 32px; text-align: center; }
.pay-card h1 { font-size: 19px; font-weight: 750; text-align: center; }
.pay-card .sub { font-size: 13px; color: var(--mall-muted-foreground); text-align: center; margin: 4px 0 16px; }
.pay-card .auth-field { text-align: left; }
.pay-amount { font-size: 34px; font-weight: 800; color: var(--mall-primary); letter-spacing: -0.02em; margin: 6px 0 18px; }
.pay-qr { width: fit-content; margin: 0 auto; padding: 12px; border: 1px solid var(--mall-border-soft); border-radius: 12px; background: #fff; }
.pay-qr img, .pay-qr canvas { display: block; border-radius: 4px; }
.pay-status { font-size: 13px; color: var(--mall-muted-foreground); margin-top: 14px; }
.pay-help { font-size: 12px; color: var(--mall-muted-foreground); margin-top: 8px; line-height: 1.6; }

/* 平台软件联系卡片（价格线下协商，联系方式 kv_config software_contact） */
.swd-contact { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--mall-border-soft); border-radius: var(--mall-radius-md); background: var(--mall-surface); }
.swd-contact p { margin: 0; font-size: 14px; font-weight: 650; color: var(--mall-foreground); }
.swd-contact-note { font-size: 12.5px !important; font-weight: 400 !important; color: var(--mall-muted-foreground) !important; line-height: 1.6; margin-top: 4px !important; }
@media (max-width: 560px) { .swd-sku { flex-direction: column; align-items: stretch; } .swd-sku-act { justify-content: space-between; } }

/* ── 管理后台工作区 Tab（设计稿 .mall-work-tabs：分段控件）── */
.mall-work-tabs { display: flex; gap: var(--mall-space-1); padding: var(--mall-space-1); overflow-x: auto; border: 1px solid var(--mall-border-soft); border-radius: var(--mall-radius-md); background: var(--mall-muted); flex-wrap: wrap; }
.mall-work-tab { flex: none; min-height: 38px; padding: 0 var(--mall-space-4); border: 0; border-radius: 8px; background: transparent; color: var(--mall-muted-foreground); font: inherit; font-size: var(--mall-text-helper); font-weight: 650; cursor: pointer; }
.mall-work-tab:hover { color: var(--mall-foreground); }
.mall-work-tab:focus-visible { outline: 2px solid var(--mall-ring); outline-offset: 1px; }
.mall-work-tab.is-active { color: var(--mall-primary-on-soft); background: var(--mall-card); box-shadow: var(--mall-shadow-card); }
.mall-work-panel[hidden] { display: none; }
.mall-work-panel { animation: mall-work-in .16s ease-out; }
@keyframes mall-work-in { from { opacity: .5; transform: translateY(3px); } to { opacity: 1; transform: none; } }

/* ── 包上传器（设计稿 .mall-package-upload：插件 zip / 安装包 exe / 说明包统一）── */
.mall-package-upload { width: 100%; min-height: 100px; display: flex; align-items: center; gap: var(--mall-space-4); padding: var(--mall-space-5); border: 2px dashed var(--mall-border); border-radius: var(--mall-radius-md); background: var(--mall-surface-muted); color: var(--mall-foreground); text-align: left; cursor: pointer; transition: border-color .16s, background .16s, transform .16s; font: inherit; }
.mall-package-upload:hover { border-color: var(--mall-primary); background: var(--mall-primary-soft); transform: translateY(-1px); }
.mall-package-upload:focus-visible { outline: 2px solid var(--mall-ring); outline-offset: 3px; }
.mall-package-upload.is-drag { border-color: var(--mall-primary); background: var(--mall-primary-soft); }
.mall-package-upload-icon { width: 52px; height: 52px; flex: none; display: grid; place-items: center; border-radius: var(--mall-radius-lg); background: var(--mall-primary-soft); color: var(--mall-primary-on-soft); }
.mall-package-upload-copy { min-width: 0; flex: 1; display: grid; gap: var(--mall-space-1); }
.mall-package-upload-title { font-size: var(--mall-text-body); font-weight: 700; line-height: var(--mall-leading-snug); }
.mall-package-upload-meta { color: var(--mall-muted-foreground); font-size: var(--mall-text-badge); line-height: var(--mall-leading-normal); }
.mall-package-upload-side { flex: none; display: flex; align-items: center; gap: var(--mall-space-2); }
.mall-package-upload.is-loading { border-style: solid; border-color: var(--mall-primary-soft-border); background: var(--mall-primary-soft); cursor: progress; }
.mall-package-upload.is-success { border-style: solid; border-color: var(--mall-success-soft-border); background: var(--mall-success-soft); }
.mall-package-upload.is-success .mall-package-upload-icon { background: var(--mall-success-soft-hover); color: var(--mall-success); }
.mall-package-upload.is-error { border-style: solid; border-color: var(--mall-danger-soft-border); background: var(--mall-danger-soft); }
.mall-package-upload.is-error .mall-package-upload-icon { background: var(--mall-danger-soft-hover); color: var(--mall-danger); }
.mall-package-upload.is-compact { min-height: 76px; padding: var(--mall-space-3) var(--mall-space-4); }
.mall-package-upload.is-compact .mall-package-upload-icon { width: 42px; height: 42px; border-radius: var(--mall-radius-md); }
@media (max-width: 640px) { .mall-package-upload { align-items: flex-start; padding: var(--mall-space-4); } .mall-package-upload-side { display: none; } }

/* 软件详情下载区 */
.swd-dl { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
