/* ==========================================================================
   admin-framework.css — 订单网工作平台 · Tile-based 科技感框架
   2026-11-05 重做：磁贴导航（图标在上文字在下）+ 四套全局主题
   结构：
     0. CSS 变量与四套主题（data-theme）
     1. 布局骨架（layout / sidebar / main / header）
     2. 侧栏磁贴导航
     3. 顶栏磁贴按钮
     4. 内容区磁贴卡片
     5. 表单 / 表格 / KPI / 抽屉 等公共组件
     6. 响应式
   ========================================================================== */

/* ==========================================================================
   0. CSS 变量与八套全局主题
   ========================================================================== */
:root {
  /* 布局尺寸 */
  --sb-w: 280px;
  --radius-card: 16px;
  --radius-tile: 12px;
  --radius-btn: 10px;

  /* 默认（深空蓝）— 背景色升级：更舒适的大地浅灰蓝底 */
  --bg-page: #eef1f6;
  --bg-card: #ffffff;
  --bg-card-alt: #f6f8fb;
  --bg-sidebar: #0b1220;
  --bg-sidebar-2: #111a2e;
  --border: #e2e8f0;
  --border-soft: rgba(148, 163, 184, 0.18);
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #64748b;
  --brand: #2563eb;
  --brand-2: #38bdf8;
  --brand-grad: linear-gradient(135deg, #2563eb, #0ea5e9);
  --brand-soft: rgba(37, 99, 235, 0.1);
  --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.06), 0 8px 24px -12px rgba(15, 23, 42, 0.12);
  --shadow-pop: 0 12px 40px -8px rgba(15, 23, 42, 0.22);
  --sb-text: #aab6c8;
  --sb-text-strong: #f1f5f9;
  --sb-tile-bg: rgba(255, 255, 255, 0.04);
  --sb-tile-border: rgba(255, 255, 255, 0.07);
}

/* 暗夜紫 */
body[data-theme="purple"] {
  --bg-page: #15101f;
  --bg-card: #1e1830;
  --bg-card-alt: #251d3a;
  --bg-sidebar: #150e24;
  --bg-sidebar-2: #1e1533;
  --border: #332a4a;
  --border-soft: rgba(168, 139, 250, 0.18);
  --text: #f5f3ff;
  --text-2: #c4b5fd;
  --text-3: #9d94c4;
  --brand: #a855f7;
  --brand-2: #ec4899;
  --brand-grad: linear-gradient(135deg, #9333ea, #ec4899);
  --brand-soft: rgba(168, 85, 247, 0.14);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.3), 0 10px 28px -12px rgba(0, 0, 0, 0.5);
  --shadow-pop: 0 16px 44px -8px rgba(0, 0, 0, 0.6);
  --sb-text: #b6a9d9;
  --sb-text-strong: #f5f3ff;
  --sb-tile-bg: rgba(255, 255, 255, 0.04);
  --sb-tile-border: rgba(168, 139, 250, 0.16);
}

