/* ===== 简易下单系统 v4 — 蓝白简约 UI ===== */
/* 设计参考：微信风格 / 简约蓝白
   - 淡蓝渐变背景（清爽干净）
   - 白色卡片 + 细线边框
   - 蓝色主色 + 柔和状态色
   - 小体小字 + 紧凑间距
   - 全屏无边宽 + 底部全宽 Tab
   - 抽屉式模态 + 触控友好 */

:root {
  /* —— 蓝白中性色板 —— */
  --bg-1:          #f0f5ff;   /* 渐变起点（淡蓝）*/
  --bg-2:          #e8f0fe;   /* 渐变终点 */
  --bg:            linear-gradient(180deg, #f0f5ff 0%, #e8f0fe 100%);
  --surface:       #ffffff;   /* 卡片表面 */
  --surface-grad:  linear-gradient(180deg, #ffffff 0%, #fafbfc 100%); /* 卡片微妙渐变 */
  --surface-2:     #f5f8fc;   /* 次级表面 */
  --surface-3:     #ecf1f7;   /* 三级表面 / hover */
  --elevated:      #ffffff;   /* 模态/浮层 */

  --border:        rgba(37, 99, 235, 0.08);   /* 淡蓝边框 */
  --border-2:      rgba(37, 99, 235, 0.15);   /* 较强边框 */
  --divider:       rgba(37, 99, 235, 0.08);

  --text:          #1f2937;  /* 主文本 (深灰) */
  --text-2:        #6b7280;  /* 次要文本 */
  --text-3:        #9ca3af;  /* 三级文本 */

  /* —— 强调色 (蓝色主色) —— */
  --accent:        #2563eb;
  --accent-2:      #1d4ed8;
  --accent-grad:   linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  --accent-hover:  #1d4ed8;
  --accent-soft:   #eff6ff;
  --on-accent:     #ffffff;

  /* —— 功能色 —— */
  --ok-fg:         #16a34a;  --ok-bg:   #dcfce7;
  --warn-fg:       #d97706;  --warn-bg: #fef3c7;
  --err-fg:        #dc2626;  --err-bg:  #fee2e2;
  --info-fg:       #2563eb;  --info-bg: #eff6ff;

  /* —— 圆角系统 —— */
  --r-xs: 6px;  --r-sm: 8px; --r-md: 10px;
  --r-lg: 12px; --r-xl: 16px; --r-2xl: 20px;
  --r-pill: 999px;

  /* —— 阴影 (柔和蓝色调) —— */
  --sh-sm: 0 1px 2px rgba(37, 99, 235, 0.04), 0 1px 1px rgba(37, 99, 235, 0.02);
  --sh-md: 0 3px 12px rgba(37, 99, 235, 0.06), 0 1px 2px rgba(37, 99, 235, 0.04);
  --sh-lg: 0 10px 30px rgba(37, 99, 235, 0.08), 0 3px 8px rgba(37, 99, 235, 0.05);
  --sh-xl: 0 18px 45px rgba(37, 99, 235, 0.10), 0 6px 14px rgba(37, 99, 235, 0.06);
  --sh-tab: 0 -2px 14px rgba(37, 99, 235, 0.05);
  --sh-focus: 0 0 0 3px rgba(37, 99, 235, 0.10);

  /* —— 字体 —— */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue",
          "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "SF Mono", "JetBrains Mono", "Cascadia Code", Consolas, monospace;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; touch-action: manipulation; /* v10: 禁止双击缩放 */ }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 14px; /* 小体字 */
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.005em;
}
input, textarea, select, button { font-family: inherit; font-size: 14px; }
a { color: var(--text); text-decoration: none; }
img { display: block; max-width: 100%; }

/* ===== App 容器 (全屏无边宽 — iPhone X 至 17 Pro Max) ===== */
.app {
  width: 100%;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  padding-bottom: calc(78px + env(safe-area-inset-bottom));
}

/* ===== 玻璃顶栏 ===== */
.app-head {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
  background: linear-gradient(180deg, rgba(240, 245, 255, 0.90) 0%, rgba(232, 240, 254, 0.80) 100%);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
}
.app-head h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.app-head .sub {
  margin-top: 2px;
  color: var(--text-2);
  font-size: 12px;
  letter-spacing: -0.005em;
}
.head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.head-right { display: flex; align-items: center; gap: 8px; }

/* 顶栏头像条 */
.head-user {
  display: flex;
  align-items: center;
  gap: 12px;
}
.head-user .avatar { width: 38px; height: 38px; }
.head-user .meta { flex: 1; min-width: 0; }
.head-user .meta .qq { font-weight: 600; font-size: 13px; letter-spacing: -0.01em; } /* v10: 改小 */
.head-user .meta .role { font-size: 11px; color: var(--text-2); margin-top: 1px; } /* v10: 改小 */
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-size: 12px;
  color: var(--text-2);
  font-weight: 500;
  box-shadow: var(--sh-sm);
}
.chip b { color: var(--text); font-weight: 600; }
.chip-cap { background: var(--info-bg); border-color: transparent; color: var(--info-fg); box-shadow: none; }
.chip-cap b { color: var(--info-fg); }
.chip-bal { background: var(--ok-bg); border-color: transparent; color: var(--ok-fg); box-shadow: none; }
.chip-bal b { color: var(--ok-fg); }

/* ===== 头像 ===== */
.avatar {
  width: 32px; height: 32px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  object-fit: cover;
  border: 1px solid var(--border);
  box-shadow: var(--sh-sm);
  flex-shrink: 0;
}
.avatar-lg { width: 48px; height: 48px; }
.avatar-sm { width: 32px; height: 32px; }
.avatar-wrap { position: relative; display: inline-block; }
.avatar-wrap .role-dot {
  position: absolute; right: -2px; bottom: -2px;
  width: 14px; height: 14px;
  background: var(--ok-fg);
  border: 2px solid var(--surface);
  border-radius: var(--r-pill);
  box-shadow: 0 1px 3px rgba(36, 138, 61, 0.4);
}
.avatar-wrap .role-dot.admin { background: var(--accent); box-shadow: 0 1px 3px rgba(29, 29, 31, 0.4); }

/* ===== 主内容区 (紧凑间距) ===== */
.main { padding: 8px 10px 16px; display: flex; flex-direction: column; gap: 8px; }

/* ===== 卡片 (白表面 + 细线边框 + 紧凑) ===== */
.card {
  background: var(--surface-grad);
  border-radius: var(--r-md);
  padding: 10px;
  box-shadow: var(--sh-sm);
  border: 1px solid var(--border);
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:active { transform: scale(0.995); box-shadow: var(--sh-sm); }
.card-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ===== 余额 + 容量双卡 ===== */
.dual-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.metric-card {
  background: var(--surface-grad);
  border-radius: var(--r-md);
  padding: 10px;
  box-shadow: var(--sh-sm);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  transition: transform .15s ease;
}
.metric-card:active { transform: scale(0.99); }
.metric-card.primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.18), 0 1px 3px rgba(37, 99, 235, 0.10);
}
.metric-card.primary::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, transparent 100%);
  pointer-events: none;
}
.metric-card .mlabel {
  font-size: 10px;
  color: var(--text-2);
  font-weight: 500;
  letter-spacing: 0.02em;
  position: relative;
}
.metric-card .mnum {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  position: relative;
}
.metric-card .mnum small { font-size: 10px; font-weight: 500; opacity: 0.6; margin-left: 2px; }
.metric-card .mmeta {
  font-size: 9px;
  color: var(--text-3);
  margin-top: 4px;
  position: relative;
}
.metric-card .mfoot { margin-top: 8px; position: relative; }
.metric-card .mfoot a {
  color: var(--text-2);
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.metric-card.primary .mlabel,
.metric-card.primary .mmeta { color: rgba(255,255,255,0.65); }
.metric-card.primary .mfoot a { color: rgba(255,255,255,0.88); }

/* ===== 区块标题 ===== */
.sec-title {
  display: flex; align-items: center; justify-content: space-between;
  padding: 2px 4px 0;
}
.sec-title > span {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
.sec-act { font-size: 13px; color: var(--text-2); }
.link { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }

/* ===== 商品卡 ===== */
.product-grid { display: flex; flex-direction: column; gap: 8px; }
.product-card {
  background: var(--surface-grad);
  border-radius: var(--r-md);
  padding: 12px;
  box-shadow: var(--sh-sm);
  border: 1px solid var(--border);
  transition: transform .15s ease, box-shadow .15s ease;
  position: relative;
  overflow: hidden;
}
.product-card:active { transform: scale(0.99); box-shadow: var(--sh-sm); }
.product-card .pname {
  font-size: 15px; font-weight: 600; letter-spacing: -0.01em;
  line-height: 1.3;
}
.product-card .pdesc {
  font-size: 12px; color: var(--text-2);
  margin-top: 3px; line-height: 1.45;
}
.product-card .pfoot {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-top: 10px;
  gap: 8px;
}
.product-card .pprice {
  font-size: 20px; font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.product-card .pprice small {
  font-size: 11px; font-weight: 500;
  color: var(--text-3); margin-left: 2px;
}
.product-card .pmeta { font-size: 11px; color: var(--text-2); margin-top: 3px; }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 3px;
  min-height: 34px;
  padding: 5px 10px;
  border: 1px solid var(--border-2);
  background: var(--surface-grad);
  color: var(--text);
  border-radius: var(--r-sm);
  font-size: 13px; font-weight: 500;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: background .15s, transform .1s, border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
.btn:active { transform: scale(0.98); }
.btn:hover { background: var(--surface-3); }
.btn-primary {
  background: var(--accent-grad);
  border-color: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.15), inset 0 1px 0 rgba(255,255,255,0.10);
}
.btn-primary:hover { background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%); border-color: var(--accent-hover); }
.btn-block { width: 100%; }
.btn-sm { min-height: 26px; padding: 0 8px; font-size: 12px; border-radius: var(--r-xs); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); box-shadow: none; }
.btn-ghost:hover { background: var(--surface-3); }

