* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* 2026-11-22 UI 改版：ONES 式干净企业风 + 年轻化（大圆角/轻阴影/单一品牌蓝）。
     旧版毛玻璃 + 蓝绿渐变显土的根源已全部移除；
     变量名保持不变（--glass-* 仍被引用，语义改为「卡片表面」）。 */
  --primary: #2f6bf6;
  --primary-dark: #1d54e0;
  --primary-light: #ecf3ff;
  --success: #12a150;
  --warning: #f59e0b;
  --danger: #e5484d;
  --info: #7c5cfc;
  --secondary: #697084;

  /* 页面底色：统一浅冷灰（旧 --bg-grad-* 光晕渐变废弃，值拉平保持引用不破） */
  --bg-grad-1: #eef1f7;
  --bg-grad-2: #eef1f7;
  --bg-grad-3: #eef1f7;

  --bg: #eef1f7;
  --bg-secondary: #f4f6fa;

  --text: #171a2b;
  --text-secondary: #697084;
  --border: #e6eaf2;
  --radius: 14px;
  --radius-sm: 10px;

  /* 卡片表面：纯白 + 发丝线 + 轻阴影（旧毛玻璃变量名保留，别再改名） */
  --glass-bg: #ffffff;
  --glass-border: #e6eaf2;
  --glass-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 6px 20px -12px rgba(16, 24, 40, 0.08);

  /* 字体：系统黑体栈（不引 webfont，加载速度优先） */
  --font-sans: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-display: 'Noto Sans SC', 'PingFang SC', sans-serif;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
}

.container-wide {
  max-width: 100%;
  width: 100%;
  padding: 16px;
}

/* Admin layout: full width with minimal padding */
.admin-layout {
  max-width: 100%;
  width: 100%;
  padding: 12px 16px;
}
.admin-layout .table-wrap {
  overflow-x: auto;
}

/* Header（报单端）：纯色品牌蓝 + 底部大圆角，干净 app 感 */
.header {
  background: var(--primary);
  color: #fff;
  padding: 26px 16px 24px;
  text-align: center;
  border-radius: 0 0 20px 20px;
  position: relative;
}
.header h1 {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.6px;
}
.header p { font-size: 13px; opacity: 0.85; margin-top: 4px; }

/* ============ 管理后台顶栏 + 左侧导航（2026-11-22 改版，ONES 式）============
   顶栏只留 ☰ / 身份 / 标题；功能全部进左侧导航（桌面常驻，手机抽屉）。 */
.topbar {
  background: #fff;
  color: var(--text);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 500;
}
.topbar-title {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.5px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}
/* 当前登录人：多人共用一台设备时一眼看出是谁登着 */
.topbar-user {
  flex: 0 0 auto;
  font-size: 12px;
  background: var(--bg-secondary);
  color: #4a5268;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
  font-weight: 500;
}
/* ☰ 抽屉开关：桌面隐藏，手机显示 */
.sn-toggle {
  display: none;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  font-size: 17px;
  cursor: pointer;
  line-height: 1;
  align-items: center;
  justify-content: center;
}