/* 石墨灰 */
body[data-theme="graphite"] {
  --bg-page: #f4f4f5;
  --bg-card: #ffffff;
  --bg-card-alt: #fafafa;
  --bg-sidebar: #18181b;
  --bg-sidebar-2: #232326;
  --border: #e4e4e7;
  --border-soft: rgba(113, 113, 122, 0.18);
  --text: #18181b;
  --text-2: #3f3f46;
  --text-3: #71717a;
  --brand: #52525b;
  --brand-2: #3b82f6;
  --brand-grad: linear-gradient(135deg, #3f3f46, #3b82f6);
  --brand-soft: rgba(63, 63, 70, 0.1);
  --shadow-card: 0 1px 3px rgba(24, 24, 27, 0.06), 0 8px 24px -12px rgba(24, 24, 27, 0.14);
  --shadow-pop: 0 12px 40px -8px rgba(24, 24, 27, 0.24);
  --sb-text: #a1a1aa;
  --sb-text-strong: #fafafa;
  --sb-tile-bg: rgba(255, 255, 255, 0.05);
  --sb-tile-border: rgba(255, 255, 255, 0.08);
}

/* 极简白 */
body[data-theme="light"] {
  --bg-page: #ffffff;
  --bg-card: #ffffff;
  --bg-card-alt: #fafafa;
  --bg-sidebar: #ffffff;
  --bg-sidebar-2: #f8fafc;
  --border: #e5e7eb;
  --border-soft: rgba(100, 116, 139, 0.16);
  --text: #0f172a;
  --text-2: #334155;
  --text-3: #64748b;
  --brand: #111827;
  --brand-2: #64748b;
  --brand-grad: linear-gradient(135deg, #111827, #475569);
  --brand-soft: rgba(17, 24, 39, 0.06);
  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.05), 0 6px 20px -12px rgba(15, 23, 42, 0.1);
  --shadow-pop: 0 12px 36px -8px rgba(15, 23, 42, 0.18);
  --sb-text: #4b5563;
  --sb-text-strong: #0f172a;
  --sb-tile-bg: rgba(15, 23, 42, 0.03);
  --sb-tile-border: rgba(15, 23, 42, 0.08);
}

/* 深海蓝（2026-11-26 新增第 5 套：青蓝科技感） */
body[data-theme="ocean"] {
  --bg-page: #eef4f8;
  --bg-card: #ffffff;
  --bg-card-alt: #f0f7fa;
  --bg-sidebar: #0a1a2e;
  --bg-sidebar-2: #0f2440;
  --border: #d8e6ee;
  --border-soft: rgba(8, 145, 178, 0.16);
  --text: #0c2540;
  --text-2: #2c4a63;
  --text-3: #5b7a94;
  --brand: #0891b2;
  --brand-2: #0ea5e9;
  --brand-grad: linear-gradient(135deg, #0891b2, #0ea5e9);
  --brand-soft: rgba(8, 145, 178, 0.1);
  --shadow-card: 0 1px 3px rgba(12, 37, 64, 0.06), 0 8px 24px -12px rgba(12, 37, 64, 0.14);
  --shadow-pop: 0 12px 40px -8px rgba(12, 37, 64, 0.22);
  --sb-text: #9fc3d8;
  --sb-text-strong: #f0f9ff;
  --sb-tile-bg: rgba(255, 255, 255, 0.04);
  --sb-tile-border: rgba(14, 165, 233, 0.18);
}

/* 翡翠绿（第 6 套：自然清新） */
body[data-theme="forest"] {
  --bg-page: #f0f7f2;
  --bg-card: #ffffff;
  --bg-card-alt: #f4faf6;
  --bg-sidebar: #0b1f16;
  --bg-sidebar-2: #123024;
  --border: #dbe7df;
  --border-soft: rgba(5, 150, 105, 0.14);
  --text: #12261d;
  --text-2: #2f5142;
  --text-3: #648574;
  --brand: #059669;
  --brand-2: #34d399;
  --brand-grad: linear-gradient(135deg, #047857, #10b981);
  --brand-soft: rgba(5, 150, 105, 0.1);
  --shadow-card: 0 1px 3px rgba(18, 38, 29, 0.06), 0 8px 24px -12px rgba(18, 38, 29, 0.14);
  --shadow-pop: 0 12px 40px -8px rgba(18, 38, 29, 0.22);
  --sb-text: #9fd3bb;
  --sb-text-strong: #ecfdf5;
  --sb-tile-bg: rgba(255, 255, 255, 0.04);
  --sb-tile-border: rgba(52, 211, 153, 0.18);
}

/* 暖阳橙（第 7 套：活力暖色） */
body[data-theme="sunset"] {
  --bg-page: #fdf6ef;
  --bg-card: #ffffff;
  --bg-card-alt: #fef8f2;
  --bg-sidebar: #2a1a0e;
  --bg-sidebar-2: #3d2617;
  --border: #f0e2d4;
  --border-soft: rgba(217, 119, 6, 0.16);
  --text: #3a2412;
  --text-2: #6b4a2e;
  --text-3: #9a7350;
  --brand: #d97706;
  --brand-2: #f59e0b;
  --brand-grad: linear-gradient(135deg, #c2410c, #f59e0b);
  --brand-soft: rgba(217, 119, 6, 0.1);
  --shadow-card: 0 1px 3px rgba(58, 36, 18, 0.06), 0 8px 24px -12px rgba(58, 36, 18, 0.14);
  --shadow-pop: 0 12px 40px -8px rgba(58, 36, 18, 0.22);
  --sb-text: #e2c9ac;
  --sb-text-strong: #fffbeb;
  --sb-tile-bg: rgba(255, 255, 255, 0.04);
  --sb-tile-border: rgba(245, 158, 11, 0.18);
}

/* 玫瑰粉（第 8 套：柔和女性向） */
body[data-theme="rose"] {
  --bg-page: #fdf3f6;
  --bg-card: #ffffff;
  --bg-card-alt: #fef7fa;
  --bg-sidebar: #2a0e1a;
  --bg-sidebar-2: #3d1729;
  --border: #f0dbe4;
  --border-soft: rgba(219, 39, 119, 0.14);
  --text: #3a1226;
  --text-2: #6b2e4a;
  --text-3: #9a5074;
  --brand: #db2777;
  --brand-2: #f472b6;
  --brand-grad: linear-gradient(135deg, #be185d, #f472b6);
  --brand-soft: rgba(219, 39, 119, 0.1);
  --shadow-card: 0 1px 3px rgba(58, 18, 38, 0.06), 0 8px 24px -12px rgba(58, 18, 38, 0.14);
  --shadow-pop: 0 12px 40px -8px rgba(58, 18, 38, 0.22);
  --sb-text: #e2aecb;
  --sb-text-strong: #fdf2f8;
  --sb-tile-bg: rgba(255, 255, 255, 0.04);
  --sb-tile-border: rgba(244, 114, 182, 0.18);
}

/* ==========================================================================
   1. 布局骨架
   ========================================================================== */
.admin-layout {
  display: flex;
  min-height: 100vh;
  background: var(--bg-page);
}

/* 左侧栏 */
.admin-sidebar {
  width: var(--sb-w);
  min-width: var(--sb-w);
  height: 100vh;
  position: sticky;
  top: 0;
  background: var(--bg-sidebar);
  color: var(--sb-text);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-soft);
  user-select: none;
  z-index: 50;
}

/* 企业主体（公司名 + WORKSPACE） */
.admin-sidebar-brand {
  height: 58px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  background: var(--bg-sidebar-2);
  border-bottom: 1px solid var(--border-soft);
}
.admin-brand-logo {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--brand-grad);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.32);
}
/* 两行严格居中：公司名与副标题同轴、同起点，杜绝错位 */
.admin-brand-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  line-height: 1.2;
  min-width: 0;
  flex: 1;
}
.admin-brand-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--sb-text-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  width: 100%;
  letter-spacing: 0.2px;
}
.admin-brand-subtitle {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: 2.4px;
  text-transform: uppercase;
  margin-top: 3px;
  opacity: 0.85;
}

/* 侧栏顶部区：域名 + 访问官网 + 安全提示（原顶栏元素迁入，2026-11-07） */
.admin-sidebar-top {
  flex-shrink: 0;
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg-sidebar-2);
}
/* 访问企业官网：侧栏顶部主按钮（原顶栏右侧按钮） */
.admin-sidebar-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: var(--radius-btn);
  background: var(--brand-grad);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-decoration: none;
  transition: filter 0.14s ease, transform 0.12s ease;
}
.admin-sidebar-cta:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
}
.admin-sidebar-cta svg { flex: none; }
/* 侧栏顶部安全提示条（原顶栏胶囊 → 常驻条） */
.admin-sidebar-shield {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: var(--radius-btn);
  border: 1px solid var(--sb-tile-border);
  background: var(--sb-tile-bg);
  color: var(--sb-text);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  /* 允许换行，避免长文本被截断 */
  white-space: normal;
  word-break: break-all;
}
.admin-sidebar-shield-icon {
  display: flex;
  flex: none;
  color: var(--brand-2);
  opacity: 0.95;
}

/* 站点域名行（紧凑单行，避免侧栏下拉） */
.admin-site-domain-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 6px 12px 0;
  font-size: 10.5px;
  color: var(--sb-text);
  font-family: var(--font-mono, monospace);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
}
.admin-site-domain-line .admin-site-url-scheme { color: var(--text-3); }
.admin-site-domain-line .admin-site-badge { flex-shrink: 0; }

/* 站点域名上下文（旧卡片样式保留，模板已改单行） */
.admin-site-context-card {
  margin: 12px 12px 0;
  padding: 9px 11px;
  background: var(--sb-tile-bg);
  border: 1px solid var(--sb-tile-border);
  border-radius: var(--radius-tile);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.admin-site-context-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.admin-site-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--sb-text-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-site-domain {
  font-size: 11px;
  color: var(--text-3);
  font-family: var(--font-mono, monospace);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 完整 URL 行：协议头弱化，域名主体高亮，读起来更协调 */
.admin-site-context-url {
  font-size: 11px;
  color: var(--sb-text);
  font-family: var(--font-mono, monospace);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.1px;
}
.admin-site-url-scheme { color: var(--text-3); }
.admin-site-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.14);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.28);
}
.admin-site-badge.is-warn {
  background: rgba(245, 158, 11, 0.14);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.3);
}