/* ===== 输入 ===== */
.field { margin-bottom: 12px; }
.field:last-child { margin-bottom: 0; }
.field > label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 5px;
  letter-spacing: -0.005em;
}
.field input, .field textarea, .field select {
  width: 100%;
  padding: 9px 12px;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  color: var(--text);
  font-size: 16px; /* v9: 必须 ≥16px，否则 iOS Safari 会自动缩放页面 */
  transition: border-color .15s, background .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
/* v9: 修复 checkbox/radio 被 -webkit-appearance:none 隐藏导致「点不了」的 bug */
.field input[type="checkbox"],
.field input[type="radio"] {
  -webkit-appearance: auto;
  appearance: auto;
  width: auto !important;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  cursor: pointer;
  margin: 0;
}
.field input[type="checkbox"]:focus,
.field input[type="radio"]:focus {
  outline: auto;
  box-shadow: none;
  background: transparent;
  border-color: transparent;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--border-2);
  box-shadow: var(--sh-focus);
}
.field textarea { resize: vertical; min-height: 64px; font-family: var(--mono); font-size: 13px; }
.field .hint {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 7px;
  line-height: 1.45;
}
.field .key-box {
  background: var(--surface-3);
  border-radius: var(--r-md);
  padding: 11px 13px;
  font-family: var(--mono);
  font-size: 13px;
  word-break: break-all;
  color: var(--text);
  border: 1px solid var(--border);
}

