/* ================= 衣湃 ERP · 移动端样式 =================
   设计要点：
   - 移动优先，基准宽度 375px
   - 适配刘海屏安全区（env(safe-area-inset-*)）
   - 浅色主题，信息密度偏高，适合业务场景
   - 触控目标不小于 44px
   ============================== */

/* 11-25 视觉升级：中性灰阶打底 + 衣湃青绿单一强调色，克制留白，大厂风格 */
:root {
  --bg: #f5f7f9;
  --surface: #ffffff;
  --surface-2: #f7f9fb;
  --border: #e9eef2;
  --border-strong: #d9e1e8;

  --text: #111827;
  --text-1: #111827;   /* 视图里大量引用，旧版漏定义导致回退成 inherit */
  --text-2: #5b6779;
  --text-3: #98a2b3;

  /* 品牌：logo 原色 #23b597；交互色取深一档保证白字对比度 */
  --brand: #23b597;
  --primary: #0d9488;
  --primary-dark: #0f766e;
  --primary-soft: #e8f7f3;

  --green: #16a34a;
  --green-soft: #eaf8ee;
  --orange: #d97706;
  --orange-soft: #fff6e8;
  --red: #dc2626;
  --red-soft: #fdecec;
  --purple: #7c3aed;
  --purple-soft: #f3edfe;
  --cyan: #0891b2;
  --cyan-soft: #e7f7fa;
  --gray: #64748b;
  --gray-soft: #f0f3f6;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .03);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .12);

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --topbar-h: 52px;
  --tabbar-h: 56px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overscroll-behavior-y: none;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; font-size: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: 16px; /* 防 iOS 缩放 */ }
a { color: var(--primary); text-decoration: none; }

[hidden] { display: none !important; }

/* ============ 登录页 ============ */
.login-screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 24px calc(24px + var(--safe-top)) calc(24px + var(--safe-bottom));
  background: linear-gradient(160deg, #2bb89b 0%, #12806f 52%, #0a574a 100%);
  overflow-y: auto;
}
.login-box {
  width: 100%; max-width: 380px;
  background: var(--surface);
  border-radius: 20px;
  padding: 32px 24px 24px;
  box-shadow: var(--shadow-lg);
}
.login-logo { display: flex; justify-content: center; margin-bottom: 16px; }
.login-title { font-size: 21px; font-weight: 650; text-align: center; margin: 0 0 6px; letter-spacing: .5px; }
.login-sub { font-size: 13px; color: var(--text-3); text-align: center; margin: 0 0 24px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  transition: border-color .15s, background .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--primary); background: #fff;
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.pass-wrap { position: relative; }
.pass-wrap input { padding-right: 44px; }
.pass-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  color: var(--text-3); border-radius: 8px;
}
.pass-toggle:active { background: var(--gray-soft); color: var(--text-2); }

.btn-primary {
  width: 100%; padding: 13px;
  background: var(--primary); color: #fff;
  border-radius: var(--radius-sm);
  font-size: 16px; font-weight: 600; letter-spacing: 2px;
  transition: background .15s, opacity .15s;
}
.btn-primary:active { background: var(--primary-dark); }
.btn-primary:disabled { opacity: .55; }
.btn-block { display: block; }

.login-error {
  background: var(--red-soft); color: var(--red);
  padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: 13px; margin-bottom: 14px;
  border: 1px solid #f7c9c9;
}
.login-mode {
  margin-top: 18px; padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-3); text-align: center; line-height: 1.7;
}
.login-mode b { color: var(--text-2); font-weight: 600; }

/* ★ 连接指引（老板 11-04：换 WiFi → IP 变 → 手机登不上） */
.login-lan {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 12.5px;
}
.login-lan > summary {
  padding: 10px 12px;
  cursor: pointer;
  color: var(--text-2);
  font-weight: 600;
  list-style: none;
}
.login-lan > summary::-webkit-details-marker { display: none; }
.login-lan > summary::before { content: '▸ '; color: var(--text-3); }
.login-lan[open] > summary::before { content: '▾ '; }
.login-lan-body { padding: 0 12px 12px; }
.login-lan-tip {
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: 10px;
  font-size: 12px;
}
.login-lan-qr { text-align: center; margin-bottom: 10px; }
.login-lan-qrbox {
  display: inline-block;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.login-lan-qr-txt {
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--text-2);
  word-break: break-all;
}
.login-lan-addrs { display: flex; flex-direction: column; gap: 6px; }
.login-lan-addr {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-1, #fff);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 9px;
}
.login-lan-addr-l { flex: 1; min-width: 0; line-height: 1.4; }
.login-lan-addr-l b { display: block; font-size: 12.5px; color: var(--text-1); }
.login-lan-addr-l span { font-size: 11px; color: var(--text-3); }
.login-lan-addr code {
  font-size: 11.5px;
  color: var(--primary);
  word-break: break-all;
  max-width: 46%;
}
.btn-mini {
  flex-shrink: 0;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 11.5px;
  cursor: pointer;
}

/* ============ 应用框架 ============ */
.app { display: flex; flex-direction: column; height: 100%; }

.topbar {
  height: calc(var(--topbar-h) + var(--safe-top));
  padding-top: var(--safe-top);
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 4px;
  padding-left: 12px; padding-right: 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.topbar-back {
  width: 36px; height: 36px; margin-left: -6px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2); border-radius: 9px; flex: 0 0 auto;
}
.topbar-back:active { background: var(--gray-soft); }
.topbar-title {
  font-size: 17px; font-weight: 650; flex: 1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.topbar-actions { display: flex; gap: 2px; flex: 0 0 auto; }
.topbar-actions button {
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  color: var(--text-2); border-radius: 9px;
}
.topbar-actions button:active { background: var(--gray-soft); }

.view {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 12px calc(16px + var(--safe-bottom));
  padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 16px);
}

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  display: flex;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-top: 1px solid var(--border);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; color: var(--text-3); font-size: 10.5px; padding-top: 6px;
  transition: color .12s;
}
.tab svg { opacity: .75; }
.tab.active { color: var(--primary); }
.tab.active svg { opacity: 1; }

/* ============ 通用卡片 ============ */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  overflow: hidden;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 14px 0;
}
.card-title { font-size: 15px; font-weight: 650; }
.card-title small { font-weight: 400; color: var(--text-3); font-size: 12px; margin-left: 6px; }
.card-more { font-size: 13px; color: var(--primary); padding: 4px 0 4px 10px; }
.card-body { padding: 12px 14px 14px; }

/* ============ KPI ============ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.kpi {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 13px 14px;
  position: relative;
  overflow: hidden;
}
.kpi-label { font-size: 12.5px; color: var(--text-2); margin-bottom: 5px; }
.kpi-value {
  font-size: 23px; font-weight: 680; letter-spacing: -.5px;
  font-variant-numeric: tabular-nums; line-height: 1.15;
  display: flex; align-items: baseline; gap: 3px;
}
.kpi-unit { font-size: 12px; font-weight: 500; color: var(--text-3); }
.kpi-sub { font-size: 11.5px; color: var(--text-3); margin-top: 4px; }
.kpi.accent-primary .kpi-value { color: var(--primary); }
.kpi.accent-green .kpi-value { color: var(--green); }
.kpi.accent-orange .kpi-value { color: var(--orange); }
.kpi.accent-purple .kpi-value { color: var(--purple); }

/* ============ 图表 ============ */
.chart-wrap { padding: 8px 6px 4px; }
.chart-svg { width: 100%; display: block; overflow: visible; }
.chart-empty { text-align: center; color: var(--text-3); font-size: 13px; padding: 28px 0; }