/* 快捷横排：首页 + VIP（2026-11-05 老板令：VIP 缩半、上移与首页并排） */
.admin-quick-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 74px;
  gap: 0;
  margin: 12px 10px 0;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
}
.admin-quick-vip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 40px;
  padding: 0 8px;
  border-radius: var(--radius-tile);
  text-decoration: none;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.22), rgba(212, 175, 55, 0.08));
  border: 1px solid rgba(212, 175, 55, 0.45);
  transition: transform 0.14s ease, background 0.14s ease, border-color 0.14s ease;
}
.admin-quick-vip--free {
  background: var(--sb-tile-bg);
  border: 1px solid var(--sb-tile-border);
}
.admin-quick-vip--free:hover {
  background: rgba(212, 175, 55, 0.12);
  border-color: rgba(212, 175, 55, 0.4);
  transform: translateY(-1px);
}
.admin-quick-vip-crown {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.22);
  font-size: 11px;
  line-height: 1;
}
.admin-quick-vip-title {
  font-size: 12px;
  font-weight: 700;
  color: #fde68a;
  letter-spacing: 0.5px;
}
.admin-quick-vip--free .admin-quick-vip-title { color: var(--sb-text); }
/* 与 VIP 并排的首页磁贴（比标准磁贴矮） */
.admin-tile--slim {
  height: 46px;
  min-height: 46px;
  padding: 7px 5px 6px;
  gap: 3px;
  justify-content: center;
}
.admin-tile--slim .admin-tile-icon { width: 22px; height: 22px; border-radius: 7px; }
.admin-tile--slim .admin-tile-icon svg { width: 13px; height: 13px; }
/* 组名格与功能格用同一尺寸，颜色区分 */
.admin-nav-grid .admin-tile--slim { height: 46px; }

/* ==========================================================================
   2. 侧栏磁贴导航（纯文字方块、40% 透明、四色区分、彼此相连）
   ========================================================================== */
/* 侧栏 5 个大目录方块竖排：格子填满整栏剩余高度，不多不少 5 格。
   老板令 2026-11-06：左侧只放大目录方块；右侧二级方块上下围住工作页。
   格子相连无缝隙、无边框、无弧度、每格不同颜色。 */
.admin-sidebar-nav {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 0 6px;
}

.side-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: repeat(7, minmax(0, 1fr));
  gap: 0;
  height: 100%;
  min-height: 0;
  border-radius: 0;
  overflow: hidden;
}
.side-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
  padding: 6px 10px;
  text-decoration: none;
  color: #ffffff;
  background: var(--sb-tile-bg);
  border: 0;
  border-radius: 0;
  transition: filter 0.16s ease;
  /* button 元素重置（大目录用 button 语义：切换而非跳转）
     18px + 粗体 = WCAG「大号文字」，对比度阈值 3:1 */
  font: inherit;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.4px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
.side-cell:hover {
  filter: brightness(1.18);
  z-index: 2;
}
.side-cell.is-active {
  filter: brightness(1.28);
  box-shadow: inset 0 0 0 3px #ffffff, inset 0 0 24px rgba(255, 255, 255, 0.28);
}
/* 2026-11-27 视觉降噪：左侧 7 个大目录块是满饱和色（蓝/绿/橙/紫/金），
   每页都形成一片高饱和色墙，抢内容注意力。改为色相保留 + 顶部渐变压暗，
   让目录退成"导航背景"而非"主视觉"；当前组仍用亮描边明确标识。 */
.side-grid .side-cell--group {
  position: relative;
  overflow: hidden;
}
.side-grid .side-cell--group::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(10, 14, 24, .30) 0%, rgba(10, 14, 24, .08) 100%);
}
.side-grid .side-cell--group.is-active::after {
  background: linear-gradient(180deg, rgba(10, 14, 24, .14) 0%, rgba(10, 14, 24, .02) 100%);
}
/* ⚠️ 只提升名字层级，不能写 > *（会把计数徽标的 position:absolute 覆盖成 relative） */
.side-grid .side-cell--group > .side-cell-name {
  position: relative;
  z-index: 1;
}
.side-cell-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.8px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB",
               "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
}
/* 大目录方块右下角的功能计数徽标（z-index:2 压过降噪蒙版层） */
.side-cell-count {
  position: absolute;
  z-index: 2;
  right: 10px;
  bottom: 8px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  letter-spacing: 0.3px;
}
.side-cell-sub {
  display: none;
}

.admin-nav-group { margin-bottom: 0; }
/* 分组标题已按老板令去掉，只保留分组间距 */
.admin-nav-group + .admin-nav-group { margin-top: 8px; }
.admin-nav-group-title { display: none; }

/* 两列无缝相连：方块之间不留间隙，靠颜色边界区分 */
.admin-nav-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border-radius: 10px;
  overflow: hidden;
}

/* 磁贴本体 */
.admin-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 12px 6px 11px;
  border: 1px solid var(--sb-tile-border);
  border-radius: 0;
  background: var(--sb-tile-bg);
  color: var(--sb-text);
  text-decoration: none;
  font-size: 12px;
  line-height: 1.3;
  transition: background 0.16s ease, border-color 0.16s ease,
              transform 0.14s ease, box-shadow 0.16s ease, color 0.16s ease;
}
.admin-tile-icon {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.14);
  color: #94a3b8;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}
.admin-tile-icon svg { width: 18px; height: 18px; }
.admin-tile-icon--gold {
  background: rgba(212, 175, 55, 0.18);
  color: #fbbf24;
  font-size: 15px;
  font-weight: 800;
}
.admin-tile-label {
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.4px;
}
/* 纯文字方块：字体方正规整（黑体类），无衬线、笔画均匀 */
.admin-nav-grid .admin-tile-label {
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB",
               "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.8px;
}
.admin-tile:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--sb-text-strong);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px -6px rgba(37, 99, 235, 0.35);
}
.admin-tile:hover .admin-tile-icon {
  background: var(--brand-grad);
  color: #ffffff;
  transform: scale(1.06);
}
/* 四色区分：同一组内四个方块各一种颜色，40% 透明 */
.admin-tile {
  background: rgba(37, 99, 235, 0.4);
}
.admin-tile:nth-child(2) { background: rgba(14, 165, 233, 0.4); }
.admin-tile:nth-child(3) { background: rgba(139, 92, 246, 0.4); }
.admin-tile:nth-child(4) { background: rgba(16, 185, 129, 0.4); }
/* 组内只有两项时（智能助手）用前两色 */
.admin-tile.is-active {
  background: var(--brand-grad);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 8px 20px -8px rgba(37, 99, 235, 0.5);
}
.admin-tile.is-active .admin-tile-icon {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}
.admin-tile-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ef4444;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.45);
}