/* ===== 表格 → 卡片列表 ===== */
.tbl { display: flex; flex-direction: column; }
.tbl-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--divider);
}
.tbl-row:first-child { padding-top: 0; }
.tbl-row:last-child { padding-bottom: 0; border-bottom: 0; }
.r-top {
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px; margin-bottom: 5px;
}
.r-top b { font-weight: 600; letter-spacing: -0.01em; }
.r-meta {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.6;
}
.r-qq {
  display: inline-block;
  background: var(--surface-3);
  padding: 2px 7px;
  border-radius: var(--r-xs);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text);
}

/* ===== 间距工具 ===== */
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-12 { margin-bottom: 12px; }
.muted { color: var(--text-2); }
.center { text-align: center; }
.grow { flex: 1; }
.empty {
  text-align: center;
  color: var(--text-3);
  font-size: 14px;
  padding: 28px 12px;
  line-height: 1.6;
}
.empty a { color: var(--text-2); text-decoration: underline; }

/* ===== 行布局 ===== */
.row { display: flex; gap: 8px; align-items: center; }
.row > * { flex-shrink: 0; }

/* ===== 状态标签 (柔和色，低饱和度背景) ===== */
.tag {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.tag-success { background: var(--ok-bg);   color: var(--ok-fg); }
.tag-pending { background: var(--warn-bg); color: var(--warn-fg); }
.tag-failed  { background: var(--err-bg);  color: var(--err-fg); }
.tag-rejected{ background: var(--err-bg);  color: var(--err-fg); }
.tag-approved{ background: var(--ok-bg);   color: var(--ok-fg); }
.tag-info    { background: var(--info-bg); color: var(--info-fg); }

/* ===== 大数字 ===== */
.big-num {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.num { font-variant-numeric: tabular-nums; }

/* ===== API 文档代码块 ===== */
.api-doc {
  background: var(--surface-3);
  border-radius: var(--r-md);
  padding: 12px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--text);
  border: 1px solid var(--border);
}

/* ===== 分隔线 ===== */
.divider {
  height: 1px;
  background: var(--divider);
  margin: 14px 0;
  border: 0;
}

/* ===== 代理系统新增样式 ===== */
/* 代理顶部横幅（渐变背景） */
.agent-banner {
  background: linear-gradient(135deg, #2c2c2e 0%, #1d1d1f 60%, #3a3a3d 100%);
  color: #fff;
  border-radius: var(--r-xl);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(29, 29, 31, 0.22), 0 2px 6px rgba(29, 29, 31, 0.10);
  border: 1px solid rgba(0,0,0,0.04);
}
.agent-banner::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at top right, rgba(255,255,255,0.08), transparent 60%);
  pointer-events: none;
}
.agent-banner > * { position: relative; }