/* ============ 列表项 ============ */
.list { display: flex; flex-direction: column; }
.list-item {
  display: block; width: 100%; text-align: left;
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.list-item:last-child { border-bottom: none; }
.list-item:active { background: var(--surface-2); }
.li-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.li-main { flex: 1; min-width: 0; }
.li-code {
  font-size: 14.5px; font-weight: 620; font-variant-numeric: tabular-nums;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.li-sub {
  font-size: 13px; color: var(--text-2); margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.li-meta {
  display: flex; align-items: center; gap: 10px; margin-top: 6px;
  font-size: 12px; color: var(--text-3);
}
.li-amount {
  font-size: 15.5px; font-weight: 650; font-variant-numeric: tabular-nums;
  white-space: nowrap; text-align: right;
}
.li-amount small { font-size: 11px; font-weight: 500; color: var(--text-3); margin-left: 2px; }

/* ============ 徽章 ============ */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 20px;
  font-size: 11.5px; font-weight: 550; white-space: nowrap;
  background: var(--gray-soft); color: var(--gray);
}
.badge.blue { background: var(--primary-soft); color: var(--primary); }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.orange { background: var(--orange-soft); color: var(--orange); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.purple { background: var(--purple-soft); color: var(--purple); }
.badge.cyan { background: var(--cyan-soft); color: var(--cyan); }
.badge.gray { background: var(--gray-soft); color: var(--gray); }
/* 加工单列表：厂内加工 / 毛衫加工 种类徽标 */
.badge.badge-cut { background: var(--primary-soft); color: var(--primary); }
.badge.badge-maoshan { background: var(--purple-soft); color: var(--purple); }
/* 横机外发单：来源毛衫加工单预筛提示条 */
.hj-src-tip {
  margin: 0 12px 10px; padding: 9px 12px; border-radius: 10px;
  font-size: 12.5px; line-height: 1.6;
  background: var(--purple-soft); color: var(--purple);
}
.hj-src-tip button {
  margin-left: 8px; padding: 2px 8px; border: 0; border-radius: 6px;
  background: transparent; color: inherit; font-size: 12px; text-decoration: underline;
  cursor: pointer;
}
/* 第二行筛选（分包状态）加个前缀标签，避免与第一行的「全部」混淆 */
.chips-split-row { align-items: center; }
.chips-label {
  flex: 0 0 auto; margin-right: 2px;
  font-size: 12px; color: var(--text-3); font-weight: 600;
}

/* ============ 进度条 ============ */
.progress {
  height: 5px; background: var(--gray-soft);
  border-radius: 3px; overflow: hidden; margin-top: 8px;
}
.progress-bar {
  height: 100%; background: var(--primary); border-radius: 3px;
  transition: width .3s ease;
}
.progress-bar.done { background: var(--green); }
.progress-bar.warn { background: var(--orange); }

/* ============ 搜索栏 ============ */
.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 0 12px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}
.search-bar input {
  flex: 1; border: none; background: none; outline: none;
  padding: 12px 0; font-size: 15px; color: var(--text);
  min-width: 0;
}
.search-bar input::placeholder { color: var(--text-3); }
.search-icon { color: var(--text-3); display: flex; flex: 0 0 auto; }
.search-clear { color: var(--text-3); padding: 6px; display: flex; }

/* ============ 筛选 chips ============ */
.chips {
  display: flex; gap: 7px; overflow-x: auto;
  padding: 0 0 12px; margin: 0 -12px 0;
  padding-left: 12px; padding-right: 12px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  padding: 6px 13px; border-radius: 20px;
  background: var(--surface); color: var(--text-2);
  font-size: 13px; white-space: nowrap; flex: 0 0 auto;
  border: 1px solid var(--border);
  transition: all .12s;
}
.chip.active {
  background: var(--primary); color: #fff; border-color: var(--primary);
  font-weight: 550;
}
/* ★ 11-04 第四轮：时间范围 与「草稿/已提交」状态筛选之间的分隔线 */
.chip-sep {
  flex: 0 0 auto; width: 1px; align-self: stretch;
  background: var(--border); margin: 3px 4px;
}
/* 时间范围提示（本周 2026-11-03 ~ 2026-11-09） */
.chip-range-tip {
  flex: 0 0 auto; align-self: center;
  font-size: 11.5px; color: var(--text-3);
  padding-left: 4px; white-space: nowrap;
}
/* 产品选择器：按类别分组的标题 */
.pick-group-title {
  padding: 12px 12px 6px;
  font-size: 12px; font-weight: 600; color: var(--text-3);
  background: var(--surface-2);
  position: sticky; top: 0; z-index: 2;
}

/* ============ FAB ============ */
.fab {
  position: fixed;
  right: 16px;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 16px);
  height: 50px; padding: 0 20px;
  border-radius: 25px;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; gap: 7px;
  font-size: 15px; font-weight: 600;
  box-shadow: 0 6px 20px rgba(13, 148, 136, .30);
  z-index: 25;
  transition: transform .12s;
}
.fab:active { transform: scale(.95); }

/* ============ 空态 / 加载 ============ */
.empty {
  text-align: center; padding: 56px 24px; color: var(--text-3);
}
.empty svg { opacity: .35; margin-bottom: 12px; }
.empty-text { font-size: 14px; }
.empty-hint { font-size: 12.5px; margin-top: 6px; color: var(--text-3); opacity: .8; }

.loading-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(255, 255, 255, .55);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  gap: 12px;
  backdrop-filter: blur(2px);
}
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--primary-soft);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
/* ★ 加载文字 + 进度条 ——
   写 ERP 要 100 秒，只有个转圈圈老板会以为死机了 */
.loading-text {
  font-size: 14px;
  color: var(--text-1);
  text-align: center;
  max-width: 78vw;
  line-height: 1.5;
}
.loading-bar {
  width: 62vw;
  max-width: 300px;
  height: 4px;
  border-radius: 2px;
  background: var(--primary-soft);
  overflow: hidden;
}
.loading-bar > i {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--primary);
  border-radius: 2px;
  transition: width .4s ease;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, var(--gray-soft) 25%, #e8ecf3 50%, var(--gray-soft) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
  border-radius: 6px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ============ 详情页 ============ */