/* 通栏横条磁贴（温贸单证）：占满两列、更矮、渐变高光，置于侧栏最顶部 */
.admin-tile--wide {
  grid-column: 1 / -1;
  flex-direction: row;
  gap: 8px;
  height: 38px;
  min-height: 38px;
  padding: 0 12px;
  justify-content: flex-start;
  margin-bottom: 12px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.28), rgba(14, 165, 233, 0.12));
  border: 1px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 4px 14px -4px rgba(37, 99, 235, 0.35);
}
.admin-tile--wide .admin-tile-icon--wide {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.14);
  color: #e0f2fe;
}
.admin-tile--wide .admin-tile-icon--wide svg { width: 14px; height: 14px; }
.admin-tile--wide .admin-tile-label {
  font-size: 13px;
  font-weight: 700;
  color: #f0f9ff;
  letter-spacing: 1.2px;
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB",
               "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
}
.admin-tile--wide:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -6px rgba(37, 99, 235, 0.5);
  border-color: rgba(56, 189, 248, 0.7);
}
.admin-tile--wide.is-active {
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 8px 20px -8px rgba(37, 99, 235, 0.6);
}

/* 通栏横条容器：占满侧栏两列，位于侧栏最顶部 */
.admin-tile--wide-wrap {
  padding: 14px 10px 0;
  flex-shrink: 0;
}

.admin-tile-sub {
  font-size: 9.5px;
  font-weight: 500;
  opacity: 0.75;
  letter-spacing: 0.2px;
  line-height: 1.2;
}

/* ==========================================================================
   3. 帘子过渡（1s 睁眼：从中间向上下拉开）
   ========================================================================== */
.curtain {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  visibility: hidden;
  display: flex;
  flex-direction: column;
}
.curtain-panel {
  flex: 1;
  background: var(--bg-sidebar);
  transition: transform 1s cubic-bezier(0.7, 0, 0.2, 1);
}
/* 睁眼：帘布初始在中间合拢（各占一半），点击后向上下两端退去 */
.curtain-panel--top {
  transform: translateY(0);
  background: linear-gradient(180deg, #0b1220 0%, #111c30 100%);
}
.curtain-panel--bottom {
  transform: translateY(0);
  background: linear-gradient(180deg, #111c30 0%, #0b1220 100%);
}
.curtain-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  margin-top: -1px;
  background: linear-gradient(90deg, transparent, var(--brand, #2563eb), transparent);
  opacity: 1;
  transition: opacity 0.3s ease;
}
/* 睁眼状态：帘布已退到上下两端（露出中间工作台） */
.curtain { visibility: hidden; }
.curtain.is-open { visibility: visible; }
.curtain.is-open .curtain-panel--top { transform: translateY(-101%); }
.curtain.is-open .curtain-panel--bottom { transform: translateY(101%); }
.curtain.is-open .curtain-line { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .curtain-panel { transition-duration: 0.01s; }
}
.admin-sidebar-footer {
  flex-shrink: 0;
  padding: 8px 10px;
  border-top: 1px solid var(--border-soft);
  background: var(--bg-sidebar-2);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
/* 侧栏底部用户行（原顶栏右侧用户胶囊 + 退出 → 侧栏底部） */
.admin-sidebar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-btn);
  border: 1px solid var(--sb-tile-border);
  background: var(--sb-tile-bg);
}
.admin-sidebar-user .admin-user-avatar {
  width: 26px;
  height: 26px;
  font-size: 12px;
  flex: none;
}
.admin-sidebar-user-name {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--sb-text-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-sidebar-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 8px;
  color: var(--sb-text);
  text-decoration: none;
  transition: background 0.14s ease, color 0.14s ease;
}
.admin-sidebar-logout:hover {
  background: rgba(239, 68, 68, 0.16);
  color: #f87171;
}
/* 底部首页 + VIP 一行 */
.admin-footer-quick {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 78px;
  gap: 0;
  border-radius: 0;
  overflow: hidden;
}
.admin-footer-home,
.admin-footer-vip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 30px;
  font-size: 11.5px;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.3px;
  color: var(--sb-text);
  background: var(--sb-tile-bg);
  border: 1px solid var(--sb-tile-border);
  border-radius: 0;
}
.admin-footer-home.is-active {
  background: var(--brand-grad);
  color: #fff;
  border-color: transparent;
}
.admin-footer-vip {
  color: #fde68a;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.22), rgba(212, 175, 55, 0.08));
  border-color: rgba(212, 175, 55, 0.45);
}
.admin-footer-vip.is-free {
  color: var(--sb-text);
  background: var(--sb-tile-bg);
  border-color: var(--sb-tile-border);
}
.admin-footer-home:hover,
.admin-footer-vip:hover { filter: brightness(1.15); }
.admin-footer-status {
  display: none;
}
.admin-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 7px rgba(16, 185, 129, 0.7);
}

/* 界面配色：商户侧只读展示（2026-11-29 权限下沉）
   原 8 个色点 cursor:pointer + hover 放大，看着能点但没反应 —— 既是误导，
   也把平台级设置摆在商户眼前。切换只在 admin 后台。 */
.admin-theme-current {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  font-size: 11.5px;
  color: rgba(255,255,255,.45);
  cursor: default;
  user-select: none;
}
.admin-theme-current-label { opacity: .75; }
.admin-theme-current-value { color: rgba(255,255,255,.72); font-weight: 600; }

.admin-footer-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: var(--radius-btn);
  border: 1px solid var(--sb-tile-border);
  background: var(--sb-tile-bg);
  color: var(--sb-text);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}
.admin-footer-link:hover {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--sb-text-strong);
}

/* ==========================================================================
   3. 右侧主区 + 顶栏
   ========================================================================== */
.admin-main {
  flex: 1;
  min-width: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-page);
  position: relative;
}

/* 顶栏已移除（老板令 2026-11-07）：标题并入帘子收缩条，工作区占满全高 */

.admin-status-capsule {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--brand-soft);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.admin-status-capsule-icon { color: var(--brand); display: flex; }