/* 代理标识小徽章 */
.agent-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.02em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* 价格展示行（成本价/售价并排） */
.price-row {
  display: flex; gap: 12px; align-items: stretch;
  margin-top: 12px;
}
.price-row > div {
  flex: 1;
  background: var(--surface-2);
  border-radius: var(--r-md);
  padding: 10px 12px;
  border: 1px solid var(--border);
}
.price-row .pl-label {
  font-size: 11px;
  color: var(--text-2);
  font-weight: 500;
  margin-bottom: 4px;
}
.price-row .pl-val {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.price-row .pl-val.cost { color: var(--text-2); }
.price-row .pl-val.sell { color: var(--text); }

/* ===== v9: 代理店铺顶部 Tab 切换 ===== */
.shop-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface-2, #f5f5f7);
  border-radius: var(--r-pill, 999px);
  margin: 0 0 14px;
  border: 1px solid var(--border, #e8e8ed);
  z-index: 15;
}
.shop-tab {
  flex: 1;
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: transparent;
  color: var(--text-2, #6e6e73);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 9px 10px;
  border-radius: var(--r-pill, 999px);
  cursor: pointer;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
  white-space: nowrap;
}
.shop-tab:active { transform: scale(0.97); }
.shop-tab.active {
  background: #fff;
  color: var(--text, #1d1d1f);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
}
.tab-panel { display: none; animation: fadeIn .18s ease; }
.tab-panel.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* 代理店铺顶部信息卡（替代旧的黑色大卡片） */
.shop-info-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
}
.shop-info-card .si-avatar {
  width: 52px; height: 52px;
  border-radius: var(--r-pill, 999px);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface-2, #f5f5f7);
}
.shop-info-card .si-main {
  flex: 1;
  min-width: 0;
}
.shop-info-card .si-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text, #1d1d1f);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shop-info-card .si-sub {
  font-size: 12px;
  color: var(--text-2, #6e6e73);
  margin-top: 3px;
}
.shop-info-card .si-stat {
  text-align: right;
  flex-shrink: 0;
}
.shop-info-card .si-stat .si-num {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  color: var(--text, #1d1d1f);
}
.shop-info-card .si-stat .si-num small {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2, #6e6e73);
  margin-left: 2px;
}
.shop-info-card .si-stat .si-label {
  font-size: 11px;
  color: var(--text-3, #a1a1a6);
  margin-top: 3px;
  letter-spacing: 0.02em;
}

/* 支付方式按钮选中态 */
.pay-type-btn { opacity: 0.55; transition: opacity .15s ease, background .15s ease; }
.pay-type-btn.active { opacity: 1; background: var(--text, #1d1d1f); color: #fff; border-color: transparent; }

/* v9: 小屏适配 — shop-info-card 在 ≤360px 时垂直布局，避免名称截断 */
@media (max-width: 360px) {
  .shop-info-card { flex-direction: column; align-items: flex-start; gap: 10px; }
  .shop-info-card .si-avatar { width: 44px; height: 44px; }
  .shop-info-card .si-name { font-size: 15px; }
  .shop-info-card .si-sub { font-size: 11px; }
  .shop-info-card .si-stat { text-align: left; width: 100%; display: flex; align-items: baseline; justify-content: space-between; }
  .shop-info-card .si-stat .si-num { font-size: 20px; }
}
/* v9: 极小屏 (iPhone SE 等) — Tab 字号缩小、卡片内边距收紧 */
@media (max-width: 340px) {
  .shop-tab { font-size: 13px; padding: 8px 6px; }
  .shop-tabs { padding: 3px; }
  .card { padding: 14px 14px; }
  .app-head { padding: calc(12px + env(safe-area-inset-top)) 14px 12px; }
  .main { padding: 14px 14px 0; }
  .btn { padding: 11px 14px; font-size: 15px; }
  .btn-sm { padding: 8px 12px; font-size: 13px; }
}
/* v9: 桌面端 (≥768px) — 保持全屏宽度（遵循设计原则），仅给登录页卡片样式优化 */
@media (min-width: 768px) {
  .auth-card { max-width: 420px; margin: 0 auto; background: var(--surface); border-radius: var(--r-2xl); padding: 32px 28px; box-shadow: var(--sh-lg); border: 1px solid var(--border); }
}

/* 利润展示卡（突出显示） */
.profit-card {
  background: linear-gradient(135deg, #e8f6ec 0%, #d8efdf 100%);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  margin-top: 12px;
  border: 1px solid rgba(36, 138, 61, 0.15);
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
}
.profit-card .pl-label {
  font-size: 12px;
  color: var(--ok-fg);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.profit-card .pl-val {
  font-size: 22px;
  font-weight: 700;
  color: var(--ok-fg);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

/* 分享链接展示框 */
.share-box {
  background: var(--surface-3);
  border-radius: var(--r-md);
  padding: 12px 14px;
  border: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
  margin-top: 10px;
}
.share-box .share-url {
  flex: 1; min-width: 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  word-break: break-all;
  line-height: 1.5;
}
.share-box .btn-sm { flex-shrink: 0; }

/* ===== 底部全宽 Tab 栏（贴底全宽，非浮动药丸） ===== */
.tabbar {
  position: fixed;
  left: 0; right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88) 0%, rgba(255, 255, 255, 0.98) 100%);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-top: 1px solid var(--border);
  box-shadow: var(--sh-tab);
  padding: 4px calc(4px + env(safe-area-inset-left)) calc(4px + env(safe-area-inset-bottom)) calc(4px + env(safe-area-inset-right));
  gap: 2px;
}
.tabbar a {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: 5px 3px calc(2px + env(safe-area-inset-bottom));
  border-radius: var(--r-sm);
  color: var(--text-3);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color .15s, transform .1s;
  text-decoration: none;
  min-height: 44px;
}
.tabbar a:active { transform: scale(0.96); }
.tabbar a .ti {
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; line-height: 1;
  border-radius: var(--r-xs);
  transition: background .15s, transform .15s;
}
.tabbar a.active { color: var(--accent); font-weight: 600; }
.tabbar a.active .ti { transform: translateY(-1px); }

/* ===== 底部抽屉式模态（全宽，底部抽屉） ===== */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 100;
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn .18s ease;
}
.modal {
  background: var(--elevated);
  width: 100%;
  max-width: 520px;
  border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  padding: 8px 20px calc(20px + env(safe-area-inset-bottom));
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp .3s cubic-bezier(.2, .8, .2, 1);
  box-shadow: var(--sh-xl);
  -webkit-overflow-scrolling: touch;
}
.modal-grip {
  width: 36px; height: 5px;
  background: var(--border-2);
  border-radius: var(--r-pill);
  margin: 6px auto 14px;
}
.modal h3 {
  margin: 0 0 16px;
  font-size: 19px; font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
}
.modal-head .close-x {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-3);
  border-radius: var(--r-pill);
  color: var(--text-2);
  font-size: 20px; line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s, color .15s, transform .1s;
}
.modal-head .close-x:hover { background: var(--border); color: var(--text); }
.modal-head .close-x:active { transform: scale(0.92); }
.modal-body { padding: 2px 0; }
.modal-foot {
  display: flex; gap: 10px;
  margin-top: 18px;
  position: sticky; bottom: 0;
  background: var(--elevated);
  padding-top: 10px;
  padding-bottom: 4px;
}
.modal-foot .btn { flex: 1; }

@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes slideUp { from { transform: translateY(100%) } to { transform: translateY(0) } }

/* ===== Toast (顶部居中 药丸) ===== */
.toast-wrap {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top));
  left: 0; right: 0;
  z-index: 200;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--accent-grad);
  color: var(--on-accent);
  padding: 11px 20px;
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  box-shadow: var(--sh-lg);
  animation: toastIn .25s ease;
  max-width: calc(100% - 32px);
  text-align: center;
  pointer-events: auto;
}
.toast.err { background: linear-gradient(180deg, #d10d1e 0%, #c00b1c 100%); }
.toast.ok  { background: linear-gradient(180deg, #2a9c46 0%, #248a3d 100%); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== 登录页 (全屏沉浸式无边框) ===== */
.auth-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background: var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 100%;
  background: transparent;
  border-radius: 0;
  padding: 24px 20px;
  box-shadow: none;
  border: 0;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 6px;
  font-size: 26px; font-weight: 700;
  letter-spacing: -0.025em;
}
.brand-dot {
  width: 16px; height: 16px;
  background: var(--accent-grad);
  border-radius: 5px;
  box-shadow: 0 2px 6px rgba(29, 29, 31, 0.3);
}
.auth-sub {
  color: var(--text-2);
  font-size: 13px;
  margin-bottom: 24px;
  line-height: 1.5;
}
.auth-tabs {
  display: flex;
  background: var(--surface-3);
  border-radius: var(--r-pill);
  padding: 3px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}
.auth-tabs button {
  flex: 1;
  background: transparent;
  border: 0;
  padding: 9px 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.auth-tabs button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--sh-sm);
  font-weight: 600;
}
.auth-foot {
  margin-top: 20px;
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.6;
}

/* ===== v10: 登录页 — 记住密码 / 自动登录 / 密码可见性（从 bmm.jujukai.cn 移植）===== */
.pwd-field { position: relative; }
.pwd-field input { padding-right: 44px; }
.pwd-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: 0;
  border-radius: var(--r-sm);
  color: var(--text-3);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color .15s, background .15s, transform .1s;
}
.pwd-toggle:hover { color: var(--text-2); background: var(--surface-3); }
.pwd-toggle:active { transform: translateY(-50%) scale(0.9); }
.pwd-toggle svg { display: block; pointer-events: none; }

.auth-options {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 4px 0 14px;
  flex-wrap: wrap;
}
.auth-options .opt-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
  letter-spacing: -0.005em;
  transition: color .15s;
}
.auth-options .opt-check:hover { color: var(--text); }
.auth-options .opt-check input {
  width: 16px; height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  margin: 0;
}

/* 机型适配微调：小屏收紧间距 */
@media (max-width: 360px) {
  .auth-options { gap: 12px; }
  .auth-options .opt-check { font-size: 12px; }
  .pwd-field input { padding-right: 40px; }
}
@media (max-width: 340px) {
  .auth-options { gap: 10px; }
}

.kbd {
  display: inline-block;
  background: var(--surface-3);
  padding: 2px 7px;
  border-radius: var(--r-xs);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text);
  border: 1px solid var(--border);
}

/* ===== 概览统计网格 ===== */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
.stat-cell {
  background: var(--surface-2);
  border-radius: var(--r-md);
  padding: 12px 8px;
  text-align: center;
  border: 1px solid var(--border);
}
.stat-cell .slabel {
  font-size: 11px;
  color: var(--text-2);
  margin-bottom: 4px;
  letter-spacing: 0.01em;
}
.stat-cell .sval {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

/* ===== 文档页 ===== */
.doc-section {
  background: var(--surface-grad);
  border-radius: var(--r-xl);
  padding: 18px;
  box-shadow: var(--sh-md);
  border: 1px solid var(--border);
}
.doc-section h2 {
  margin: 0 0 12px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.doc-section h3 {
  margin: 16px 0 7px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
.doc-section p {
  margin: 7px 0;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.65;
}
.doc-section ul { margin: 7px 0; padding-left: 18px; color: var(--text-2); font-size: 13px; line-height: 1.75; }
.doc-section code {
  background: var(--surface-3);
  padding: 2px 7px;
  border-radius: var(--r-xs);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  border: 1px solid var(--border);
}
.doc-section .endpoint {
  display: inline-block;
  background: var(--accent-grad);
  color: var(--on-accent);
  padding: 3px 9px;
  border-radius: var(--r-xs);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  margin-right: 6px;
  box-shadow: 0 1px 3px rgba(29, 29, 31, 0.15);
}
.doc-section .ex {
  background: var(--surface-3);
  border-radius: var(--r-md);
  padding: 11px 13px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--text);
  margin: 7px 0;
  border: 1px solid var(--border);
}

/* 小屏微调 */
@media (max-width: 360px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .dual-cards { grid-template-columns: 1fr; }
  .app-head h1 { font-size: 22px; }
  .metric-card .mnum { font-size: 24px; }
  .product-card .pprice { font-size: 22px; }
}

/* 减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== v5: 用户搜索 / 按商品定价 / 商品选择 ===== */
.search-row { display:flex; gap:8px; align-items:stretch; }
.search-row input { flex:1; min-width:0; }
.search-results { margin-top:8px; }
.search-result-item { display:flex; align-items:center; gap:10px; padding:10px 12px; border:1px solid var(--border); border-radius:var(--r-md); margin-bottom:6px; cursor:pointer; background:var(--surface); }
.search-result-item:active { background:var(--bg-2); }
.search-result-item.selected { border-color:var(--accent); background:rgba(29,29,31,0.04); }
.price-input-row { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:10px 0; border-bottom:1px solid var(--border); }
.price-input-row:last-child { border-bottom:none; }
.price-input-row .pir-label { flex:1; min-width:0; }
.price-input-row .pir-label b { display:block; font-size:14px; }
.price-input-row .pir-label small { color:var(--text-2); font-size:12px; }
.price-input-row input { width:120px; text-align:right; flex-shrink:0; }
.prod-radio { display:flex; align-items:center; gap:10px; padding:12px; border:1px solid var(--border); border-radius:var(--r-md); margin-bottom:8px; cursor:pointer; background:var(--surface); transition:background .15s,border-color .15s; }
.prod-radio:active { background:var(--bg-2); }
.prod-radio input[type=radio] { flex-shrink:0; width:18px; height:18px; accent-color:var(--accent); }
.prod-radio .prod-info { flex:1; min-width:0; }

/* ===== v6: 游客下单落地页 ===== */
/* 顶部总库存展示区（渐变背景，大字号） */
.guest-hero {
  background: linear-gradient(135deg, #2c2c2e 0%, #1d1d1f 60%, #3a3a3d 100%);
  color: #fff;
  border-radius: var(--r-xl);
  padding: 26px 22px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(29, 29, 31, 0.22), 0 2px 6px rgba(29, 29, 31, 0.10);
  border: 1px solid rgba(0,0,0,0.04);
}
.guest-hero::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at top right, rgba(255,255,255,0.10), transparent 60%);
  pointer-events: none;
}
.guest-hero > * { position: relative; }
.guest-hero .hero-label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.62);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.guest-hero .hero-num {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
}
.guest-hero .hero-num small {
  font-size: 14px;
  font-weight: 500;
  opacity: 0.6;
  margin-left: 4px;
  letter-spacing: -0.005em;
}
.guest-hero .hero-sub {
  font-size: 13px;
  color: rgba(255,255,255,0.66);
  margin-top: 8px;
  line-height: 1.5;
}
/* v8: 首页下单已关闭 — 离线提示样式 */
.guest-hero-offline {
  background: linear-gradient(135deg, #6e6e73 0%, #48484a 100%);
}
.guest-hero-offline .hero-label {
  color: rgba(255,255,255,0.85);
}
.guest-hero-offline .hero-sub {
  color: rgba(255,255,255,0.75);
  font-size: 14px;
}
/* v8: 代理下单引导卡片 */
.agent-only-card {
  padding: 18px 18px 6px;
}
.agent-only-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--divider, #e8e8ed);
}
.agent-only-step:last-child {
  border-bottom: none;
}
.agent-only-step .aos-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--text, #1d1d1f);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.agent-only-step .aos-text {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  color: var(--text, #1d1d1f);
  line-height: 1.55;
  padding-top: 3px;
}
.agent-only-step .aos-text small {
  font-size: 12px;
  color: var(--text-2, #6e6e73);
  word-break: break-all;
}
.agent-only-step .aos-text b {
  font-weight: 600;
}

/* 游客商品网格 */
.guest-product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 560px) {
  .guest-product-grid { grid-template-columns: 1fr 1fr; }
}