/* ---- 左侧导航 ---- */
.admin-body { display: flex; align-items: flex-start; min-height: calc(100vh - 58px); }
.sidenav {
  flex: 0 0 208px;
  position: sticky;
  top: 58px;
  height: calc(100vh - 58px);
  overflow-y: auto;
  background: #fff;
  border-right: 1px solid var(--border);
  padding: 0 10px 14px;
  z-index: 400;
}
.sn-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 6px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.sn-logo {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 1px;
}
.sn-brand-txt { min-width: 0; }
.sn-brand-txt b { display: block; font-size: 14.5px; line-height: 1.25; }
.sn-brand-txt span { display: block; font-size: 11px; color: var(--text-secondary); }
.sn-group {
  font-size: 11px;
  font-weight: 600;
  color: #98a0b3;
  letter-spacing: 0.08em;
  padding: 14px 8px 6px;
}
/* 导航项（.tab-item 复用：switchTab 靠它切换 active，别改名） */
.sidenav .tab-item,
.sidenav .sn-item {
  display: block;
  padding: 9px 10px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 500;
  color: #4a5268;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.15s, color 0.15s;
  margin-bottom: 2px;
  border: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.sidenav .tab-item:hover,
.sidenav .sn-item:hover { background: var(--primary-light); color: var(--primary); }
.sidenav .tab-item.active {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  border-bottom: none;
  margin-bottom: 2px;
}
.sidenav .tab-item .tab-badge {
  display: inline-block;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  margin-left: 6px;
  vertical-align: middle;
}
.sn-bottom {
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.sn-logout { color: #d92d23 !important; }
.sn-logout:hover { background: #fdecec !important; color: #d92d23 !important; }
.admin-main { flex: 1 1 auto; min-width: 0; }
/* 手机端抽屉 */
.sn-mask { display: none; }
@media (max-width: 768px) {
  .sn-toggle { display: inline-flex; }
  .topbar-title { font-size: 15.5px; }
  .admin-body { display: block; }
  .sidenav {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    height: 100vh;
    width: 232px;
    flex: none;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    z-index: 1200;
    box-shadow: 0 10px 40px -10px rgba(16, 24, 40, 0.3);
  }
  .sidenav.open { transform: none; }
  .sn-mask {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 1100;
  }
  .sn-mask.show { display: block; }
  .sidenav .tab-item,
  .sidenav .sn-item { padding: 11px 12px; font-size: 14px; }
}

/* Card —— 纯白表面 + 发丝线 + 轻阴影 */
.card {
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}
.card-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

/* Form */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-group label .required { color: var(--danger); margin-left: 2px; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  color: var(--text);
  background: #fff;
  transition: border-color 0.18s, box-shadow 0.18s;
  font-family: inherit;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 107, 246, 0.14);
}
.form-group textarea { resize: vertical; min-height: 70px; }
.form-group .hint {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

/* Buttons —— 扁平单色，圆角胶囊感 */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: background 0.16s ease, box-shadow 0.16s ease;
  text-align: center;
  text-decoration: none;
  font-family: inherit;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  width: 100%;
  box-shadow: 0 2px 8px -2px rgba(47, 107, 246, 0.5);
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:active { box-shadow: none; }
.btn-primary:disabled {
  background: #c6cdd9;
  box-shadow: none;
  cursor: not-allowed;
}
.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
  border-radius: 9px;
}
.btn-outline {
  background: #fff;
  color: var(--primary);
  border: 1px solid #c4d4f8;
  transition: all 0.18s ease;
}
.btn-outline:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #0e8a43; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #d98a0b; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #cf3539; }

/* Badge —— 三级降噪（2026-11-22 第二轮）：
   过程状态一律中性蓝灰（页面安静），彩色只留给「结果/异常/行动项」：
   红=异常/未回款，绿=已回款/已核实，琥珀=待扫码（当前工作队列） */
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.7;
  white-space: nowrap;
}
.badge-pending { background: #eef2f8; color: #4a5268; }
.badge-verified { background: #e8f7ee; color: #1e7f43; }
.badge-received { background: #eef2f8; color: #4a5268; }
.badge-scanned { background: #eef2f8; color: #4a5268; }
.badge-pending-scan { background: #fff4e0; color: #b25e00; }
.badge-paid { background: #e8f7ee; color: #1e7f43; }
.badge-unpaid { background: #fdecec; color: #c62a2e; }
.badge-issue { background: #fff4e0; color: #b25e00; }

/* Success page */
.success-page { text-align: center; padding: 40px 20px; }
.success-icon {
  width: 64px;
  height: 64px;
  background: #e8f7ee;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.success-icon svg { fill: var(--success); width: 32px; height: 32px; }
.order-no {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
}

/* Stats cards —— 白卡 + 左侧状态色条 + 彩色数字 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius);
  padding: 18px;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--primary);
  opacity: 0.9;
}
.stat-card:hover { box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 10px 28px -14px rgba(16,24,40,.14); }
.stat-card .stat-num {
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
}
.stat-card .stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 8px;
  font-weight: 500;
}
/* 左侧色条按状态着色 */
.stat-card.today { border-left: 4px solid var(--primary); }
.stat-card.today .stat-num { color: var(--primary); }
.stat-card.pending-review { border-left: 4px solid var(--warning); }
.stat-card.pending-review .stat-num { color: var(--warning); }
.stat-card.pending-payment { border-left: 4px solid var(--danger); }
.stat-card.pending-payment .stat-num { color: var(--danger); }
.stat-card.completed { border-left: 4px solid var(--success); }
.stat-card.completed .stat-num { color: var(--success); }
.stat-card.scanned { border-left: 4px solid var(--info); }
.stat-card.scanned .stat-num { color: var(--info); }
.stat-card.received { border-left: 4px solid var(--warning); }
.stat-card.received .stat-num { color: var(--warning); }
.stat-card.all { border-left: 4px solid var(--primary); }
.stat-card.all .stat-num { color: var(--primary); }
.stat-card.pending-scan { border-left: 4px solid var(--danger); }
.stat-card.pending-scan .stat-num { color: var(--danger); }

/* Filters */
.filters-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}
.filter-tab {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  background: #fff;
  transition: all 0.18s ease;
  font-weight: 500;
  color: #4a5268;
}
.filter-tab:hover { border-color: #b9cdf7; color: var(--primary); }
.filter-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: transparent;
}
.filter-tab.active .tab-count {
  background: rgba(255, 255, 255, 0.28);
  color: #fff;
}
.tab-count {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border-radius: 999px;
  margin-left: 4px;
  vertical-align: middle;
}
.search-input {
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  flex: 1;
  min-width: 150px;
  outline: none;
  background: #fff;
  transition: border-color 0.18s, box-shadow 0.18s;
  font-family: inherit;
  color: var(--text);
}
.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 107, 246, 0.14);
}
/* 🐛 修复：.btn-primary 全局 width:100%（给表单提交按钮用的），
  混进筛选栏后「搜索」按钮被撑成一整行蓝条 */
.filters-bar .btn,
.filters-bar .btn-primary { width: auto; flex: 0 0 auto; }
/* 筛选 chips 容器：桌面 display:contents（等于不存在，chips 仍是 .filters-bar 的直接子项），
  手机端变成一行横向滑动，搜索框和按钮另起一行 */
.filter-scroll { display: contents; }
/* 2026-11-22：手机端筛选 chips 不再横滑——自动换行全部铺开（同一界面可见） */
@media (max-width: 768px) {
  .filter-scroll {
    display: flex;
    flex: 1 1 100%;
    flex-wrap: wrap;
    gap: 8px;
  }
  .filter-tab { flex: 0 0 auto; white-space: nowrap; padding: 6px 12px; font-size: 12.5px; }
  .filters-bar { row-gap: 8px; }
  .search-input { flex: 1 1 auto; min-width: 0; order: 2; }
  .filters-bar .btn { order: 3; }
}

/* Table —— 白底 + 浅灰表头 + 发丝行线 */
.table-wrap {
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
/* 2026-11-22 第二轮：表头降一级（更小/更浅/更轻），和正文拉开灰度层级——
   ONES 式「主黑正文 + 浅灰小表头」，之前表头正文一样重，整页发灰没层次 */
th {
  background: var(--bg-secondary);
  padding: 10px 12px;
  text-align: left;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: #98a0b3;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 10px 12px;
  border-bottom: 1px solid #eef1f6;
  white-space: nowrap;
  line-height: 1.5;
}
/* 金额/数量列：右对齐 + 等宽数字，扫读对位（col-amount 类由 JS 按权限控制显隐，不动逻辑） */
th.col-amount, td.col-amount {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
td.col-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
td.wrap-cell {
  white-space: normal;
  word-break: break-all;
  min-width: 80px;
  max-width: 200px;
}
tr:hover td { background: #f6f9fe; }
/* 行内操作列（2026-11-22 第二轮）：边框按钮太重还折行 → ONES 式轻量文字按钮，
   nowrap 一行放齐（4 个文字按钮 ≈ 200px，不再两行参差） */
.actions-cell { display: flex; gap: 0; flex-wrap: nowrap; align-items: center; white-space: nowrap; }
.actions-cell .btn {
  border: none;
  background: transparent;
  padding: 3px 6px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 7px;
  box-shadow: none;
}
.actions-cell .btn:hover { background: var(--primary-light); }
.actions-cell .btn-warning { background: transparent; color: var(--warning); }
.actions-cell .btn-warning:hover { background: #fff4e0; }

/* 快速入库 + 按钮：商品名称后圆形加号，一键打开该商品的手动入库 */
.quick-add-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  border: none;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  margin-top: 2px;
  transition: transform 0.12s ease, background 0.12s ease;
}
.quick-add-btn:hover { transform: scale(1.14); background: #0e8a43; }
.quick-add-btn:active { transform: scale(0.92); }

/* Compact table for admin fullscreen */
.admin-layout table { font-size: 12px; }
.admin-layout th,
.admin-layout td { padding: 9px 10px; }

/* 表头吸顶：表格容器内滚动时列名不消失（所有 .table-wrap 通用） */
.table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}
tbody tr { transition: background 0.15s; }
.admin-layout tbody tr:hover { background: #f6f9fe; }

/* ============ 手机端订单卡片流（2026-10-11）============
  15 列表格在手机上只能横滚，一屏看不全一单。
  ≤768px 时隐藏表格、显示卡片：一单一张卡，信息分层，操作按钮常驻。
  卡片由 renderOrders() 与表格行同循环渲染，数据完全同源。 */
.order-cards { display: none; }
@media (max-width: 768px) {
  #ordersTableWrap { display: none; }
  .order-cards { display: block; }
}
.ocard {
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--glass-shadow);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.ocard-top {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ocard-check { flex: 0 0 auto; display: flex; align-items: center; }
.ocard-check input { width: 17px; height: 17px; }
.ocard-no {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ocard-time { flex: 0 0 auto; font-size: 11px; color: var(--text-secondary); }
.ocard-goods {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}
.ocard-goods .ocard-qty {
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 12px;
  margin-left: 4px;
  white-space: nowrap;
}
.ocard-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  word-break: break-all;
}
.ocard-badges {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.ocard-amount {
  margin-left: auto;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.ocard-actions {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.ocard-actions .btn { flex: 0 0 auto; }

/* Login page（管理后台）：浅底 + 纯白卡片 */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.login-card {
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 4px 28px -12px rgba(16, 24, 40, 0.16);
  border-radius: 18px;
  padding: 32px;
  width: 360px;
}
.login-card h2 {
  text-align: center;
  margin-bottom: 24px;
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
}

/* Modal —— 纯白面板 + 深色遮罩 */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 100;
  align-items: center;
  justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal {
  background: #fff;
  border: none;
  box-shadow: 0 24px 64px -16px rgba(16, 24, 40, 0.28);
  border-radius: 16px;
  padding: 24px;
  width: 90%;
  max-width: 440px;
  max-height: 80vh;
  overflow-y: auto;
}
.modal h3 { font-size: 17px; margin-bottom: 16px; font-weight: 700; }
.modal .detail-row {
  display: flex;
  padding: 8px 0;
  border-bottom: 1px solid #eef1f6;
  font-size: 13px;
}
.modal .detail-label {
  width: 90px;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.modal .detail-value { flex: 1; }
.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* Toast —— 深色实心 */
.toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(23, 26, 43, 0.94);
  color: #fff;
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 14px;
  /* ⚠️ 必须高于一切全屏遮挡层（登录/注册页 999、弹窗 900、相机 300），
     否则报错提示被遮住，用户看到的就是"点了没反应"（2026-11-01 注册登录事故根因） */
  z-index: 3000;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  box-shadow: 0 10px 28px -8px rgba(0, 0, 0, 0.4);
}
.toast.show { opacity: 1; }

/* Empty state */
.empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-secondary);
}
.empty svg { width: 48px; height: 48px; fill: #c4ccd8; margin-bottom: 12px; }

/* Responsive */
@media (max-width: 768px) {
  .container-wide { padding: 8px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { flex-direction: column; gap: 0; }
  th, td { padding: 8px 6px; font-size: 12px; }
}

/* 主导航 .tab-bar 已于 2026-11-22 移入左侧导航（.sidenav 体系），顶部横向 tab 条废弃。
   switchTab() 仍靠 .tab-item 切 active，样式见 .sidenav .tab-item。 */

/* Scan section */
.scan-area { max-width: 500px; margin: 0 auto; }
.scan-input-card {
  background: #fff;
  border: 1.5px dashed #b9cdf7;
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  margin-bottom: 16px;
  transition: border-color 0.2s, background 0.2s;
}
.scan-input-card.active { border-color: var(--success); background: #f2fbf5; }
.scan-input-card.duplicate { border-color: var(--warning); background: #fff8e8; }
.scan-input-card.notfound { border-color: var(--danger); background: #fdf1f1; }
.scan-input-card svg { width: 48px; height: 48px; fill: var(--primary); margin-bottom: 8px; }
.scan-input {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 18px;
  text-align: center;
  letter-spacing: 2px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fff;
  font-family: inherit;
  color: var(--text);
}
.scan-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47,107,246,.12); }
.scan-input.result-ok { border-color: var(--success); background: #f2fbf5; }
.scan-input.result-dup { border-color: var(--warning); background: #fff8e8; }
.scan-input.result-err { border-color: var(--danger); background: #fdf1f1; }
.scan-result {
  margin-top: 12px;
  font-size: 14px;
  min-height: 20px;
  transition: all 0.2s;
}
.scan-result.ok { color: var(--success); font-weight: 600; }
.scan-result.dup { color: var(--warning); font-weight: 600; }
.scan-result.err { color: var(--danger); }
.scan-count {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 12px;
}
.scan-count strong { color: var(--success); font-size: 20px; }
.scan-history {
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--glass-shadow);
  border-radius: 12px;
  overflow: hidden;
}
.scan-history h4 {
  font-size: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  font-weight: 600;
}
.scan-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid #eef1f6;
  font-size: 13px;
}
.scan-item:last-child { border-bottom: none; }
.scan-item-time { color: var(--text-secondary); font-size: 12px; }
.scan-item-info { flex: 1; margin: 0 8px; }
.scan-flash {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(18, 161, 80, 0.15);
  z-index: 999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s;
}
.scan-flash.show { opacity: 1; }
.beep-text {
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  padding: 20px;
}

/* Camera scan button */
.btn-camera {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease;
  font-family: inherit;
  box-shadow: 0 2px 8px -2px rgba(47, 107, 246, 0.5);
}
.btn-camera:hover { background: var(--primary-dark); }
.btn-camera:disabled { background: #c6cdd9; box-shadow: none; cursor: not-allowed; }

/* Camera overlay —— 2026-10-01 改为顶部半屏：
  相机占上半屏，下半屏仍看得到扫码结果和物品信息，连扫多件不用反复开关相机 */
.camera-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 52vh;              /* 只占上半屏，不遮挡下方内容 */
  background: #000;
  z-index: 300;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 0 0 18px 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
.camera-overlay.show { display: flex; }
.camera-container {
  /* ⚠️ 2026-11-01 修复：原来 height:100% 依赖父层高度解析，部分手机浏览器
     （夸克/UC 等 WebView 内核）解析失败 → 容器塌缩成内容高 → 绝对定位的
     「关闭相机」按钮被顶出面板底部裁切。改为绝对填充，与高度解析无关。 */
  position: absolute;
  top: 0; bottom: 0; left: 0; right: 0;
  margin: 0 auto;            /* 配合 max-width 水平居中 */
  width: 100%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.camera-container video {
  width: 100%;
  height: auto;
  max-height: 40vh;          /* 跟着半屏调小，别顶出面板 */
  object-fit: cover;
  border-radius: 4px;
}
.camera-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  max-width: 400px;
  height: 120px;
  border: 2px solid rgba(18, 161, 80, 0.85);
  border-radius: 10px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}
.camera-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 13px;
  text-align: center;
  margin-top: 90px;
  opacity: 0.9;
  pointer-events: none;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}
.btn-camera-close {
  position: absolute;
  bottom: 14px;              /* 2026-11-01：40px→14px，贴底但完整可见；与上方控制条(68px)不重叠 */
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 32px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 24px;
  font-size: 15px;
  cursor: pointer;
}
.camera-unsupported {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  text-align: center;
  font-size: 15px;
  line-height: 1.8;
}
.camera-unsupported.show { display: block; }
.camera-unsupported small { font-size: 13px; opacity: 0.7; }

/* ============ 物流时间线 ============ */
.tracking-timeline {
  position: relative;
  padding-left: 20px;
  margin-top: 4px;
}
.tracking-timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.tracking-item {
  position: relative;
  padding: 6px 0 10px 12px;
}
.tracking-item:last-child { padding-bottom: 0; }
.tracking-dot {
  position: absolute;
  left: -18px;
  top: 10px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #b6bed0;
  border: 2px solid var(--bg);
}
.tracking-item.latest .tracking-dot {
  background: var(--success);
  width: 12px;
  height: 12px;
  left: -19px;
  top: 9px;
  box-shadow: 0 0 0 3px rgba(18, 161, 80, 0.2);
}
.tracking-content { font-size: 13px; }
.tracking-text { color: var(--text); line-height: 1.5; }
.tracking-item.latest .tracking-text { font-weight: 600; color: var(--success); }
.tracking-time { color: var(--text-secondary); font-size: 11px; margin-top: 2px; }

/* 文本选中配色 */
::selection { background: rgba(47, 107, 246, 0.18); }

/* 尊重无障碍偏好：减少动效 */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ============================================================
  客户端三栏 Tab（首页 / 回收品类 / 我的）  2026-10-11
  ============================================================ */
#mainContainer { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }

.ctabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 900;
  display: flex;
  background: #fff;
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.ctab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 7px 0 6px;
  color: #8a94a6;
  font-size: 11px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s;
}
.ctab-item svg { width: 22px; height: 22px; fill: currentColor; }
.ctab-item.active { color: var(--primary); font-weight: 600; }

/* ---- Tab2 回收品类 ---- */
.cat-search {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 0 12px; margin-bottom: 10px;
}
.cat-search-ico { font-size: 14px; opacity: .6; }
.cat-search input {
  flex: 1; border: none; outline: none; background: transparent;
  padding: 11px 0; font-size: 15px; font-family: inherit; color: var(--text);
}
.cat-summary { font-size: 12px; color: var(--text-secondary); margin: 0 2px 10px; }
.cat-summary b { color: var(--primary); }

/* ---- 品类导航（横向滑动 chips，对齐竞品左侧品类导航的移动版） ---- */
.cat-nav {
  display: flex; gap: 8px;
  overflow-x: auto; padding: 2px 0 12px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.cat-nav::-webkit-scrollbar { display: none; }
.cn-item {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 5px;
  padding: 6px 14px; border-radius: 999px;
  background: #fff; border: 1px solid var(--border);
  font-size: 13px; color: #4a5268;
  cursor: pointer; white-space: nowrap; user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.15s;
}
.cn-item.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.cn-n { font-size: 11px; opacity: .72; }
.cn-item.active .cn-n { opacity: .92; }

/* ---- 商品列表（大图卡片：名称/单位/更新日期 + 右侧参考价，对齐小程序商品卡风格） ---- */
.pl-item {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--glass-shadow);
  padding: 14px; margin-bottom: 10px; cursor: pointer;
  transition: box-shadow 0.18s;
}
.pl-item:active { background: var(--primary-light); }
.pl-item:hover { box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 10px 26px -14px rgba(16,24,40,.14); }
.pl-thumb {
  flex: none; width: 76px; height: 76px; border-radius: 12px;
  overflow: hidden; background: var(--bg-secondary); position: relative;
  display: flex; align-items: center; justify-content: center;
}
.pl-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pl-thumb.placeholder span { font-size: 24px; font-weight: 600; color: #9aa4b2; }
/* 有图时的放大提示角标（2026-11-23 改到图片正中央，半透明圆形底） */
.pl-zoom {
  position: absolute; left: 50%; top: 50%; width: 32px; height: 32px;
  margin: -16px 0 0 -16px;
  line-height: 32px; text-align: center;
  background: rgba(23, 33, 43, 0.55); color: #fff; font-size: 17px;
  border-radius: 50%; cursor: zoom-in;
}
.pl-body { flex: 1; min-width: 0; }
.pl-name { font-size: 15px; font-weight: 600; line-height: 1.45; word-break: break-all; }
.pl-meta { font-size: 11.5px; color: var(--text-secondary); margin-top: 4px; }
.pl-right { flex: none; text-align: right; min-width: 66px; }
.pl-price { font-size: 17px; font-weight: 700; color: var(--danger); line-height: 1.25; }
.pl-price.pending { font-size: 13px; font-weight: 500; color: #9aa5b5; }
.pl-plabel { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }

/* ---- 商品图片全屏查看器（点击品类页缩略图弹出） ---- */
.photo-viewer {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(15, 20, 28, 0.92);
  display: none; align-items: center; justify-content: center;
}
.photo-viewer.show { display: flex; }
.photo-viewer img {
  max-width: 92vw; max-height: 82vh; border-radius: 10px;
  object-fit: contain; -webkit-user-select: none; user-select: none;
}
.pv-close {
  position: absolute; top: calc(env(safe-area-inset-top, 0px) + 14px); right: 16px;
  width: 38px; height: 38px; line-height: 36px; text-align: center;
  background: rgba(255, 255, 255, 0.14); color: #fff; font-size: 20px;
  border-radius: 50%; cursor: pointer;
}
.pv-name {
  position: absolute; top: calc(env(safe-area-inset-top, 0px) + 18px); left: 18px;
  color: #fff; font-size: 14px; font-weight: 600; max-width: 60vw;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pv-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 64px; line-height: 64px; text-align: center;
  background: rgba(255, 255, 255, 0.12); color: #fff; font-size: 24px;
  border-radius: 10px; cursor: pointer;
}
.pv-prev { left: 10px; }
.pv-next { right: 10px; }
.pv-count {
  position: absolute; bottom: calc(env(safe-area-inset-bottom, 0px) + 20px); left: 0; right: 0;
  text-align: center; color: rgba(255, 255, 255, 0.75); font-size: 12px;
}

.cat-empty { text-align: center; color: #8a94a6; font-size: 13px; padding: 28px 0; }
.cat-tip {
  margin-top: 12px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: rgba(245, 158, 11, 0.08); border: 1px solid rgba(245, 158, 11, 0.28);
  color: #8a5a00; font-size: 12.5px; line-height: 1.65;
}

/* ---- Tab3 我的 ---- */
.mine-identity { display: flex; align-items: center; gap: 10px; }
.mine-phone { font-size: 18px; font-weight: 700; letter-spacing: .5px; }
.mine-sub { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

.mine-stats { display: flex; gap: 10px; margin-bottom: 12px; }
.mine-stat {
  flex: 1; min-width: 0; text-align: center; padding: 14px 4px;
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--glass-shadow);
}
.mine-stat-num { font-size: 17px; font-weight: 800; line-height: 1.25; word-break: break-all; color: var(--primary); }
.mine-stat-lbl { font-size: 11.5px; color: var(--text-secondary); margin-top: 3px; }

.mcard {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--glass-shadow);
  padding: 13px 14px; margin-bottom: 10px;
}
.mcard-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.mcard-no { flex: 1; min-width: 0; font-size: 12px; color: var(--text-secondary); font-family: ui-monospace, Menlo, Consolas, monospace; word-break: break-all; }
.mcard-line { display: flex; gap: 10px; font-size: 13px; padding: 2px 0; }
.mcard-k { flex: none; width: 34px; color: var(--text-secondary); }
.mcard-v { flex: 1; min-width: 0; word-break: break-all; }
.mcard-amt { color: var(--danger); font-weight: 700; }
.mcard-foot { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); font-size: 11.5px; color: var(--text-secondary); }
.mine-empty { text-align: center; color: #8a94a6; font-size: 13px; padding: 30px 10px; }

.mine-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 2px; font-size: 14px; border-bottom: 1px solid var(--border); cursor: pointer; }
.mine-row:active { background: var(--primary-light); }

.faq-item { border-bottom: 1px solid var(--border); }
.faq-item:last-child { border-bottom: none; }
.faq-q { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 2px; font-size: 14px; cursor: pointer; }
.faq-arrow { flex: none; font-size: 12px; color: #9aa5b5; transition: transform .2s ease; }
.faq-item.open .faq-arrow { transform: rotate(180deg); }
.faq-a { padding: 0 2px 12px; font-size: 13px; color: var(--text-secondary); line-height: 1.7; }

@media (max-width: 360px) {
  .ctab-item { font-size: 10px; }
  .ctab-item svg { width: 20px; height: 20px; }
}

/* ============================================================
  级联选择器弹层 + 收货地址卡片  2026-10-11
  ============================================================ */
.sheet-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45); z-index: 1000; display: none; }
.sheet-mask.show { display: block; }
.picker-sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-width: 520px; margin: 0 auto;
  background: #fff; border-radius: 18px 18px 0 0;
  display: flex; flex-direction: column; max-height: 78vh;
  animation: psUp .2s ease;
  padding-bottom: env(safe-area-inset-bottom);
}
@keyframes psUp { from { transform: translateY(48px); opacity: .5; } to { transform: none; opacity: 1; } }
.ps-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.ps-back { border: none; background: none; color: var(--primary); font-size: 14px; cursor: pointer; padding: 4px 6px; white-space: nowrap; font-family: inherit; }
.ps-title { flex: 1; text-align: center; font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-close { border: none; background: var(--bg-secondary); width: 28px; height: 28px; border-radius: 50%; cursor: pointer; font-size: 13px; color: #64748b; flex: none; }
.ps-search { display: flex; align-items: center; gap: 8px; margin: 10px 12px 6px; padding: 0 12px; background: var(--bg-secondary); border-radius: 10px; font-size: 13px; }
.ps-search input { flex: 1; border: none; background: none; outline: none; padding: 9px 0; font-size: 14px; font-family: inherit; color: var(--text); min-width: 0; }
.ps-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 0 18px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
/* 底部弹层里的表单容器（修改密码/修改订单/打款信息/添加商品）：
   必须有独立滚动区，否则内容超高时滑不动、手势会穿透滚动背后页面 */
.sheet-form { width: 100%; box-sizing: border-box; }
.ps-row { display: flex; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer; border-bottom: 1px solid #f2f4f9; }
.ps-row:active { background: var(--primary-light); }
.ps-row-main { flex: 1; min-width: 0; }
.ps-row-t { font-size: 14px; word-break: break-all; line-height: 1.4; }
.ps-row-s { font-size: 11.5px; color: var(--text-secondary); margin-top: 2px; }
.ps-chev { color: #9aa5b5; font-size: 16px; flex: none; }
.ps-price { font-weight: 700; color: var(--danger); font-size: 14px; white-space: nowrap; }
.ps-price.pending { color: #9aa5b5; font-weight: 500; font-size: 12px; }
.ps-unit { background: var(--primary-light); color: var(--primary); border-radius: 8px; padding: 1px 6px; font-size: 11px; }
.ps-empty { text-align: center; color: #8a94a6; font-size: 13px; padding: 30px 16px; }
/* 内部账号「添加商品」入口（2026-10-15）：搜索无结果时出现 */
.ps-addrow .ps-row-t { color: var(--primary, #2563eb); font-weight: 600; }

.addr-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.addr-item:last-child { border-bottom: none; }
.addr-info { flex: 1; min-width: 0; }
.addr-title { font-size: 13.5px; font-weight: 600; }
.addr-phone { font-size: 12.5px; color: var(--primary); font-weight: 600; margin-top: 2px; word-break: break-all; }
.addr-text { font-size: 12.5px; color: var(--text-secondary); margin-top: 2px; word-break: break-all; line-height: 1.55; }
.addr-copy { flex: none; border: 1px solid #c4d4f8; color: var(--primary); background: #fff; border-radius: 8px; padding: 5px 12px; font-size: 12.5px; cursor: pointer; margin-top: 2px; font-family: inherit; }
.addr-copy:active { background: var(--primary-light); }

/* ---- 首页地址库 chips ---- */
.addr-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 8px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.addr-chips::-webkit-scrollbar { display: none; }
.addr-chip { flex: none; border: 1px solid var(--border); background: #fff; color: #4a5268; border-radius: 999px; padding: 5px 13px; font-size: 12.5px; cursor: pointer; font-family: inherit; white-space: nowrap; }
.addr-chip.on { border-color: var(--primary); color: var(--primary); background: var(--primary-light); font-weight: 600; }

/* ---- 品牌背书 + 回收流程 ---- */
.brand-bar { display: flex; align-items: center; gap: 10px; }
.brand-logo { flex: none; width: 44px; height: 44px; border-radius: 13px; background: var(--primary); color: #fff; font-size: 15px; font-weight: 700; display: flex; align-items: center; justify-content: center; letter-spacing: 1px; }
.brand-info { flex: 1; min-width: 0; }
.brand-name { font-size: 14.5px; font-weight: 700; }
.brand-sub { font-size: 11.5px; color: var(--text-secondary); margin-top: 2px; }
.brand-cta { flex: none; border: none; background: var(--primary); color: #fff; border-radius: 999px; padding: 7px 16px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; }
.brand-cta:active { opacity: .85; }
.flow-steps { display: flex; align-items: center; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); }
.flow-step { flex: 1; text-align: center; min-width: 0; }
.flow-icon { font-size: 20px; line-height: 1; }
.flow-label { font-size: 11px; color: var(--text-secondary); margin-top: 5px; white-space: nowrap; }
.flow-arrow { flex: none; color: #c3ccd9; font-size: 13px; padding: 0 1px; }

/* ---- 我的：回收订单分桶 + 服务宫格（对标竞品「我的」页） ---- */
.mine-sum { font-size: 12px; color: var(--text-secondary); margin: -2px 0 10px; line-height: 1.8; }
.mine-export-btn { font-size: 12px; font-weight: 600; color: var(--primary); background: #fff; border: 1px solid var(--primary); border-radius: 999px; padding: 3px 12px; cursor: pointer; white-space: nowrap; }
.mine-export-btn:active { background: var(--primary); color: #fff; }
.mine-sum-amt { color: var(--primary); font-weight: 700; font-variant-numeric: tabular-nums; }
.svc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px 0; }
.svc-grid.svc-grid-five { grid-template-columns: repeat(5, 1fr); gap: 2px 0; }
.svc-cell { text-align: center; padding: 10px 2px; border-radius: 10px; cursor: pointer; }
.svc-cell:active { background: var(--primary-light); }
.svc-cell.on .svc-label, .svc-cell.on .svc-num { color: var(--primary); font-weight: 700; }
.svc-icon { font-size: 22px; line-height: 1; }
.svc-num { font-size: 15px; font-weight: 700; margin-top: 5px; font-variant-numeric: tabular-nums; }
.svc-label { font-size: 11.5px; color: var(--text-secondary); margin-top: 4px; white-space: nowrap; }

/* ---- 查询 tab：iframe 全屏视图（避开底部 tab 栏） ---- */
#viewQuery { position: fixed; top: 0; left: 0; right: 0; bottom: calc(58px + env(safe-area-inset-bottom)); z-index: 1; background: var(--bg); }

/* ---- 地址库竖排：复制 + 选为下单地址 双按钮 ---- */
.addr-btns { flex: none; display: flex; flex-direction: column; gap: 6px; }
.addr-pick { border: 1px solid var(--primary); color: #fff; background: var(--primary); border-radius: 8px; padding: 5px 10px; font-size: 12px; cursor: pointer; font-family: inherit; white-space: nowrap; }
.addr-pick:active { opacity: .85; }

/* ---- 单次/批次 切换 ---- */
.mode-seg { display: flex; background: var(--bg-secondary); border-radius: 11px; padding: 3px; margin-bottom: 8px; }
.mode-seg-item { flex: 1; border: none; background: none; padding: 7px 0; font-size: 13.5px; color: var(--text-secondary); border-radius: 9px; cursor: pointer; font-family: inherit; }
.mode-seg-item.on { background: #fff; color: var(--primary); font-weight: 700; box-shadow: 0 1px 3px rgba(16,24,40,.1); }

/* ---- 批次报单行 ---- */
.brow { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 10px; background: var(--bg-secondary); }
.brow-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.brow-no { font-size: 12.5px; font-weight: 700; color: var(--text-secondary); }
.brow-del { border: none; background: none; color: #d93025; font-size: 12px; cursor: pointer; font-family: inherit; padding: 2px 4px; }
.brow-name { width: 100%; padding: 9px 10px; border: 1px solid var(--border); border-radius: 9px; font-size: 14px; background: #fff; cursor: pointer; box-sizing: border-box; font-family: inherit; color: var(--text); }
.brow-qtyrow { display: flex; align-items: stretch; gap: 0; margin-top: 8px; }
.brow-qty { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px 0 0 9px; font-size: 14px; box-sizing: border-box; font-family: inherit; }
.brow-unit { display: flex; align-items: center; padding: 0 10px; background: var(--primary-light); color: var(--primary); font-size: 13px; font-weight: 600; border: 1px solid #c4d4f8; border-left: none; white-space: nowrap; }
.brow-amt { width: 110px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 0 9px 9px 0; font-size: 14px; box-sizing: border-box; font-family: inherit; }
.brow-hint { font-size: 11.5px; margin-top: 6px; color: var(--text-secondary); }
.brow-tn { width: 100%; padding: 9px 10px; border: 1px solid var(--border); border-radius: 9px; font-size: 14px; box-sizing: border-box; font-family: inherit; }

/* ---- 覆盖 .form-group input 的 width:100%，让数量|单位|金额 弹性布局生效 ---- */
.form-group .brow-qty { flex: 1 1 auto; width: auto; min-width: 0; }
.form-group .brow-amt { width: 110px; flex: none; }

/* ============================================================
   报单端桌面适配（2026-11-22）：很多人用电脑报单
   ≥900px：顶部导航（.dnav，复用 ctab-item/switchCTab 零改 JS）取代
   底部手机 tab 栏；内容 480 → 760 加宽；物流查询 iframe 全高；
   提示文字放大一档提升桌面阅读性。
   ============================================================ */
.dnav { display: none; }
@media (min-width: 900px) {
  .dnav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 500;
    padding: 8px 16px;
  }
  .dnav .ctab-item {
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    gap: 7px;
    font-size: 14px;
    color: #5a6478;
    padding: 8px 18px;
    border-radius: 999px;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s, color 0.15s;
  }
  .dnav .ctab-item svg { width: 17px; height: 17px; }
  .dnav .ctab-item:hover { background: var(--primary-light); color: var(--primary); }
  .dnav .ctab-item.active { background: var(--primary); color: #fff; font-weight: 600; }
  /* 手机底部 tab 栏在桌面退役，主容器不再需要给它留空隙 */
  .ctabbar { display: none; }
  #mainContainer { padding-bottom: 24px; }
  /* 内容全宽（2026-11-23 二调）：与 admin 管理后台一致，宽屏充满不留灰边 */
  .container { max-width: 100%; padding: 24px; }
  /* 物流查询 iframe：全屏到桌面底部（不再避开手机 tab 栏） */
  #viewQuery { bottom: 0; }
  /* 桌面阅读性：小字提示放大一档 */
  .form-group .hint, .brow-hint, .cat-tip { font-size: 13px; }
}

/* ============================================================
   桌面端二次提升（2026-11-23，借鉴竞品 911.888sudi 的宽屏利用）：
   ≥900px 下把「纵向长列表」变「双列卡片栅格」，减少滚动；
   卡片在栅格里保持独立边框，hover 微浮起。
   ============================================================ */
@media (min-width: 900px) {
  /* 品类页：产品列表自适应多列（宽屏填满，与后台表格一样利用横向空间） */
  #catList { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 10px; align-items: start; }
  #catList .pl-item { margin-bottom: 0; }
  /* 我的：订单卡自适应多列 */
  #mineOrders { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 10px; align-items: start; }
  #mineOrders .mcard { margin-bottom: 0; }
}

/* ============================================================
   桌面端字号整体上调一档（2026-11-23）：宽屏阅读距离远，沿用手机字号偏小。
   只作用于 ≥900px，手机端不变。
   ============================================================ */
@media (min-width: 900px) {
  body { font-size: 17px; }
  .card-title { font-size: 18px; }
  .form-group label { font-size: 15px; }
  .form-group input,
  .form-group select,
  .form-group textarea { font-size: 16px; }
  .btn { font-size: 16px; }
  .dnav .ctab-item { font-size: 15px; }
  .svc-icon { font-size: 26px; }
  .svc-num { font-size: 17px; }
  .svc-label { font-size: 13px; }
  .mine-phone { font-size: 20px; }
  .mine-sub { font-size: 13px; }
  .mcard-line { font-size: 14px; }
  .mcard-no { font-size: 13px; }
  .pl-name { font-size: 16px; }
  .pl-meta { font-size: 13px; }
  .pl-price { font-size: 18px; }
  .pl-price.pending { font-size: 14px; }
  .form-group .hint, .brow-hint, .cat-tip { font-size: 13.5px; }
}