/* 顶栏极简化（2026-11-07）：访问官网/用户/退出全部迁入侧栏，旧顶栏按钮样式已移除 */

.admin-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand-grad);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

/* 主画布：外层框架锁死，绝不整页滚动。
   工作页内容自己管滚动（长列表页内部加滚动容器），
   这样侧栏/顶栏始终固定，视觉更正规大气。 */
.admin-content-canvas {
  flex: 1;
  position: relative;
  min-height: 0;        /* flex 子项允许收缩，配合 overflow:hidden 才能真正锁死 */
  overflow: hidden;
  padding: 22px;
  display: flex;
  flex-direction: column;
}
/* 工作页内容包裹层：占满画布，内部滚动（页面模板需自行套 .admin-page-body） */
.admin-page-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;   /* 收缩态头部 absolute 浮条的定位上下文 */
}

/* ══ 2026-11-09 空间充分利用：表格页专用布局 ══
   用法：page-body 加 .admin-fill，把要吃剩余空间的卡片加 .admin-fill-card。
   卡片内的表格容器会被 flex 撑满，精确吃掉所有剩余垂直空间（底部与视口齐平）。
   结构：admin-page-body.admin-fill > [header/kpi/...] + .admin-card.admin-fill-card(含表格) */
.admin-page-body.admin-fill {
  display: flex;
  flex-direction: column;
  overflow: hidden;          /* 页面本身不滚动，交给表格容器滚 */
  gap: 0;
}
/* header / KPI / 其他块：不参与伸缩，保持自然高度 */
.admin-page-body.admin-fill > .admin-page-header,
.admin-page-body.admin-fill > .admin-kpi-grid,
.admin-page-body.admin-fill > section {
  flex-shrink: 0;
}
/* 要吃剩余空间的卡片：flex 撑满 + 内部 flex 列 */
.admin-page-body.admin-fill > .admin-card.admin-fill-card,
.admin-page-body.admin-fill .admin-fill-card {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
  margin-top: 0;
  overflow: hidden;
}
/* 卡片内的表格容器：吃掉卡片剩余空间 */
.admin-fill-card > .admin-table-container,
.admin-fill-card > .admin-table-wrap {
  flex: 1;
  min-height: 0;
  max-height: none;          /* 不再用 vh 估算，交给 flex 精确分配 */
  border: 0;
  border-radius: 0;
}
/* 卡片内的工具栏不参与滚动（固定） */
.admin-fill-card > .admin-toolbar {
  flex-shrink: 0;
}
/* 卡片内表格容器之后的分页条：固定不滚 */
.admin-fill-card > .admin-table-container + div,
.admin-fill-card > div[style*="justify-content:center"] {
  flex-shrink: 0;
}
/* 多卡片纵向排列时，非 fill 卡片保持自然高度、有间距 */
.admin-page-body.admin-fill > .admin-card + .admin-card { margin-top: 16px; }
/* 栅格布局（如 news 的 2:1）：栅格整体吃剩余空间，两列各自 flex 列。
   2026-11-09：恢复丢失的 .admin-grid-2-1 基础定义（display:grid 两列）。 */
.admin-grid-2-1 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  align-items: start;
}
.admin-page-body.admin-fill > .admin-grid-2-1 {
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  align-items: stretch;      /* 两列等高，撑满栅格高度 */
}
.admin-page-body.admin-fill > .admin-grid-2-1 > .admin-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;          /* 关键：grid item 默认 min-width:auto 会把列撑坏 */
  overflow: hidden;
  margin-bottom: 0;
}
/* 右列可能是无 class 的包装 div（news 页结构差异），同样要 min-width:0 */
.admin-page-body.admin-fill > .admin-grid-2-1 > div {
  min-width: 0;
  min-height: 0;
}
.admin-page-body.admin-fill > .admin-grid-2-1 > div > .admin-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
/* 卡片内的表格容器也要 min-width:0，否则 overflow-x:auto 失效撑开列 */
.admin-page-body.admin-fill > .admin-grid-2-1 > .admin-card > .admin-table-container {
  min-width: 0;
  width: 100%;
}
/* 栅格内卡片里的表格容器吃剩余空间 */
.admin-page-body.admin-fill > .admin-grid-2-1 > .admin-card > .admin-table-container {
  flex: 1;
  min-height: 0;
  max-height: none;
  border: 0;
  border-radius: 0;
}

/* ===== 通用工作页头固定（2026-11-07） =====
   页面内的 .admin-page-header（操作按钮）自动固定，标题已移至帘子顶部杆。
   不依赖页面结构，所有有 admin-page-header 的页面自动生效。
   2026-11-08：收缩态（帘子方块露出）头部改为内容流内普通块
   （原 sticky top:0 会让白条一直粘在页顶、下拉不跟走、还盖住方块）。 */
.admin-page-body > .admin-page-header {
  position: sticky;
  top: 0;
  z-index: 20;
  margin-bottom: 14px;
  padding: 4px 0 10px;
  background: var(--bg-page);
  border-bottom: 1px solid var(--border);
  transition: top 0.3s ease, padding 0.3s ease;
  /* 只有操作按钮时靠右、垂直居中 */
  justify-content: flex-end;
  align-items: center;
}
/* 帘子收缩时：头部回到内容流（relative），跟随内容滚动，不再粘在页顶/遮挡方块。
   重复标题隐藏（标题已在帘子顶部杆上），只保留操作按钮。
   2026-11-08：下移让出提示条空间（提示条在 y=88-120，头部从 y=128 开始）。 */
body.curtain-revealed .admin-page-body > .admin-page-header {
  position: relative;
  top: auto;
  z-index: auto;
  margin-bottom: 12px;
  margin-top: 12px;   /* 2026-11-09 收紧：薄边已改 26px，不用让 40px */
  padding: 0 0 8px;
  background: transparent;
  border-bottom: 0;
}
/* 铺满态（帘子打开）：头部隐藏（方块已占满，头部多余，且会浮在方块上） */
.admin-page-body > .admin-page-header {
  transition: opacity 0.2s ease;
}
body:not(.curtain-revealed) .admin-page-body > .admin-page-header {
  display: none;
}
/* 头部内重复标题（admin-page-title-wrap）收缩态隐藏（标题已在帘子杆上） */
body.curtain-revealed .admin-page-body > .admin-page-header .admin-page-title-wrap {
  display: none;
}
body.curtain-revealed .admin-page-body {
  padding-top: 76px;   /* 48px 方块条 + 26px 薄边 + 2px 呼吸位（2026-11-09 收紧） */
}