.detail-hero {
  background: linear-gradient(135deg, #119985, #0d7061);
  color: #fff;
  padding: 16px 14px 18px;
  margin: -12px -12px 12px;
  border-radius: 0 0 18px 18px;
}
.dh-code { font-size: 20px; font-weight: 680; font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.dh-sub { font-size: 13px; opacity: .85; margin-top: 4px; }
.dh-tags { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.dh-tags .badge {
  background: rgba(255, 255, 255, .22);
  color: #fff;
  font-weight: 550;
  backdrop-filter: blur(4px);
}

.info-list { padding: 4px 0; }
.info-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.info-row:last-child { border-bottom: none; }
.info-key { color: var(--text-2); flex: 0 0 84px; font-size: 13.5px; }
.info-val { flex: 1; text-align: right; word-break: break-all; font-variant-numeric: tabular-nums; }
.info-val.strong { font-weight: 620; font-size: 15px; }
.info-val.money { color: var(--primary); font-weight: 650; }

/* 明细表 */
.detail-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.detail-table th {
  text-align: left; font-weight: 500; color: var(--text-3);
  font-size: 12px; padding: 8px 6px; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.detail-table td {
  padding: 10px 6px; border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.detail-table tr:last-child td { border-bottom: none; }
.detail-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.detail-table .total-row td { font-weight: 650; background: var(--surface-2); }

/* ============ 弹层 ============ */
.sheet-mask {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(16, 24, 40, .42);
  animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41;
  background: var(--surface);
  border-radius: 18px 18px 0 0;
  max-height: 88vh;
  display: flex; flex-direction: column;
  padding-bottom: var(--safe-bottom);
  animation: slideup .24s cubic-bezier(.32, .72, 0, 1);
  box-shadow: 0 -6px 24px rgba(16, 24, 40, .16);
}
@keyframes slideup { from { transform: translateY(100%); } }
.sheet-handle {
  width: 36px; height: 4px; border-radius: 2px;
  background: var(--border-strong);
  margin: 8px auto 0; flex: 0 0 auto;
}
.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px 10px; flex: 0 0 auto;
}
.sheet-title {
  font-size: 16.5px; font-weight: 650;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 副标题：放货号、名称这类长文本 */
.sheet-sub {
  font-size: 12.5px; color: var(--text-3); font-weight: 400;
  margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sheet-head-text { min-width: 0; flex: 1; }
.sheet-close {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  color: var(--text-3); border-radius: 8px;
}
.sheet-body {
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 0 16px 16px;
}

/* ============ 表单 ============ */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: 13px; color: var(--text-2);
  margin-bottom: 6px; font-weight: 500;
}
.form-label .req { color: var(--red); margin-left: 2px; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 11px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text); font-size: 16px;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--primary); background: #fff;
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.form-textarea { min-height: 76px; resize: vertical; line-height: 1.5; }
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238b95a7' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
  padding-right: 34px;
}
.form-hint { font-size: 12px; color: var(--text-3); margin-top: 5px; }
.form-error { font-size: 12.5px; color: var(--red); margin-top: 5px; }

/* 多选组（货品的颜色 / 尺码）——选项直接来自 ERP */
.pf-multi {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  max-height: 240px; overflow-y: auto;
  padding: 4px 0;
  -webkit-overflow-scrolling: touch;
}
.pf-multi-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 13px; font-size: 15px; color: var(--text);
  cursor: pointer;
}
.pf-multi-item:active { background: var(--primary-soft); }
.pf-multi-item input[type=checkbox] {
  width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--primary);
}
/* 编码副标题（黑色111 · C-001） */
.pf-multi-item em {
  margin-left: auto; font-style: normal;
  font-size: 12px; color: var(--text-3);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
/* 多选搜索框（颜色 128 项 / 尺码 150 项，必须能搜） */
.pf-multi-search {
  margin: 0 0 8px; font-size: 14px; padding: 9px 12px;
}
/* 已选计数 */
.pf-multi-count {
  font-size: 12px; font-weight: 400; color: var(--primary);
  margin-left: 6px;
}
/* 分组（颜色按「颜色组」分，跟 ERP 官方选择器一致） */
.pf-multi-group-title {
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 1;
  padding: 7px 13px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-size: 12.5px; font-weight: 600; color: var(--text-2);
}
.pf-multi-group-title span {
  font-weight: 400; color: var(--text-3);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.pf-multi-group:first-child .pf-multi-group-title { border-top: none; }

/* 选择器（选客户/选物料） */
.picker-trigger {
  width: 100%; padding: 11px 13px; text-align: left;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 44px;
}
.picker-trigger.filled { background: #fff; }
.picker-trigger .ph-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-trigger .ph-placeholder { color: var(--text-3); }
.picker-trigger .ph-arrow { color: var(--text-3); flex: 0 0 auto; }

/* 明细行 */
.line-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 10px;
  background: var(--surface-2);
}
.line-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 10px; }
.line-name { font-size: 14px; font-weight: 600; flex: 1; }
.line-code { font-size: 11.5px; color: var(--text-3); font-weight: 400; margin-top: 2px; }
.line-del { color: var(--red); padding: 4px; display: flex; flex: 0 0 auto; }
.line-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.line-grid .form-input { padding: 9px 11px; }
.line-amount {
  text-align: right; font-size: 13px; color: var(--text-2);
  margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--border-strong);
}
.line-amount b { color: var(--primary); font-size: 15px; font-variant-numeric: tabular-nums; }

/* ============ Toast ============ */
.toast-wrap {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 24px);
  z-index: 200; display: flex; flex-direction: column; gap: 8px;
  align-items: center; pointer-events: none; width: max-content; max-width: 88vw;
}
.toast {
  background: rgba(22, 32, 47, .93);
  color: #fff; padding: 10px 16px;
  border-radius: 20px; font-size: 13.5px;
  box-shadow: var(--shadow-lg);
  animation: toastin .22s ease;
  text-align: center;
}
.toast.error { background: rgba(220, 38, 38, .95); }
.toast.success { background: rgba(15, 157, 88, .95); }
@keyframes toastin { from { opacity: 0; transform: translateY(10px); } }

/* ============ 搜索结果分组 ============ */
.search-group { margin-bottom: 14px; }
.sg-head {
  display: flex; align-items: baseline; gap: 6px;
  padding: 0 2px 8px;
}
.sg-title { font-size: 13.5px; font-weight: 650; color: var(--text-2); }
.sg-count { font-size: 12px; color: var(--text-3); }

/* ============ 我的页 ============ */
.profile {
  display: flex; align-items: center; gap: 13px;
  background: var(--surface); border-radius: var(--radius);
  padding: 16px 14px; box-shadow: var(--shadow); margin-bottom: 12px;
}
.avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: linear-gradient(135deg, #119985, #0d7061);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 19px; font-weight: 650; flex: 0 0 auto;
}
.profile-name { font-size: 17px; font-weight: 650; }
.profile-meta { font-size: 13px; color: var(--text-3); margin-top: 2px; }

.menu { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 12px; }
.menu-item {
  display: flex; align-items: center; gap: 11px;
  width: 100%; text-align: left;
  padding: 14px;
  border-bottom: 1px solid var(--border);
  font-size: 14.5px;
}
.menu-item:last-child { border-bottom: none; }
.menu-item:active { background: var(--surface-2); }
.menu-icon { width: 20px; height: 20px; color: var(--text-2); display: flex; flex: 0 0 auto; }
.menu-label { flex: 1; }
.menu-value { font-size: 13px; color: var(--text-3); }
.menu-arrow { color: var(--text-3); display: flex; }