/* 游客商品卡 */
.guest-product-card {
  background: var(--surface-grad);
  border-radius: var(--r-lg);
  padding: 14px;
  box-shadow: var(--sh-md);
  border: 1px solid var(--border);
  transition: transform .18s ease, box-shadow .18s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.guest-product-card:active { transform: scale(0.99); box-shadow: var(--sh-sm); }
.guest-product-card .gp-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 8px;
}
.guest-product-card .gp-name {
  font-size: 15px; font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
}
.guest-product-card .gp-desc {
  font-size: 12px; color: var(--text-2);
  line-height: 1.5;
}
.guest-product-card .gp-value-chip {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 8px;
  background: var(--accent-soft);
  border-radius: var(--r-pill);
  font-size: 10px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
  flex-shrink: 0;
}
.guest-product-card .gp-foot {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-top: auto;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--divider);
}
.guest-product-card .gp-price {
  font-size: 22px; font-weight: 700;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.guest-product-card .gp-price small {
  font-size: 11px; font-weight: 500;
  color: var(--text-3); margin-left: 2px;
}
.guest-product-card .gp-stock {
  font-size: 11px; color: var(--text-2);
  margin-top: 4px;
  display: inline-flex; align-items: center; gap: 4px;
}
.guest-product-card .gp-stock .stock-dot {
  width: 5px; height: 5px;
  background: var(--ok-fg);
  border-radius: var(--r-pill);
  display: inline-block;
}
.guest-product-card .gp-stock.low { color: var(--warn-fg); }
.guest-product-card .gp-stock.low .stock-dot { background: var(--warn-fg); }
.guest-product-card .gp-stock.none { color: var(--err-fg); }
.guest-product-card .gp-stock.none .stock-dot { background: var(--err-fg); }

/* ===== v15: 套餐卡片（简洁版） ===== */
.package-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.pkg-card {
  background: var(--surface-grad);
  border-radius: var(--r-lg);
  padding: 14px 10px 10px;
  box-shadow: var(--sh-sm);
  border: 2px solid var(--border);
  transition: all .18s ease;
  cursor: pointer;
  text-align: center;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 90px;
  justify-content: center;
}
.pkg-card:active { transform: scale(0.98); }
.pkg-card.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(29,29,31,0.06), var(--sh-sm);
}
.pkg-card.active::after {
  content: '✓';
  position: absolute;
  top: 6px; right: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}