/* ==========================================================================
   3.5 工作页统一布局系统（2026-11-07 重构）
   结构：.page-work > .page-work-head（固定）+ .page-work-main（滚动）
   目的：所有内容局限在框架内，长列表在 main 内滚动，head 始终可见。
   ========================================================================== */
.page-work {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  gap: 16px;
  padding-top: 0;
  transition: padding-top 0.3s ease;
}
/* 帘子收缩时顶部杆悬浮，工作页给 56px 让位（body.curtain-revealed 由 JS 切换） */
body.curtain-revealed .page-work { padding-top: 56px; }
/* 头部：标题 + 操作 + 筛选，始终固定 */
.page-work-head {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
/* 主体：占满剩余高度，内部滚动 */
.page-work-main {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;   /* 给滚动条留位，避免贴边 */
}
/* 主体内的卡片间距 */
.page-work-main > * + * { margin-top: 16px; }
/* 头部操作行（标题左、按钮右） */
.page-work-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.page-work-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  letter-spacing: 0.2px;
}
.page-work-desc {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.5;
}
.page-work-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

/* ===== 工作页磁贴按钮（九宫格形式 + 圆角，与导航区分） =====
   用于工作页内的主要操作（发布、保存、上架等）：
   方形圆角磁贴，图标在上文字在下，与侧栏大目录同语言但更小。 */
.tile-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 76px;
  padding: 12px 14px;
  border-radius: var(--radius-tile);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  text-align: center;
  transition: transform 0.12s ease, box-shadow 0.14s ease,
              border-color 0.14s ease, background 0.14s ease;
  appearance: none;
  -webkit-appearance: none;
}
.tile-btn:hover {
  transform: translateY(-2px);
  border-color: var(--brand);
  box-shadow: 0 8px 20px -8px rgba(37, 99, 235, 0.35);
  color: var(--brand);
  background: var(--brand-soft);
}
.tile-btn svg { width: 20px; height: 20px; flex: none; }
.tile-btn--primary {
  background: var(--brand-grad);
  color: #ffffff;
  border-color: transparent;
}
.tile-btn--primary:hover {
  color: #ffffff;
  background: var(--brand-grad);
  filter: brightness(1.08);
}
.tile-btn--danger:hover {
  border-color: var(--c-danger);
  color: var(--c-danger);
  background: var(--c-danger-bg);
  box-shadow: 0 8px 20px -8px rgba(239, 68, 68, 0.35);
}
/* 磁贴组：多个磁贴并排 */
.tile-btn-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* 移动端菜单按钮与遮罩（顶栏移除后，按钮改为浮动，见响应式段落） */
.admin-mobile-menu-btn,
.admin-mobile-nav-backdrop { display: none; }

/* ==========================================================================
   4. 内容区磁贴卡片
   ========================================================================== */
.admin-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  margin-bottom: 20px;
}
.admin-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--brand-grad);
  opacity: 0.85;
}
.admin-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.admin-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-card-body { padding: 20px; }
.admin-card-body--flush { padding: 0; }

.admin-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.admin-page-title { font-size: 22px; font-weight: 800; color: var(--text); }
.admin-page-desc { font-size: 13px; color: var(--text-3); margin-top: 4px; }
.admin-page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* KPI 磁贴 → 2026-11-09 紧凑单行条：老板令「减少空间浪费，充分利用框内空间」
   原：4 张 134px 大卡 = 154px；现：单卡 ~64px（图标绝对定位左侧，文字右移竖排紧凑）。
   模板结构不变（header[标题+图标] / value / footer）。 */
.admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.admin-kpi-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 10px 14px 10px 54px;   /* 左侧 54px 给绝对定位的图标 */
  box-shadow: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  overflow: hidden;
  transition: border-color 0.14s ease, background 0.14s ease;
}
.admin-kpi-card:hover { transform: none; box-shadow: none; border-color: var(--brand); }
.admin-kpi-card::after { display: none; }
/* 图标绝对定位到左侧，跨整卡居中 */
.admin-kpi-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
}
/* header 里的图标就是同一个（模板把图标放在 header 内），绝对定位后脱离文档流 */
.admin-kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  min-width: 0;
}
.admin-kpi-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}
.admin-kpi-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.3;
}
.admin-kpi-label { font-size: 12px; color: var(--text-3); font-weight: 500; }

/* 徽章 */
.admin-kpi-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--brand-soft);
  color: var(--brand);
}
.admin-kpi-badge.is-warning { background: rgba(245, 158, 11, 0.14); color: #d97706; }
.admin-kpi-badge.is-success { background: rgba(16, 185, 129, 0.14); color: #059669; }
.admin-kpi-badge.is-danger { background: rgba(239, 68, 68, 0.14); color: #dc2626; }

/* ==========================================================================
   5. 公共组件（按钮 / 表单 / 表格 / 抽屉）
   ========================================================================== */
.admin-btn-primary,
.admin-btn-secondary,
.admin-btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: var(--radius-btn);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.12s ease, box-shadow 0.14s ease,
              background 0.14s ease, border-color 0.14s ease;
}
.admin-btn-primary {
  background: var(--brand-grad);
  color: #ffffff;
  box-shadow: 0 6px 16px -6px rgba(37, 99, 235, 0.45);
}
.admin-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -8px rgba(37, 99, 235, 0.55); }
.admin-btn-secondary {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--text-2);
}
.admin-btn-secondary:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
}
.admin-btn-danger {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.25);
  color: #dc2626;
}
.admin-btn-danger:hover { background: rgba(239, 68, 68, 0.16); }

.admin-drawer-form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}
.drawer-form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}
.drawer-form-control,
.admin-form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  background: var(--bg-card);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}
.drawer-form-control:focus,
.admin-form-control:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

/* 表格 */
.admin-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  background: var(--bg-card);
}
/* admin-table-container：部分模板用的容器名（news/inquiries/products/detail）。
   统一行为：横向可滚动 + 吃掉所有剩余垂直空间（2026-11-09 从 62vh 改为 calc）。
   算法：视口高 - 顶部固定占用（76 padding + header ~50 + KPI ~62 + card头 ~40 + toolbar ~66）
        ≈ 100vh - 294px，保证表格撑满框内、底部不留白。 */
.admin-table-container {
  overflow-x: auto;
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  background: var(--bg-card);
  max-height: calc(100vh - 294px);
  min-height: 220px;
  overflow-y: auto;
}