/* ============ 诊断页 ============ */
.diag-section { margin-bottom: 12px; }
.diag-textarea {
  width: 100%; min-height: 120px; padding: 11px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12.5px; line-height: 1.5; background: var(--surface-2);
  resize: vertical;
}
.code-block {
  background: #0f172a; color: #cbd5e1;
  padding: 12px; border-radius: var(--radius-sm);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11.5px; line-height: 1.6;
  overflow-x: auto; white-space: pre; margin: 0;
  max-height: 320px; overflow-y: auto;
}
.note {
  background: var(--primary-soft); color: var(--primary-dark);
  padding: 11px 13px; border-radius: var(--radius-sm);
  font-size: 12.5px; line-height: 1.65; margin-bottom: 12px;
}
.note.warn { background: var(--orange-soft); color: #92500a; }
.note.ok { background: var(--green-soft); color: #0a6b3c; }

.btn-secondary {
  padding: 11px 16px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border-strong);
  color: var(--text); font-size: 14px; font-weight: 550;
}
.btn-secondary:active { background: var(--gray-soft); }
.btn-sm { padding: 7px 13px; font-size: 13px; }
.btn-danger { color: var(--red); }
.btn-row { display: flex; gap: 8px; }
.btn-row > * { flex: 1; }

/* 通用间距工具类 */
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.text-muted { color: var(--text-3); }
.text-sm { font-size: 12.5px; }
.text-right { text-align: right; }
.mono { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.flex-1 { flex: 1; }
.row { display: flex; align-items: center; gap: 8px; }

/* 大屏优化 */
@media (min-width: 640px) {
  .view { max-width: 720px; margin: 0 auto; width: 100%; }
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .login-box { max-width: 400px; }
}

/* ============ 问题反馈 ============ */
.fb-cats { display: flex; flex-direction: column; gap: 8px; }
.fb-cat {
  display: flex; flex-direction: column; gap: 2px;
  padding: 11px 13px; text-align: left; width: 100%;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2);
  transition: all .12s;
}
.fb-cat.active {
  border-color: var(--primary); background: var(--primary-soft);
}
.fb-cat-label { font-size: 14px; font-weight: 600; }
.fb-cat.active .fb-cat-label { color: var(--primary-dark); }
.fb-cat-desc { font-size: 12px; color: var(--text-3); }

/* ============ 登录页降级方案 ============ */
.login-alt {
  margin-top: 18px; padding-top: 14px;
  border-top: 1px solid var(--border);
}
.login-alt summary {
  font-size: 13px; color: var(--primary);
  cursor: pointer; list-style: none;
  padding: 4px 0;
  user-select: none;
}
.login-alt summary::-webkit-details-marker { display: none; }
.login-alt summary::before { content: '＋ '; color: var(--text-3); }
.login-alt[open] summary::before { content: '－ '; }
.login-alt-body { padding-top: 12px; }
.login-alt-tip {
  font-size: 12.5px; line-height: 1.7; color: var(--text-2);
  background: var(--orange-soft); color: #92500a;
  padding: 10px 12px; border-radius: var(--radius-sm);
  margin-bottom: 14px;
}
.login-alt-how {
  font-size: 11.5px; color: var(--text-3); line-height: 1.7; margin-top: 6px;
}
.login-alt-how code {
  background: var(--gray-soft); padding: 1px 5px; border-radius: 4px;
  font-size: 11px;
}
.login-alt .field textarea {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface-2); font-size: 13px; line-height: 1.6;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  resize: vertical;
}
.login-alt .field textarea:focus {
  outline: none; border-color: var(--primary); background: #fff;
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.login-alt-note {
  font-size: 11.5px; color: var(--text-3); margin-top: 10px; text-align: center;
}


/* ============ 登录页：系统地址选择 ============ */
.base-picker { display: flex; flex-direction: column; gap: 8px; }
.base-select { padding: 10px 13px; }
.base-select:disabled { opacity: .5; }
#login-erpbase { font-size: 14px; }
#login-erpbase:disabled { background: var(--gray-soft); color: var(--text-3); }
.form-hint { font-size: 12px; color: var(--text-3); margin-top: 6px; line-height: 1.6; }

/* ============ 统计页 ============ */
.stat-tabs {
  display: flex; gap: 4px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 4px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}
.stat-tab {
  flex: 1; padding: 9px 4px;
  border-radius: 9px;
  font-size: 13.5px; font-weight: 550;
  color: var(--text-2);
  transition: all .15s;
  white-space: nowrap;
}
.stat-tab.active {
  background: var(--primary);
  color: #fff;
}

.stat-range {
  font-size: 12.5px; color: var(--text-3);
  padding: 0 4px 10px;
}
.stat-loading {
  padding: 40px 0; text-align: center;
  color: var(--text-3); font-size: 13px;
}

.stat-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--primary);
  opacity: .8;
}
.stat-card-label {
  font-size: 12.5px; color: var(--text-2);
  margin-bottom: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stat-card-main { display: flex; align-items: baseline; gap: 3px; }
.stat-card-num {
  font-size: 26px; font-weight: 680;
  letter-spacing: -.6px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.stat-card-unit { font-size: 12px; color: var(--text-3); }
.stat-card-sub {
  margin-top: 6px;
  display: flex; flex-wrap: wrap; gap: 4px 10px;
  font-size: 11.5px; color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.stat-card-err {
  margin-top: 5px; font-size: 11px; color: var(--red);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.stat-note {
  font-size: 11.5px; color: var(--text-3);
  padding: 0 4px 16px; line-height: 1.6;
}

/* 货品查询 */
.goods-suggest {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 12px;
}
.goods-chip {
  padding: 5px 10px; border-radius: 16px;
  background: var(--primary-soft); color: var(--primary-dark);
  font-size: 12.5px; font-weight: 550;
}
.goods-chip span { font-weight: 400; opacity: .75; margin-left: 3px; }
.goods-head {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px; margin-bottom: 10px;
}
.goods-code {
  font-size: 20px; font-weight: 680;
  letter-spacing: .5px;
  font-variant-numeric: tabular-nums;
}
.goods-sub { font-size: 12px; color: var(--text-3); margin-top: 3px; }

/* 业务员汇总 */
.sm-total {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; margin-bottom: 12px;
}
.sm-total-item {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 10px; text-align: center;
}
.sm-total-item b {
  display: block;
  font-size: 18px; font-weight: 680;
  font-variant-numeric: tabular-nums;
  color: var(--primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sm-total-item span {
  display: block; font-size: 11.5px; color: var(--text-3); margin-top: 3px;
}
.sm-bar {
  height: 4px; background: var(--gray-soft);
  border-radius: 2px; margin-top: 8px; overflow: hidden;
}
.sm-bar-fill {
  height: 100%; background: var(--primary);
  border-radius: 2px;
  transition: width .3s;
}

/* ============ 新版本提示 ============ */
.update-tip {
  position: fixed;
  left: 12px; right: 12px;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 12px);
  z-index: 150;
  background: var(--text);
  color: #fff;
  border-radius: var(--radius);
  padding: 11px 14px;
  display: flex; align-items: center; gap: 10px;
  font-size: 13.5px;
  box-shadow: var(--shadow-lg);
  animation: toastin .25s ease;
}
.update-tip span { flex: 1; }
/* 带版本号对比的提示（新版样式） */
.update-tip-text {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 1px;
}
.update-tip-text b { font-size: 13.5px; font-weight: 650; }
.update-tip-text span {
  font-size: 11.5px;
  opacity: .75;
  font-variant-numeric: tabular-nums;
}
.update-tip button {
  padding: 6px 12px; border-radius: 8px;
  font-size: 13px; font-weight: 550;
  background: rgba(255,255,255,.16); color: #fff;
}
.update-tip #update-btn { background: var(--primary); }

/* ===== 添加到桌面引导条 ===== */
.install-bar {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(62px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 16px rgba(15, 23, 42, .10);
  animation: installSlide .28s ease;
}
.install-bar[hidden] { display: none; }
@keyframes installSlide {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.install-text { flex: 1; min-width: 0; }
.install-title { font-size: 13.5px; font-weight: 650; color: var(--text); }
.install-desc {
  font-size: 11.5px; color: var(--text-3); margin-top: 2px;
  line-height: 1.45;
}
.install-btn {
  flex: none;
  background: var(--primary);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 8px 13px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.install-btn:active { opacity: .85; }
.install-close {
  flex: none;
  background: transparent;
  border: 0;
  color: var(--text-3);
  padding: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
}
.install-close:active { color: var(--text); }

/* ===== 添加到桌面：步骤化引导弹层（11-27，适配各浏览器） ===== */
.install-guide-mask {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(15, 23, 42, .45);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: igFade .18s ease;
}
@keyframes igFade { from { opacity: 0; } to { opacity: 1; } }
.install-guide-card {
  width: 100%; max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 18px 16px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, .22);
  animation: igPop .22s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes igPop { from { transform: translateY(12px) scale(.97); opacity: .4; } to { transform: none; opacity: 1; } }
.ig-head { display: flex; align-items: center; justify-content: space-between; }
.ig-browser { font-size: 12px; color: var(--text-3); }
.ig-browser b { color: var(--primary); font-weight: 650; }
.ig-close {
  border: 0; background: transparent; color: var(--text-3);
  font-size: 24px; line-height: 1; padding: 0 2px; cursor: pointer;
}
.ig-title { font-size: 17px; font-weight: 700; color: var(--text); margin: 10px 0 14px; }
.ig-steps { list-style: none; margin: 0; padding: 0; }
.ig-step {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.ig-step:last-child { border-bottom: 0; }
.ig-step-no {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary);
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.ig-step-text { font-size: 13.5px; color: var(--text); line-height: 1.55; }
.ig-note {
  margin-top: 12px; padding: 10px 12px;
  background: var(--orange-soft); color: #92400e;
  border-radius: 8px; font-size: 12px; line-height: 1.6;
}
.ig-fullscreen {
  margin-top: 10px; padding: 10px 12px;
  background: var(--primary-soft); color: #0f766e;
  border-radius: 8px; font-size: 12px; line-height: 1.6;
}
.ig-fullscreen-title { font-weight: 700; margin-bottom: 3px; }
.ig-fullscreen b { color: var(--primary-dark); }
.ig-actions { display: flex; gap: 10px; margin-top: 16px; }
.ig-btn-primary, .ig-btn-ghost {
  flex: 1; border-radius: 9px; padding: 11px 8px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--primary);
}
.ig-btn-primary { background: var(--primary); color: #fff; }
.ig-btn-ghost { background: var(--surface); color: var(--primary); }
.ig-btn-primary:active, .ig-btn-ghost:active { opacity: .85; }

/* ===== 经营日报弹层（11-27） ===== */
.report-mask {
  position: fixed; inset: 0; z-index: 210;
  background: rgba(15, 23, 42, .45);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: igFade .18s ease;
}
.report-card {
  width: 100%; max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, .22);
  animation: igPop .22s cubic-bezier(.2,.9,.3,1.2);
}
.report-head { display: flex; align-items: center; justify-content: space-between; }
.report-title { font-size: 17px; font-weight: 700; color: var(--text); }
.report-close {
  border: 0; background: transparent; color: var(--text-3);
  font-size: 24px; line-height: 1; padding: 0 2px; cursor: pointer;
}
.report-hint { font-size: 12px; color: var(--text-3); margin: 6px 0 12px; }
.report-text {
  width: 100%; min-height: 240px; resize: vertical;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface-2); color: var(--text);
  padding: 12px; font-size: 13px; line-height: 1.7;
  font-family: var(--font-mono, monospace);
  box-sizing: border-box;
}
.report-actions { display: flex; gap: 10px; margin-top: 14px; }
.report-btn-primary, .report-btn-ghost {
  flex: 1; border-radius: 9px; padding: 11px 8px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--primary);
}
.report-btn-primary { background: var(--primary); color: #fff; }
.report-btn-ghost { background: var(--surface); color: var(--primary); }
.report-btn-primary:active, .report-btn-ghost:active { opacity: .85; }

/* ===== 统计页：某周期没单据时的提示 ===== */
.stat-empty-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 10px;
  padding: 10px 12px;
  background: #fff8e6;
  border: 1px solid #ffe0a3;
  border-radius: 10px;
  font-size: 13px;
  color: #8a5a00;
}
.stat-empty-btn {
  flex: none;
  background: #fff;
  border: 1px solid #f0c060;
  color: #8a5a00;
  border-radius: 7px;
  padding: 5px 10px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.stat-empty-btn:active { background: #fff3d6; }

/* ===== 颜色 × 尺码 二维矩阵 ===== */
.sku-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -2px;
}
.sku-table {
  border-collapse: collapse;
  width: 100%;
  min-width: max-content;
  font-size: 13px;
}
.sku-table th,
.sku-table td {
  border: 1px solid var(--border);
  padding: 0;
  text-align: center;
  white-space: nowrap;
}
.sku-corner {
  background: var(--surface-2, #f6f8fb);
  color: var(--text-3);
  font-size: 11.5px;
  font-weight: 550;
  padding: 7px 10px !important;
  text-align: left !important;
  position: sticky;
  left: 0;
  z-index: 4;
  box-shadow: 2px 0 4px rgba(15, 23, 42, .07);
}
.sku-col {
  background: var(--surface-2, #f6f8fb);
  color: var(--text-2);
  font-weight: 600;
  font-size: 12.5px;
  padding: 7px 12px !important;
}
.sku-row {
  background: var(--surface-2, #f6f8fb);
  color: var(--text-2);
  font-weight: 600;
  font-size: 12.5px;
  text-align: left !important;
  padding: 7px 10px !important;
  position: sticky;
  left: 0;
  z-index: 3;
  /* 横向滚动时，这一列要盖住后面的格子，否则字会被裁掉 */
  box-shadow: 2px 0 4px rgba(15, 23, 42, .07);
}
.sku-cell {
  padding: 0 !important;
  color: var(--text-3);
  min-width: 52px;
  font-size: 13px;
}
.sku-cell.has-stock {
  color: var(--text);
  font-weight: 550;
  background: var(--primary-soft);
}
.sku-sum {
  background: var(--surface-2, #f6f8fb);
  color: var(--text-2);
  font-weight: 600;
  min-width: 56px;
}
.sku-total-row .sku-row {
  color: var(--text);
}
.sku-input {
  width: 100%;
  min-width: 52px;
  border: 0;
  background: transparent;
  padding: 8px 4px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  font-family: inherit;
  outline: none;
}
.sku-input:focus {
  background: var(--primary-soft);
  box-shadow: inset 0 0 0 2px var(--primary);
  border-radius: 3px;
}
.sku-input::placeholder {
  color: var(--text-3);
  font-weight: 400;
  opacity: .55;
}
.sku-empty {
  padding: 16px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
  background: var(--surface-2, #f6f8fb);
  border-radius: 8px;
}

/* 明细行里的颜色尺码小标签 */
.sku-tag {
  display: inline-block;
  padding: 1px 7px;
  margin: 2px 4px 2px 0;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 550;
  background: var(--primary-soft);
  color: var(--primary-dark);
  border: 1px solid #cdece5;
}
.sku-tag.size {
  background: #f3f0ff;
  color: #6b46c1;
  border-color: #e2d9ff;
}

/* 详情页里的「看颜色尺码库存」按钮 */
.link-btn {
  display: inline-block;
  margin-top: 3px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--primary);
  font-size: 11.5px;
  font-family: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.link-btn:active { opacity: .7; }

/* 矩阵展开行 */
.sku-detail-row > td {
  padding: 10px !important;
  background: var(--surface-2, #f6f8fb);
}
.sku-detail-row[hidden] { display: none; }

/* 弹层里的矩阵说明 + 加工单的颜色尺码明细 */
.sku-sheet-hint {
  font-size: 12.5px;
  color: var(--text-3);
  line-height: 1.6;
  margin-bottom: 10px;
  padding: 8px 10px;
  background: var(--primary-soft);
  border-radius: 8px;
  border: 1px solid #cdece5;
}
.sku-line-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.sku-line {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  background: var(--surface-2, #f6f8fb);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12.5px;
}
.sku-line .sku-tag { margin: 0; }
.sku-line-qty {
  font-weight: 650;
  color: var(--text);
}

/* ★ 加工单：颜色/尺码明细合计 + 自动带出的生产数量（老板 11-05） */
.sku-line-sum {
  margin-top: 9px;
  font-size: 12.5px;
  color: var(--text-2);
}
.sku-line-sum b { color: var(--primary); font-size: 14px; }
.form-input.auto-qty {
  background: var(--surface-2);
  color: var(--text-2);
  font-weight: 650;
}
.form-hint b { color: var(--primary); font-weight: 650; }

/* 业务员汇总：业务员筛选条 */
.sm-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 10px 12px;
  background: var(--surface-2, #f6f8fb);
  border-radius: 10px;
}
.sm-filter-label {
  font-size: 13px;
  color: var(--text-2);
  font-weight: 550;
  flex: none;
}
.sm-select {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  font-size: 13.5px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  outline: none;
}
.sm-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, .12);
}

/* ===== 看板：统计口径说明条 ===== */
.stat-range-bar {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin: 0 0 10px;
  padding: 8px 12px;
  background: var(--primary-soft);
  border: 1px solid #cdece5;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.5;
}
.stat-range-bar .sr-label {
  flex: none;
  color: var(--primary);
  font-weight: 650;
}
.stat-range-bar .sr-main {
  flex: none;
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.stat-range-bar .sr-hint {
  flex: 1 1 100%;
  color: var(--text-3);
  font-size: 11.5px;
}

/* KPI 卡片上的区间角标 */
.kpi-label {
  display: flex;
  align-items: baseline;
  gap: 5px;
  flex-wrap: wrap;
}
.kpi-range {
  font-size: 10px;
  font-weight: 550;
  color: var(--text-3);
  background: rgba(15, 23, 42, .06);
  border-radius: 4px;
  padding: 1px 5px;
  white-space: nowrap;
}

/* ===== 统计页顶部搜索框 ===== */
.top-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  height: 40px;
  background: var(--surface-2, #f6f8fb);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 12px;
}
.top-search:focus-within {
  background: var(--surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, .12);
}
.top-search-icon {
  display: flex; align-items: center;
  color: var(--text-3);
  flex: none;
}
.top-search input {
  flex: 1; min-width: 0;
  border: 0; outline: none; background: transparent;
  font-size: 14px; color: var(--text);
  font-family: inherit;
}
.top-search input::placeholder { color: var(--text-3); }
.top-search-clear {
  flex: none;
  background: none; border: 0; padding: 2px;
  color: var(--text-3); cursor: pointer;
  display: flex; align-items: center;
}
.top-search-clear:active { color: var(--text); }

/* 资料页的说明文字 */
.form-note {
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--text-2);
  background: #fff8e6;
  border: 1px solid #ffe0a3;
  border-radius: 8px;
  padding: 9px 11px;
  margin-bottom: 14px;
}

/* ========== 销售订单详情：产品明细的颜色×尺码二维展示 ========== */
.so-item-block {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.so-item-block:first-child { padding-top: 2px; }
.so-item-head {
  display: flex; align-items: flex-start; gap: 12px;
  margin-bottom: 10px;
}
.so-item-name { flex: 1; min-width: 0; }
.so-item-nums {
  text-align: right; font-size: 13px; color: var(--text-2);
  display: flex; flex-direction: column; gap: 2px; white-space: nowrap;
}
.so-item-nums b { font-size: 14.5px; color: var(--text-1); font-weight: 600; }
.so-item-sub {
  display: inline-block; margin-left: 5px;
  font-size: 11px; color: var(--text-3); font-weight: 400;
}
.so-item-sku {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  overflow-x: auto;
}
.so-item-sku-title {
  font-size: 12.5px; font-weight: 600; color: var(--text-2);
  margin-bottom: 8px;
}
.so-item-sku-note {
  font-size: 11px; font-weight: 400; color: var(--text-3);
  margin-left: 8px;
}
.so-item-sku-note em { font-style: normal; color: var(--text-2); font-weight: 600; }
.so-item-total {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0 2px; font-size: 13px; color: var(--text-2);
}
.so-item-total .money { font-size: 15px; font-weight: 600; color: var(--text-1); }

/* ★★ 产品图片（老板 11-02：选产品时显示图片，核对产品和图片对应）★★ */
.so-item-img {
  width: 52px; height: 52px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  flex-shrink: 0;
}
.so-item-name { display: flex; gap: 10px; align-items: flex-start; }

/* ★ 颜色×尺码 明细表（老板 11-02：明细要展示颜色、尺码对应的下单数量）★ */
.so-item-sku-list {
  margin: 2px 0 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.so-sku-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.so-sku-table th {
  background: var(--surface-2);
  color: var(--text-2);
  font-weight: 600;
  font-size: 12px;
  text-align: left;
  padding: 8px 10px;
  white-space: nowrap;
}
.so-sku-table td {
  padding: 8px 10px;
  border-top: 1px solid var(--border);
  color: var(--text-1);
  white-space: nowrap;
}
.so-sku-table tr:first-child td { border-top: none; }
.so-sku-table .ta-r { text-align: right; }
.so-sku-table td b { font-weight: 600; }

/* ★ 库存分布折叠按钮（默认隐藏库存，点开才看）★ */
.so-stock-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-2);
  font-size: 12.5px;
  padding: 6px 10px;
  cursor: pointer;
  margin: 2px 0 8px;
}
.so-stock-toggle:active { background: var(--border); }
.so-stock-toggle.open { color: var(--primary); border-color: var(--primary-soft); }
.so-stock-caret { font-size: 11px; line-height: 1; }

/* ★ 加工单详情：颜色尺码矩阵 + 可折叠工序（老板 11-05）★ */
.prod-steps-toggle { margin: 0 0 10px; }
.prod-steps { display: flex; flex-direction: column; gap: 8px; }
.prod-step {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}
.prod-step-seq {
  flex: 0 0 22px; height: 22px; line-height: 22px;
  text-align: center; border-radius: 50%;
  background: var(--primary-soft, rgba(63, 170, 161, .12));
  color: var(--primary); font-size: 12px; font-weight: 600;
}
.prod-step-main { min-width: 0; flex: 1; }
.prod-step-name {
  font-size: 13.5px; font-weight: 600; color: var(--text-1);
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px;
}
.prod-step-code { font-size: 11.5px; font-weight: 400; color: var(--text-3); }
.prod-step-meta {
  margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px 10px;
  font-size: 12px; color: var(--text-2);
}
.prod-step-meta span:not(:last-child)::after { content: ''; }
.sku-empty { padding: 12px 2px; color: var(--text-3); font-size: 12.5px; }

/* ★ 加工单详情：裁剪分包卡片（老板 11-06 B 方案）★
   外挂只做只读摘要 + 入口，生成工票/改状态/打印都在 ERP 原生页面完成。 */
.prod-sub-toggle { margin: 0 0 10px; }
.prod-sub-summary { margin-bottom: 12px; }
.prod-sub-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.prod-sub-badge {
  display: inline-block; padding: 3px 9px; border-radius: 12px;
  font-size: 11.5px; font-weight: 600;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border);
}
.prod-sub-badge.done { background: rgba(45, 164, 108, .12); color: #1a8a55; border-color: rgba(45, 164, 108, .28); }
.prod-sub-badge.printed { background: var(--primary-soft, rgba(63,170,161,.12)); color: var(--primary); border-color: var(--primary-soft, rgba(63,170,161,.3)); }
.prod-sub-facts {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
}
.prod-sub-fact {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--surface-2);
  font-size: 12px; min-width: 0;
}
.prod-sub-fact span { color: var(--text-3); white-space: nowrap; }
.prod-sub-fact b { color: var(--text-1); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prod-sub-links { display: flex; flex-direction: column; gap: 8px; }
.prod-sub-link {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--surface-2);
  text-decoration: none; color: var(--text-1);
  transition: background .15s, border-color .15s;
}
.prod-sub-link:active { background: var(--border); }
.prod-sub-link.primary {
  background: var(--primary-soft, rgba(63,170,161,.10));
  border-color: var(--primary-soft, rgba(63,170,161,.35));
}
.prod-sub-icon {
  flex: 0 0 30px; height: 30px; line-height: 30px; text-align: center;
  border-radius: 8px; background: var(--surface, #fff);
  color: var(--primary); font-size: 15px;
}
.prod-sub-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.prod-sub-text b { font-size: 13.5px; font-weight: 650; }
.prod-sub-text em {
  font-style: normal; font-size: 11.5px; color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.prod-sub-arrow { color: var(--text-3); font-size: 20px; line-height: 1; }
.prod-sub-note {
  margin-top: 12px; padding: 10px 12px;
  border-radius: 8px; background: var(--surface-2);
  border: 1px dashed var(--border);
  font-size: 11.5px; color: var(--text-2); line-height: 1.65;
}
.prod-sub-note-t { font-weight: 650; color: var(--text-2); margin-bottom: 4px; }
.prod-sub-note ol { margin: 0 0 6px; padding-left: 18px; }
.prod-sub-note p { margin: 0; color: var(--text-3); }

/* ★ 选产品弹窗里的产品图片 */
.pick-img {
  width: 44px; height: 44px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  flex-shrink: 0;
}
.pick-item-img {
  width: 34px; height: 34px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  flex-shrink: 0;
}
/* 明细行里的小图标（点击可放大） */
.line-thumb {
  width: 30px; height: 30px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: zoom-in;
  flex-shrink: 0;
}

/* ★ 无图占位（ERP 里 370 个成品只有 99 个配了图，其余是占位图 NoPT.png）
     没图时画一个灰块，而不是干脆不渲染 —— 否则老板会以为功能坏了 */
.img-ph {
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2);
  border: 1px dashed var(--border);
  color: var(--text-3);
  flex-shrink: 0;
}
.pick-img.img-ph { width: 44px; height: 44px; border-radius: 8px; cursor: default; }
.line-thumb.img-ph { width: 30px; height: 30px; border-radius: 6px; cursor: default; }
.so-item-img.img-ph { width: 52px; height: 52px; border-radius: 8px; cursor: default; }

/* ★★ 订单的颜色×尺码 下单数量矩阵（老板 11-03：一个款一张表，不拆分）★★ */
.so-item-sku-matrix { margin: 2px 0 10px; }
.so-order-matrix .sku-table { font-size: 13px; }
.so-order-matrix .sku-cell {
  text-align: center;
  padding: 7px 10px !important;
  line-height: 1.35;
}
.so-order-matrix .sku-cell b { font-weight: 600; font-size: 14px; }
.so-order-matrix .sku-cell.has-stock { color: var(--text-1); }
.so-order-matrix .sku-row { text-align: left; white-space: nowrap; }
.so-cell-ship {
  display: block;
  font-style: normal;
  font-size: 10px;
  color: var(--text-3);
  line-height: 1.3;
}
.so-matrix-foot {
  display: flex; flex-wrap: wrap; gap: 12px;
  align-items: center;
  padding: 8px 10px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 12px;
  color: var(--text-2);
}
.so-matrix-foot b { color: var(--text-1); font-weight: 600; }
.so-matrix-foot .money { color: var(--primary); }

/* ★ 图片放大预览 */
.img-zoom-mask {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0, 0, 0, .82);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.img-zoom-mask img {
  max-width: 92vw;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}

/* ★ 订单附件（老板 11-02：拍照/相册上传图片）★ */
.so-attach-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.so-attach-item {
  width: 92px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-2);
}
.so-attach-img {
  width: 100%;
  height: 76px;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}
.so-attach-meta { padding: 5px 7px; }
.so-attach-name {
  font-size: 11.5px; color: var(--text-1);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.so-attach-size { font-size: 10.5px; color: var(--text-3); }
.so-attach-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.so-attach-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 8px 12px;
  font-size: 13px;
}
.so-attach-tip { font-size: 11px; color: var(--text-3); flex: 1; min-width: 160px; }

/* ★ 附件的 ERP 同步状态（老板 11-04：同步改后台异步，要能看到进度） */
.so-attach-sync {
  display: inline-block;
  margin-top: 3px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  line-height: 1.5;
  background: var(--surface-2);
  color: var(--text-3);
  border: 1px solid var(--border);
}
.so-attach-sync.done { color: #16a34a; border-color: #16a34a55; background: #16a34a12; }
.so-attach-sync.fail { color: #dc2626; border-color: #dc262655; background: #dc262612; }

/* ★ 订单详情的收款信息区 */
#so-income-body .info-list { margin: 0; }
#so-income-body .money { font-weight: 600; }

/* ★ 收款信息区（老板 11-03：下单时记录收款，一行 = 付到哪个账户 + 多少）★ */
.so-income-row {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 8px;
  background: var(--surface-2);
}
.so-income-row-main {
  display: flex;
  align-items: center;
  gap: 8px;
}
.so-income-row-main .so-inc-acc {
  flex: 1;
  min-width: 0;
}
.so-income-row-amt {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 132px;
}
.so-income-row-amt input {
  flex: 1;
  min-width: 0;
  text-align: right;
}
.so-income-row-amt span { color: var(--text-3); font-size: 13px; }
.so-income-row .so-inc-note {
  margin-top: 8px;
  font-size: 13px;
}
.so-income-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 2px 2px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-2);
}
.so-income-foot b { font-size: 16px; }
.so-income-note {
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 6px;
}
/* 下单页的付款凭证：删除按钮压在图片角上 */
.so-attach-item { position: relative; }
.so-attach-item .line-del {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(15, 23, 42, .55);
  border-radius: 6px;
  padding: 3px;
  display: flex;
  color: #fff;
}


/* 老板 11-04：销售订单「保存草稿」 */
.so-draft-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
  border-radius: 10px;
  background: #f59e0b12;
  border: 1px solid #f59e0b55;
  color: var(--text-2);
  font-size: 12.5px;
}
.so-draft-banner[hidden] { display: none; }
.so-draft-banner b { color: #b45309; }
.so-draft-banner button {
  flex: none;
  border: 1px solid var(--border);
  background: var(--card, #fff);
  color: var(--text-3);
  border-radius: 7px;
  padding: 5px 9px;
  font-size: 12px;
}
.li-draft-tag {
  color: #b45309;
  background: #f59e0b18;
  border: 1px solid #f59e0b55;
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 10.5px;
}

/* ============ 看板 · 待处理提醒（11-19：汇总数字 + 点开明细） ============ */
.alert-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 14px 2px;
}
.alert-tile {
  flex: 1 1 140px;
  min-width: 130px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  text-align: left;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.alert-tile:active { background: var(--border); }
.alert-tile.open { background: var(--primary-soft); border-color: var(--primary); }
.alert-tile .at-num {
  font-size: 27px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.alert-tile .at-label {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.35;
}
.alert-tile .at-arrow {
  flex: none;
  color: var(--text-3);
  transition: transform .18s;
}
.alert-tile.open .at-arrow { transform: rotate(90deg); }
.alert-tile.red .at-num { color: var(--red); }
.alert-tile.orange .at-num { color: var(--orange); }
.alert-tile.gray .at-num { color: var(--gray); }

.alert-more-hint {
  padding: 4px 14px 11px;
  font-size: 11.5px;
  color: var(--text-3);
}
.alert-group[hidden] { display: none; }
.alert-group:not([hidden]) { border-top: 1px solid var(--border); }
.alert-group-head {
  padding: 11px 14px 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
}

/* ===== 待收金额 TOP 客户（11-27）===== */
.recv-card .card-more { color: var(--red); font-weight: 700; font-variant-numeric: tabular-nums; }
.recv-list { padding: 4px 14px 6px; }
.recv-row { padding: 9px 0; border-bottom: 1px solid var(--border); }
.recv-row:last-child { border-bottom: none; }
.recv-line { display: flex; align-items: center; gap: 9px; }
.recv-rank {
  flex: none; width: 20px; height: 20px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--text-2); background: var(--surface-2);
}
.recv-rank.top1 { color: #fff; background: var(--red); }
.recv-name {
  flex: 1; min-width: 0; font-size: 13px; font-weight: 600; color: var(--text-1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.recv-due { flex: none; font-size: 14px; font-weight: 700; color: var(--red); font-variant-numeric: tabular-nums; }
.recv-bar { height: 5px; border-radius: 3px; background: var(--surface-2); margin: 7px 0 5px 29px; overflow: hidden; }
.recv-bar-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--brand), var(--red)); }
.recv-meta { margin-left: 29px; font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.recv-note {
  margin: 2px 14px 12px; padding: 8px 10px;
  background: var(--surface-2); border-radius: 7px;
  font-size: 11px; line-height: 1.55; color: var(--text-3);
}

/* ================================================================
   11-25 整体视觉升级 · 简洁 / 大气 / 品牌统一（覆盖层）
   原则：中性色打底、青绿单一强调、极轻阴影、充足留白、层级清晰。
   只覆盖样式，不改任何 DOM 结构与业务逻辑。
   ================================================================ */

/* ---- 登录页：品牌青绿，去掉老气的蓝色重渐变与大字距 ---- */
.login-screen {
  background: linear-gradient(160deg, #2bb89b 0%, #12806f 52%, #0a574a 100%);
}
.login-box {
  border-radius: 22px;
  padding: 30px 24px 24px;
  box-shadow: 0 24px 60px rgba(4, 45, 38, .28), 0 2px 8px rgba(4, 45, 38, .12);
}
.login-brand-mark {
  width: 68px; height: 68px;
  margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 20px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.login-brand-mark img { width: 60px; height: 60px; display: block; border-radius: 14px; }
.login-title { font-size: 22px; font-weight: 650; letter-spacing: .3px; }
.login-sub { margin-bottom: 22px; }
.btn-primary {
  border-radius: 12px;
  letter-spacing: .5px;
  padding: 14px;
  box-shadow: 0 4px 12px rgba(13, 148, 136, .22);
}
.btn-primary:active { box-shadow: none; transform: translateY(1px); }
.btn-primary:disabled { box-shadow: none; }
.login-alt summary { color: var(--primary-dark); }
.field input:focus, .field select:focus, .field textarea:focus,
.form-input:focus, .form-select:focus, .form-textarea:focus,
.login-alt .field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

/* ---- 顶栏 / 底部导航：轻边界、明确层级 ---- */
.topbar {
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
}
.topbar-title { font-size: 16.5px; font-weight: 650; letter-spacing: -.2px; }
.tabbar { background: rgba(255, 255, 255, .96); border-top: 1px solid var(--border); }
.tab { font-size: 10.5px; font-weight: 500; letter-spacing: .1px; }
.tab.active { font-weight: 650; }
.tab.active svg { transform: translateY(-1px); }

/* ---- 卡片 / KPI：极轻投影 + 细边，信息更透气 ---- */
.card, .kpi, .stat-card, .menu, .profile, .search-bar, .stat-tabs,
.goods-head, .sm-total-item {
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.card { margin-bottom: 12px; }
.card-head { padding: 15px 16px 0; }
.card-body { padding: 12px 16px 16px; }
.card-title { font-size: 15px; font-weight: 650; letter-spacing: -.1px; }
.kpi { padding: 15px 16px; }
.kpi-label { font-size: 12px; letter-spacing: .1px; }
.kpi-value { font-size: 25px; font-weight: 700; letter-spacing: -.8px; }
.kpi-sub { font-size: 11.5px; }
.stat-card-num { font-size: 28px; font-weight: 700; letter-spacing: -.8px; }
.stat-card::after { background: var(--primary); width: 3px; opacity: .85; }
.stat-tab.active { background: var(--primary); box-shadow: 0 2px 6px rgba(13, 148, 136, .2); }

/* ---- 列表：分隔更浅，金额收敛为深墨色，不再满屏蓝 ---- */
.list-item { padding: 14px 16px; border-bottom-color: var(--border); }
.li-code { font-size: 14.5px; font-weight: 650; }
.li-sub { font-size: 12.5px; }
.li-amount { font-size: 15.5px; font-weight: 650; color: var(--text); }
.li-amount small { color: var(--text-3); }
.info-val.money, .line-amount b, .so-matrix-foot .money { color: var(--text); }
.progress-bar, .sm-bar-fill { background: var(--primary); }

/* ---- 筛选 chip：未选中浅灰无边界，选中品牌实底 ---- */
.chip {
  background: var(--gray-soft);
  border-color: transparent;
  color: var(--text-2);
  padding: 7px 14px;
}
.chip.active {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 2px 6px rgba(13, 148, 136, .2);
}
.chip-sep { background: var(--border-strong); }

/* ---- 徽章 / 标签：收敛饱和，避免花哨 ---- */
.badge { font-size: 11.5px; font-weight: 600; padding: 3px 9px; }
.badge.blue { color: var(--primary-dark); }
.badge.badge-cut { background: var(--primary-soft); color: var(--primary-dark); }
.goods-chip { background: var(--primary-soft); color: var(--primary-dark); }
.sku-tag { background: var(--primary-soft); color: var(--primary-dark); border-color: #cdece5; }
.sku-tag.size { background: var(--purple-soft); color: var(--purple); border-color: #e4d7fb; }

/* ---- 表单 / 明细：统一圆角和边框 ---- */
.form-input, .form-select, .form-textarea, .picker-trigger,
.pf-multi, .form-note { border-color: var(--border-strong); border-radius: 10px; }
.form-input::placeholder, .search-bar input::placeholder { color: var(--text-3); }
.line-item { background: var(--surface); border-color: var(--border); }

/* ---- 详情页头图 / 头像：换成品牌青绿 ---- */
.detail-hero {
  background: linear-gradient(135deg, #119985, #0d7061);
  border-radius: 0 0 20px 20px;
}
.avatar { background: linear-gradient(135deg, #2bb89b, #0d7061); }
.note { background: var(--primary-soft); color: var(--primary-dark); }

/* ---- FAB / 提示条 / 弹层：统一品牌投影 ---- */
.fab { box-shadow: 0 6px 20px rgba(13, 148, 136, .3); }
.sheet { box-shadow: 0 -8px 32px rgba(16, 24, 40, .14); border-radius: 20px 20px 0 0; }
.toast.success { background: rgba(22, 163, 74, .95); }
.update-tip #update-btn { background: var(--primary); }
.install-btn { border-radius: 10px; box-shadow: 0 2px 6px rgba(13, 148, 136, .2); }

/* ---- 清理旧版残留的浅蓝硬编码，统一到品牌浅色 ---- */
.sku-cell.has-stock, .sku-input:focus, .sku-sheet-hint,
.stat-range-bar { background: var(--primary-soft); }
.sku-tag, .sku-sheet-hint, .stat-range-bar { border-color: #cdece5; }
.sm-select:focus, .top-search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, .12);
}
.stat-range-bar .sr-label { color: var(--primary-dark); }
.form-hint b, .sku-line-sum b { color: var(--primary-dark); }
.prod-step-seq { color: var(--primary-dark); }
.prod-sub-link.primary { color: var(--primary-dark); }

/* ---- 看板提醒：数字更醒目，卡片更克制 ---- */
.alert-tile { background: var(--surface); border-color: var(--border); }
.alert-tile.open { background: var(--primary-soft); border-color: var(--primary); }
.alert-tile .at-num { font-size: 28px; font-weight: 700; letter-spacing: -.5px; }
.alert-tile.red .at-num { color: var(--red); }
.alert-tile.orange .at-num { color: var(--orange); }

/* ---- KPI 数字收敛：核心指标用品牌色，其余深墨色，避免满屏彩数字 ---- */
.kpi-value { color: var(--text); }
.kpi.accent-primary .kpi-value { color: var(--primary-dark); }
.kpi.accent-green .kpi-value,
.kpi.accent-orange .kpi-value,
.kpi.accent-purple .kpi-value { color: var(--text); }

/* ---- 空态：留白更大，弱化图标 ---- */
.empty { padding: 64px 24px; }
.empty-text { font-size: 14.5px; font-weight: 550; }

/* ---- 大屏：内容居中、卡片不再拉满 ---- */
@media (min-width: 640px) {
  .view { max-width: 720px; }
  .kpi-grid, .stat-cards { gap: 12px; }
}