.pkg-card.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}
.pkg-likes {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.pkg-likes small {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-2);
  margin-left: 1px;
}
.pkg-price {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
/* v18: 首单价标签（卡片内嵌在 .pkg-price 后） */
.pkg-first-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: #ff9500;
  border-radius: var(--r-pill);
  vertical-align: 2px;
  letter-spacing: 0;
}
.pkg-stock {
  font-size: 10px;
  color: var(--text-3);
  margin-top: 2px;
}

/* CAPTCHA 输入区 */
.captcha-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px;
}
.captcha-question {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
  padding: 14px 8px;
  background: var(--surface);
  border-radius: var(--r-md);
  margin-top: 8px;
  border: 1px dashed var(--border-2);
  font-variant-numeric: tabular-nums;
}

/* 订单确认摘要 */
.order-summary {
  background: var(--surface-2);
  border-radius: var(--r-md);
  padding: 14px 16px;
  border: 1px solid var(--border);
}
.order-summary .os-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--divider);
}
.order-summary .os-row:last-child { border-bottom: 0; }
.order-summary .os-label {
  font-size: 13px;
  color: var(--text-2);
}
.order-summary .os-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.order-summary .os-value.big {
  font-size: 18px;
  color: var(--accent);
}
.order-summary .os-value.mono {
  font-family: var(--mono);
  font-size: 12px;
}