/* ══ 商品表格单元格（2026-11-09 从备份恢复：重构时丢失，导致图片按原图 1080×810 渲染撑爆行高） ══ */
.admin-goods-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}
.admin-goods-thumb {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  object-fit: cover;
  background: #f8fafc;
  flex-shrink: 0;
}
.admin-goods-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.admin-goods-name {
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}
.admin-goods-meta {
  font-size: 12px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
/* 价格单元格（强化内控出厂价保密标识） */
.admin-price-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.admin-price-val {
  font-weight: 700;
  font-size: 14px;
  color: #0f172a;
  font-family: var(--font-mono, monospace);
}
.admin-price-sub {
  font-size: 11px;
  color: #d97706;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}
/* 操作列按钮组 */
.admin-table-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap; /* 2026-11-10：列宽被压缩时按钮文字会竖排 */
}
.admin-btn-action {
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  font-size: 12px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
  white-space: nowrap; /* 2026-11-10：防「编辑」折成竖排 */
}
.admin-btn-action:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.admin-btn-action.is-danger { color: #dc2626; border-color: #fecaca; }
.admin-btn-action.is-danger:hover { background: #fef2f2; border-color: #dc2626; }

/* ══ 工具条 / 筛选 / Tab（同上，重构丢失恢复） ══ */
.admin-toolbar {
  padding: 10px 16px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.admin-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 6px;
}
.admin-tab {
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s;
}
.admin-tab:hover { color: var(--text); }
.admin-tab.is-active { background: var(--bg-card); color: var(--text); box-shadow: 0 1px 3px rgba(15,23,42,.08); }
.admin-filters {
  display: flex;
  align-items: center;
  gap: 10px;
}
.admin-input-search {
  height: 32px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  font-size: 13px;
  color: #0f172a;
  outline: none;
  transition: border-color 0.15s;
  width: 220px;
}
.admin-input-search:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.admin-select {
  height: 32px;
  padding: 0 28px 0 10px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E") no-repeat right 8px center;
  font-size: 13px;
  color: #334155;
  outline: none;
  appearance: none;
  cursor: pointer;
}

/* ══ KPI 卡内部（同上） ══ */
.admin-kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #64748b;
  font-size: 13px;
  font-weight: 500;
}
.admin-kpi-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #64748b;
}

/* ══ 抽屉头部（同上） ══ */
.admin-drawer-title {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}
.admin-drawer-close {
  background: transparent;
  border: none;
  font-size: 20px;
  color: #64748b;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.admin-drawer-close:hover { background: #f1f5f9; color: var(--text); }

/* ══ 键值列表 / 提示条 / 表单小节标题（同上） ══ */
.admin-kv-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 13px;
}
.admin-kv-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.admin-kv-label { color: #64748b; flex-shrink: 0; }
.admin-kv-value { color: #0f172a; font-weight: 500; text-align: right; word-break: break-all; }
.admin-notice-bar {
  padding: 12px 16px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  color: #1e40af;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.admin-form-section-title {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  padding: 12px 0 8px;
  margin: 16px 0 12px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ══ 快捷入口栅格（同上） ══ */
.admin-quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.admin-quick-btn {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.15s;
}
.admin-quick-btn:hover { border-color: var(--brand); background: var(--brand-soft); }
.admin-quick-title {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
}
.admin-quick-desc { font-size: 11px; color: #64748b; }

/* 表头在容器滚动时吸顶 */
.admin-table-container > .admin-table thead th,
.admin-table-wrap > .admin-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg-card-alt);
  box-shadow: 0 1px 0 var(--border);
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  color: var(--text-2);
}
.admin-table thead tr {
  background: var(--bg-card-alt);
  color: var(--text-3);
  text-align: left;
}
.admin-table th {
  padding: 11px 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.admin-table td { padding: 12px 14px; border-top: 1px solid var(--border); }
.admin-table tbody tr { transition: background 0.12s ease; }
.admin-table tbody tr:hover { background: var(--brand-soft); }

/* 抽屉浮层（overlay 承载遮罩 + 抽屉，二者联动） */
.admin-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.admin-drawer-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}
.admin-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(480px, 92vw);
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-pop);
  z-index: 101;
  display: flex;
  flex-direction: column;
  transform: translateX(102%);
  transition: transform 0.22s ease;
}
.admin-drawer.is-open { transform: translateX(0); }
.admin-drawer-overlay.is-open .admin-drawer { transform: translateX(0); }
.admin-drawer-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-drawer-body { flex: 1; overflow-y: auto; padding: 20px; }
.admin-drawer-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ==========================================================================
   6. 响应式
   ========================================================================== */
@media (max-width: 1200px) {
  .admin-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  html, body { overflow: hidden; }
  .admin-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-102%);
    width: min(var(--sb-w), 86vw);
    box-shadow: 12px 0 36px rgba(15, 23, 42, 0.28);
    transition: transform 0.22s ease, visibility 0.22s ease;
    visibility: hidden;
  }
  .admin-sidebar.is-mobile-open {
    transform: translateX(0);
    visibility: visible;
  }
  .admin-mobile-nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(15, 23, 42, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }
  .admin-mobile-nav-backdrop.is-visible { opacity: 1; pointer-events: auto; }
  .admin-mobile-menu-btn {
    display: inline-grid;
    place-items: center;
    position: fixed;
    left: 12px;
    top: 60px;
    z-index: 60;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius-btn);
    background: var(--bg-card);
    color: var(--text-2);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    box-shadow: var(--shadow-card);
  }
  .admin-content-canvas { padding: 18px; }
}