/* 游客页右上角登录入口 */
.guest-login-link {
  position: absolute;
  top: calc(14px + env(safe-area-inset-top));
  right: 16px;
  z-index: 25;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 13px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  box-shadow: var(--sh-sm);
  transition: color .15s, transform .1s;
}
.guest-login-link:active { transform: scale(0.96); }
.guest-login-link:hover { color: var(--text); }

/* 游客页头部简化版（无头像） */
.guest-head {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: calc(14px + env(safe-area-inset-top)) 18px 14px;
  background: linear-gradient(180deg, rgba(247, 247, 248, 0.88) 0%, rgba(237, 237, 240, 0.78) 100%);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}
.guest-head h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
}
.guest-head .sub {
  margin-top: 3px;
  color: var(--text-2);
  font-size: 12px;
  letter-spacing: -0.005em;
}

/* ===== 数据报表面板 (dash-*) ===== */
/* 综合指标 4 列网格 (移动端 2 列) */
.dash-metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 10px;
}
@media (max-width: 600px) {
  .dash-metric-grid { grid-template-columns: 1fr 1fr; }
}
.dash-metric-cell {
  background: var(--surface-2);
  border-radius: var(--r-md);
  padding: 12px 12px;
  border: 1px solid var(--border);
}
.dash-metric-cell .dmc-label {
  font-size: 11px;
  color: var(--text-2);
  font-weight: 500;
  letter-spacing: 0.01em;
  margin-bottom: 6px;
}
.dash-metric-cell .dmc-val {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  line-height: 1.15;
}
.dash-metric-cell .dmc-sub {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 6px;
  line-height: 1.4;
}

/* 趋势图头部 (标题 + 7/30 切换按钮) */
.dash-trend-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.dash-trend-switch {
  display: inline-flex;
  background: var(--surface-3);
  border-radius: var(--r-pill);
  padding: 3px;
  border: 1px solid var(--border);
  gap: 2px;
}
.dash-trend-btn {
  min-height: 30px;
  padding: 4px 14px;
  font-size: 12px;
  border: 0;
  background: transparent;
  color: var(--text-2);
  box-shadow: none;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.dash-trend-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--sh-sm);
  font-weight: 600;
}

/* 图例 */
.dash-trend-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.dash-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-2);
}
.dash-legend-dot {
  width: 10px; height: 10px;
  border-radius: var(--r-pill);
  display: inline-block;
}
.dash-legend-dot.dot-blue { background: #2c5fa6; }
.dash-legend-dot.dot-green { background: #248a3d; }

/* SVG 折线图容器 */
.dash-trend-wrap {
  width: 100%;
  height: 200px;
  background: var(--surface-2);
  border-radius: var(--r-md);
  padding: 4px;
  border: 1px solid var(--border);
  overflow: hidden;
}
.dash-trend-svg {
  width: 100%;
  height: 100%;
  display: block;
}
.dash-trend-empty {
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
  padding: 30px 12px;
}

/* 横向条形图列表 (商品销售 / 代理利润) */
.dash-bar-list { display: flex; flex-direction: column; }
.dash-bar-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--divider);
}
.dash-bar-row:last-child { border-bottom: 0; padding-bottom: 0; }
.dash-bar-row:first-child { padding-top: 0; }
.dbr-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.dbr-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dbr-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: var(--surface-3);
  color: var(--text-2);
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.dbr-nums {
  font-size: 11px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}
.dbr-bar {
  height: 8px;
  background: var(--surface-3);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.dbr-fill {
  height: 100%;
  border-radius: var(--r-pill);
  transition: width .3s ease;
}
.dbr-fill.fill-blue { background: linear-gradient(90deg, #2c5fa6 0%, #4a7fc8 100%); }
.dbr-fill.fill-green { background: linear-gradient(90deg, #248a3d 0%, #4aa85d 100%); }

/* 最近订单详情展开区 */
.dash-recent-row { transition: background .15s; }
.dash-recent-row:active { background: var(--surface-2); }
.dash-detail-box {
  background: var(--surface-2);
  border-radius: var(--r-md);
  padding: 12px 14px;
  border: 1px solid var(--border);
}
.dash-detail-box .ddi-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px dashed var(--divider);
  font-size: 13px;
}
.dash-detail-box .ddi-row:last-child { border-bottom: 0; }
.dash-detail-box .ddi-label {
  color: var(--text-2);
  font-size: 12px;
}

/* ===== 订单查询面板 (oq-*) ===== */
/* 筛选表单网格 */
.oq-filter-wrap {
  border-bottom: 1px solid var(--divider);
  padding-bottom: 14px;
  margin-bottom: 6px;
}
.oq-filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
}
@media (max-width: 480px) {
  .oq-filter-grid { grid-template-columns: 1fr; }
}
.oq-filter-grid .field { margin-bottom: 10px; }

/* 订单列表 */
.oq-list .tbl-row { padding: 12px 0; }
.oq-list .oq-row { transition: background .15s; }

/* 分页 */
.oq-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--divider);
}
.oq-pagination .btn-sm:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}
.oq-page-info {
  font-size: 13px;
  color: var(--text-2);
  text-align: center;
  flex: 1;
  font-variant-numeric: tabular-nums;
}
.oq-page-info b { color: var(--text); font-weight: 600; }