@media (max-width: 640px) {
  /* 移动端：顶部杆标题隐藏（避免与浮动 ☰ 按钮重叠） */
  .work-curtain-edge--up .edge-title { display: none; }
  /* 内容区顶部留出 ☰ 按钮空间（按钮 fixed 在 top:60px，高 40px → 底部 100px） */
  .admin-content-canvas { padding: 12px; padding-top: 104px; overflow-x: hidden; }
  .admin-page-header { flex-direction: column; align-items: stretch; gap: 12px; }
  .admin-page-actions { width: 100%; flex-wrap: wrap; }
  .admin-page-actions > * { flex: 1 1 auto; justify-content: center; }
  .admin-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .admin-grid-2-1 { grid-template-columns: 1fr !important; }
  .admin-card { border-radius: 12px; }
  .admin-card-header, .admin-card-body { padding: 14px; }
  .admin-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .admin-table { min-width: 680px; }
  .admin-drawer { width: 100vw; max-width: 100vw; }
  .admin-drawer-body { padding: 16px; padding-bottom: 24px; }
  .admin-drawer-footer { position: sticky; bottom: 0; z-index: 5; flex-wrap: wrap; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
  .admin-drawer-footer button { flex: 1 1 auto; min-height: 42px; }
  .img-upload-toolbar > div:last-of-type { width: 100%; }
  .img-upload-toolbar .img-btn-upload-primary { flex: 1 1 140px; justify-content: center; }
  .img-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .admin-nav-grid { gap: 6px; }
  .admin-tile { padding: 10px 4px 9px; gap: 5px; font-size: 11px; }
  .admin-tile-icon { width: 30px; height: 30px; border-radius: 9px; }
  .admin-tile-icon svg { width: 16px; height: 16px; }
}


/* ==========================================================================
   7. 语义状态色（页面内联样式里残留的 #hex 统一走这里）
   ========================================================================== */
:root {
  --c-success: #10b981;      --c-success-bg: rgba(16, 185, 129, 0.12);
  --c-warn: #f59e0b;         --c-warn-bg: rgba(245, 158, 11, 0.14);
  --c-danger: #ef4444;       --c-danger-bg: rgba(239, 68, 68, 0.12);
  --c-accent-1: #8b5cf6;     --c-accent-1-bg: rgba(139, 92, 246, 0.12);
  --c-accent-2: #ec4899;     --c-accent-2-bg: rgba(236, 72, 153, 0.12);
  --c-accent-3: #eab308;     --c-accent-3-bg: rgba(234, 179, 8, 0.14);
}
body[data-theme="purple"] {
  --c-success: #34d399;      --c-success-bg: rgba(52, 211, 153, 0.16);
  --c-warn: #fbbf24;         --c-warn-bg: rgba(251, 191, 36, 0.16);
  --c-danger: #fb7185;       --c-danger-bg: rgba(251, 113, 133, 0.16);
  --c-accent-1: #a78bfa;     --c-accent-1-bg: rgba(167, 139, 250, 0.16);
  --c-accent-2: #f472b6;     --c-accent-2-bg: rgba(244, 114, 182, 0.16);
  --c-accent-3: #facc15;     --c-accent-3-bg: rgba(250, 204, 21, 0.16);
}
body[data-theme="graphite"] {
  --c-success: #22c55e;      --c-success-bg: rgba(34, 197, 94, 0.12);
  --c-warn: #eab308;         --c-warn-bg: rgba(234, 179, 8, 0.14);
  --c-danger: #ef4444;       --c-danger-bg: rgba(239, 68, 68, 0.12);
  --c-accent-1: #a1a1aa;     --c-accent-1-bg: rgba(161, 161, 170, 0.14);
  --c-accent-2: #3b82f6;     --c-accent-2-bg: rgba(59, 130, 246, 0.12);
  --c-accent-3: #f59e0b;     --c-accent-3-bg: rgba(245, 158, 11, 0.14);
}
body[data-theme="light"] {
  --c-success: #059669;      --c-success-bg: rgba(5, 150, 105, 0.08);
  --c-warn: #d97706;         --c-warn-bg: rgba(217, 119, 6, 0.08);
  --c-danger: #dc2626;       --c-danger-bg: rgba(220, 38, 38, 0.08);
  --c-accent-1: #7c3aed;     --c-accent-1-bg: rgba(124, 58, 237, 0.08);
  --c-accent-2: #db2777;     --c-accent-2-bg: rgba(219, 39, 119, 0.08);
  --c-accent-3: #ca8a04;     --c-accent-3-bg: rgba(202, 138, 4, 0.08);
}

/* 深海蓝 / 翡翠绿 / 暖阳橙 / 玫瑰粉 的强调色（2026-11-26 新增主题配套） */
body[data-theme="ocean"] {
  --c-success: #22d3ee;      --c-success-bg: rgba(34, 211, 238, 0.16);
  --c-warn: #fbbf24;         --c-warn-bg: rgba(251, 191, 36, 0.16);
  --c-danger: #fb7185;       --c-danger-bg: rgba(251, 113, 133, 0.16);
  --c-accent-1: #22d3ee;     --c-accent-1-bg: rgba(34, 211, 238, 0.16);
  --c-accent-2: #0ea5e9;     --c-accent-2-bg: rgba(14, 165, 233, 0.16);
  --c-accent-3: #2dd4bf;     --c-accent-3-bg: rgba(45, 212, 191, 0.16);
}
body[data-theme="forest"] {
  --c-success: #4ade80;      --c-success-bg: rgba(74, 222, 128, 0.16);
  --c-warn: #fbbf24;         --c-warn-bg: rgba(251, 191, 36, 0.16);
  --c-danger: #f87171;       --c-danger-bg: rgba(248, 113, 113, 0.16);
  --c-accent-1: #34d399;     --c-accent-1-bg: rgba(52, 211, 153, 0.16);
  --c-accent-2: #a3e635;     --c-accent-2-bg: rgba(163, 230, 53, 0.16);
  --c-accent-3: #fbbf24;     --c-accent-3-bg: rgba(251, 191, 36, 0.16);
}
body[data-theme="sunset"] {
  --c-success: #84cc16;      --c-success-bg: rgba(132, 204, 22, 0.14);
  --c-warn: #f59e0b;         --c-warn-bg: rgba(245, 158, 11, 0.16);
  --c-danger: #ef4444;       --c-danger-bg: rgba(239, 68, 68, 0.14);
  --c-accent-1: #f59e0b;     --c-accent-1-bg: rgba(245, 158, 11, 0.16);
  --c-accent-2: #fb923c;     --c-accent-2-bg: rgba(251, 146, 60, 0.16);
  --c-accent-3: #facc15;     --c-accent-3-bg: rgba(250, 204, 21, 0.16);
}
body[data-theme="rose"] {
  --c-success: #4ade80;      --c-success-bg: rgba(74, 222, 128, 0.14);
  --c-warn: #fbbf24;         --c-warn-bg: rgba(251, 191, 36, 0.14);
  --c-danger: #fb7185;       --c-danger-bg: rgba(251, 113, 133, 0.16);
  --c-accent-1: #f472b6;     --c-accent-1-bg: rgba(244, 114, 182, 0.16);
  --c-accent-2: #e879f9;     --c-accent-2-bg: rgba(232, 121, 249, 0.16);
  --c-accent-3: #c084fc;     --c-accent-3-bg: rgba(192, 132, 252, 0.16);
}
/* 页头内表单按钮不额外占位（2026-11-25，全球电商动态/品目信息台共用） */
.admin-page-actions > form { display: contents; }
