/* 代发工作台原型 — 视觉规范
   背景 #F4F5F7 / 墨色 #16181D / 主色靛蓝 #4F46E5 / 强调琥珀 #D97706 */

:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --ink: #16181d;
  --ink-2: #5b616e;
  --line: #e5e7eb;
  --line-strong: #adb5c2;
  --primary: #4f46e5;
  --primary-soft: #eef2ff;
  --accent: #d97706;
  --accent-soft: #fef3c7;
  --danger: #dc2626;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(22, 24, 29, 0.04);
  --font: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --topbar-bg: #ffffff;
  --panel-head: #fafbfc;
  --input-bg: #ffffff;
  --hover: #f4f5f7;
  --table-head: #f7f8fa;
  --cell-zero: #c5c9d0;
  --marker-idle: #8b939f;
  --modal-mask: rgba(22, 24, 29, 0.45);
}

html.dark {
  --bg: #0f1115;
  --card: #1a1d24;
  --ink: #e8eaed;
  --ink-2: #9aa0ab;
  --line: #2c313a;
  --line-strong: #414a5a;
  --marker-idle: #737d8f;
  --primary: #7c8cff;
  --primary-soft: #252a4a;
  --accent: #f0b429;
  --accent-soft: #3a2e12;
  --danger: #f87171;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  --topbar-bg: #161920;
  --panel-head: #1e222b;
  --input-bg: #14171d;
  --hover: #242833;
  --table-head: #1e222b;
  --cell-zero: #5a6170;
  --modal-mask: rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== 顶栏 ===== */
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: 56px;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 24px;
  padding: 0 24px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 15px; letter-spacing: 0.02em;
  white-space: nowrap;
}
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 700;
}
.role-switch {
  display: flex; background: var(--bg); border-radius: 999px; padding: 3px; gap: 2px;
}
.role-switch button {
  border: 0; background: transparent; border-radius: 999px;
  padding: 6px 14px; color: var(--ink-2); font-size: 13px; font-weight: 500;
}
.role-switch button.active {
  background: var(--card); color: var(--ink);
  box-shadow: var(--shadow); font-weight: 600;
}
.topbar-nav { display: flex; gap: 4px; margin-left: auto; }
.topbar-nav a {
  padding: 6px 12px; border-radius: 8px; color: var(--ink-2); font-weight: 500;
}
.topbar-nav a:hover { background: var(--bg); text-decoration: none; color: var(--ink); }
.topbar-nav a.active {
  background: var(--primary-soft); color: var(--primary); font-weight: 600;
}
.topbar-hint { color: var(--ink-2); font-size: 12px; margin-left: 8px; }

.theme-toggle {
  margin-left: 8px;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 16px;
  line-height: 1;
  display: grid;
  place-items: center;
  color: var(--ink);
}
.theme-toggle:hover {
  background: var(--hover);
  border-color: var(--primary);
}
html.dark .theme-toggle { background: var(--primary-soft); }

/* ===== 主内容 ===== */
.main {
  max-width: 1200px; margin: 0 auto; padding: 28px 24px 64px;
}
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 20px;
}
.page-title { font-size: 20px; font-weight: 600; margin: 0 0 4px; }
.page-sub { color: var(--ink-2); margin: 0; font-size: 13px; }
.page-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--card);
  border-radius: 8px; padding: 7px 14px; font-size: 13px; font-weight: 500;
  color: var(--ink); transition: background 0.12s, border-color 0.12s;
}
.btn:hover { background: var(--bg); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary {
  background: var(--primary); border-color: var(--primary); color: #fff;
}
.btn-primary:hover { background: #4338ca; }
html.dark .btn-primary:hover { background: #8f9cff; } /* 亮蓝紫 hover 提亮，修硬编码浅色深紫反变暗 */
.btn-danger { color: var(--danger); border-color: #fecaca; }
.btn-danger:hover { background: #fef2f2; }
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--bg); color: var(--ink); }

/* ===== 卡片网格 ===== */
.grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.product-card { overflow: hidden; display: flex; flex-direction: column; }
.product-thumb {
  height: 140px; display: flex; align-items: flex-end; padding: 14px;
  color: rgba(255, 255, 255, 0.95); font-weight: 600; font-size: 14px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.product-thumb-square {
  position: relative;
  height: auto;
  aspect-ratio: 1 / 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  padding: 14px;
  overflow: hidden;
}
.product-thumb-square .thumb-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 0;
}
.product-thumb-square.has-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.45) 0%, transparent 45%);
  pointer-events: none;
  z-index: 1;
}
.product-thumb-square .thumb-title,
.product-thumb-square .thumb-cat {
  z-index: 2;
}
.product-thumb-square .thumb-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
  position: relative;
  z-index: 1;
}
.thumb-cat {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  background: rgba(255, 255, 255, 0.92);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  padding: 2px 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.product-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-name { font-weight: 600; font-size: 15px; }
.product-meta { color: var(--ink-2); font-size: 12px; }
.product-price { color: var(--primary); font-weight: 700; font-size: 16px; }
.product-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
}
.product-actions .btn {
  justify-content: center;
}
.product-footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: auto; padding-top: 8px; gap: 8px;
}

/* ===== 网店主 · 方形商品卡 ===== */
.shop-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.shop-card {
  overflow: hidden; display: flex; flex-direction: column;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.shop-card:hover {
  box-shadow: 0 8px 24px rgba(22, 24, 29, 0.08);
  transform: translateY(-1px);
}
.shop-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 14px;
  color: rgba(255, 255, 255, 0.95);
}
/* 轻微布料纹理（纯 CSS，无外链） */
.shop-thumb::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 3px,
      rgba(255, 255, 255, 0.04) 3px,
      rgba(255, 255, 255, 0.04) 4px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 3px,
      rgba(0, 0, 0, 0.03) 3px,
      rgba(0, 0, 0, 0.03) 4px
    );
  pointer-events: none;
}
.shop-thumb .thumb-sku {
  position: relative; z-index: 1;
  font-size: 12px; font-weight: 600; letter-spacing: 0.06em;
  opacity: 0.92;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.shop-thumb .thumb-style {
  position: relative; z-index: 1;
  font-size: 15px; font-weight: 700; line-height: 1.35;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.shop-thumb .thumb-badge {
  position: absolute; top: 12px; left: 12px; z-index: 1;
  background: rgba(255, 255, 255, 0.92);
  color: var(--accent);
  font-size: 11px; font-weight: 600;
  border-radius: 6px; padding: 3px 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.shop-body {
  padding: 12px 14px 14px;
  display: flex; flex-direction: column; gap: 8px; flex: 1;
  background: var(--card);
}
.shop-colors {
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.shop-colors-label {
  font-size: 12px; color: var(--ink-2); flex-shrink: 0;
}
.swatches-lg { gap: 6px; }
.swatches-lg .swatch {
  width: 18px; height: 18px; border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.shop-body .shop-name {
  font-weight: 600; font-size: 14px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 2.8em;
}
.shop-meta { color: var(--ink-2); font-size: 12px; }
.shop-price-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  margin-top: auto;
}
.shop-price {
  color: var(--primary); font-weight: 700; font-size: 18px;
  font-variant-numeric: tabular-nums;
}
.shop-price .unit { font-size: 12px; font-weight: 400; color: var(--ink-2); margin-left: 2px; }
.shop-action { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.shop-action .btn-primary { flex: 1; justify-content: center; }
.swatches { display: flex; gap: 4px; flex-wrap: wrap; }
.swatch {
  width: 12px; height: 12px; border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.08);
}
.merchant-tag {
  display: inline-block; font-size: 11px; color: var(--accent);
  background: var(--accent-soft); border-radius: 4px; padding: 1px 6px; font-weight: 500;
}

/* ===== 表格 ===== */
.table-wrap {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
table.data {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
table.data th {
  text-align: left; font-weight: 500; color: var(--ink-2);
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  background: #fafbfc; white-space: nowrap;
}
table.data td {
  padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle;
}
table.data tr:last-child td { border-bottom: 0; }
table.data tr.clickable { cursor: pointer; }
table.data tr.clickable:hover td { background: #fafbff; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }

/* ===== 表单 ===== */
.form-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 24px; max-width: 720px;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-row.full { grid-column: 1 / -1; }
.form-row label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.form-row input[type="text"],
.form-row input[type="number"],
.form-row textarea,
.form-row select {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px;
  background: var(--card); outline: none; transition: border-color 0.12s, box-shadow 0.12s;
}
.form-row input:focus, .form-row textarea:focus, .form-row select:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}
.form-actions { display: flex; gap: 10px; margin-top: 20px; }
.hint { font-size: 12px; color: var(--ink-2); }

/* 商品表单分区 */
.product-form {
  display: flex; flex-direction: column; gap: 16px;
  max-width: 880px;
}
.form-section {
  padding: 20px 22px 22px;
}
.section-title {
  margin: 0 0 6px; font-size: 15px; font-weight: 600;
}
.section-desc {
  margin: 0 0 14px; font-size: 12px; color: var(--ink-2); line-height: 1.55;
}
.req { color: var(--danger); font-weight: 600; margin-left: 2px; }

/* 网店主商品长条卡 */
.shop-strip-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.shop-strip {
  padding: 10px 12px 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  transition: box-shadow 0.15s ease;
  /* 商户专属色条：--ma 由模板注入色相，同一商户永远同色（与清单一致） */
  box-shadow: inset 4px 0 0 0 hsl(var(--ma, 210), 62%, 52%);
}
.shop-strip:hover {
  box-shadow: inset 4px 0 0 0 hsl(var(--ma, 210), 62%, 52%), 0 2px 10px rgba(22, 24, 29, 0.07);
}
/* 卡片头部：货号徽章 + 名称为主，价格区间靠右 */
.strip-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  position: relative;
}
/* 货号徽章：票据式锚点，底色/文字随商户专属色（与清单货号徽章同款） */
.strip-sku {
  display: inline-flex;
  align-items: center;
  flex: none;
  padding: 2px 9px;
  border-radius: 6px;
  background: hsl(var(--ma, 210), 80%, 93%);
  color: hsl(var(--ma, 210), 62%, 34%);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.3px;
  line-height: 1.4;
  white-space: nowrap;
  flex-shrink: 0;
  /* 防御：个别商品把名称填进了货号字段，徽章最长 16em 截断 */
  max-width: 16em;
  overflow: hidden;
  text-overflow: ellipsis;
}
html.dark .strip-sku {
  background: hsl(var(--ma, 210), 30%, 20%);
  color: hsl(var(--ma, 210), 70%, 74%);
}
/* 名称：第一行整卡正中（50%），胶囊底防压字 */
.strip-name {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  max-width: 44%;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  color: hsl(var(--ma, 210), 62%, 32%);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--card);
  box-shadow: 0 0 0 1px var(--line);
  pointer-events: none;
}
html.dark .strip-name { color: hsl(var(--ma, 210), 70%, 74%); }
/* 材质：第二行居中，与第一行正中的名称上下对齐 */
.strip-meta { position: relative; }
/* 查看详情：第二行最右占位，填了网址变成外链 */
.strip-detail {
  margin-left: auto;
  flex: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
}
a.strip-detail:hover { text-decoration: underline; }
.strip-detail.is-empty { color: var(--ink-3, #b0b5bd); font-weight: 500; cursor: default; }
.strip-meta .strip-mat {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: 56%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: hsl(var(--ma, 210), 50%, 42%);
  font-weight: 600;
}
html.dark .strip-meta .strip-mat { color: hsl(var(--ma, 210), 55%, 66%); }
/* 右侧汇总：价格区间（商户专属色，与卡片色条/货号徽章同源） */
.strip-price-range {
  margin-left: auto;
  flex: none;
  font-size: 13px;
  font-weight: 700;
  color: hsl(var(--ma, 210), 62%, 34%);
  white-space: nowrap;
}
html.dark .strip-price-range { color: hsl(var(--ma, 210), 70%, 74%); }
/* 次要信息行：分类（商户色点+商户色文字）+ 材质（居中，商户色） */
.strip-cat {
  flex-shrink: 0 !important;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  color: hsl(var(--ma, 210), 55%, 38%);
}
.strip-cat::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: hsl(var(--ma, 210), 62%, 52%);
  flex: none;
}
html.dark .strip-cat { color: hsl(var(--ma, 210), 45%, 68%); }
.strip-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 11px;
  color: var(--ink-2);
  overflow: hidden;
}
.strip-meta > span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
}
/* 商户徽章：首字圆徽（与清单商户标题徽章同款） */
.strip-mbadge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: hsl(var(--ma, 210), 62%, 52%);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
/* 第一行行首的徽章 + 商户简称胶囊（原货号位置；货号、名称依次跟随） */
.strip-mbadge-mid {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  max-width: 42%;
  padding: 4px 14px 4px 4px;
  border-radius: 999px;
  background: var(--card);
  box-shadow: 0 0 0 1px var(--line);
  font-size: 15px;
  font-weight: 700;
  color: hsl(var(--ma, 210), 62%, 34%);
  white-space: nowrap;
  overflow: hidden;
  pointer-events: none;
}
html.dark .strip-mbadge-mid {
  color: hsl(var(--ma, 210), 70%, 74%);
}
html.dark .strip-mbadge { background: hsl(var(--ma, 210), 55%, 46%); }
/* 商户列表行内徽章：商品卡同款首字圆徽缩小版（开单订货 .mp-item / 信息维护 .merchant-pick），flex 居中保证与文字对齐 */
.mp-item .mp-name {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.mp-item .mp-name-txt {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.merchant-pick .cell-name {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.merchant-pick .cell-name-txt {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mp-item .strip-mbadge,
.merchant-pick .strip-mbadge {
  width: 20px;
  height: 20px;
  font-size: 11px;
  flex: none;
}
html.dark .strip-cat { color: hsl(var(--ma, 210), 45%, 68%); }
.strip-sep {
  flex: none !important;
  color: var(--ink-3, #b0b5bd);
  overflow: visible !important;
}
.strip-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 0 4px;
  border-top: 1px solid #f0f1f3;
  border-bottom: 1px solid #f0f1f3;
}
.strip-color {
  position: relative;
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 4px;
  width: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
}
/* 该颜色已填数量角标：切到别的颜色时也能看到"这个颜色已经填了几件" */
.strip-color-qty {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: hsl(var(--ma, 210), 62%, 46%);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.22);
  pointer-events: none;
  z-index: 2;
}
html.dark .strip-color-qty { background: hsl(var(--ma, 210), 60%, 58%); color: #0b1220; }
.strip-color:hover { border-color: #c7cad1; }
/* 点击后保留焦点但不出现默认描边；键盘 Tab 过来仍然可见 */
.strip-color:focus { outline: none; }
.strip-color:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.strip-color.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.12);
}
.strip-color-img {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 6px;
  overflow: hidden;
  display: block;
}
.strip-color-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.strip-color-name {
  font-size: 10px;
  color: var(--ink-2);
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.strip-color.active .strip-color-name {
  color: var(--primary);
  font-weight: 700;
}
.strip-sizes {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.strip-sizes-grid {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.strip-size-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
}
.strip-size-label {
  font-size: 10px;
  color: var(--ink-2);
  font-weight: 600;
}
.strip-size-price {
  font-size: 10px;
  color: var(--primary);
  font-weight: 700;
  text-align: center;
}
.strip-size-input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 2px;
  outline: none;
  background: #fff;
  -moz-appearance: textfield;
}
.strip-size-input::-webkit-outer-spin-button,
.strip-size-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.strip-size-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.12);
}
.strip-add {
  flex: 1 1 100%;
  width: 100%;
  flex-shrink: 0;
  height: 34px;
  padding: 0 12px;
  margin-bottom: 1px;
  margin-top: 6px;
  justify-content: center;
  /* 商户专属色：和卡片色条、货号徽章同源（--ma 色相），亮度压低保证白字可读 */
  background: hsl(var(--ma, 210), 60%, 38%);
  border-color: hsl(var(--ma, 210), 60%, 32%);
  color: #fff;
  font-weight: 600;
}
.strip-add:hover {
  background: hsl(var(--ma, 210), 60%, 32%);
  border-color: hsl(var(--ma, 210), 60%, 28%);
}
/* 加货成功闪烁：绿底 ✓ 短暂显示，播完再重建卡片 */
.strip-add-ok {
  background: #16a34a !important;
  border-color: #16a34a !important;
  color: #fff !important;
  animation: add-ok-pop 0.25s ease;
}
@keyframes add-ok-pop {
  0% { transform: scale(0.96); }
  60% { transform: scale(1.03); }
  100% { transform: scale(1); }
}
.strip-size-readonly {
  width: 100%;
  min-width: 0;
  border: 1px dashed var(--line);
  border-radius: 6px;
  text-align: center;
  font-size: 12px;
  color: #c5c9d0;
  padding: 5px 2px;
  background: #fafbfc;
  display: block;
}
.strip-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  height: 34px;
  margin-bottom: 1px;
}
.strip-actions .btn {
  height: 34px;
  padding: 0 12px;
}

/* 规格价格组 */
.price-groups-block {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.pg-size-link {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 10px;
  background: var(--primary-soft);
  border-radius: 8px;
  margin-bottom: 10px;
}
.pg-size-link-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
}
.pg-size-link-value {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.pg-size-link-hint {
  font-size: 11px;
  color: var(--ink-2);
  margin-left: auto;
}
.pg-size-chip {
  display: inline-flex;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
}
.price-group-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.price-group-card.is-active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}
.price-group-card.is-active .pg-preview {
  background: var(--primary-soft);
}
.color-thumb-card.pg-selected {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.color-thumb-card.box-hit {
  outline: 2px dashed var(--primary);
  outline-offset: 2px;
  background: var(--primary-soft);
}
.pg-check {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 3;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.color-marquee {
  position: absolute;
  z-index: 20;
  border: 1.5px solid var(--primary);
  background: rgba(79, 70, 229, 0.12);
  border-radius: 4px;
  pointer-events: none;
}

.pg-size-field {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--card);
}
.pg-size-field.is-selecting {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.pg-size-ops {
  display: flex;
  gap: 6px;
}
.pg-size-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.pg-size-chip {
  display: inline-flex;
  align-items: center;
  background: var(--bg);
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.pg-size-chip.is-on {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--primary);
}
.pg-size-chip:hover {
  border-color: var(--primary);
}
.pg-size-chip.is-draft {
  background: var(--accent-soft);
  color: var(--accent);
}
.size-cell.size-selectable {
  cursor: pointer;
  border-color: var(--accent);
}
.size-cell.size-selectable:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.pg-row {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.pg-row:last-child {
  border-bottom: 0;
}
.pg-size-head {
  flex-wrap: wrap;
}
.pg-size-head .pg-size-list {
  margin: 0;
  flex: 1;
  min-width: 0;
}
.pg-line .pg-size-list {
  flex-wrap: wrap;
  overflow: visible;
}
.pg-size-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  width: 100%;
  overflow: hidden;
}
.pg-line .pg-size-chip {
  flex: 1 1 0;
  min-width: 0;
  justify-content: center;
  padding: 6px 2px;
  font-size: 11px;
  text-align: center;
}
.pg-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.pg-row-price .pg-price-wrap {
  width: 100%;
}
.pg-row-price .pg-price {
  width: 100%;
  text-align: left;
  font-size: 18px;
  padding: 10px 12px;
}

.pg-color-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-head);
}
.pg-lines-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px 56px;
  gap: 6px;
  padding: 8px 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line);
}
.pg-lines-head > span:nth-child(2),
.pg-lines-head > span:nth-child(3) {
  text-align: center;
}
.pg-line-price {
  justify-content: center;
}
.pg-line-price .pg-price {
  text-align: center;
}
.pg-line-ops {
  justify-content: center;
}
.pg-add-line-wrap {
  padding: 10px 14px 12px;
  display: flex;
  justify-content: center;
}
.pg-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px 56px;
  gap: 6px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.pg-line.is-active {
  background: var(--primary-soft);
}
.pg-line:last-child {
  border-bottom: 0;
}
.pg-line-label {
  display: none;
}
.pg-line-price {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.pg-line-price .pg-price {
  width: 100%;
  text-align: center;
  padding: 4px 4px;
  font-size: 13px;
}
.pg-line-ops {
  display: flex;
  gap: 2px;
  justify-content: flex-end;
}
.price-group-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafbfc;
  overflow: hidden;
}
.pg-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.pg-thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: #ddd;
}
.pg-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pg-meta {
  flex: 1;
  min-width: 0;
}
.pg-colors {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pg-range {
  font-size: 12px;
  color: var(--ink-2);
  margin-top: 2px;
}
.pg-price-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.pg-yuan {
  color: var(--primary);
  font-weight: 700;
}
.pg-price {
  width: 88px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 14px;
  font-weight: 700;
  text-align: right;
  outline: none;
  background: var(--input-bg);
}
.pg-price:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}
.pg-editor {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pg-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pg-field-row {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pg-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
}
.pg-color-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pg-color-thumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 8px 4px 4px;
  background: var(--card);
}
.pg-color-thumb-img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  overflow: hidden;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: #999;
}
.pg-color-thumb-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pg-color-thumb-name {
  font-size: 12px;
  font-weight: 600;
  max-width: 6em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pg-field-row select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  background: var(--input-bg);
  outline: none;
}
.pg-sep {
  color: var(--ink-2);
  font-size: 12px;
}

/* ===== 网店主四栏 ===== */
.main.shop-quad {
  max-width: none;
  padding: 6px 12px 8px;
  height: calc(100vh - 56px);
  max-height: calc(100vh - 56px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.shop-quad-grid {
  display: grid;
  /* 分类最窄，商户只占内容所需宽度，商品与清单占主要宽度；纯比例自适应 */
  grid-template-columns: minmax(124px, 0.22fr) minmax(180px, 0.3fr) minmax(0, 1.3fr) minmax(0, 1.24fr);
  gap: 10px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.shop-quad-grid > .merchant-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
/* 网店主：卡片较窄，前四个字段让位，材质列加宽保证显示完整 */
.shop-quad-grid .strip-top {
  grid-template-columns: minmax(0, 0.53fr) minmax(0, 0.81fr) minmax(0, 0.78fr) minmax(0, 1.25fr) minmax(0, 1.64fr);
  column-gap: 4px;
}
/* 网店主：档口行 = 单行三列（简称 | 首拼 | 款数），列轨固定，跨行严格对齐
   首拼列收窄到 32px（实测最长 CYJD≈30px）右移起点，款数列 34px，省出的宽度全部让给名称列保证徽章+简称完整 */
.shop-quad-grid .mp-item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px 34px;
  column-gap: 3px;
  align-items: center;
  width: 100%;
  min-height: 34px;
  padding: 0 8px 0 9px;
  text-align: left;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font: inherit;
  cursor: pointer;
  transition: background 0.12s ease;
}
/* 行间细分隔线（首行不画） */
.shop-quad-grid .mp-item::before {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: 0;
  height: 1px;
  background: var(--line);
}
.shop-quad-grid .mp-item:first-child::before { display: none; }
/* 选中/悬停：左侧竖条 */
.shop-quad-grid .mp-item::after {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  border-radius: 2px;
  background: transparent;
  transition: background 0.12s ease;
}
.shop-quad-grid .mp-item:hover { background: #f4f5f8; }
.shop-quad-grid .mp-item.active { background: var(--primary-soft); }
.shop-quad-grid .mp-item.active::after { background: var(--primary); }
.shop-quad-grid .mp-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shop-quad-grid .mp-item.active .mp-name { color: var(--primary); }
.shop-quad-grid .mp-sub {
  font-size: 11px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shop-quad-grid .mp-qty {
  justify-self: end;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.shop-quad-grid .mp-qty em {
  font-style: normal;
  font-size: 10px;
  font-weight: 400;
  margin-left: 2px;
  opacity: 0.75;
}
.shop-quad-grid .mp-item.active .mp-qty { color: var(--primary); }
.shop-quad-grid .mp-item.is-zero .mp-qty { opacity: 0.55; }
.shop-quad-grid .merchant-list { gap: 0; }
/* 搜索框可随列宽收缩（否则默认 min-width:auto 会撑住列宽） */
.shop-quad-grid .merchant-search input { min-width: 0; }
.cart-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px !important;
}
.cart-empty {
  text-align: center;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.7;
  padding: 36px 12px;
}
.cart-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  flex: 1;
  min-height: 0;
}
/* 商户块不压缩，放不下时出滚动条 */
.cart-list > .cart-merchant { flex-shrink: 0; }
.cart-merchant {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--card);
  /* 商户专属色条：--ma 由模板按商户 id 注入色相 */
  box-shadow: inset 4px 0 0 0 hsl(var(--ma, 210), 62%, 52%);
}
.cart-merchant-title {
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
  background: hsl(var(--ma, 210), 80%, 95%);
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
html.dark .cart-merchant-title { background: hsl(var(--ma, 210), 26%, 16%); }
/* 商户首字徽标 */
.cart-merchant-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: hsl(var(--ma, 210), 62%, 52%);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
html.dark .cart-merchant-badge { background: hsl(var(--ma, 210), 55%, 46%); }
/* 商户标题胶囊：徽章+商户名组成圆角胶囊（与商品卡行首徽章同款效果） */
.cart-merchant-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  max-width: 60%;
  padding: 3px 14px 3px 3px;
  border-radius: 999px;
  background: var(--card);
  box-shadow: 0 0 0 1px var(--line);
  white-space: nowrap;
  overflow: hidden;
}
.cart-merchant-pill .cart-merchant-name {
  font-size: 15px;
  color: hsl(var(--ma, 210), 62%, 34%);
}
html.dark .cart-merchant-pill .cart-merchant-name { color: hsl(var(--ma, 210), 70%, 74%); }
.cart-merchant-name {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
/* 商户汇总徽标：N 款 · M 件 · ¥金额 */
.cart-merchant-stats {
  margin-left: auto;
  flex: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
}
.cart-merchant-stats strong { color: var(--primary); font-weight: 700; }
.cart-merchant-addr {
  font-weight: 500;
  font-size: 11px;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
/* 「合计 N 件」胶囊（发货仓明细 + 清单面板商户卡首行共用一套视觉）
   外层 .wh-mer-total-slot 仅发货仓用：与下方「数量」列同宽的定宽槽位（右移 2px 补偿表格缩进），
   胶囊在槽内居中：1~2 位数正好贴合；3 位及以上按内容自适应加宽，向左右对称溢出，
   胶囊中心始终压在「数量」列中线上，不会随位数增加而偏。清单面板不需要槽位，胶囊直接跟在款数/金额后面。 */
.wh-mer-total-slot {
  margin-left: auto;
  margin-right: 2px;
  flex: none;
  width: 64px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.wh-mer-total,
.cart-mer-total {
  flex: none;
  min-width: 64px;
  height: 30px; /* 与商户标题行左侧胶囊同高（24px 徽章 + 上下各 3px 内边距） */
  padding: 0 9px;
  border-radius: 999px;
  background: var(--card);
  box-shadow: 0 0 0 1px var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
  color: hsl(var(--ma, 210), 62%, 30%);
}
/* 清单面板商户卡：胶囊单独贴在首行最右（无款数/金额文字在前） */
.cart-merchant-title > .cart-mer-total {
  margin-left: auto;
}
.wh-mer-total-k,
.cart-mer-total-k {
  font-size: 13px;
  font-weight: 700;
  opacity: 0.85;
}
.wh-mer-total-u,
.cart-mer-total-u {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.9;
}
html.dark .wh-mer-total,
html.dark .cart-mer-total { color: hsl(var(--ma, 210), 72%, 76%); }
.cart-product-block {
  padding: 10px;
  border-bottom: 1px solid var(--line);
}
.cart-product-block:last-child { border-bottom: 0; }
.cart-product-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.cart-thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: #ddd;
}
.cart-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cart-product-info {
  min-width: 0;
  flex: 1;
}
.cart-product-name {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 清单商品：名称 + 货号·价格 同一行（2026-11-05） */
.cart-product-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.cart-product-line .cart-product-name { flex: 0 1 auto; }
.cart-product-line .cart-sku { margin-top: 0; flex: none; white-space: nowrap; }
.cart-sku {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-top: 2px;
}
.cart-product-amount {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
}
/* 商品行右侧小计：N 件 */
.cart-prod-qty {
  margin-left: auto;
  flex: none;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
  white-space: nowrap;
}
/* 清单/发货仓商品块：货号徽章化（锚点）+ 商户色 --ma 联动（发货仓明细与清单同体系） */
.cart-list .cart-product-block { padding: 12px 10px; }
.cart-list .cart-product-head { margin-bottom: 10px; }
.cart-list .cart-sku,
.wh-cart-list .cart-sku {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 6px;
  background: hsl(var(--ma, 210), 80%, 93%);
  color: hsl(var(--ma, 210), 62%, 34%);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
  line-height: 1.4;
  white-space: nowrap;
}
html.dark .cart-list .cart-sku,
html.dark .wh-cart-list .cart-sku {
  background: hsl(var(--ma, 210), 30%, 20%);
  color: hsl(var(--ma, 210), 70%, 74%);
}
/* 清单 / 发货仓详情卡片头部：款式名称整行 50% 绝对居中（货号徽章居左、件数居右），字号加大 */
.cart-list .cart-product-line,
.wh-cart-list .cart-product-line { position: relative; }
.cart-list .cart-product-name,
.wh-cart-list .cart-product-name {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: 50%;
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: hsl(var(--ma, 210), 62%, 32%);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
html.dark .cart-list .cart-product-name,
html.dark .wh-cart-list .cart-product-name {
  color: hsl(var(--ma, 210), 70%, 74%);
}
/* 清单卡片：合计件数放大 + 与表格「金额」列同宽居中（上下中心线对齐），并用商户专属色 */
.cart-list .size-th-amt { width: 84px; }
.cart-list .cart-prod-qty {
  width: 84px;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  color: hsl(var(--ma, 210), 62%, 32%);
}
html.dark .cart-list .cart-prod-qty { color: hsl(var(--ma, 210), 70%, 74%); }
/* 加入清单后：新加的款闪烁提示（商户色） */
@keyframes cart-flash-kf {
  0%   { background: hsl(var(--ma, 210), 85%, 88%); }
  60%  { background: hsl(var(--ma, 210), 85%, 94%); }
  100% { background: transparent; }
}
html.dark .cart-list .cart-flash,
html.dark .cart-list tr.cart-flash td,
html.dark .cart-list tr.cart-flash th { animation-name: cart-flash-kf-dark; }
@keyframes cart-flash-kf-dark {
  0%   { background: hsl(var(--ma, 210), 40%, 24%); }
  60%  { background: hsl(var(--ma, 210), 32%, 18%); }
  100% { background: transparent; }
}
.cart-list .cart-flash { animation: cart-flash-kf 1.8s ease-out; }
/* 颜色行的闪烁：tr 自身背景会被 td 盖住，让 td 一起闪 */
.cart-list tr.cart-flash td,
.cart-list tr.cart-flash th { animation: cart-flash-kf 1.8s ease-out; }
.size-table-wrap {
  overflow: visible;
  margin: 0;
}
.size-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  table-layout: auto;
}
.size-table th,
.size-table td {
  border: 1px solid var(--line);
  padding: 3px 1px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.size-table th {
  background: var(--table-head);
  font-weight: 700;
  color: var(--ink);
  font-size: 13px;
  padding: 6px 1px;
}
.size-th-color {
  width: 64px;
  font-size: 13px;
}
/* 颜色拆两格后的图片列：只放缩略图 */
.size-th-thumb {
  width: 60px;
  font-size: 13px;
}
.size-thumb-cell {
  text-align: center;
  padding: 4px 2px;
}
.size-thumb-cell .color-thumb-sm { display: block; margin: 0 auto; }
.size-th-total {
  width: 60px;
  color: var(--ink);
}
/* 清单尺码表：价格行 */
.size-table tr.size-price-row th {
  font-size: 12px;
  padding: 3px 1px;
  color: var(--ink-2);
}
.size-price-cell {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  padding: 3px 1px !important;
  background: var(--panel-head);
}
.size-price-cell.size-price-zero {
  color: var(--cell-zero);
  font-weight: 600;
}
/* 清单价格行：商户专属色（--ma 由商户块注入） */
.cart-list tr.size-price-row th,
.cart-list .size-price-cell {
  background: hsl(var(--ma, 210), 60%, 94%);
}
.cart-list .size-price-cell {
  color: hsl(var(--ma, 210), 62%, 32%);
}
.cart-list .size-price-cell.size-price-zero {
  color: var(--cell-zero);
}
html.dark .cart-list tr.size-price-row th,
html.dark .cart-list .size-price-cell {
  background: hsl(var(--ma, 210), 26%, 18%);
}
html.dark .cart-list .size-price-cell {
  color: hsl(var(--ma, 210), 70%, 74%);
}
/* 清单/发货仓商户色贯穿：尺码表头行 + 有货数量文字（--ma 由 .cart-merchant 注入，两页共用） */
.cart-merchant .size-table thead tr:first-child th:not(.size-th-color) {
  color: hsl(var(--ma, 210), 58%, 36%);
}
html.dark .cart-merchant .size-table thead tr:first-child th:not(.size-th-color) {
  color: hsl(var(--ma, 210), 66%, 72%);
}
.cart-merchant .size-cell-edit.size-has .size-qty-input {
  color: hsl(var(--ma, 210), 62%, 30%);
  font-weight: 700;
}
html.dark .cart-merchant .size-cell-edit.size-has .size-qty-input {
  color: hsl(var(--ma, 210), 70%, 74%);
}
/* 汇总行 */
.size-table tr.size-sum-row th {
  font-size: 12px;
  padding: 4px 1px;
  background: #eef0f4;
  text-align: center;
}
.size-sum-row .size-sum-qty {
  font-size: 13px;
  font-weight: 700;
  background: #eef0f4;
}
.size-sum-row .size-sum-amt {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  background: #eef0f4;
  white-space: nowrap;
}
html.dark .size-sum-row th,
html.dark .size-sum-row .size-sum-qty,
html.dark .size-sum-row .size-sum-amt { background: #1e2128; }
.size-color-cell {
  text-align: left !important;
  padding: 3px 4px !important;
  font-weight: 600;
  background: var(--panel-head);
  white-space: nowrap;
}
/* 颜色列按内容自适应（1px 技巧：压到最小内容宽度，多余宽度让给尺码列） */
.size-table th.size-th-color { width: 1px; white-space: nowrap; }
.color-thumb-sm {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 6px;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
  margin-right: 4px;
  background: #ddd;
  flex-shrink: 0;
}
.color-thumb-sm[data-thumb-select] { cursor: pointer; }
.color-thumb-sm.thumb-selected { box-shadow: 0 0 0 2px var(--primary); }
.color-thumb-sm img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.color-label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  vertical-align: middle;
  font-size: 12px;
  line-height: 1.3;
}
.size-zero { color: var(--cell-zero); }
.size-has { font-weight: 700; color: var(--ink); background: #fffef8; }
.size-cell-edit {
  padding: 0 !important;
  background: var(--card);
}
.size-qty-input {
  width: 100%;
  min-width: 0;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 3px;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  background: transparent;
  outline: none;
  padding: 0 1px;
  -moz-appearance: textfield;
}
.size-qty-input::-webkit-outer-spin-button,
.size-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.size-qty-input:hover {
  border-color: var(--line-strong);
  background: var(--input-bg);
}
.size-qty-input:focus {
  border-color: var(--primary);
  background: var(--input-bg);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.12);
  font-weight: 700;
}
.size-zero .size-qty-input { color: var(--cell-zero); font-weight: 500; }
/* 清单数量格：零值=纯空白（点击即输入）；有数量=商户专属色铺底（--ma 由商户块注入） */
.cart-list .size-zero .size-qty-input { color: var(--ink); font-weight: 700; }
.cart-list .size-cell-edit.size-has { background: hsl(var(--ma, 210), 78%, 88%); }
html.dark .cart-list .size-cell-edit.size-has { background: hsl(var(--ma, 210), 30%, 24%); }
.cart-list .size-has .size-qty-input:hover {
  background: transparent;
  border-color: var(--line-strong);
}
.cart-list .size-has .size-qty-input:focus {
  background: transparent;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.18);
}
/* 清单汇总行：商户专属色（--ma 由商户块注入，发货仓/编辑页不受影响） */
.cart-list .size-sum-row th,
.cart-list .size-sum-qty,
.cart-list .size-sum-amt {
  background: hsl(var(--ma, 210), 60%, 91%);
}
.cart-list .size-sum-amt,
.cart-list .size-sum-qty {
  color: hsl(var(--ma, 210), 62%, 30%);
}
html.dark .cart-list .size-sum-row th,
html.dark .cart-list .size-sum-qty,
html.dark .cart-list .size-sum-amt {
  background: hsl(var(--ma, 210), 26%, 20%);
}
html.dark .cart-list .size-sum-amt,
html.dark .cart-list .size-sum-qty {
  color: hsl(var(--ma, 210), 70%, 74%);
}
/* 合计条：顶部为全商户色渐变条（渐变色标由 renderCartPanel 按在场商户注入） */
.cart-summary { padding-top: 12px; }
.size-total-cell {
  font-weight: 700;
  background: var(--primary-soft);
  color: var(--primary);
  position: relative;
  padding: 3px 18px !important;
}
.size-total-num { font-size: 15px; }
/* 金额列 */
.size-total-amt-cell {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  background: var(--panel-head);
  white-space: nowrap;
}
.size-del {
  position: absolute;
  top: 1px;
  right: 1px;
  padding: 0 5px !important;
  min-height: unset;
  height: 20px;
  width: 20px;
  line-height: 1;
  opacity: 0.75;
  font-size: 15px;
  color: var(--danger) !important;
  border-color: transparent !important;
  background: transparent !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.size-del:hover {
  opacity: 1;
  background: #fee2e2 !important;
  border-color: #fecaca !important;
}
.size-craft-row td {
  background: #fffaf0;
  color: var(--accent);
  font-size: 11px;
  text-align: left;
  padding: 3px 6px;
}
html.dark .size-craft-row td { background: var(--accent-soft); }
.cart-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid #f0f1f3;
}
.cart-row:last-child { border-bottom: 0; }
.cart-row-main { min-width: 0; flex: 1; }
.cart-row-name {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cart-row-spec {
  margin-top: 2px;
  font-size: 11px;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.spec-dot {
  width: 10px; height: 10px; border-radius: 50%;
  display: inline-block;
  border: 1px solid rgba(0,0,0,0.08);
}
.cart-crafts {
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 4px;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 600;
}
.cart-row-ops {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.cart-qty { gap: 4px; }
.cart-qty b { min-width: 22px; text-align: center; font-size: 13px; }
.cart-row-price {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
}
.cart-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
  background: #fff;
}
.cart-item-main { min-width: 0; flex: 1; }
.cart-item-name {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cart-item-meta {
  font-size: 11px;
  color: var(--ink-2);
  margin-top: 2px;
}
.cart-item-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  margin-top: 4px;
}
.cart-item-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}
.cart-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  font-size: 13px;
  flex-shrink: 0;
}
.cart-summary strong {
  color: var(--ink);
  font-size: 16px;
}
/* 合计条：总价紧跟合计件数（左侧成组），提交按钮在右侧 */
.cart-sum-info {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
}
.cart-sum-price {
  font-weight: 700;
}

/* ===== 商户页三栏 ===== */
.main.merchant-layout {
  max-width: none;
  padding: 6px 12px 8px;
  height: calc(100vh - 56px);
  max-height: calc(100vh - 56px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.merchant-tri {
  display: grid;
  /* 分类窄，商户资料中，商品列表占主空间；纯比例自适应 */
  grid-template-columns: minmax(0, 0.28fr) minmax(0, 0.78fr) minmax(0, 1.94fr);
  gap: 10px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.merchant-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.col-head {
  padding: 10px 14px;
  min-height: 46px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-head);
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
/* 标题不允许换行、不被搜索框挤压（否则窄列里“商户”竖排两行撑高头部） */
.col-head > span:first-child {
  flex: none;
  white-space: nowrap;
}
.col-body {
  padding: 12px 14px;
  overflow: auto;
  flex: 1;
  min-height: 0;
}
.profile-block {
  text-align: center;
  padding: 8px 0 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}
.profile-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff; font-size: 22px; font-weight: 700;
  display: grid; place-items: center;
  margin: 0 auto 10px;
}
.profile-name {
  font-size: 16px; font-weight: 700;
}
.profile-contact {
  font-size: 12px; color: var(--ink-2); margin-top: 4px;
}
.profile-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  margin-bottom: 16px;
}
.stat {
  text-align: center;
  background: var(--bg);
  border-radius: 8px;
  padding: 8px 4px;
  display: flex; flex-direction: column; gap: 2px;
}
.stat-num { font-size: 16px; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 11px; color: var(--ink-2); }
.profile-switch-label {
  font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px;
}
.merchant-row-head {
  display: grid;
  /* 首拼、名称、地址保证完整显示 */
  grid-template-columns: 1.3fr 0.65fr 0.75fr 1.5fr 0.48fr 0.3fr;
  gap: 6px;
  padding: 0 6px 8px;
  font-size: 11px;
  font-weight: 600;
  color: #9aa0a8;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}
.merchant-row-head span {
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.merchant-list {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 100%;
  overflow: auto;
  flex: 1;
}
.merchant-empty {
  margin-top: 4px;
  padding: 18px 10px;
  text-align: center;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-2);
  border: 1px dashed var(--line);
  border-radius: 10px;
}
.merchant-pick {
  display: grid;
  grid-template-columns: 1.3fr 0.65fr 0.75fr 1.5fr 0.48fr 0.3fr;
  gap: 6px;
  align-items: center;
  justify-items: center;
  width: 100%; text-align: center;
  border: 1px solid var(--line); background: var(--card);
  border-radius: 10px;
  padding: 10px 6px;
  margin-bottom: 0;
  font-size: 13px;
}
.merchant-pick.editing {
  background: #fafbff;
  border-color: var(--primary);
  /* 末列留给 保存 / 取消 / × 三个按钮，给足宽度 */
  grid-template-columns: 1.05fr 0.55fr 0.62fr 1.2fr 0.38fr 1.15fr;
}
.merchant-pick .cell-input {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 4px;
  font-size: 11px;
  min-width: 0;
  width: 100%;
  outline: none;
  background: #fff;
  text-align: center;
}
.merchant-pick .cell-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.12);
}
.merchant-pick:hover { border-color: #c7cad1; }
.merchant-pick.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08);
}
.merchant-pick .cell {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-2);
  font-size: 11px;
  text-align: center;
  display: block;
}
.merchant-pick .cell-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  /* 徽章左对齐：整行首字圆徽贴列左边缘，各行徽章纵向成一条线（名称过长省略号截断） */
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  justify-self: stretch;
  text-align: left;
}
.merchant-pick .cell-name-txt {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.merchant-pick.active .cell-name { color: var(--primary); }
.merchant-pick .cell-pinyin {
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}
.merchant-pick .cell-count {
  text-align: center;
}
.row-actions {
  display: flex;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
  width: 100%;
}
/* 档口编辑行内的删除 ×：只露图标不带文字 */
.row-actions .m-del {
  flex: none;
  width: 26px;
  min-width: 26px;
  height: 26px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  color: var(--danger) !important;
  border-color: transparent !important;
  background: transparent !important;
}
.row-actions .m-del:hover {
  background: #fee2e2 !important;
  border-color: #fca5a5 !important;
}
html.dark .row-actions .m-del:hover {
  background: rgba(239, 68, 68, 0.18) !important;
  border-color: #7f1d1d !important;
}
/* 档口下有商品 → 禁用删除 */
.row-actions .m-del.is-locked {
  color: #b9bec7 !important;
  opacity: 0.6;
  cursor: not-allowed;
}
.row-actions .m-del.is-locked:hover {
  background: transparent !important;
  border-color: transparent !important;
  color: #b9bec7 !important;
}
.merchant-list-body {
  display: flex; flex-direction: column;
  padding: 12px !important;
  overflow: hidden;
}
.merchant-search {
  flex-shrink: 0;
  margin-bottom: 10px;
  position: relative;
  display: flex;
  align-items: center;
}
.product-list-search {
  margin-bottom: 12px;
}
/* 栏目标题行内的紧凑搜索框（商品列表头部），右侧留位给操作按钮 */
.col-head-search {
  margin-bottom: 0;
  margin-left: auto;
  flex: 0 1 190px;
  max-width: 220px;
  min-width: 0;
}
/* 开单订货商品列表首行：儿童款/成人款筛选胶囊（互斥，再点取消） */
.age-filter {
  display: flex;
  gap: 4px;
  flex: none;
  margin-left: 6px;
  margin-right: 8px;
}
.age-chip {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-2);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
}
.age-chip:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}
.age-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
/* 胶囊上的数量角标（儿童款 4 / 成人款 21），等宽数字不抖动 */
.age-chip-n {
  font-variant-numeric: tabular-nums;
  opacity: 0.72;
  margin-left: 1px;
}
/* 商户栏：搜索框与标题同排，空间不足时自动收窄 */
.merchant-profile .col-head-search {
  flex: 1 1 120px;
  min-width: 64px;
  max-width: 190px;
  margin-left: 8px;
}
.col-head-search input {
  height: 26px;
  padding: 2px 8px 2px 26px;
  font-size: 12px;
  line-height: 1;
  border-radius: 7px;
}
.col-head-search .search-icon {
  left: 9px;
}
.merchant-search .search-icon {
  position: absolute;
  left: 10px;
  font-size: 12px;
  line-height: 1;
  pointer-events: none;
  opacity: 0.65;
}
.merchant-search input {
  width: 100%;
  border: 1.5px solid #c7cad1;
  border-radius: 8px;
  padding: 8px 12px 8px 32px;
  font-size: 13px;
  outline: none;
  background: #fff;
  color: var(--ink);
  box-shadow: inset 0 1px 2px rgba(22, 24, 29, 0.03);
}
.merchant-search input::placeholder {
  color: #9aa0a8;
}
.merchant-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}
.merchant-empty {
  text-align: center;
  color: var(--ink-2);
  font-size: 13px;
  padding: 24px 8px;
}
.merchant-edit {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  display: flex; flex-direction: column; gap: 10px;
  flex: 1;
  min-height: 0;
}
.merchant-edit-title {
  font-size: 12px; font-weight: 700; color: var(--ink-2);
}
.merchant-edit .form-row label {
  font-size: 12px; font-weight: 600;
}
.merchant-edit .form-row input {
  border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; outline: none; width: 100%;
  font-size: 13px;
}
.merchant-edit .form-row input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}
.merchant-edit-actions {
  display: flex; gap: 8px; margin-top: 4px;
}

/* 分类列表：固定行高，避免被拉伸 */
.col-body.cat-list {
  padding: 4px 6px;
  display: block;
  flex: none;
  overflow: auto;
  position: relative;
  z-index: 5;
  pointer-events: auto !important;
}
.cat-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  height: 32px;
  min-height: 32px;
  max-height: 32px;
  margin: 0;
  padding: 0 8px 0 11px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 13px;
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
  box-sizing: border-box;
  overflow: hidden;
  white-space: nowrap;
  pointer-events: auto !important;
  position: relative;
  z-index: 1;
}
/* 行首状态标识：未选为浅灰短条，选中变为主题色 */
.cat-line::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 14px;
  margin-top: -7px;
  border-radius: 2px;
  background: var(--marker-idle);
  transition: background 0.12s ease, height 0.12s ease, margin-top 0.12s ease;
}
.cat-line:hover::before { background: var(--ink-2); }
.cat-line.active::before {
  height: 18px;
  margin-top: -9px;
  background: var(--primary);
}
.cat-line:hover { background: var(--bg); }
.cat-line.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}
.cat-line-toggle {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-2);
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
}
.cat-line-toggle:hover {
  background: var(--hover);
  color: var(--primary);
}
.cat-pick-btn {
  flex-shrink: 0;
  border: 1px solid var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  pointer-events: auto !important;
}
.cat-line-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  pointer-events: auto !important;
  cursor: pointer;
}
.cat-line-count {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--ink-2);
  font-weight: 500;
  pointer-events: auto !important;
  cursor: pointer;
}
.cat-line.active .cat-line-count { color: var(--primary); }
.cat-line-child {
  padding-left: 30px;
  font-size: 12px;
  color: var(--ink-2);
}
.cat-line-child .cat-line-name {
  font-weight: 500;
}
.cat-line-child.active {
  color: var(--primary);
}
.cat-line[draggable="true"] {
  cursor: grab;
}
.cat-line.dragging {
  opacity: 0.45;
  cursor: grabbing;
}
.cat-line.drop-target {
  outline: 2px dashed var(--primary);
  outline-offset: -2px;
  background: var(--primary-soft);
}
.cat-shared-hint {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  font-size: 11px;
  color: #9aa0a8;
  text-align: center;
  line-height: 1.5;
}
.cat-manage-list {
  border-top: 1px solid var(--line);
  padding-top: 8px;
  max-height: 260px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cat-manage-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbfc;
  font-size: 13px;
}
.cat-manage-name {
  flex: 1;
  min-width: 0;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cat-manage-count {
  color: var(--ink-2);
  font-size: 12px;
  flex-shrink: 0;
}
.cat-manage-ops {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.merchant-grid {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.cat-badge {
  flex-shrink: 0;
  font-size: 11px; font-weight: 600;
  background: var(--accent-soft); color: var(--accent);
  border-radius: 4px; padding: 1px 6px;
}


/* ===== 三栏满铺商品编辑 ===== */
.main.form-wide {
  max-width: none;
  padding: 8px 12px 56px;
  /* one viewport: topbar 56 + bottom bar ~56 */
  height: calc(100vh - 56px);
  max-height: calc(100vh - 56px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.main.form-wide .form-page-head {
  padding: 2px 8px 8px;
  margin-bottom: 4px;
  flex-shrink: 0;
}
.main.form-wide .form-page-head .page-title {
  font-size: 18px;
}
.main.form-wide .form-page-head .page-sub {
  display: none;
}
.tri-form {
  display: grid;
  /* 纯比例自适应：左侧基本信息最窄，中间颜色图次之，尺码/价格右栏最宽 */
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 10px;
  align-items: stretch;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.tri-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.tri-panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: #fafbfc;
  flex-shrink: 0;
}
.tri-panel-head h2 {
  margin: 0; font-size: 14px; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.tri-panel-head h2::before {
  content: "";
  width: 8px; height: 8px; border-radius: 2px;
  background: var(--primary);
}
.tri-info .tri-panel-head h2::before { background: #16a34a; }
.tri-colors .tri-panel-head h2::before { background: #dc2626; }
.tri-sizes .tri-panel-head h2::before { background: #1d4ed8; }
.tri-count { font-size: 12px; color: var(--ink-2); }
.tri-count strong { color: var(--primary); }
.tri-count-inline {
  font-size: 12px; font-weight: 500; color: var(--ink-2);
  margin-left: 2px;
}
.tri-count-inline strong { color: var(--primary); }
.btn-clear-accent {
  background: #fee2e2;
  border-color: #fecaca;
  color: #b91c1c;
  font-weight: 600;
}
.btn-clear-accent:hover {
  background: #fecaca;
  border-color: #f87171;
}
.tri-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.tri-panel-body {
  padding: 12px 14px;
  overflow: auto;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.info-tip {
  margin-top: auto;
  background: var(--primary-soft);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.5;
  flex-shrink: 0;
}
.info-tip strong {
  display: block; color: var(--primary); margin-bottom: 4px; font-size: 13px;
}
.info-tip p { margin: 0; }

/* 基本信息：标签 + 控件同行 */
.info-line {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
}
.info-line-label {
  flex: 0 0 auto;
  width: auto;
  min-width: 5.5em;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  margin-right: 4px;
}
.info-line-label-lg {
  width: auto;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  margin-right: 2px;
}
.info-line-control {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  background: var(--card);
  outline: none;
  font-size: 15px;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.info-line-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}
.info-line-merchant {
  margin-bottom: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.info-line-merchant .info-line-control {
  font-size: 15px;
  font-weight: 500;
}

/* 颜色图：缩略图网格 + 末尾上传块 */
.tri-colors-body {
  align-items: stretch;
}
.color-thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 10px;
  width: 100%;
}
.upload-tile {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--card);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.upload-tile:hover,
.upload-tile.dragover {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}
.upload-tile-img {
  aspect-ratio: 1 / 1;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
}
.upload-tile-icon {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary);
  display: grid; place-items: center;
  font-size: 18px; font-weight: 600; line-height: 1;
}
.upload-tile-label {
  padding: 7px 8px;
  font-size: 12px; font-weight: 600;
  text-align: center;
  background: #fafbfc;
  color: var(--ink-2);
}
.color-thumb-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--card);
  display: flex;
  flex-direction: column;
}
.color-thumb-img {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--bg);
  overflow: hidden;
  cursor: grab;
}
.color-thumb-card.dragging {
  opacity: 0.45;
}
.color-thumb-card.drop-target {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.color-thumb-card.dragging .color-thumb-img {
  cursor: grabbing;
}
.drag-hint {
  position: absolute; top: 4px; left: 4px;
  width: 22px; height: 22px; border-radius: 6px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink-2);
  font-size: 11px; font-weight: 700;
  display: grid; place-items: center;
  opacity: 0; transition: opacity 0.12s;
  pointer-events: none;
  letter-spacing: -1px;
}
.color-thumb-card:hover .drag-hint { opacity: 1; }
.zoom-hint {
  position: absolute; right: 4px; bottom: 4px;
  width: 22px; height: 22px; border-radius: 6px;
  background: rgba(255, 255, 255, 0.9);
  font-size: 11px; line-height: 22px; text-align: center;
  opacity: 0; transition: opacity 0.12s;
  pointer-events: none;
}
.color-preview-modal .modal-body { gap: 14px; }
.color-preview-stage {
  background: #0f1115;
  border-radius: 10px;
  overflow: auto;
  max-height: min(62vh, 520px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.color-preview-stage img {
  max-width: 100%;
  max-height: min(58vh, 480px);
  transform-origin: center center;
  transition: transform 0.12s ease;
  image-rendering: auto;
}
.color-thumb-img img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.color-thumb-fallback {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255, 255, 255, 0.95);
  font-size: 16px; font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.color-thumb-del {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px; border-radius: 50%;
  border: 0; background: rgba(255, 255, 255, 0.92);
  color: var(--ink-2); font-size: 14px; line-height: 1;
  padding: 0; opacity: 0; transition: opacity 0.12s;
}
.color-thumb-card:hover .color-thumb-del { opacity: 1; }
.color-thumb-del:hover { background: #fee2e2; color: var(--danger); }
.color-thumb-replace {
  position: absolute; top: 4px; left: 4px;
  width: 22px; height: 22px; border-radius: 50%;
  border: 0; background: rgba(255, 255, 255, 0.92);
  color: var(--ink-2); font-size: 13px; line-height: 1;
  padding: 0; opacity: 0; transition: opacity 0.12s;
}
.color-thumb-card:hover .color-thumb-replace { opacity: 1; }
.color-thumb-replace:hover { background: #e0e7ff; color: var(--primary); }
.color-thumb-name {
  border: 0; border-top: 1px solid var(--line);
  padding: 7px 8px;
  font-size: 12px; font-weight: 600;
  text-align: center;
  width: 100%;
  outline: none;
  background: #fafbfc;
}
.color-thumb-name:focus {
  background: var(--card);
  box-shadow: inset 0 0 0 2px var(--primary);
}

.color-img-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 10px;
  margin-top: 4px;
}
.color-img-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--card);
}
.color-img-thumb {
  display: block;
  position: relative;
  aspect-ratio: 1 / 1;
  cursor: pointer;
  overflow: hidden;
  background: var(--bg);
}
.color-img-thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.color-img-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255, 255, 255, 0.92);
  font-size: 12px; font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.color-img-thumb:hover .color-img-placeholder::after {
  content: " 点击上传";
  opacity: 0.95;
}
.color-img-meta {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 8px 8px 10px;
}
.color-img-name {
  flex: 1; min-width: 0;
  font-size: 12px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.color-img-del {
  border: 0; background: transparent; color: var(--ink-2);
  width: 22px; height: 22px; border-radius: 50%;
  line-height: 1; font-size: 14px; padding: 0; flex-shrink: 0;
}
.color-img-del:hover { background: #fee2e2; color: var(--danger); }

.quick-sizes {
  display: none;
}
.size-chips-lg {
  display: none;
}

/* 尺码板：成人/儿童两排 + 框选 */
.size-board {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 28px;
  user-select: none;
}
.size-board-row {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.size-board-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
}
.size-board-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  width: 100%;
}
.size-cell {
  flex: 1 1 0;
  min-width: 0;
  height: 48px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  transition: background 0.1s, border-color 0.1s, color 0.1s;
  white-space: nowrap;
}
.size-cell:hover {
  border-color: #c7cad1;
}
.size-cell.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
/* 尺码拖框选：拖拽选框 + 命中预览 */
.inline-size-board { user-select: none; }
.inline-size-board.is-marquee .size-cell { transition: none; }
.inline-size-board .size-cell.is-hit {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.28);
}
.size-marquee {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  border: 1px dashed var(--primary);
  background: rgba(79, 70, 229, 0.12);
  border-radius: 4px;
}
.size-cell.pg-range {
  box-shadow: inset 0 0 0 2px var(--accent);
  background: var(--accent-soft) !important;
}
.size-cell.box-hit {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}
.size-marquee {
  position: absolute;
  z-index: 5;
  border: 1.5px solid var(--primary);
  background: rgba(79, 70, 229, 0.1);
  border-radius: 4px;
  pointer-events: none;
}
.size-board-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.range-box {
  border: 1px dashed #c7cad1;
  border-radius: 10px;
  padding: 14px;
  background: #fafbfc;
}
.range-title {
  font-size: 13px; font-weight: 600; margin-bottom: 10px;
}
.range-line {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin-bottom: 8px;
}
.range-tag {
  background: var(--primary-soft); color: var(--primary);
  border-radius: 6px; padding: 4px 10px;
  font-size: 13px; font-weight: 600;
}
.range-arrow { color: var(--ink-2); font-size: 11px; }
.img-dot { color: var(--accent); font-size: 11px; }

.main.form-wide .form-actions-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  margin: 0;
  border-radius: 0;
  border-left: 0; border-right: 0; border-bottom: 0;
  padding: 8px 16px;
  min-height: 48px;
}

.batch-box {
  border: 1px dashed #c7cad1; border-radius: 10px;
  background: #fafbfc; padding: 12px 14px;
}
.batch-box-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 13px; font-weight: 600; margin-bottom: 8px;
}
.batch-textarea {
  width: 100%; min-height: 88px; resize: vertical;
  border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; outline: none; line-height: 1.5;
  background: var(--card); font-size: 13px;
}
.batch-textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}
.batch-textarea-sm { min-height: 56px; }
.batch-box-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-top: 10px;
}
.batch-box-actions label.btn { cursor: pointer; margin-bottom: 0; }

.color-list {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px;
}
.color-chip {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); background: var(--card);
  border-radius: 999px; padding: 5px 8px 5px 10px;
  font-size: 13px; font-weight: 500;
}
.color-chip .swatch {
  width: 16px; height: 16px; border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.08); flex-shrink: 0;
}
.color-chip-name { line-height: 1; }
.color-chip button {
  border: 0; background: transparent; color: var(--ink-2);
  width: 20px; height: 20px; border-radius: 50%;
  line-height: 1; font-size: 14px; padding: 0;
}
.color-chip button:hover { background: #fee2e2; color: var(--danger); }

.size-chips {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px;
}
.size-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--primary-soft); color: var(--primary);
  border-radius: 6px; padding: 5px 6px 5px 10px;
  font-size: 13px; font-weight: 600;
}
.size-chip button {
  border: 0; background: transparent; color: inherit;
  width: 18px; height: 18px; border-radius: 50%; line-height: 1;
  font-size: 13px; padding: 0; opacity: 0.7;
}
.size-chip button:hover { background: rgba(79, 70, 229, 0.12); opacity: 1; }

.form-actions-bar {
  position: sticky; bottom: 12px;
  background: rgba(244, 245, 247, 0.92);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 16px;
  margin: 4px 0 24px;
  justify-content: flex-end;
}

/* 标签输入 */
.tag-editor {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px;
  display: flex; flex-wrap: wrap; gap: 6px; min-height: 40px; align-items: center;
  background: var(--card);
}
.tag-editor:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12); }
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--primary-soft); color: var(--primary);
  border-radius: 6px; padding: 3px 8px; font-size: 12px; font-weight: 500;
}
.tag.amber { background: var(--accent-soft); color: var(--accent); }
.tag button {
  border: 0; background: transparent; color: inherit; padding: 0;
  font-size: 14px; line-height: 1; opacity: 0.7;
}
.tag button:hover { opacity: 1; }
.tag-editor input {
  border: 0; outline: none; flex: 1; min-width: 100px; padding: 2px 4px; background: transparent;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line); background: var(--card);
  border-radius: 999px; padding: 5px 12px; font-size: 12px; color: var(--ink-2);
}
.chip:hover { border-color: #c7cad1; color: var(--ink); }
.chip.active {
  border-color: var(--accent); background: var(--accent-soft);
  color: var(--accent); font-weight: 600;
}
.chip.primary.active {
  border-color: var(--primary); background: var(--primary-soft); color: var(--primary);
}

/* ===== 布局：逛商户 ===== */
.browse-layout {
  display: grid; grid-template-columns: 240px 1fr; gap: 16px; align-items: start;
}
.merchant-panel { padding: 8px; }
.merchant-item {
  display: block; width: 100%; text-align: left;
  border: 0; background: transparent; border-radius: 8px;
  padding: 12px 14px; margin-bottom: 2px;
}
.merchant-item:hover { background: var(--bg); }
.merchant-item.active { background: var(--primary-soft); }
.merchant-item .name { font-weight: 600; font-size: 14px; }
.merchant-item.active .name { color: var(--primary); }
.merchant-item .contact { font-size: 12px; color: var(--ink-2); margin-top: 2px; }

/* ===== Modal ===== */
.modal-mask {
  position: fixed; inset: 0; background: var(--modal-mask);
  display: flex; align-items: center; justify-content: center; z-index: 100;
  padding: 24px;
}
.modal {
  background: var(--card); border-radius: 14px; width: 100%; max-width: 520px;
  max-height: 90vh; overflow: auto; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
}
.modal.wide { max-width: 680px; }
.modal-head {
  padding: 18px 22px 12px; display: flex; justify-content: space-between; align-items: flex-start;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 600; }
.modal-head p { margin: 4px 0 0; color: var(--ink-2); font-size: 12px; }
.modal-close {
  border: 0; background: transparent; font-size: 20px; color: var(--ink-2);
  line-height: 1; padding: 0 4px;
}
.modal-body { padding: 18px 22px; display: flex; flex-direction: column; gap: 16px; }
.modal-foot {
  padding: 14px 22px 18px; display: flex; justify-content: flex-end; gap: 10px;
  border-top: 1px solid var(--line);
}
.spec-group .label {
  font-size: 13px; font-weight: 600; margin-bottom: 8px; display: flex; align-items: center; gap: 8px;
}
.spec-group .label .selected { color: var(--primary); font-weight: 500; }

/* ===== 状态徽标 ===== */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600;
}
.badge-待拿货 { background: #dcfce7; color: #15803d; }
.badge-已标记 { background: #dbeafe; color: #1d4ed8; }
.badge-已配货 { background: #ccfbf1; color: #0f766e; }
.badge-已打包 { background: #ede9fe; color: #6d28d9; }
.badge-已发货 { background: #dcfce7; color: #15803d; }

/* ===== 详情页 ===== */
.detail-layout { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; }
.panel { padding: 18px 20px; }
.panel h3 {
  margin: 0 0 12px; font-size: 14px; font-weight: 600;
  display: flex; align-items: center; justify-content: space-between;
}
.kv { display: grid; grid-template-columns: 80px 1fr; gap: 8px 12px; font-size: 13px; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.note-area {
  width: 100%; min-height: 90px; resize: vertical;
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
  outline: none;
}
.note-area:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12); }
.print-log { list-style: none; margin: 0; padding: 0; font-size: 12px; color: var(--ink-2); }
.print-log li { padding: 4px 0; border-bottom: 1px dashed var(--line); }
.print-log li:last-child { border-bottom: 0; }

/* 打印预览（配货单） */
.pick-slip {
  border: 1px solid var(--line); border-radius: 8px; padding: 20px;
  font-size: 13px; background: #fff;
}
.pick-slip .slip-title {
  text-align: center; font-size: 18px; font-weight: 700; letter-spacing: 0.2em; margin-bottom: 4px;
}
.pick-slip .slip-meta {
  text-align: center; color: var(--ink-2); font-size: 12px; margin-bottom: 16px;
}
.pick-slip table { width: 100%; border-collapse: collapse; }
.pick-slip th, .pick-slip td {
  border: 1px solid #d1d5db; padding: 8px 10px; text-align: left; font-size: 12px;
}
.pick-slip th { background: #f9fafb; font-weight: 600; }
.pick-slip .sign {
  margin-top: 24px; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px;
  color: var(--ink-2); font-size: 12px;
}
.pick-slip .sign span { border-top: 1px solid #d1d5db; padding-top: 8px; display: block; }

/* ===== 空状态 / 汇总条 ===== */
.empty {
  text-align: center; padding: 56px 24px; color: var(--ink-2);
  background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius);
}
.empty .icon { font-size: 28px; margin-bottom: 8px; }
.summary-bar {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 18px; margin-top: 16px; box-shadow: var(--shadow);
}
.summary-bar .total { font-size: 15px; }
.summary-bar .total strong { color: var(--primary); font-size: 20px; margin-left: 6px; }

/* toast */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  background: #16181d; color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 13px; z-index: 200; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  animation: toast-in 0.2s ease;
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.muted { color: var(--ink-2); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.flex { display: flex; align-items: center; gap: 8px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* 尺码行：标签与尺码按钮同一行、同一水平线（2026-11-05） */
.info-size-row {
  align-items: center;
}
.info-size-row .info-line-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-top: 0;
}
.inline-size-board {
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  /* 放不下时换行铺排，不出横向滚动条 */
}
.inline-size-board .size-cell {
  flex: 0 0 auto;
}
.inline-size-board .size-cell {
  min-width: 42px;
}
/* 快递报价页（2026-11-09 新增栏目）：左右两列 */
/* 寄件方式横排三等分胶囊（在报价区上方） */
.ex-type-bar {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}
.ex-type {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 100%;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  cursor: pointer;
  font: inherit;
  color: var(--ink);
  text-align: center;
}
.ex-type.active {
  border-color: #4f46e5;
  box-shadow: 0 0 0 1px #4f46e5 inset;
  background: #eef2ff;
}
.ex-type-name { font-weight: 600; font-size: 14px; line-height: 1.3; }
.ex-type-sub { font-size: 11.5px; color: var(--ink-2, #5b616e); line-height: 1.3; }
.ex-type.active .ex-type-sub { color: #4f46e5; }

/* 报价表维护：三列三等分 */
/* 第三列拆成左右两张卡片：左边地区报价，右边预留 */
.ex-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  min-height: 0;
}
.ex-split > .card { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
/* 左卡片本身已是半宽，内部胶囊区铺满即可，虚线也随之铺满 */
.ex-split .ex-rg-chips { max-width: 100%; }
.ex-split .ex-rg-pg .ex-rg-chips { max-width: 100%; }
.ex-split .ex-rg::after { width: 100%; }
.ex-cols-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-weight: 600;
}
.ex-cols {
  display: grid;
  /* 三列按 1 : 1 : 8 分配，前两列保底 120px 防止被压扁 */
  grid-template-columns: minmax(120px, 1fr) minmax(120px, 1fr) minmax(0, 8fr);
  gap: 10px;
  height: calc(100vh - 148px);
  min-height: 380px;
}
/* 前两列（快递公司 / 客户类型）窄列：压缩内边距与字号 */
.ex-cols > .card:nth-child(-n + 2) .col-head {
  padding: 8px 10px;
  min-height: 42px;
  font-size: 13px;
}
.ex-cols > .card:nth-child(-n + 2) .col-body { padding: 8px; }
.ex-cols > .card:nth-child(-n + 2) .ex-item {
  padding: 8px 9px;
  border-radius: 8px;
}
.ex-cols > .card:nth-child(-n + 2) .ex-item + .ex-item { margin-top: 6px; }
.ex-cols > .card:nth-child(-n + 2) .ex-item-name {
  font-size: 13px;
  line-height: 1.25;
  word-break: break-word;
}
.ex-cols > .card:nth-child(-n + 2) .ex-item-sub {
  font-size: 11px;
  line-height: 1.3;
  word-break: break-word;
}
.ex-cols > .card { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.ex-cols .col-body { overflow-y: auto; }
.ex-col-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px 84px;
  gap: 6px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line);
}
.ex-col-row:last-child { border-bottom: 0; }
.ex-col-row .cell-input { width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font-size: 13px; background: var(--card); color: var(--ink); }
.ex-name-wrap { display: flex; gap: 4px; align-items: center; min-width: 0; }
.ex-name-wrap .cell-input { flex: 1; min-width: 0; }
.ex-col-row .num-input { text-align: right; }
.ex-col-row .num-input:focus { border-color: #4f46e5; outline: none; }
.ex-col-row .ex-row-del { padding: 4px 8px; flex-shrink: 0; }
/* 地区面板：按分组流式铺开的地区胶囊（点选 / 按住拖框选） */
.ex-region-board { position: relative; }
.ex-region-board.is-marquee { user-select: none; }
.ex-rg {
  --ex-label-w: 64px;
  --ex-label-gap: 5px;
  position: relative;
  display: grid;
  grid-template-columns: var(--ex-label-w) minmax(0, 1fr);
  gap: var(--ex-label-gap);
  align-items: start;
  padding: 4px 0;
}
/* 分组之间的虚线只画到中线，与胶囊区右缘对齐 */
.ex-rg::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 50%;
  border-bottom: 1px dashed var(--line);
  pointer-events: none;
}
.ex-rg:last-child::after { display: none; }
.ex-rg-label {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  text-align: left;
  padding-top: 7px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 胶囊区最多占整行的一半，右半边留给后续内容 */
.ex-rg-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: calc(50% - var(--ex-label-w) / 2 - var(--ex-label-gap) / 2);
}
/* 价格组区域：没有左侧标签，卡片从行首开始，仍限宽半行 */
.ex-rg-pg { display: block; }
.ex-rg-pg .ex-rg-chips { max-width: 50%; }
.ex-region-chip {
  position: relative;
  min-width: 64px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}
.ex-region-chip:hover { border-color: #a5b4fc; }
.ex-region-chip.active {
  border-color: #4f46e5;
  background: #eef2ff;
  color: #4338ca;
  font-weight: 600;
}
.ex-region-chip.is-hit {
  border-color: #4f46e5;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.25);
}
/* 非编辑状态：地区不可选，光标与悬停都不做「可点」暗示 */
.ex-region-board.is-locked .ex-region-chip { cursor: default; }
.ex-region-board.is-locked .ex-region-chip:hover { border-color: var(--pgc, var(--line)); }
/* 已属于其他价格组的地区：不可再选（仅编辑状态淡化，锁定态保持原色） */
.ex-region-chip.is-taken { cursor: not-allowed; }
.ex-region-board:not(.is-locked) .ex-region-chip.is-taken:not(.active) { opacity: 0.62; }
.ex-region-chip.is-taken:hover { border-color: var(--pgc, var(--line)); }
/* 价格组卡片列表：一组一张卡，可展开看地区 */
.ex-pg-list { flex-direction: column; flex-wrap: nowrap; align-items: stretch; align-content: flex-start; gap: 6px; width: 100%; }
.ex-pg-card {
  border: 1px solid #dfe3ef;
  border-radius: 10px;
  background: var(--card);
  overflow: hidden;
}
.ex-pg-card.has-price { border-color: #bfe6cd; }
.ex-pg-card.is-editing { border-color: #818cf8; }
/* 拖动排序 */
.ex-pg-card[draggable="true"] { cursor: grab; }
.ex-pg-card[draggable="true"]:active { cursor: grabbing; }
.ex-pg-card.is-dragging { opacity: 0.45; }
.ex-pg-card.drop-before { box-shadow: 0 -3px 0 0 #6366f1; }
.ex-pg-card.drop-after { box-shadow: 0 3px 0 0 #6366f1; }
.ex-pg-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px;
}
.ex-pg-card-name {
  width: 160px;
  font-size: 14px;
  font-weight: 700;
  color: #383d47;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ex-pg-card-cnt {
  font-size: 12px;
  color: #9aa0ac;
  white-space: nowrap;
}
/* 保存态：编辑按钮推到首行最右；价格用与编辑态一致的 5 等分只读单元格 */
.ex-pg-card-head .ex-pg-card-edit { margin-left: auto; }
.ex-pg-prices.is-view { padding: 0 8px 8px; }
.ex-pg-prices.is-view .ex-pg-cell { cursor: default; }
.ex-pg-prices.is-view .ex-pg-cell b {
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbfe;
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--pgink, #374151);
}
/* 价格组卡片内所有文字统一用组专属色 */
.ex-pg-card[class*=" pg-c"] .ex-pg-card-name,
.ex-pg-card[class*=" pg-c"] .ex-pg-card-cnt,
.ex-pg-card[class*=" pg-c"] .ex-pg-card-edit,
.ex-pg-card[class*=" pg-c"] .ex-pg-card-del,
.ex-pg-card[class*=" pg-c"] .ex-pg-cell > span,
.ex-pg-card[class*=" pg-c"] .ex-pg-cell > span em,
.ex-pg-card[class*=" pg-c"] .ex-pg-cell b,
.ex-pg-card[class*=" pg-c"] .ex-pg-edit-name,
.ex-pg-card[class*=" pg-c"] .ex-pg-cell input { color: var(--pgink); }
.ex-pg-card-del {
  border: 0;
  background: none;
  padding: 0 2px;
  font-size: 14px;
  line-height: 1;
  color: #c2c6cf;
  cursor: pointer;
}
.ex-pg-card-del:hover { color: #dc2626; }
.ex-pg-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 8px 6px;
}
/* 头部内的编辑按钮：小尺寸，跟地区数、× 同一行 */
.ex-pg-card-edit { height: 22px; padding: 0 9px; font-size: 12px; line-height: 1; }
/* 编辑态：组名/地区数一行，五个价格档+保存/取消全部一行不换行 */
/* 编辑态：行1 组名+地区数+右侧按钮；行2 五个价格档均匀分布铺满整行 */
.ex-pg-card-head.is-editing { flex-wrap: wrap; row-gap: 7px; gap: 5px; justify-content: space-between; }
.ex-pg-card-head.is-editing .btn { height: 26px; padding: 0 8px; font-size: 12px; }
.ex-pg-card-head.is-editing #ex-pg-save { margin-left: auto; }
.ex-pg-break { flex-basis: 100%; height: 0; }
.ex-pg-edit-name {
  width: 160px;
  height: 28px;
  line-height: 26px;
  padding: 0 8px;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  color: #383d47;
  background: var(--card);
}
.ex-pg-edit-name:focus { outline: none; border-color: #4f46e5; }
/* 行2：五个价格档 5 等分网格，档名居中在上、输入框占满格宽 */
.ex-pg-prices {
  flex-basis: 100%;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.ex-pg-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: text;
}
.ex-pg-cell > span {
  font-size: 14px;
  font-weight: 700;
  color: #374151;
  text-align: center;
  white-space: nowrap;
  line-height: 1.2;
}
.ex-pg-cell > span em {
  font-style: normal;
  font-size: 13px;
  font-weight: 700;
  color: #8a90a0;
}
.ex-pg-cell input {
  width: 100%;
  box-sizing: border-box;
  height: 30px;
  line-height: 28px;
  padding: 0 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  text-align: center;
  color: var(--ink);
  background: var(--card);
}
.ex-pg-cell input:focus { outline: none; border-color: #4f46e5; }
.ex-pg-add {
  height: 28px;
  padding: 0 12px;
  border: 1px dashed #b9bdc7;
  border-radius: 999px;
  background: var(--card);
  font: inherit;
  font-size: 12px;
  color: #5b6270;
  cursor: pointer;
}
.ex-pg-add:hover { border-color: #4f46e5; color: #4338ca; }
/* 编辑中的价格组卡片：组名 + 首重/续重 + 保存/取消，成员一览 */
.ex-pg-editor {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid #c7d2fe;
  border-radius: 10px;
  background: #fafbff;
}
.ex-pg-editor-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ex-pg-editor-row .ex-pg-name-input {
  flex: 1 1 120px;
  min-width: 90px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  background: var(--card);
}
.ex-pg-editor-row .ex-pg-name-input:focus { border-color: #4f46e5; outline: none; }
.ex-pg-field {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #6b7280;
  white-space: nowrap;
}
.ex-pg-field input {
  width: 58px;
  height: 28px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  text-align: right;
  color: var(--ink);
  background: var(--card);
}
.ex-pg-field input:focus { border-color: #4f46e5; outline: none; }
/* 价格组成员：等宽胶囊，按行铺满卡片宽度 */
.ex-pg-members {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 6px;
}
.ex-pg-members .hint { grid-column: 1 / -1; }
.ex-pg-member {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid #dad7f7;
  border-radius: 999px;
  background: #f4f4ff;
  font-size: 12px;
  line-height: 1.2;
  color: #4338ca;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 编辑态成员：右上角红叉，点击从组里移除该地区 */
.ex-pg-member-edit { position: relative; overflow: visible; padding-right: 14px; }
.ex-pg-member-x {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 15px;
  height: 15px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #fca5a5;
  border-radius: 50%;
  background: #fff;
  color: #dc2626;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
}
.ex-pg-member-x:hover { background: #dc2626; border-color: #dc2626; color: #fff; }
/* 价格组配色：每组一色，卡片/色点/成员胶囊/上方地区胶囊共用 */
.pg-c1 { --pgc: #6366f1; --pgbg: #eef2ff; --pgink: #3730a3; }
.pg-c2 { --pgc: #0ea5e9; --pgbg: #e0f2fe; --pgink: #075985; }
.pg-c3 { --pgc: #10b981; --pgbg: #d1fae5; --pgink: #065f46; }
.pg-c4 { --pgc: #f59e0b; --pgbg: #fef3c7; --pgink: #92400e; }
.pg-c5 { --pgc: #ec4899; --pgbg: #fce7f3; --pgink: #9d174d; }
.pg-c6 { --pgc: #14b8a6; --pgbg: #ccfbf1; --pgink: #115e59; }
.pg-c7 { --pgc: #ef4444; --pgbg: #fee2e2; --pgink: #991b1b; }
.pg-c8 { --pgc: #84cc16; --pgbg: #ecfccb; --pgink: #3f6212; }
.ex-pg-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pgc, #c7cbd6);
  flex: 0 0 auto;
}
/* 组内的地区胶囊：用组色填充（覆盖默认选中态的紫色） */
.ex-region-chip[class*=" pg-c"],
.ex-pg-member[class*=" pg-c"] {
  background: var(--pgbg);
  border-color: var(--pgc);
  color: var(--pgink);
  font-weight: 600;
}
.ex-region-chip[class*=" pg-c"].active { box-shadow: inset 0 0 0 2px var(--pgc); }
.ex-region-chip[class*=" pg-c"].is-hit { box-shadow: inset 0 0 0 2px var(--pgc), 0 0 0 3px var(--pgbg); }
/* 卡片：左侧一条组色，不占布局 */
.ex-pg-card[class*=" pg-c"] { box-shadow: inset 3px 0 0 var(--pgc); }
.ex-pg-card[class*=" pg-c"] .ex-pg-card-head { padding-left: 10px; }
.ex-pg-chip.is-editing { border-color: #4f46e5; background: #eef2ff; }
/* 右半卡：价格组表格视图（深蓝表头 + 按价格深浅着色，参考报价单） */
.ex-pgt-wrap { margin: -2px 0 0; }
.ex-pgt { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.ex-pgt thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #4472c4;
  color: #fff;
  font-weight: 600;
  font-size: 11px;
  line-height: 1.25;
  padding: 6px 6px;
  text-align: center;
  border-right: 1px solid rgba(255, 255, 255, 0.35);
  border-bottom: 1px solid #3a62a8;
}
.ex-pgt thead th:last-child { border-right: 0; }
.ex-pgt td { border-bottom: 1px solid #d4daeb; border-right: 1px solid #fff; padding: 6px 10px; text-align: center; }
/* 最右侧格子的右边线也用组色（与左侧组名色条呼应） */
.ex-pgt tbody tr[class*=" pg-c"] td:last-child { border-right: 3px solid var(--pgc, #6366f1); }
.ex-pgt-prov { background: #f2f5fb; font-weight: 600; color: #2b3245; }
/* 省份列与价格列都用所属价格组的专属色（与组卡/成员胶囊同色），列间以白线分隔 */
.ex-pgt tr[class*=" pg-c"] .ex-pgt-prov { background: var(--pgbg); color: var(--pgink); }
.ex-pgt tr[class*=" pg-c"] .ex-pgt-num { background: var(--pgbg); color: var(--pgink); font-weight: 600; font-variant-numeric: tabular-nums; }
.ex-pgt-group {
  width: 132px;
  min-width: 132px;
  background: var(--pgbg, #f4f4ff);
  color: var(--pgink, #3730a3);
  font-weight: 700;
  text-align: left;
  vertical-align: middle;
  padding: 6px 10px;
  border-left: 3px solid var(--pgc, #6366f1);
  border-right: 1px solid var(--pgc, #6366f1);
  border-bottom: 1px solid var(--pgc, #6366f1);
}
.ex-pgt-name { font-size: 13px; }
.ex-pgt-cnt { font-weight: 500; font-size: 11px; margin-top: 3px; opacity: 0.72; white-space: nowrap; }
/* 表格下方说明条款 */
.ex-pgt-notes {
  margin: 10px 12px 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: #4b5563;
  line-height: 1.7;
}
.ex-pgt-notes-title { font-size: 13px; font-weight: 700; color: #374151; margin-bottom: 4px; display: flex; align-items: center; justify-content: space-between; }
.ex-notes-edit {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  background: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 10px;
  cursor: pointer;
}
.ex-notes-edit:hover { color: #4f46e5; border-color: #a5b4fc; }
.ex-pgt-notes.is-editing .ex-pgt-notes-title { margin-bottom: 6px; }
.ex-pgt-notes-input {
  width: 100%;
  box-sizing: border-box;
  min-height: 150px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--card);
  resize: vertical;
}
.ex-pgt-notes-input:focus { outline: none; border-color: #4f46e5; }
.ex-pgt-notes-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.ex-pgt-notes-item { display: flex; gap: 6px; margin-top: 2px; }
.ex-pgt-notes-item b { color: #6b7280; font-weight: 700; flex-shrink: 0; }
.ex-pgt-notes-item span { min-width: 0; }
/* 底部批量价格条 */
.ex-batch-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  background: var(--panel-head, #f7f8fc);
}
.ex-batch-count { font-size: 13px; color: var(--ink-2, #5b616e); }
.ex-batch-count b { color: #4f46e5; font-size: 15px; }
.ex-batch-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-2, #5b616e);
}
.ex-batch-field input {
  width: 90px;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  line-height: 20px;
  font-size: 13px;
  background: var(--card);
  color: var(--ink);
  text-align: center;
}
.ex-batch-field input:focus { border-color: #4f46e5; outline: none; }
.ex-table { width: 100%; }
.ex-table .cell-input { width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font-size: 13px; background: var(--card); color: var(--ink); }
.ex-table .num-input { text-align: right; }
.ex-table .num-input:focus { border-color: #4f46e5; outline: none; }
.ex-th-group { background: #f7f8fc; }

/* 快递报价页：压缩上下留白、放开宽度限制，尽量利用空间 */
.main.ex-page {
  max-width: 100%;
  padding-top: 12px;
  padding-left: 16px;
  padding-right: 16px;
  padding-bottom: 16px;
}

.ex-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.42fr) minmax(0, 1.58fr);
  gap: 10px;
  height: calc(100vh - 148px);
  min-height: 420px;
}
.ex-grid > .card { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.ex-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  cursor: pointer;
  font: inherit;
  color: var(--ink);
}
.ex-item + .ex-item { margin-top: 8px; }
.ex-item.active { border-color: #4f46e5; box-shadow: 0 0 0 1px #4f46e5 inset; }
.ex-item-name { font-weight: 600; font-size: 14px; }
.ex-item-sub { font-size: 12px; color: var(--ink-2, #5b616e); }
.ex-form { max-width: 480px; display: flex; flex-direction: column; gap: 12px; }
.ex-form label { font-size: 12px; color: var(--sub, #5b616e); display: block; margin-bottom: 4px; }
.ex-form input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  background: var(--card);
  color: var(--ink);
}
.ex-form input:focus { outline: none; border-color: #4f46e5; }

/* 成人尺码固定两行：子行结构，行内胶囊平分宽度，第一行 XS~5XL、第二行 6XL~10XL */
.inline-size-board .size-sub-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  flex-basis: 100%;
  min-width: 0;
}
.inline-size-board .size-sub-row .size-cell {
  /* 两行统一格宽：以第一行 9 格为基准均分整行宽 */
  flex: 0 0 auto;
  width: calc((100% - 48px) / 9);
  min-width: 0;
  padding-left: 2px;
  padding-right: 2px;
}

/* 儿童码格宽与成人码1统一：按 9 列网格均分 */
.inline-size-board[data-size-group="kids"] .size-cell {
  flex: 0 0 auto;
  width: calc((100% - 48px) / 9);
  min-width: 0;
  padding-left: 2px;
  padding-right: 2px;
}

.tri-prices .tri-panel-body {
  gap: 10px;
}

/* 右栏：尺码棋盘与规格价格分组隔（2026-11-05 布局调整） */
.tri-sizes .price-groups-block {
  border-top: 1px solid var(--line);
  margin-top: 10px;
  padding-top: 10px;
}

/* 价格组自定义组名（2026-11-05） */
.pg-name-row { padding: 10px 14px 0; }
.pg-name-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
  background: var(--card);
  color: var(--ink);
}
.pg-name-input:focus { outline: none; border-color: #4f46e5; }

/* 价格组内尺码板：点选 + 框选（2026-11-05） */
.pg-size-pick { position: relative; padding: 2px 0; }
.pg-pick-row { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 6px; }
.pg-pick-label { flex: none; width: 46px; font-size: 12px; color: var(--sub, #5b616e); padding-top: 5px; }
.pg-pick-chips { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
.pg-size-pick .size-cell { min-width: 34px; padding: 3px 8px; font-size: 12px; cursor: pointer; }
.pg-size-pick .size-cell.box-hit { background: #eef2ff; border-color: #4f46e5; }
.pg-pick-marquee {
  position: absolute;
  background: rgba(79, 70, 229, 0.12);
  border: 1px solid rgba(79, 70, 229, 0.45);
  pointer-events: none;
  z-index: 5;
}

/* 修复 5XL/6XL 换行拉伸：尺码按钮改固定紧凑尺寸（2026-11-05） */
.inline-size-board {
  gap: 4px;
}
.inline-size-board .size-cell,
.pg-size-pick .size-cell {
  flex: 0 0 auto;
  height: 30px;
  min-width: 32px;
  padding: 0 6px;
  font-size: 12px;
}
.pg-pick-chips { gap: 4px; }
.pg-pick-label { width: 40px; }

/* 成人尺码分两行：XS-5XL / 6XL-10XL（2026-11-05） */
.inline-size-board.is-two-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  /* 两行铺满即可，不再横向滚动 */
  overflow: visible;
  padding-bottom: 0;
  flex: 1 1 auto;
  min-width: 0;
}
.inline-size-board.is-two-row .size-board-line {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 4px;
}
/* 均码单码行：与成人码同一套列宽，左对齐 */
.inline-size-board.is-single {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 4px;
  overflow: visible;
  padding-bottom: 0;
  flex: 1 1 auto;
  min-width: 0;
}
.inline-size-board.is-two-row .size-cell,
.inline-size-board.is-single .size-cell {
  min-width: 0;
  height: 28px;
  padding: 0;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  letter-spacing: -0.2px;
}

/* 商户卡片：尺码+价格表格（2026-11-05） */
.strip-table-wrap {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
}
.strip-price-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 11px;
}
.strip-price-table th,
.strip-price-table td {
  border: 1px solid var(--line);
  text-align: center;
  padding: 4px 2px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.strip-price-table th {
  width: 44px;
  background: var(--bg);
  color: var(--ink-2);
}
.strip-price-table td.has-price {
  color: hsl(var(--ma, 210), 62%, 34%);
  font-weight: 700;
}
html.dark .strip-price-table td.has-price { color: hsl(var(--ma, 210), 70%, 74%); }
/* 尺码行：商户专属色（与价格/库存同源） */
.strip-price-table tr:first-child td {
  color: hsl(var(--ma, 210), 58%, 36%);
}
html.dark .strip-price-table tr:first-child td { color: hsl(var(--ma, 210), 66%, 72%); }
/* 库存行：数量随商户专属色，零值空白可直接输入，失焦即存 */
.strip-price-table td.stock-cell { padding: 2px; }
.strip-price-table td.stock-cell.has-stock { color: hsl(var(--ma, 210), 62%, 34%); font-weight: 700; }
html.dark .strip-price-table td.stock-cell.has-stock { color: hsl(var(--ma, 210), 70%, 74%); }
.strip-price-table td.stock-cell .stock-input {
  width: 100%;
  height: 24px;
  border: 0;
  background: transparent;
  text-align: center;
  font: inherit;
  color: inherit;
  outline: none;
  padding: 0 2px;
}
.strip-price-table td.stock-cell.stock-zero .stock-input { color: var(--ink-3, #b0b5bd); font-weight: 500; }
.strip-price-table td.stock-cell.stock-zero .stock-input::placeholder { color: var(--ink-3, #c2c7ce); font-weight: 400; }
/* 售罄（库存扣到 0）：红色提示 */
.strip-price-table td.stock-cell.stock-empty .stock-input { color: var(--danger); font-weight: 700; }
.strip-price-table td.stock-cell:focus-within { box-shadow: inset 0 0 0 2px var(--primary); }
/* 开单订货页库存为只读回显：有剩余=商户色粗体，扣光/超量=红色提示，未设库存=灰色「—」不限量 */
.strip-price-table .stock-left {
  display: block;
  padding: 1px 2px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.strip-price-table td.stock-cell.stock-empty { color: var(--danger); font-weight: 700; }
.strip-price-table td.stock-cell.stock-empty .stock-left { font-weight: 700; }
.strip-price-table td.stock-cell.stock-unlimited { color: var(--ink-3, #b0b5bd); font-weight: 500; }
/* 网店主卡片：表格内的数量输入框压缩适配 */
.strip-shop-table .strip-size-input {
  padding: 3px 2px;
  height: 26px;
  border-radius: 4px;
}
/* 合计列（网店主卡片尺码表末列） */
.strip-shop-table .strip-total-th,
.strip-shop-table .strip-total-cell {
  width: 64px;
  background: #f7f8fa;
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
}
.strip-shop-table .strip-total-cell span {
  font-weight: 700;
  color: var(--primary);
}
html.dark .strip-shop-table .strip-total-th,
html.dark .strip-shop-table .strip-total-cell { background: #23262e; }

/* ===== 发货仓 · 清单详情（复用网店主清单的“商户→商品→颜色”汇总排版，只读） ===== */
.wh-items-panel { min-width: 0; }
.wh-items-panel h3 { display: flex; align-items: baseline; gap: 8px; }
.wh-items-sub { font-size: 12px; font-weight: 400; color: var(--ink-2); }
.wh-cart-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.wh-cart-list .cart-merchant { border-radius: 10px; }
.wh-cart-list .cart-product-block { padding: 10px 12px; }
.wh-cart-list .cart-product-line { width: 100%; align-items: baseline; }
/* 总件数：与下方「数量」列（固定 64px）同宽居中，上下中心线对齐 */
/* 款式名称与合计件数用商户专属色（--ma 由商户块注入） */
.wh-cart-list .cart-product-name,
.wh-prod-total {
  color: hsl(var(--ma, 210), 62%, 32%);
}
html.dark .wh-cart-list .cart-product-name,
html.dark .wh-prod-total {
  color: hsl(var(--ma, 210), 70%, 74%);
}
/* 商品标题行右侧：单价 + 件数·小计 */
.wh-prod-price {
  margin-left: auto;
  flex: none;
  font-size: 13px;
  font-weight: 600;
  color: hsl(var(--ma, 210), 45%, 42%);
  white-space: nowrap;
}
html.dark .wh-prod-price {
  color: hsl(var(--ma, 210), 60%, 70%);
}
.wh-prod-price + .wh-prod-total { margin-left: 10px; }
.wh-prod-total {
  margin-left: auto;
  flex: none;
  text-align: right;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}
/* 尺码表头两行：尺码名 + 该尺码单价（小灰字） */
.wh-cart-list .size-table thead th .size-name {
  display: block;
  white-space: nowrap;
  line-height: 1.15;
}
.wh-cart-list .size-table thead th .size-price {
  display: block;
  font-size: 9.5px;
  font-weight: 400;
  line-height: 1.15;
  color: var(--muted, #8a8f98);
  letter-spacing: -0.2px;
}
.list-main .list-detail-wrap .size-table thead th .size-price { font-size: 9px; }
.wh-cart-list .size-table-wrap { overflow-x: auto; }
/* 尺码列等宽：fixed 布局下未给宽度的列平分剩余宽度，S / 2XL 视觉宽度一致 */
.wh-cart-list .size-table { font-size: 13px; table-layout: fixed; }
/* r483 修：发货仓明细是非拆分表（无 colgroup），老规则 th.size-th-color{width:1px}
   在 fixed 下变成真 1px → 颜色列 9px、缩略图整个看不见（原来的 JS 实测列宽已在
   列宽重构时删除）。非拆分表恢复 auto：颜色列由内容撑开，尺码列平分剩余宽度；
   我的清单（.has-thumb-col，有 colgroup 定宽）维持 fixed 不受影响。 */
.wh-cart-list .size-table:not(.has-thumb-col) { table-layout: auto; }
.wh-cart-list .size-table th,
.wh-cart-list .size-table td { padding-left: 2px; padding-right: 2px; }
.wh-cart-list .size-table th {
  font-size: 13px;
  padding: 7px 4px;
  white-space: nowrap;
}
/* 颜色列宽度由 JS 按最长颜色名实测内联给值（自适应），此处只保证内容不换行 */
.wh-cart-list .size-table th.size-th-color { white-space: nowrap; }
.wh-cart-list .size-color-cell { white-space: nowrap; }
.wh-cart-list .size-th-total { width: 64px; }
/* 商品颜色缩略图加大（30→60px），行高同步抬高保证不被裁切 */
.wh-cart-list .color-thumb-sm {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  margin-right: 10px;
}
.wh-cart-list .color-label { font-size: 15px; }
.wh-cart-list .size-color-cell { padding: 5px 10px !important; }
.wh-qty {
  height: 70px;
  padding: 0 4px !important;
  font-size: 14px;
  color: var(--ink);
}
/* 数量格：0 留空（不画占位符），有数量的用商户专属色铺底 */
.wh-qty.has { font-weight: 700; background: hsl(var(--ma, 210), 78%, 88%); }
.wh-qty.zero { color: transparent; background: transparent; }
.wh-cart-list .size-total-cell {
  padding: 0 10px !important;
  font-size: 15px;
}
.wh-cart-list .size-craft-row td {
  font-size: 12px;
  padding: 5px 10px;
  color: var(--accent);
}
html.dark .wh-qty.has { background: hsl(var(--ma, 210), 30%, 24%); }
html.dark .wh-qty.zero { color: transparent; }

/* ===== 缩略图「看大图」角标：平时隐藏，缩略图被选中后才出现 ===== */
.thumb-zoom {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(17, 19, 26, 0.74);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: zoom-in;
  opacity: 0;
  transform: scale(0.7);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease, background 0.15s ease;
  z-index: 4;
  backdrop-filter: blur(2px);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28);
}
.thumb-zoom:hover { background: rgba(17, 19, 26, 0.92); transform: scale(1.08); }
.thumb-zoom:focus-visible { outline: 2px solid #fff; outline-offset: 1px; opacity: 1; transform: scale(1); pointer-events: auto; }

/* 选中态才显示角标：商品卡选中颜色 / 编辑弹窗选中颜色 / 清单·发货仓选中行 */
.strip-color.active .thumb-zoom,
.color-thumb-card.pg-selected .thumb-zoom,
.color-thumb-card.thumb-selected .thumb-zoom,
.color-thumb-sm.thumb-selected .thumb-zoom {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}
/* 编辑弹窗里选中态的高亮描边（无价格组时的单选） */
.color-thumb-card.thumb-selected .color-thumb-img {
  box-shadow: inset 0 0 0 2px var(--primary);
}

/* ===== 全屏大图 lightbox（放大镜角标打开） ===== */
.img-lightbox {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(10, 12, 18, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  animation: lbIn 0.16s ease;
}
@keyframes lbIn { from { opacity: 0; } to { opacity: 1; } }
.img-lightbox.closing { opacity: 0; transition: opacity 0.16s ease; }
.img-lightbox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  color: #fff;
}
.img-lightbox-title {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.img-lightbox-close {
  flex: none;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.img-lightbox-close:hover { background: rgba(255, 255, 255, 0.26); }
.img-lightbox-stage {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  padding: 24px;
  cursor: grab;
}
.img-lightbox-stage.grabbing { cursor: grabbing; }
.img-lightbox-stage img {
  margin: auto;
  max-width: none;
  border-radius: 4px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  user-select: none;
  -webkit-user-drag: none;
}
.img-lightbox-bar {
  width: max-content;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(17, 19, 26, 0.78);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 13px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}
.img-lightbox-bar button {
  border: none;
  background: transparent;
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.img-lightbox-bar button:hover { background: rgba(255, 255, 255, 0.16); }
.img-lightbox-sep { width: 1px; height: 16px; background: rgba(255, 255, 255, 0.25); }


/* 导出PDF：打印容器（.pg-print-holder）
   容器版式在「屏幕」与「打印」两种媒体下同款渲染（平时 display:none，导出时才挂到 body 上），
   这样 JS 能先用真实 A4 尺寸量出内容高度、把字号压到刚好一整页，再交给 window.print()。
   r494：此前 holder 用 height:100vh 且表格 height:100%，说明条款被顶到第 2 页。 */
.pg-print-holder { display: none; }
@media screen {
  /* 导出过程中离屏渲染：用户看不到，但能参与布局测量 */
  body.print-table .pg-print-holder { position: fixed; left: -30000px; top: 0; }
}
body.print-table .pg-print-holder {
  display: flex;
  flex-direction: column;
  width: 210mm;
  height: 297mm;
  box-sizing: border-box;
  padding: 8mm 10mm;
  overflow: hidden;
  background: #fff;
  /* 字号由 JS 按内容高度从 10px 往下压，保证一整页装完 */
  --ex-fs: 10px;
}
/* 卡片头（标题 + 导出按钮）不进 PDF；说明的「编辑」按钮也不进 */
body.print-table .pg-print-holder .col-head { display: none; }
body.print-table .pg-print-holder .ex-notes-edit { display: none; }
body.print-table .pg-print-holder .card {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  max-width: none;
  max-height: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
body.print-table .pg-print-holder .col-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: auto;
  max-height: none;
  overflow: visible;
}
/* 价格核算的价格表带内边距且自身可滚动，打印时交给外层容器控制 */
body.print-table .pg-print-holder .ex-calc-ptwrap { padding: 0; overflow: visible; }
/* r497：wrap 不再 flex:1 拉伸、表格不再 height:100%——拉伸会让表格内容溢出自身盒子、
   盖到下方说明上（视觉即「最后一行下面多出一条横线」）。改为自然高度 + 说明用 margin-top:auto 贴底。 */
body.print-table .pg-print-holder .ex-pgt-wrap { flex: 0 0 auto; min-height: 0; overflow: visible; margin-bottom: 8px; }
body.print-table .pg-print-holder .ex-pgt { height: auto; font-size: var(--ex-fs); }
body.print-table .pg-print-holder .ex-pgt thead th {
  position: static;
  padding: 4px 6px;
  font-size: calc(var(--ex-fs) - 0.5px);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
body.print-table .pg-print-holder .ex-pgt td {
  padding: 2.5px 6px;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
body.print-table .pg-print-holder .ex-pgt td.ex-pgt-group { padding: 3px 8px; }
body.print-table .pg-print-holder .ex-pgt .ex-pgt-name { font-size: calc(var(--ex-fs) + 1px); }
body.print-table .pg-print-holder .ex-pgt .ex-pgt-cnt { font-size: calc(var(--ex-fs) - 1px); margin-top: 1px; }
/* r499：价格核算表格打印时表头与「价格组一览」一致——重量区间并入主行单行显示 */
body.print-table .pg-print-holder .ex-calc-pt thead th em { display: inline; font-size: inherit; font-weight: inherit; opacity: 1; margin-left: 2px; }
/* 防跨页截断：单行绝不从中间切开 */
body.print-table .pg-print-holder .ex-pgt tr,
body.print-table .pg-print-holder .ex-pgt tbody { page-break-inside: avoid; break-inside: avoid; }
/* 说明条款固定贴底：flex 容器里用 margin-top:auto 吸收剩余空间（放不下时自然紧跟表格，绝不与表格重叠） */
body.print-table .pg-print-holder .ex-pgt-notes {
  flex-shrink: 0;
  margin: auto 2px 0;
  padding-top: 8px;
  font-size: var(--ex-fs);
  line-height: 1.55;
}
body.print-table .pg-print-holder .ex-pgt-notes-title { font-size: calc(var(--ex-fs) + 1px); margin-bottom: 3px; }
body.print-table .pg-print-holder .ex-pgt-notes-item { margin-top: 1px; }
@media print {
  /* 页边距归零：浏览器页眉页脚（日期/页面标题/URL）画在边距里，无边距即不出现 */
  @page { size: A4; margin: 0; }
  /* 隐藏页面所有内容（顶栏导航、侧栏等），只留打印容器 */
  body.print-table > :not(.pg-print-holder) { display: none !important; }
  body.print-table .pg-print-holder { position: static; left: auto; top: auto; }
}
/* 屏幕上该容器默认不可见（只有导出瞬间离屏渲染用于测量） */
body:not(.print-table) .pg-print-holder { display: none; }
/* 客户类型新增：就地输入卡片 */
.ex-cust-add-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  margin-bottom: 6px;
  border: 1px solid var(--line, #d0d7e2);
  border-radius: 8px;
  background: var(--tint, #f6f8fb);
}
.ex-cust-add-input {
  width: 100%;
  padding: 5px 8px;
  border: 1px solid var(--line, #d0d7e2);
  border-radius: 6px;
  font-size: 13px;
}
.ex-cust-add-btns { display: flex; justify-content: flex-end; gap: 6px; }
.ex-cust-add-btns .btn { flex: 1; white-space: nowrap; padding-left: 0; padding-right: 0; font-size: 12px; }
#ex-cust-add { white-space: nowrap; }
/* 自定义客户类型的删除按钮：项右上角小 × */
.ex-item { position: relative; }
.ex-cust-del {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 18px;
  height: 18px;
  line-height: 16px;
  padding: 0;
  border: 1px solid var(--line, #d0d7e2);
  border-radius: 50%;
  background: var(--card, #fff);
  color: var(--ink-2, #5b616e);
  font-size: 13px;
  cursor: pointer;
}
.ex-cust-del:hover { background: #fee2e2; border-color: #ef4444; color: #ef4444; }
.ex-cust-edit {
  position: absolute;
  top: 6px;
  right: 32px;
  width: 18px;
  height: 18px;
  line-height: 16px;
  padding: 0;
  border: 1px solid var(--line, #d0d7e2);
  border-radius: 50%;
  background: var(--card, #fff);
  color: var(--ink-2, #5b616e);
  font-size: 11px;
  cursor: pointer;
}
.ex-cust-edit:hover { background: #e0e7ff; border-color: #4f46e5; color: #4f46e5; }
.ex-item.has-cust-btns .ex-item-name { padding-right: 48px; }
/* 客户类型二级分类：一级分类下缩进挂子项，左侧竖线表示层级 */
.ex-cust-kids {
  margin: 6px 0 0 14px;
  padding-left: 10px;
  border-left: 2px solid var(--line, #d0d7e2);
}
.ex-item.is-child { padding: 8px 10px; border-radius: 8px; background: var(--tint, #f6f8fb); }
.ex-item.is-child .ex-item-name { font-size: 13px; }
.ex-item.is-child .ex-item-sub { font-size: 11px; }
/* 窄列下名称过长：单行省略，按钮悬浮右上 */
.ex-item.has-cust-btns .ex-item-name { padding-right: 44px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ex-item.has-cust-btns .ex-item-sub { padding-right: 44px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 寄件方式视图（门店散单/网店充值/共享充值）：只读报价明细 */
.ex-form .ex-ro-val {
  padding: 6px 10px;
  border: 1px dashed var(--line, #d0d7e2);
  border-radius: 6px;
  background: var(--tint, #f6f8fb);
  color: var(--ink, #22242a);
  min-height: 20px;
  font-size: 13px;
}
/* 寄件方式视图：价格总览（每家快递一段只读表格） */
.ex-vo-sec { margin-bottom: 16px; }
.ex-vo-sec:last-child { margin-bottom: 0; }
.ex-vo-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 6px;
  padding-left: 2px;
}
/* 客户类型拖动排序：插入位置指示线 + 拖拽中淡化 */
.ex-item.ex-cust-drop-before { box-shadow: 0 -2px 0 0 var(--primary, #4f6ef2); }
.ex-item.ex-cust-drop-after { box-shadow: 0 2px 0 0 var(--primary, #4f6ef2); }
.ex-item.is-dragging { opacity: 0.45; }
/* 寄件方式视图三列布局：快递公司 | 客户类型 | 价格总览 = 1:1:8 */
.ex-grid3 { grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) minmax(0, 8fr); }
/* 商户档口视图：三列三等分 */
.ex-grid3e { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* 寄件方式视图：价格总览区再拆两卡（左=价格表，右=其他内容预留位） */
.ex-grid-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  min-width: 0; min-height: 0;
}
.ex-grid-pair > .card { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
/* 两卡中的价格表：列宽重新分配——价格组/省份收窄固定，5 个价格列均分剩余宽度 */
.ex-grid-pair .ex-pgt, .ex-grid3e .ex-pgt { table-layout: fixed; }
.ex-grid-pair .ex-pgt thead th:nth-child(1), .ex-grid3e .ex-pgt thead th:nth-child(1) { width: 98px; }
.ex-grid-pair .ex-pgt thead th:nth-child(2), .ex-grid3e .ex-pgt thead th:nth-child(2) { width: 64px; }
.ex-grid-pair .ex-pgt thead th, .ex-grid3e .ex-pgt thead th { padding: 6px 3px; }
/* 组名列原本固定 132px，在窄卡里太占地方，改为自适应窄列 */
.ex-grid-pair .ex-pgt-group, .ex-grid3e .ex-pgt-group {
  width: auto; min-width: 0; padding: 6px 5px;
  border-left-width: 3px;
}
.ex-grid-pair .ex-pgt-name, .ex-grid3e .ex-pgt-name { font-size: 11.5px; line-height: 1.3; word-break: break-all; }
.ex-grid-pair .ex-pgt-cnt, .ex-grid3e .ex-pgt-cnt { font-size: 9.5px; margin-top: 2px; }
.ex-grid-pair .ex-pgt-prov, .ex-grid3e .ex-pgt-prov { white-space: nowrap; }
.ex-grid-pair .ex-pgt-num, .ex-grid3e .ex-pgt-num { white-space: nowrap; }
.ex-grid-pair .ex-pgt td, .ex-grid3e .ex-pgt td { padding: 6px 4px; }

/* 电子面单申请地址：竖排行列表，真实 logo + 可编辑链接 + 复制/保存 */
.ex-wb-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ex-wb-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  background: #fff;
  min-width: 0;
}
.ex-wb-logo-wrap {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  overflow: hidden;
  border-radius: 6px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}
.ex-wb-logo {
  width: 26px;
  height: 26px;
  object-fit: contain;
  border-radius: 6px;
}
/* 天猫 App 图标裁掉底部活动贴纸，只露顶部「天猫+猫头」 */
.ex-wb-logo.is-crop {
  width: 37px;
  height: 37px;
  max-width: none;
  object-fit: cover;
}
.ex-wb-name {
  flex: 0 0 auto;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text, #1f2937);
  line-height: 1.3;
  white-space: nowrap;
}
.ex-wb-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 26px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 7px;
  padding: 0 8px;
  font-size: 12px;
  color: var(--text, #1f2937);
  background: #fafafa;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.ex-wb-input:focus {
  border-color: var(--primary, #3b82f6);
  background: #fff;
}
.ex-wb-input::placeholder { color: var(--muted, #9ca3af); }
.ex-wb-row .btn.btn-sm { flex: 0 0 auto; }
.ex-wb-row .btn.is-ok {
  color: #16a34a;
  border-color: #16a34a;
}
/* 商户档口版：每个平台一块（申请主体/地址/账号/密码） */
.ex-wb-list.is-acct { gap: 10px; }
.ex-wb-acct {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  background: #fff;
  padding: 8px 10px 9px;
}
.ex-wb-acct-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.ex-wb-acct-head .ex-wb-name { font-size: 13px; }
.ex-wb-acct-head .btn { margin-left: auto; }
.ex-wb-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  min-width: 0;
}
.ex-wb-field > span {
  flex: 0 0 auto;
  width: 30px;
  font-size: 11.5px;
  color: var(--muted, #9ca3af);
  line-height: 1;
}
/* 申请主体四个字，标签列加宽到 46px，四行标签左对齐 */
.ex-wb-acct .ex-wb-field > span { width: 46px; }
.ex-wb-field .ex-wb-input { height: 26px; font-size: 12px; min-width: 0; }
.ex-wb-acct .btn.is-ok { color: #16a34a; border-color: #16a34a; }
/* 拖动排序：左侧点阵手柄 */
.ex-drag-handle {
  flex: 0 0 auto;
  width: 12px;
  height: 20px;
  cursor: grab;
  border-radius: 3px;
  background-image: radial-gradient(circle, #c3c9d2 1.1px, transparent 1.3px);
  background-size: 4px 4px;
  background-position: center;
  opacity: 0.85;
  transition: opacity 0.15s ease, background-color 0.15s ease;
}
.ex-drag-handle:hover { opacity: 1; background-color: #f1f5f9; }
.ex-drag-handle:active { cursor: grabbing; }
.ex-wb-acct.is-dragging {
  opacity: 0.55;
  border-style: dashed;
  border-color: var(--primary, #3b82f6);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
}
.ex-wb-acct.is-dragging * { pointer-events: none; }
/* 打单工具块：首字色标 + 可就地改名的标题 */
.ex-tool-icon {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}
.ex-tool-name {
  flex: 1 1 auto;
  min-width: 0;
  height: 24px;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #1f2937);
}
.ex-tool-name:hover { border-color: var(--border, #e5e7eb); }
.ex-tool-name:focus {
  outline: none;
  border-color: var(--primary, #3b82f6);
  background: #fff;
}
/* 真实 logo 版图标：白底 + 细边框容纳异形图 */
.ex-tool-icon.is-img {
  background: #fff;
  border: 1px solid var(--border, #e5e7eb);
}
.ex-tool-icon.is-img img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: block;
  border-radius: 4px;
}
.ex-wb-acct-head .ex-tool-save { margin-left: auto; }
.ex-tool-del { color: var(--muted, #9ca3af); }
.ex-tool-del:hover { color: #dc2626; border-color: #dc2626; }
/* 使用方式按钮：已填写说明时高亮主题色 */
.ex-tool-how { flex: 0 0 auto; }
.ex-tool-how.has-how {
  color: var(--primary, #3b82f6);
  border-color: rgba(59, 130, 246, 0.45);
  background: rgba(59, 130, 246, 0.06);
}
.ex-wb-acct-head .btn.btn-sm { padding: 3px 7px; font-size: 11.5px; }
/* 正在查看使用方式的工具块：左侧色条 + 浅底 */
.ex-wb-acct.is-how {
  border-color: var(--primary, #3b82f6);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
/* 右列上下两卡：使用方式（自适应）+ 价格总览（占满剩余） */
.ex-col-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  min-height: 0;
}
.ex-col-stack > .card { min-width: 0; min-height: 0; overflow: hidden; }
.ex-how-card { flex: 0 1 auto; }
.ex-col-stack > .ex-price-card { flex: 1 1 auto; }
.ex-how-card > .col-body { display: flex; flex-direction: column; }
.ex-how-card .ex-how-ta { flex: 1 1 auto; min-height: 150px; }
.ex-how-link.is-empty { color: var(--muted, #9ca3af); }
/* 使用方式内容 */
.ex-how-link {
  font-size: 12px;
  color: var(--muted, #6b7280);
  margin-bottom: 10px;
  word-break: break-all;
}
.ex-how-link a { color: var(--primary, #3b82f6); text-decoration: none; }
.ex-how-link a:hover { text-decoration: underline; }
.ex-how-label {
  display: block;
  font-size: 12px;
  color: var(--muted, #6b7280);
  margin-bottom: 6px;
}
.ex-how-ta {
  width: 100%;
  min-height: 130px;
  padding: 9px 10px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.7;
  font-family: inherit;
  color: var(--text, #1f2937);
  resize: vertical;
  box-sizing: border-box;
}
.ex-how-ta:focus {
  outline: none;
  border-color: var(--primary, #3b82f6);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}


/* ===== 门店散单：报价计算器 ===== */
.ex-calc {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  height: calc(100vh - 148px);
  min-height: 420px;
}
.ex-calc > .card { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
/* 中栏：计算结果 / 最近计算 两张卡片（客户类型已移到左栏顶部） */
.ex-calc-mid { display: grid; grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 10px; min-height: 0; }
.ex-calc-mid > .card { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.ex-calc-mid .ex-mid-body { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 6px 12px 8px; }
/* 计算结果卡首行正中：快递 · 地区 · 重量 */
.ex-calc-mid > .card > .col-head { position: relative; }
.ex-res-cond {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font-size: 12px; font-weight: 600; color: var(--muted, #6b7280);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 64%; pointer-events: none; letter-spacing: 0;
}
/* 计算结果三区：左=大价格 · 中=条件+价格组/档位 · 右=明细算法；各区内容在自身区域内居中 */
.ex-calc-res3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
  min-height: 100%;
}
.ex-calc-res3 .res3-price,
.ex-calc-res3 .res3-meta,
.ex-calc-res3 .res3-lines {
  display: flex; flex-direction: column; justify-content: center;
  min-width: 0; height: 100%;
}
.ex-calc-res3 .res3-price { align-items: center; }
.ex-calc-res3 .res3-meta { align-items: center; text-align: center; gap: 5px; }
.ex-calc-res3 .res3-lines { align-items: stretch; text-align: left; }
/* 三区之间用竖线分隔（中区、右区各带一条左边线） */
.ex-calc-res3 .res3-price { padding: 0 10px 0 2px; }
.ex-calc-res3 .res3-meta,
.ex-calc-res3 .res3-lines { border-left: 1px solid var(--line, #dfe4ee); padding: 0 10px; }
.ex-calc-res3 .ex-calc-num { font-size: 40px; line-height: 1; letter-spacing: -1.5px; }
/* 大价格：货币符号与小数收小，整数撑到最大（字号由 exCalcFitPrice 按可用宽高设定） */
.ex-calc-res3 .ex-calc-num.is-big {
  display: inline-block; width: fit-content; white-space: nowrap;
  font-size: 60px; line-height: 0.94; letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.ex-calc-res3 .ex-calc-num.is-big .cur { font-size: 0.3em; font-weight: 700; vertical-align: 0.66em; letter-spacing: 0; margin-right: 0.03em; }
.ex-calc-res3 .ex-calc-num.is-big .dec { font-size: 0.38em; font-weight: 700; letter-spacing: -0.02em; }
.ex-calc-res3 .ex-calc-num.is-empty { font-size: 20px; letter-spacing: 0; line-height: 1.2; max-width: 110px; text-align: center; }
.ex-calc-res3 .ex-calc-res-head { font-size: 11.5px; margin: 0; line-height: 1.35; color: var(--muted, #6b7280); }
/* 价格组 / 档位：中区内竖排、等宽撑满、字号放大 */
.ex-calc-res3 .ex-calc-res-badges {
  margin-top: 0; flex-direction: column; align-items: stretch;
  gap: 6px; width: 100%; flex-wrap: nowrap;
}
.ex-calc-res3 .ex-calc-badge {
  display: block; text-align: center;
  font-size: 13.5px; line-height: 1.35; padding: 4px 6px; border-radius: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ex-calc-res3 .res3-hint { font-size: 10.5px; color: var(--muted, #9aa1ad); line-height: 1.35; }
.ex-calc-res3 .ex-calc-lines { width: 100%; gap: 1px; font-size: 10.5px; }
.ex-calc-res3 .ex-calc-line { gap: 6px; }
.ex-calc-res3 .ex-calc-line.is-total { margin-top: 1px; padding-top: 2px; }
.ex-calc-mid .ex-calc-hist-row { padding: 5px 6px; }
/* 客户类型下拉（数据与报价表维护的客户类型一致）：整卡留白居中，下拉做得显眼 */
.ex-cust-pick { display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.ex-cust-pick-row { position: relative; display: flex; align-items: center; }
.ex-calc-custsel {
  width: 100%; height: 48px; padding: 0 44px 0 16px;
  border: 1px solid var(--line); border-radius: 11px;
  background: var(--card); color: var(--ink);
  font: inherit; font-size: 16px; font-weight: 700; letter-spacing: 0;
  text-overflow: ellipsis; cursor: pointer;
  appearance: none; -webkit-appearance: none;
}
.ex-calc-custsel:hover { border-color: var(--line-strong); }
.ex-calc-custsel:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.ex-cust-pick-caret {
  position: absolute; right: 15px; top: 50%; transform: translateY(-50%);
  font-size: 12px; color: var(--ink-2); pointer-events: none;
}
.ex-cust-pick .ex-cust-pick-hint { font-size: 11.5px; line-height: 1.45; color: var(--ink-2); }
/* 价格表表头：快递公司下拉 + 客户类型后缀 */
.ex-calc-qsel {
  margin-right: auto; min-width: 0; max-width: 190px;
  height: 26px; padding: 0 22px 0 8px;
  border: 1px solid var(--line); border-radius: 7px;
  background: var(--card); color: var(--ink);
  font: inherit; font-size: 11.5px; font-weight: 600;
  cursor: pointer;
}
.ex-calc-qsel:focus { outline: none; border-color: var(--primary); }
.ex-calc-pt-sub.is-tail { margin-right: 0; }

/* ===== 计价规则页 ===== */
.ex-rules {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 10px;
  height: calc(100vh - 148px);
  min-height: 420px;
}
.ex-rules-col { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 10px; min-height: 0; }
.ex-rules > .card,
.ex-rules-col > .card { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.ex-rules-auto { font-size: 11px; font-weight: 500; color: var(--ink-2); margin-right: auto; }
.ex-rule-body { display: flex; flex-direction: column; gap: 14px; padding: 14px 16px; }
.ex-rule-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.ex-rule-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ex-rule-copy b { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.ex-rule-copy span { font-size: 11.5px; color: var(--ink-2); line-height: 1.35; }
.ex-rule-sel,
.ex-rule-input {
  height: 34px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--ink); font: inherit; font-size: 12.5px; padding: 0 10px;
}
.ex-rule-sel { flex: none; width: 250px; cursor: pointer; }
.ex-rule-input { width: 110px; text-align: center; font-weight: 700; }
.ex-rule-sel:focus,
.ex-rule-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.ex-rule-note { font-size: 11.5px; line-height: 1.55; color: var(--ink-2); border-top: 1px dashed var(--line); padding-top: 10px; }
.ex-rules-test .col-body { display: flex; flex-direction: column; gap: 14px; padding: 14px 16px; }
.ex-rule-test-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; flex: none; }
.ex-rule-f { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ex-rule-f > span { font-size: 11.5px; color: var(--ink-2); }
.ex-rule-f .ex-rule-sel,
.ex-rule-f .ex-rule-input { width: 100%; min-width: 0; }
.ex-rule-test-out { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; justify-content: center; }
.ex-rule-out { display: flex; flex-direction: column; gap: 12px; }
.ex-rule-out-top { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ex-rule-out-price { font-size: 36px; font-weight: 800; letter-spacing: -1.5px; font-variant-numeric: tabular-nums; color: var(--ink); }
.ex-rule-out-badge {
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 5px;
  background: var(--pgbg, #f1f3f9); color: var(--pgink, #374151); border: 1px solid var(--pgc, #d0d7e2);
}
.ex-rule-out-tier { font-size: 11.5px; color: var(--ink-2); }
.ex-rule-out-lines { display: flex; flex-direction: column; gap: 4px; max-width: 380px; font-size: 12.5px; color: var(--ink-2); }
.ex-calc-form { padding: 12px 14px; display: flex; flex-direction: column; gap: 12px; overflow: auto; }
.ex-calc-label { font-size: 12px; font-weight: 600; color: var(--muted, #6b7280); margin-bottom: 5px; }
.ex-calc-qchips { display: flex; flex-wrap: wrap; gap: 6px; }
.ex-calc-q {
  padding: 5px 10px; font-size: 12px; border: 1px solid var(--line, #d0d7e2);
  border-radius: 7px; background: #fff; cursor: pointer; color: var(--ink, #22242a);
}
.ex-calc-q:hover { border-color: var(--primary, #4f6ef2); }
.ex-calc-q.active { border-color: var(--primary, #4f6ef2); background: var(--primary-soft, #eef2ff); color: var(--primary, #4f6ef2); font-weight: 600; }
.ex-calc-wrow { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.ex-calc-w { flex: 1; text-align: center; font-size: 22px; font-weight: 800; padding: 8px 0; letter-spacing: -0.5px; }
.ex-calc-unit { font-size: 12px; color: var(--muted, #6b7280); }
.ex-calc-wchips { display: flex; flex-wrap: wrap; gap: 5px; }
.ex-calc-wchip {
  padding: 3px 9px; font-size: 11px; border: 1px solid var(--line, #d0d7e2);
  border-radius: 6px; background: var(--tint, #f6f8fb); cursor: pointer; color: var(--ink, #22242a);
}
.ex-calc-wchip:hover { border-color: var(--primary, #4f6ef2); color: var(--primary, #4f6ef2); }
.ex-calc-right { padding: 12px 14px; display: flex; flex-direction: column; gap: 14px; overflow: auto; }
/* 结果卡只占 1/3 宽：大号总价与计价明细改上下排布，避免横向挤压 */
.ex-calc-res-top { display: flex; flex-direction: column; gap: 12px; }
.ex-calc-right .ex-calc-lines { min-width: 0; width: 100%; }
.ex-calc-res-head { font-size: 12px; color: var(--muted, #6b7280); margin-bottom: 4px; }
.ex-calc-num { font-size: 34px; font-weight: 800; line-height: 1.15; letter-spacing: -1px; }
.ex-calc-num.is-empty { font-size: 20px; font-weight: 600; color: var(--muted, #9aa1ad); letter-spacing: 0; }
.ex-calc-res-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ex-calc-badge {
  padding: 2px 9px; font-size: 11px; font-weight: 600; border-radius: 5px;
  background: var(--pgbg, #f1f3f9); color: var(--pgink, #374151); border: 1px solid var(--pgc, #d0d7e2);
}
.ex-calc-badge.plain { background: var(--tint, #f6f8fb); color: var(--muted, #6b7280); border-color: var(--line, #d0d7e2); }
.ex-calc-lines { min-width: 190px; font-size: 12px; color: var(--muted, #6b7280); display: flex; flex-direction: column; gap: 3px; }
.ex-calc-line { display: flex; justify-content: space-between; gap: 14px; }
.ex-calc-line span:last-child { color: var(--ink, #22242a); font-variant-numeric: tabular-nums; }
.ex-calc-line.is-total { border-top: 1px solid var(--line, #e2e6ef); margin-top: 4px; padding-top: 4px; font-weight: 700; }
.ex-calc-sec { border-top: 1px solid var(--line, #eef1f7); padding-top: 10px; }
.ex-calc-sec-title { font-size: 12px; font-weight: 600; color: var(--muted, #6b7280); margin-bottom: 8px; }
.ex-calc-hist { display: flex; flex-direction: column; }
.ex-calc-hist-row {
  display: flex; justify-content: space-between; gap: 12px; align-items: center; width: 100%;
  padding: 6px 8px; border: 0; border-radius: 7px; background: transparent; cursor: pointer; text-align: left;
  font-size: 12px; color: var(--muted, #6b7280);
}
.ex-calc-hist-row:hover { background: var(--tint, #f6f8fb); }
.ex-calc-hist-main { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ex-calc-hist-val { color: var(--ink, #22242a); font-weight: 700; font-variant-numeric: tabular-nums; }
/* 计算器左卡：只保留 地区 / 重量 两块，上下各占 50% 高度 */
.ex-calc-form.is-two { padding: 0; gap: 0; overflow: hidden; }
.ex-calc-pane {
  flex: 1 1 50%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  padding: 16px 16px;
}
.ex-calc-pane + .ex-calc-pane { border-top: 1px solid var(--line, #e2e6ef); }
.ex-calc-pane-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--muted, #6b7280);
}
.ex-calc-region-sel {
  width: 100%;
  padding: 13px 12px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 9px;
}
.ex-calc-pane .ex-calc-w { font-size: 30px; padding: 10px 0; }
.ex-calc-pane .ex-calc-wchips { justify-content: center; }
/* 收件人地区：首拼搜索下拉 */
.ex-calc > .card.ex-calc-left { overflow: visible; }
.ex-calc-left .ex-calc-form.is-two { overflow: visible; }
.ex-calc-pane { position: relative; }
.ex-calc-pane:has(.ex-region-picker) { z-index: 30; }
.ex-region-picker { position: relative; }
.ex-calc-region-input {
  width: 100%;
  padding: 13px 34px 13px 12px;
  font-size: 16px;
  font-weight: 700;
  border: 1px solid var(--line, #d0d7e2);
  border-radius: 9px;
  background: #fff;
  color: var(--ink, #22242a);
}
.ex-calc-region-input::placeholder { font-weight: 500; color: var(--muted, #9aa1ad); }
.ex-calc-region-input:focus { outline: none; border-color: var(--primary, #4f6ef2); box-shadow: 0 0 0 3px rgba(79, 110, 242, 0.14); }
.ex-region-caret { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--muted, #9aa1ad); pointer-events: none; }
.ex-region-pop {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 60;
  max-height: 268px; overflow: auto; padding: 5px;
  background: #fff; border: 1px solid var(--line, #d0d7e2); border-radius: 10px;
  box-shadow: 0 12px 30px rgba(20, 30, 60, 0.16);
}
.ex-region-group { padding: 6px 9px 3px; font-size: 11px; font-weight: 700; color: var(--muted, #9aa1ad); }
.ex-region-item {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 7px 9px; border-radius: 7px; cursor: pointer;
  font-size: 13px; color: var(--ink, #22242a);
}
.ex-region-item.active { background: var(--primary-soft, #eef2ff); color: var(--primary, #4f6ef2); font-weight: 700; }
.ex-region-item-py { font-size: 11px; letter-spacing: 0.5px; color: var(--muted, #9aa1ad); }
.ex-region-empty { padding: 12px; text-align: center; font-size: 12px; color: var(--muted, #9aa1ad); }
/* 收件人地区：字体加大，输入框宽度约卡片一半（最宽地区名正好铺半宽） */
.ex-calc-pane .ex-calc-pane-label { font-size: 13px; }
.ex-calc-pane .ex-region-picker { width: 50%; min-width: 190px; }
.ex-calc-pane .ex-calc-region-input { font-size: 22px; padding: 16px 40px 16px 16px; border-radius: 10px; }
.ex-calc-pane .ex-region-caret { font-size: 14px; right: 14px; }
.ex-region-pop .ex-region-item { font-size: 15px; padding: 9px 10px; }
.ex-region-pop .ex-region-item-py { font-size: 12px; }
.ex-region-pop .ex-region-group { font-size: 12px; }
/* 抵消左右内边距，使输入框正好占卡片宽度的一半 */
.ex-calc-pane .ex-region-picker { width: calc(50% + 16px); }
/* 填写报价条件：拆成上下两张独立卡片，各占一半高度 */
.ex-calc-side { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.ex-calc-side > .ex-side-card {
  flex: 1 1 0; min-height: 0;
  display: flex; flex-direction: column;
  position: relative; overflow: visible;
}
/* 客户类型卡放左栏顶部：高度按内容自适应，剩下空间给地区 / 重量两卡平分 */
.ex-calc-side > .ex-side-card.is-cust { flex: 0 0 auto; }
.ex-calc-side > .ex-side-card.is-region { z-index: 30; }
.ex-side-card > .col-head { border-radius: var(--radius, 12px) var(--radius, 12px) 0 0; position: relative; }
/* 重量卡标题栏正中：单位说明（绝对定位居中，不挤左右两侧） */
.ex-side-card > .col-head .ex-side-unit {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font-size: 16px; font-weight: 800; color: var(--ink, #22242a);
  letter-spacing: 0; white-space: nowrap; pointer-events: none;
}
.ex-side-body {
  flex: 1 1 auto; min-height: 0;
  padding: 16px;
  display: flex; flex-direction: column; justify-content: center; gap: 12px;
  position: relative; overflow: visible;
}
.ex-side-body .ex-region-picker { width: calc(50% + 16px); }
.ex-side-body .ex-calc-region-input { font-size: 22px; padding: 16px 40px 16px 16px; border-radius: 10px; }
.ex-side-body .ex-region-caret { font-size: 14px; right: 14px; }
.ex-side-body .ex-calc-w { font-size: 30px; padding: 10px 0; }
.ex-side-body .ex-calc-wchips { justify-content: center; }
/* 重量：去掉快捷按钮，输入框铺满卡片，字号由 JS 自适应到最大 */
/* 与收件人地区同款可见外框：框包住大数字，聚焦时高亮 */
.ex-side-body .ex-calc-wrow {
  height: 100%; margin-bottom: 0; align-items: stretch;
  box-sizing: border-box;
  border: 2px solid var(--line, #d5dbe6);
  border-radius: 12px;
  padding: 8px 12px;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ex-side-body .ex-calc-wrow:focus-within {
  border-color: var(--primary, #4f6ef2);
  box-shadow: 0 0 0 4px rgba(79, 110, 242, 0.13);
}
.ex-side-body .ex-calc-w {
  height: 100%; box-sizing: border-box;
  min-width: 0; width: 100%; /* 大字号会撑开 input 固有宽度，必须压制 */
  font-size: 200px; padding: 0 8px; letter-spacing: -0.02em;
  border: 0; background: transparent;
}
/* 描边与焦点环交给外层框，避免双层边框 */
.ex-side-body .ex-calc-w:focus { outline: none; box-shadow: none; border-color: transparent; }
/* 重量框聚焦选择态：旧数字变灰且只读（光标提示不可编辑），再输入即全新输入 */
.ex-side-body .ex-calc-w.is-dim { color: var(--muted, #9aa1ad); cursor: default; }
.ex-side-body .ex-calc-w.is-dim::selection { background: transparent; }
/* 收件人地区：文字再放大一档 */
.ex-side-body .ex-calc-region-input { font-size: 28px; padding: 14px 44px 14px 18px; }
.ex-side-body .ex-calc-region-input::placeholder { font-size: 24px; font-weight: 500; }
.ex-side-body .ex-region-caret { font-size: 15px; }
/* 收件人地区：文字再放大一档（超大号） */
.ex-side-body .ex-calc-region-input { font-size: 38px; font-weight: 800; padding: 16px 48px 16px 20px; letter-spacing: 0; }
.ex-side-body .ex-calc-region-input::placeholder { font-size: 30px; font-weight: 500; }
.ex-side-body .ex-region-caret { font-size: 18px; right: 18px; }
/* 收件人地区：再放大约 2 倍（72px），输入框适当加宽以容纳三字地区 */
.ex-side-body .ex-region-picker { width: calc(60% + 16px); }
.ex-side-body .ex-calc-region-input { font-size: 72px; line-height: 1.1; padding: 10px 40px 10px 16px; }
.ex-side-body .ex-calc-region-input::placeholder { font-size: 40px; }
.ex-side-body .ex-region-caret { font-size: 22px; right: 16px; }
.ex-side-body .ex-calc-region-input::placeholder { font-size: 30px; }
/* 收件人地区：再放大 2 倍（144px），输入框占满卡片；文字水平居中；空态提示放大且上下居中 */
/* 收件人地区：外层可见边框（框包住大字），聚焦时高亮 */
.ex-side-body .ex-region-picker {
  width: 100%; height: 100%; box-sizing: border-box;
  border: 2px solid var(--line, #d5dbe6);
  border-radius: 12px;
  padding: 8px 12px;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ex-side-body .ex-region-picker:focus-within {
  border-color: var(--primary, #4f6ef2);
  box-shadow: 0 0 0 4px rgba(79, 110, 242, 0.13);
}
.ex-side-body .ex-calc-region-input {
  font-size: 144px; line-height: 1.05;
  height: 100%; box-sizing: border-box;
  padding: 0 16px; text-align: center;
  border: 0; background: transparent;
}
/* 输入框自身的描边/焦点环交给外层框，避免双层边框 */
.ex-side-body .ex-calc-region-input:focus { box-shadow: none; border-color: transparent; }
/* 空态：提示文字放大到 72px，输入框固定高度内自动上下居中 */
.ex-side-body .ex-calc-region-input.is-empty { font-size: 72px; }
.ex-side-body .ex-calc-region-input::placeholder { font-size: inherit; font-weight: 500; }
.ex-side-body .ex-region-caret { font-size: 24px; right: 12px; }
/* ===== 门店散单第三栏：价格表（当前快递 · 当前客户类型） ===== */
.ex-calc-pricecard > .col-body { padding: 0; }
.ex-calc-pt-sub { font-size: 11px; font-weight: 500; color: var(--muted, #7f8794); margin-right: auto; }
.ex-calc-pricecard > .ex-calc-ptwrap { padding: 10px 10px 14px; overflow: auto; flex: 1 1 auto; min-height: 0; }
.ex-calc-pt { font-size: 11.5px; table-layout: fixed; }
.ex-calc-pt th:first-child { width: 76px; }
.ex-calc-pt thead th { padding: 4px 2px; font-size: 9.5px; letter-spacing: 0; }
.ex-calc-pt thead th em { display: block; font-style: normal; font-weight: 500; opacity: 0.72; font-size: 8.5px; white-space: nowrap; }
.ex-calc-pt td { padding: 4px 3px; }
.ex-calc-pt .ex-pgt-group { padding: 5px 5px; vertical-align: middle; }
.ex-calc-pt .ex-pgt-name { font-size: 11px; word-break: break-all; }
.ex-calc-pt .ex-pgt-cnt { font-size: 9.5px; margin-top: 2px; }
/* 当前选中的地区整行加深，方便在表里快速定位 */
.ex-calc-pt tr.is-hit td { background-image: linear-gradient(rgba(79, 110, 242, 0.16), rgba(79, 110, 242, 0.16)); font-weight: 800; }
/* 价格表下方：说明条款（只读，与报价表维护同款） */
.ex-calc-pt-notes { margin: 14px 0 0; padding: 10px 2px 0; font-size: 11.5px; line-height: 1.65; }
.ex-calc-pt-notes .ex-pgt-notes-title { font-size: 12px; margin-bottom: 6px; }
.ex-calc-pt-notes .ex-pgt-notes-item { font-size: 11.5px; }
/* 收件人地区：聚焦选择态——旧内容变灰（像占位提示），下拉弹出全部地区 */
.ex-side-body .ex-calc-region-input.is-dim { color: var(--muted, #9aa1ad); }
.ex-side-body .ex-calc-region-input.is-dim::selection { background: transparent; }
/* 灰字只读态：光标提示不可编辑 */
.ex-side-body .ex-calc-region-input.is-dim { cursor: default; }

/* ═══ 我的清单：未提交 / 已提交 两板块页签 ═══ */
.list-tabs {
  display: flex;
  gap: 10px;
  margin: 0 0 16px;
}
.list-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 999px;
  background: #fff;
  color: var(--text, #1f2937);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.list-tab:hover { border-color: var(--primary, #4f6ef2); }
.list-tab.is-active {
  border-color: var(--primary, #4f6ef2);
  background: rgba(79, 110, 242, 0.08);
  color: var(--primary, #4f6ef2);
  box-shadow: 0 1px 6px rgba(79, 110, 242, 0.15);
}
.list-tab-badge {
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  background: #eef1f6;
  color: var(--muted, #6b7280);
  white-space: nowrap;
}
.list-tab.is-active .list-tab-badge {
  background: var(--primary, #4f6ef2);
  color: #fff;
}
/* 我的清单铺满整屏（不受 1200px 内容区限制）：左 1/3 列表，右 2/3 预留区 */
.main.list-wide { max-width: none; }
.list-split {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 16px;
  align-items: start;
}
.list-main { min-width: 0; }
/* 右侧 2/3 预留区：两张卡平分宽度 */
.list-side {
  min-height: min(760px, calc(100vh - 220px));
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: stretch;
}
.list-side-card {
  border: 1px dashed var(--border, #e5e7eb);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}
.list-side-hint { font-size: 12.5px; color: var(--muted, #9ca3af); letter-spacing: 0.5px; }
/* 窄列内表格：订单表自适应栏宽；明细矩阵在商户块内横向滚动 */
.list-main .table-wrap { overflow-x: auto; }
.list-main table.data { font-size: 12.5px; }
.list-main table.data th,
.list-main table.data td { padding-left: 8px; padding-right: 8px; }
/* 清单内所有表头居中（订单表 + 明细尺码表），单元格内容保持原对齐 */
.list-main table.data thead th,
.list-main .list-detail-wrap .size-table thead th { text-align: center; }
.list-main .cart-list { overflow-x: auto; }
@media (max-width: 1180px) {
  .list-split { grid-template-columns: 1fr; }
  .list-side { display: none; }
}
/* 已提交板块：按日期分组的日期行 */
.list-day { margin-bottom: 22px; }
.list-day:last-child { margin-bottom: 0; }
.list-day-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 6px 2px 8px;
}
.list-day-date {
  font-size: 15px;
  font-weight: 800;
  color: var(--text, #1f2937);
}
.list-day-week { font-size: 12.5px; color: var(--muted, #6b7280); }
.list-day-week em {
  font-style: normal;
  color: var(--primary, #4f6ef2);
  font-weight: 700;
  margin-left: 2px;
}
.list-day-sum {
  margin-left: auto;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted, #6b7280);
  font-variant-numeric: tabular-nums;
}
/* 已提交：日期筛选条（默认今天） */
.list-day-filter {
  display: flex;
  gap: 8px;
  margin: 0 0 14px;
  flex-wrap: wrap;
}
.list-day-chip {
  padding: 5px 13px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 999px;
  background: #fff;
  color: var(--muted, #6b7280);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.list-day-chip:hover { border-color: var(--primary, #4f6ef2); color: var(--primary, #4f6ef2); }
.list-day-chip.is-active {
  border-color: var(--primary, #4f6ef2);
  background: rgba(79, 110, 242, 0.08);
  color: var(--primary, #4f6ef2);
}
.list-main .list-detail-wrap { overflow-x: auto; width: 0; min-width: 100%; }
/* 窄左栏内：明细矩阵随商户块横向滚动，避免「数量」列被裁 */
/* 窄左栏内：明细矩阵适当缩小字号 + 颜色列压窄，保证整表在栏内完整显示 */
.list-main .list-detail-wrap .size-table { font-size: 11.5px; }
.list-main .list-detail-wrap .size-table th { font-size: 12px; }
/* 图片列固定窄宽，颜色名列按名字自适应（内联 width 由 JS 计算） */
.list-main .list-detail-wrap .size-table .size-th-thumb { width: 50px !important; }
/* 数量列只放数字，压窄给尺码列让空间 */
.list-main .list-detail-wrap .size-table .size-th-total { width: 46px !important; }
/* 左栏窄：表格内边距收小，给尺码列让出空间（否则 2XL/3XL 表头被压出省略号） */
.list-main .list-detail-wrap .size-table th,
.list-main .list-detail-wrap .size-table td { padding-left: 4px !important; padding-right: 4px !important; }
/* 颜色拆两格：图片格只放缩略图，颜色格只放颜色名 */
.list-main .list-detail-wrap .wh-cart-list .size-thumb-cell,
.list-main .list-detail-wrap .size-thumb-cell { padding: 4px 3px !important; text-align: center; }
.list-main .list-detail-wrap .wh-cart-list .color-thumb-sm,
.list-main .list-detail-wrap .color-thumb-sm {
  display: block;
  width: 44px;
  height: 44px;
  border-radius: 6px;
  margin: 0 auto;
}
.list-main .list-detail-wrap .wh-cart-list .color-label,
.list-main .list-detail-wrap .color-label {
  display: flex;
  justify-content: center;
  font-size: 12px;
  line-height: 1.25;
  white-space: nowrap;
}
/* 尺码超多（>8 列）的表：不横向滚动，压缩列宽把全部尺码塞进一行；
   表头单行放不下时由 JS 折成「数字 / XL」两行，保证尺码完整显示 */
.list-main .list-detail-wrap .size-table-wrap { max-width: 100%; overflow-x: auto; width: 0; min-width: 100%; }
.list-main .list-detail-wrap .size-table-wrap:has(> .size-table.is-wide) { overflow-x: hidden; }
.list-main .list-detail-wrap .size-table.is-wide {
  table-layout: fixed;
  width: 100%;
}
.list-main .list-detail-wrap .size-table.is-wide thead th,
.list-main .list-detail-wrap .size-table.is-wide tbody td { white-space: nowrap; }
.list-main .list-detail-wrap .size-table.is-wide thead th { padding-left: 2px; padding-right: 2px; }
/* 尺码表头：字号收小、允许折行（2XL → 2 / XL），不省略不换行截断 */
.list-main .list-detail-wrap .size-table.is-wide thead th:not(.size-th-thumb):not(.size-th-color):not(.size-th-total) {
  font-size: 10.5px;
  line-height: 1.15;
  white-space: normal;
  padding-left: 1px;
  padding-right: 1px;
}
/* 图片 / 数量列压窄，把宽度让给尺码列 */
.list-main .list-detail-wrap .size-table.is-wide thead th.size-th-thumb { width: 50px !important; }
.list-main .list-detail-wrap .size-table.is-wide thead th.size-th-total { width: 40px !important; }
/* 已提交：日期下再按商户分组 */
.list-merch-groups { display: flex; flex-direction: column; gap: 14px; }
.list-merch-group {
  background: var(--card, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  overflow: hidden;
}
.list-merch-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: rgba(79, 110, 242, 0.05);
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.list-merch-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--text, #1f2937);
  display: flex;
  align-items: center;
  gap: 6px;
}
.list-merch-name::before {
  content: "";
  width: 4px;
  height: 14px;
  border-radius: 2px;
  background: var(--primary, #4f6ef2);
}
.list-merch-sum {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted, #6b7280);
  font-variant-numeric: tabular-nums;
}
.list-merch-group .table-wrap { border: none; border-radius: 0; }
/* 已提交订单行：商户列完整展示（多行换行，不截断）+ 行点击展开商户明细 */
.list-merch-cell {
  min-width: 140px;
  white-space: normal;
  line-height: 1.5;
  font-size: 12.5px;
}
.list-order-row { cursor: pointer; }
.list-order-row:hover td { background: rgba(79, 110, 242, 0.04); }
.list-expand-cell { width: 34px; text-align: center; }
.list-expand-arrow {
  display: inline-block;
  color: var(--muted, #9aa1ad);
  font-size: 12px;
  transition: transform 0.18s ease;
}
.list-order-row.is-open .list-expand-arrow { transform: rotate(180deg); color: var(--primary, #4f6ef2); }
.list-order-row.is-open td { background: rgba(79, 110, 242, 0.06); }
.list-detail-row > td {
  background: #fafbfe;
  padding: 0 !important;
  border-top: 1px dashed var(--border, #e5e7eb);
}
.list-detail-wrap { padding: 12px 14px 14px; }
/* 明细完整展开：不做内部滚动，页面自然往下延伸 */
.list-detail-wrap .wh-cart-list { max-height: none; overflow: visible; }




/* 我的清单：窄栏内复用「拿货清单」面板，压缩列宽保证整表可见 */
.list-main .list-detail-wrap .cart-list .size-table { font-size: 11.5px; }
.list-main .list-detail-wrap .cart-list .size-table th { font-size: 11px; padding: 4px 1px; }
.list-main .list-detail-wrap .cart-list .size-th-color { width: 58px; font-size: 11px; }
.list-main .list-detail-wrap .cart-list .size-table thead th.size-th-total { width: 38px !important; }
.list-main .list-detail-wrap .cart-list .size-table thead th.size-th-amt { width: 64px !important; }
/* 价格行：字号压小，灰色区间才放得进窄列 */
.list-main .list-detail-wrap .cart-list .size-price-row th,
.list-main .list-detail-wrap .cart-list .size-price-cell { font-size: 8.5px; padding: 2px 0 !important; }
.list-main .list-detail-wrap .cart-list .size-table tbody td.wh-qty { font-size: 11.5px; padding: 3px 0; }
/* 宽表（>8 尺码）列更窄：数量字号再压小，两位数也放得下 */
.list-main .list-detail-wrap .cart-list .size-table.is-wide tbody td.wh-qty { font-size: 10px; letter-spacing: -0.3px; }
.list-main .list-detail-wrap .cart-list .size-table.is-wide tbody .size-total-cell { font-size: 10px; letter-spacing: -0.3px; }
.list-main .list-detail-wrap .cart-list .size-total-cell,
.list-main .list-detail-wrap .cart-list .size-total-amt-cell { font-size: 10px; padding: 3px 2px; letter-spacing: -0.2px; }
.list-main .list-detail-wrap .cart-list .size-sum-row th,
.list-main .list-detail-wrap .cart-list .size-sum-row .size-sum-qty,
.list-main .list-detail-wrap .cart-list .size-sum-row .size-sum-amt { font-size: 10.5px; padding: 3px 1px; }
.list-main .list-detail-wrap .cart-list .cart-prod-qty { width: 52px; font-size: 13px; }
.list-main .list-detail-wrap .cart-list .size-color-cell { padding: 3px 2px !important; }
.list-main .list-detail-wrap .cart-list .size-color-cell .color-thumb-sm { width: 34px; height: 34px; }
.list-main .list-detail-wrap .cart-list .size-color-cell .color-label { font-size: 10.5px; }

/* 我的清单：图片 / 颜色拆成两列，尺码一行铺满（不横滚）——列宽由 colgroup 精确分配，
   尺码列吃掉剩余宽度并均分，宽度不够时 JS 逐级加 is-tight 收紧字号 */
.list-main .list-detail-wrap .cart-list .size-table.has-thumb-col {
  table-layout: fixed;
  width: 100%;
}
.list-main .list-detail-wrap .cart-list .size-table.has-thumb-col col.col-sp-thumb { width: 66px; }
.list-main .list-detail-wrap .cart-list .size-table.has-thumb-col col.col-sp-color { width: 42px; }
.list-main .list-detail-wrap .cart-list .size-table.has-thumb-col col.col-sp-qty { width: 34px; }
/* 数量/金额表头允许折行兜底（数量 → 数/量），避免差 1px 触发省略号 */
.list-main .list-detail-wrap .cart-list .size-table.has-thumb-col thead th.size-th-total { white-space: normal; line-height: 1.15; }
.list-main .list-detail-wrap .cart-list .size-table.has-thumb-col col.col-sp-amt { width: 56px; }
/* 缩略图格：只放图片，居中 */
.list-main .list-detail-wrap .cart-list .size-thumb-cell { padding: 3px 1px !important; }
.list-main .list-detail-wrap .cart-list .size-thumb-cell .color-thumb-sm {
  width: 54px;
  height: 54px;
  border-radius: 9px;
  margin-right: 0;
}
/* 颜色格：只放颜色名，允许折行不省略 */
.list-main .list-detail-wrap .cart-list .size-table.has-thumb-col .size-color-cell { text-align: center !important; padding: 3px 1px !important; }
.list-main .list-detail-wrap .cart-list .size-table.has-thumb-col .size-color-cell .color-label {
  display: block;
  font-size: 10px;
  line-height: 1.15;
  white-space: normal;
  word-break: break-all;
}
/* 自适应收紧：一级 / 二级 */
.list-main .list-detail-wrap .cart-list .size-table.is-tight tbody td.wh-qty { font-size: 9px; letter-spacing: -0.4px; padding: 3px 0; }
.list-main .list-detail-wrap .cart-list .size-table.is-tight .size-price-cell { font-size: 7.5px; letter-spacing: -0.4px; }
.list-main .list-detail-wrap .cart-list .size-table.is-tight .size-total-cell { font-size: 9px; letter-spacing: -0.5px; }
.list-main .list-detail-wrap .cart-list .size-table.is-tight thead th:not(.size-th-thumb):not(.size-th-color) { font-size: 9.5px; }
.list-main .list-detail-wrap .cart-list .size-table.is-tighter tbody td.wh-qty { font-size: 8px; letter-spacing: -0.5px; padding: 3px 0; }
.list-main .list-detail-wrap .cart-list .size-table.is-tighter .size-price-cell { font-size: 7px; letter-spacing: -0.5px; }
.list-main .list-detail-wrap .cart-list .size-table.is-tighter .size-total-cell { font-size: 8px; letter-spacing: -0.6px; }
.list-main .list-detail-wrap .cart-list .size-table.is-tighter thead th:not(.size-th-thumb):not(.size-th-color) { font-size: 9px; }
/* 拆列后的表：列宽完全交给 colgroup（清掉旧 th 定宽，避免和 col 打架） */
.list-main .list-detail-wrap .cart-list .size-table.has-thumb-col thead th { width: auto !important; }
/* 数量格内的数字 span 有独立 15px 字号，收紧模式下一并压小 */
.list-main .list-detail-wrap .cart-list .size-total-num { font-size: 11px; }
.list-main .list-detail-wrap .cart-list .size-table.is-tight .size-total-num { font-size: 9px; letter-spacing: -0.4px; }
.list-main .list-detail-wrap .cart-list .size-table.is-tighter .size-total-num { font-size: 8px; letter-spacing: -0.5px; }
/* 缩略图放大后尺码列更窄：表头左右 padding 归零 + 收紧模式再降字号，保证「XL」不被省略 */
.list-main .list-detail-wrap .cart-list .size-table.has-thumb-col thead tr:first-child th:not(.size-th-thumb):not(.size-th-color):not(.size-th-total) {
  padding-left: 0 !important;
  padding-right: 0 !important;
}
.list-main .list-detail-wrap .cart-list .size-table.is-tight thead tr:first-child th:not(.size-th-thumb):not(.size-th-color):not(.size-th-total) { font-size: 9px; }
.list-main .list-detail-wrap .cart-list .size-table.is-tighter thead tr:first-child th:not(.size-th-thumb):not(.size-th-color):not(.size-th-total) { font-size: 8.5px; }
/* 缩略图格：上下留白收一点，行高不被图片撑太松 */
.list-main .list-detail-wrap .cart-list .size-thumb-cell { padding: 2px 1px !important; }

/* ===== r378 加工单表头（我的清单/已提交）：LOGO / 提交人 / 创建时间 + 正反面设计稿上传 ===== */
.wo-form {
  margin: 0 0 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
/* 首行：左 LOGO / 中 提交人 / 右 创建时间 */
.wo-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-head);
}
.wo-logo {
  justify-self: start;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--ink);
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  padding: 6px 14px;
  line-height: 1.2;
}
.wo-owner { display: flex; align-items: baseline; gap: 8px; }
.wo-owner-label {
  font-size: 12px;
  color: var(--ink-2);
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 999px;
  padding: 2px 10px;
}
.wo-owner-name { font-size: 17px; font-weight: 500; color: var(--ink); }
.wo-date { justify-self: end; font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
/* 正反面设计稿上传区 */
.wo-design {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 14px 18px;
  background: #eaf3de;
}
html.dark .wo-design { background: #1d2416; }
.wo-design-slot {
  position: relative;
  min-height: 190px;
  border: 1.5px dashed #97c459;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s, background 0.15s;
}
html.dark .wo-design-slot { background: rgba(255, 255, 255, 0.04); }
.wo-design-slot:hover { border-color: #3b6d11; background: rgba(255, 255, 255, 0.85); }
.wo-design-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  font-size: 12px;
  color: #27500a;
  background: #c0dd97;
  border-radius: 999px;
  padding: 2px 10px;
  line-height: 1.5;
}
html.dark .wo-design-tag { color: #c0dd97; background: #2c3a1c; }
.wo-design-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: #5f7a3a;
  font-size: 13px;
}
html.dark .wo-design-empty { color: #97c459; }
.wo-design-plus {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px dashed #97c459;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
  color: #3b6d11;
}
html.dark .wo-design-plus { color: #97c459; border-color: #5d7a35; }
.wo-design-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}
.wo-design-del {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  display: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(22, 24, 29, 0.55);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.wo-design-slot.has-img .wo-design-del { display: flex; }
.wo-design-slot.has-img { cursor: default; }
.wo-design-del:hover { background: var(--danger); }

/* ===== r379 加工单布局：左侧日期列表 + 中间整张加工单 ===== */
.list-split.wo-split { grid-template-columns: 260px minmax(0, 1fr); }
.wo-days { min-width: 0; }
.wo-day-list { display: flex; flex-direction: column; gap: 8px; }
.wo-day-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.wo-day-item:hover { border-color: var(--line-strong); }
.wo-day-item.is-active { border-color: var(--primary); background: var(--primary-soft); }
.wo-day-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.wo-day-d { font-size: 14px; font-weight: 500; color: var(--ink); }
.wo-day-w { font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.wo-day-bot { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--ink-2); }
.wo-day-amt { color: var(--ink); font-variant-numeric: tabular-nums; }
/* 中间加工单：居中、可打印的白色单据 */
.wo-sheet-wrap { min-width: 0; }
.wo-sheet-wrap .wo-form { max-width: 1040px; }
.wo-sheet-wrap .wo-design-slot { min-height: 240px; }
.wo-detail-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px 4px;
}
.wo-detail-date { font-size: 14px; font-weight: 500; color: var(--ink); }
.wo-detail-sum { font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* ===== r380 加工单：左侧明细（宽度还原）+ 中间表头/设计稿/拖放明细 ===== */
.list-split.wo-split { grid-template-columns: 1fr 2fr; }
.wo-sheet-wrap .wo-form { max-width: 100%; }
.wo-sheet-wrap .wo-design-slot { min-height: 220px; }
/* 左侧可拖动的颜色行 */
tr.wo-drag-row { cursor: grab; }
tr.wo-drag-row:hover > td { background: var(--primary-soft) !important; }
tr.wo-drag-row.is-dragging { opacity: 0.45; }
/* 加工单明细拖放区 */
.wo-drop {
  border-top: 1px solid var(--line);
  padding: 12px 16px 16px;
  background: var(--card);
}
.wo-drop-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 8px; }
.wo-drop-title { font-size: 14px; font-weight: 500; color: var(--ink); }
.wo-drop-hint { font-size: 12px; color: var(--ink-2); }
.wo-drop-empty {
  min-height: 140px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--ink-2);
  font-size: 13px;
  background: var(--table-head);
}
.wo-drop-plus { font-size: 20px; line-height: 1; color: var(--ink-2); }
.wo-drop.is-over .wo-drop-empty,
.wo-drop.is-over .wo-drop-body { border-color: var(--primary); background: var(--primary-soft); }
.wo-drop.is-over { outline: 2px dashed var(--primary); outline-offset: -6px; border-radius: 8px; }
.wo-drop-chips { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 10px; }
.wo-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px 3px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12.5px;
  max-width: 100%;
}
.wo-chip-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wo-chip-del {
  border: none;
  background: transparent;
  color: var(--primary);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  padding: 0 3px;
  border-radius: 50%;
}
.wo-chip-del:hover { background: rgba(79, 70, 229, 0.16); }
.wo-drop-body { min-height: 60px; }

/* ===== r381 三栏：左 明细 / 中 加工单（定宽）/ 右 A4 打印预览 ===== */
.list-split.wo-split {
  grid-template-columns: minmax(0, 1fr) 430px minmax(0, 1fr);
  align-items: start;
}
.wo-sheet-wrap .wo-design-slot { min-height: 180px; }
.wo-preview {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  box-shadow: var(--shadow);
}
.wo-preview-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 2px 10px;
}
.wo-preview-title { font-size: 13px; font-weight: 500; color: var(--ink); }
.wo-preview-hint { font-size: 11.5px; color: var(--ink-2); }
.pp-page {
  position: relative;
  width: 100%;
  aspect-ratio: 210 / 297;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}
.pp-scale {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: top left;
  pointer-events: none;
  background: #fff;
}
.pp-scale .wo-form { border: none; border-radius: 0; box-shadow: none; margin: 0; max-width: none; }

/* ===== r382 三列三等分 ===== */
.list-split.wo-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); }

/* ===== r383 三栏收紧：缩小列间距 + 该视图减小页面左右留白，充分利用宽度 ===== */
.main.list-wide:has(.wo-split) { padding: 10px 10px 40px; }
.list-split.wo-split { gap: 8px; }

/* ===== r384 左侧日期头不再溢出：允许换行 + 两端留白 ===== */
.list-day-head { flex-wrap: wrap; row-gap: 2px; column-gap: 10px; padding: 6px 4px 8px; }
.list-day-date,
.list-day-week,
.list-day-sum { white-space: nowrap; }
.list-day-sum { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

/* ===== r385 日期头与卡片内边距对齐，避免贴边像溢出 ===== */
.list-day-head { padding: 6px 14px 8px; }
.list-day-sum { font-size: 12px; }

/* ===== r386 日期头强制单行：日期/周几/统计同一行，窄时压缩周几而不是换行 ===== */
.list-day-head { flex-wrap: nowrap; align-items: baseline; }
.list-day-date { flex: 0 0 auto; }
.list-day-week { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.list-day-sum { flex: 0 0 auto; margin-left: auto; }

/* ===== r388 中间列「明细」待放 SKU 区域加长 ===== */
.wo-drop-empty { min-height: 340px; }
.wo-drop-body { min-height: 180px; }

/* ===== r389 中间加工单默认按 A4 版面（210:297），明细区吃满剩余高度 ===== */
.wo-sheet-wrap .wo-form {
  aspect-ratio: 210 / 297;
  display: flex;
  flex-direction: column;
  background: #fff;
  overflow: hidden;
}
html.dark .wo-sheet-wrap .wo-form { background: #17191d; }
.wo-sheet-wrap .wo-head,
.wo-sheet-wrap .wo-design { flex: 0 0 auto; }
.wo-sheet-wrap .wo-drop {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
}
.wo-sheet-wrap .wo-drop-empty { flex: 1 1 auto; min-height: 0; }
.wo-sheet-wrap .wo-drop-body { flex: 0 0 auto; min-height: 0; }
.wo-sheet-wrap .wo-drop-head { flex: 0 0 auto; }

/* ===== r390 设计稿上传区：「正面 / 背面」大字作为背景铺满 ===== */
.wo-design-word {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 0;
  font-size: clamp(46px, 5.6vw, 82px);
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  color: #2f6b12;
  opacity: 0.13;
  user-select: none;
  pointer-events: none;
  white-space: nowrap;
}
html.dark .wo-design-word { color: #a3d977; opacity: 0.16; }
/* 交互内容浮在大字之上 */
.wo-design-slot .wo-design-empty { position: relative; z-index: 1; }
.wo-design-slot .wo-design-plus { background: rgba(255, 255, 255, 0.8); }
html.dark .wo-design-slot .wo-design-plus { background: rgba(0, 0, 0, 0.35); }
.wo-design-slot .wo-design-hint {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  padding: 1px 8px;
}
html.dark .wo-design-slot .wo-design-hint { background: rgba(0, 0, 0, 0.3); }
/* 已上传图片时隐藏大字；打印预览里也不显示 */
.wo-design-slot.has-img .wo-design-word { display: none; }
.pp-scale .wo-design-word { display: none; }

/* ===== r391 设计稿上传区「+」加大 ===== */
.wo-design-slot .wo-design-plus {
  width: 64px;
  height: 64px;
  font-size: 40px;
  font-weight: 300;
  border-width: 2px;
  border-radius: 50%;
}
.wo-design-slot .wo-design-hint { font-size: 13.5px; padding: 2px 10px; }

/* ===== r392 「正面/背面」背景大字铺满上传框（按容器宽度自适应，尽可能大不溢出） ===== */
.wo-design-slot { container-type: inline-size; }
.wo-design-word {
  font-size: clamp(40px, 47.5cqw, 150px);
  letter-spacing: 0;
  font-weight: 900;
}

/* r392b 同时受高度约束：宽窗口下不让大字纵向被裁 */
.wo-design-slot { container-type: size; }
.wo-design-word { font-size: clamp(40px, min(47.5cqw, 66cqh), 150px); }

/* r393b 高度上限再放宽一档（宽窗口下更满，仍留 8px 余量） */
.wo-design-word { font-size: clamp(40px, min(47.5cqw, 69cqh), 150px); }

/* ===== r480 传图区固定框（用户要求：比例和位置就以现在的方图固定，传啥图都只能框内显示） =====
   以前 r395 是「有图后高度随图片原始比例撑开」，竖图能把 347 高撑到 806，明细区被挤没；
   现在框尺寸只由版面决定（占上方一半），图片 absolute inset:0 + object-fit:contain 等比缩进框内、居中留白。 */
.wo-sheet-wrap .wo-design { flex: 0 0 50%; min-height: 0; }
.wo-sheet-wrap .wo-design-slot { min-height: 0; }
/* 有图不再改变区域高度：与空态完全同尺寸同位置 */
.wo-sheet-wrap .wo-design.has-img { flex: 0 0 50%; height: auto; }
.wo-sheet-wrap .wo-design.has-img .wo-design-slot { min-height: 0; }
.wo-design-slot.has-img { align-items: center; }
.wo-design-slot.has-img .wo-design-img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  max-height: none;
  background: transparent;
}

/* r480 有图的格子：框尺寸不再由图片比例决定，拉伸填满传图区（图片自身 contain 居中） */
.wo-sheet-wrap .wo-design-slot.has-img {
  align-self: stretch;
  height: auto;
  min-height: 0;
  align-items: center;
  flex: 0 1 auto;
}
.wo-design-slot.has-img .wo-design-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  flex: 0 0 auto;
  object-fit: contain;
  background: #fff;
}

/* ===== r398 加工单传图区：去掉中间缝隙，两格贴合成一整块 ===== */
.wo-sheet-wrap .wo-design { gap: 0; }

/* r398b 缝隙规则同样作用于打印预览的克隆体 */
.wo-design { gap: 0; }

/* ===== r400 传图区吃满整个纸宽：去掉四周内边距，两格直接顶到边缘 ===== */
.wo-design { padding: 0; }
.wo-sheet-wrap .wo-design-slot,
.pp-scale .wo-design-slot { border-radius: 0; }

/* ===== r401 拖入的 SKU 卡片撑满中间列：去掉明细区层层内边距 ===== */
.wo-drop { padding: 0; }
.wo-drop-head { padding: 12px 16px 8px; }
.wo-drop-chips { padding: 0 16px 10px; }
/* r455：明细标题行（"明细 / 已拖入 N 个颜色行"）已移除，标题行的上下间距并入明细区 */
.wo-drop .list-detail-wrap { padding: 12px 0 10px; }

/* ===== r457 加工单明细表：固定布局 + 尺码等宽 + 数量 4 位数不截断 =====
   用户要求：① 数量能放 4 位数不截断；② 各尺码列宽度相等（把位置让给数量）；
   ③ 导出 PDF 里的表格与页面一致（此前 table-layout:auto 随内容伸缩，两处宽窄不一）。
   做法：.wo-drop 作用域（中列纸张、右列预览克隆、PDF 打印克隆都带 .wo-drop，一处生效三处一致）
   改 table-layout:fixed——col 显式宽度的列（图/颜色/数量）定死，其余尺码列自动"平分"剩余宽度即等宽；
   数量列 34→52px（4 位 15px 粗体数字 + 内距足够），图 44px、颜色 40px。 */
.wo-drop .size-table { table-layout: fixed; }
/* r458：缩略图本体 54px，列宽 44px 会裁掉 10px（用户要求不能有任何信息被截断）→ 列加宽到 58px */
.wo-drop .size-table.has-thumb-col col.col-sp-thumb { width: 58px !important; }
.wo-drop .size-table.has-thumb-col col.col-sp-color { width: 40px !important; }
.wo-drop .size-table.has-thumb-col col.col-sp-qty { width: 52px !important; }
.wo-drop .cart-product-block { padding-left: 6px; padding-right: 6px; }
.wo-drop::-webkit-scrollbar { width: 6px; height: 6px; }
.wo-drop-empty { margin: 12px 16px 16px; }

/* ===== r402 加工单明细：颜色行数量格右上角的红叉（点击移出该颜色行） ===== */
.wo-drop-body .size-total-cell { overflow: visible; }
.wo-row-del {
  position: absolute;
  top: -1px;
  right: -1px;
  width: 15px;
  height: 15px;
  padding: 0 !important;
  min-height: unset !important;
  line-height: 1;
  border: 0 !important;
  border-radius: 50%;
  background: transparent !important;
  color: #ef4444 !important;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.62;
  transition: opacity 0.12s ease, background 0.12s ease, color 0.12s ease;
}
.wo-row-del:hover {
  opacity: 1;
  background: #ef4444 !important;
  color: #fff !important;
  box-shadow: 0 1px 4px rgba(239, 68, 68, 0.4);
}
html.dark .wo-row-del { color: #f87171 !important; }
html.dark .wo-row-del:hover { background: #ef4444 !important; color: #fff !important; }

/* ===== r403 打印预览克隆体补齐加工单的 A4 版面规则 =====
   此前 flex/aspect-ratio 只写了 .wo-sheet-wrap 作用域，克隆体在 .pp-scale 里
   拿不到 flex 布局 → 传图区高度塌成内容高度（不占 A4 上半），图片也撑不出一半高度。 */
.pp-scale .wo-form {
  aspect-ratio: 210 / 297;
  display: flex;
  flex-direction: column;
  background: #fff;
  overflow: hidden;
}
html.dark .pp-scale .wo-form { background: #17191d; }
.pp-scale .wo-head { flex: 0 0 auto; }
/* 传图区固定占纸张上部 32%；有图后尺寸不变（r480：图片只做 contain 缩放，不撑高版面） */
.pp-scale .wo-design { flex: 0 0 32%; min-height: 0; }
.pp-scale .wo-design.has-img { flex: 0 0 32%; height: auto; }
.pp-scale .wo-design-slot { min-height: 0; }
.pp-scale .wo-design-slot.has-img {
  align-self: stretch;
  height: auto;
  min-height: 0;
  align-items: center;
  flex: 0 1 auto;
}
.pp-scale .wo-drop {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.pp-scale .wo-drop-head { flex: 0 0 auto; }
.pp-scale .wo-drop-body { flex: 0 0 auto; min-height: 0; }
.pp-scale .wo-drop-empty { flex: 1 1 auto; min-height: 0; }

/* ===== r404 传图格支持 Ctrl+V 粘贴：聚焦高亮，提示可粘贴 ===== */
.wo-design-slot:focus { outline: none; }
.wo-design-slot:focus-visible {
  outline: none;
  border-color: #3b6d11;
  box-shadow: inset 0 0 0 2px rgba(59, 109, 17, 0.45);
}
.pp-scale .wo-design-slot:focus-visible { box-shadow: none; }
.wo-design-empty .wo-design-hint { white-space: nowrap; }

/* ===== r405 收紧三列之间的缝 =====
   原来左列明细区自带 14px 右内边距，加上 8px 栅格间距，卡片到加工单之间看着有 22px。
   这里把明细区右侧内边距收到 6px、栅格间距收到 6px，打印预览列左右内边距同步收到 6px，
   三列之间的可见缝隙统一到 10px 出头。 */
.main.list-wide:has(.wo-split) { padding: 10px 8px 40px; }
.list-split.wo-split { gap: 6px; }
.wo-left .list-detail-wrap { padding-right: 6px; }
.wo-preview { padding-left: 6px; padding-right: 6px; }

/* ===== r406 左侧价格清单独立滚动 =====
   以前整列内容撑高页面（左列 2152px），滚动是整页滚，加工单/预览会跟着移动。
   现在：左列高度锁定到视口（不随内容增高），日期头固定在顶部，只有明细区自己滚；
   页面整体高度改由中间加工单决定，基本不再出现整页滚动。 */
.wo-left {
  position: sticky;
  top: 66px;
  height: calc(100vh - 106px); /* 顶栏56 + 页面上边距10 + 下边距40，留 0 余量防整页滚动 */
  min-height: 380px;
  display: flex;
  flex-direction: column;
  align-self: start;
}
.wo-left > .draft-list-page {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.wo-left > .wo-build { flex: 0 0 auto; }
.wo-left .list-day {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}
.wo-left .list-day-head { flex: 0 0 auto; }
.wo-left .list-detail-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: auto;
  overscroll-behavior: contain;
}
/* 明细区细滚动条（默认半透明，悬停加深） */
.wo-left .list-detail-wrap::-webkit-scrollbar { width: 8px; height: 8px; }
.wo-left .list-detail-wrap::-webkit-scrollbar-track { background: transparent; }
.wo-left .list-detail-wrap::-webkit-scrollbar-thumb {
  background: rgba(120, 130, 150, 0.3);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.wo-left .list-detail-wrap:hover::-webkit-scrollbar-thumb { background: rgba(120, 130, 150, 0.55); background-clip: padding-box; }
html.dark .wo-left .list-detail-wrap::-webkit-scrollbar-thumb { background: rgba(180, 190, 210, 0.28); background-clip: padding-box; }
html.dark .wo-left .list-detail-wrap:hover::-webkit-scrollbar-thumb { background: rgba(180, 190, 210, 0.5); background-clip: padding-box; }

/* ===== r408 加工单数量可改 + 左侧剩余/置灰 ===== */
/* 加工单里尺码格变成可编辑数字：外观与普通数字一致，聚焦才出现细边框 */
.wo-drop-body .wh-qty-edit { padding: 0 !important; }
.wo-qty-input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-variant-numeric: tabular-nums;
  text-align: center;
  padding: 4px 1px;
  margin: 0;
  appearance: textfield;
  -moz-appearance: textfield;
  cursor: text;
}
.wo-qty-input::-webkit-outer-spin-button,
.wo-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.wo-qty-input:hover { background: rgba(79, 70, 229, 0.07); }
.wo-qty-input:focus {
  outline: none;
  background: rgba(79, 70, 229, 0.12);
  box-shadow: inset 0 0 0 1px var(--primary);
}
/* 预览/打印里的数字（输入框被替换成 span） */
.pp-scale .size-qty-num { font-variant-numeric: tabular-nums; }

/* 左侧数量格里「剩余/原量」：1/6 表示这一行还剩 1 件，原件数 6 */
.size-total-of { font-size: 9px; color: var(--ink-2); opacity: 0.75; margin-left: 1px; }

/* 已被拖入加工单的左侧行：全拖完 → 置灰；只拖走一部分 → 轻微淡化 + 左侧色条提示 */
.wo-left tr.wo-drag-row.is-taken > td { opacity: 0.45; filter: grayscale(0.85); }
.wo-left tr.wo-drag-row.is-taken { cursor: default; }
.wo-left tr.wo-drag-row.is-part > td:first-child { box-shadow: inset 3px 0 0 0 var(--primary); }
.wo-left tr.wo-drag-row.is-part .size-total-of { color: var(--primary); opacity: 1; font-weight: 600; }

/* ===== r409 左侧「可分配」列：分走多少在这里体现 ===== */
/* 列宽：数量/金额保持紧凑，可分配列固定窄宽并吸右边缘（表宽出横向滚动时也一直可见） */
.wo-left .col-sp-alloc { width: 52px; }
.wo-left .size-th-alloc,
.wo-left .size-alloc-cell {
  position: sticky;
  right: 0;
  z-index: 2;
  background: var(--card, #fff);
  border-left: 1px solid var(--line);
  box-shadow: -8px 0 10px -8px rgba(15, 23, 42, 0.25);
}
.wo-left thead .size-th-alloc { background: var(--table-head, #f3f4f6); z-index: 3; }
.wo-left .size-alloc-num { font-variant-numeric: tabular-nums; font-weight: 600; }
.wo-left .size-alloc-num.is-part { color: var(--primary); }
.wo-left .size-alloc-num.is-zero { color: var(--danger, #ef4444); }
.wo-left .size-sum-alloc { font-weight: 600; }
/* 行悬停高亮时吸右列也要跟着变色 */
.wo-left tr.wo-drag-row:hover .size-alloc-cell { background: var(--primary-soft, #eef); }

/* 全部分完置灰：图片（缩略图格）保持原样，其余格子变灰 */
.wo-left tr.wo-drag-row.is-taken > td:not(.size-thumb-cell) { opacity: 0.45; filter: grayscale(0.85); }
.wo-left tr.wo-drag-row.is-taken > td.size-thumb-cell { opacity: 1; filter: none; }

/* 左列加了一列后宽度吃紧：中间列让位（预览列基本不变） */
.list-split.wo-split { grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.94fr) minmax(0, 0.88fr); }

/* ===== r410 可分配数字加大 ===== */
.wo-left .col-sp-alloc { width: 62px; }
.wo-left .size-alloc-num { font-size: 18px; font-weight: 700; line-height: 1.1; display: inline-block; }
.wo-left .size-sum-alloc { font-size: 15px; font-weight: 700; }

/* ===== r411 左列卡片合计对齐「数量」列右缘 =====
   加了「可分配」列后数量列不再贴右，卡片首行「合计 N 件」与货号行「N 件」
   由 JS 测出数量列右缘位置（--qty-right），这里用它替换 margin-left:auto 的贴边行为 */
.wo-left .cart-product-line .cart-prod-qty,
.wo-left .cart-list .cart-prod-qty {
  width: auto;
  text-align: right;
  margin-left: auto;
  margin-right: var(--qty-right, 0px);
}
.wo-left .cart-merchant-title > .cart-mer-total { margin-right: var(--qty-right, 0px); }

/* ===== r412 左列汇总并入价格行 =====
   汇总数字现在住在价格行（size-price-row）的空位里，不再有 .size-sum-row 包裹，这里补同等样式 */
.wo-left .size-price-row .size-sum-qty { font-size: 13px; font-weight: 700; }
.wo-left .size-price-row .size-sum-amt { font-size: 13px; font-weight: 700; color: var(--primary); white-space: nowrap; }
.wo-left .size-price-row .size-sum-alloc { font-weight: 700; }

/* ===== r413 左列卡片排版统一：不再忽大忽小 =====
   旧机制：尺码多的款逐级压字号（is-tight 9px/is-tighter 8px），和尺码少的款（14px）差一倍，观感割裂。
   新机制：全部款同一字号 + 尺码列统一最小宽度，放不下就整表横向滚动（可分配列 sticky 常驻右缘）。 */
/* 1) 字号全部拉回基准值，压缩档位在左列全部失效 */
.wo-left .size-table.is-tight tbody td.wh-qty,
.wo-left .size-table.is-tighter tbody td.wh-qty { font-size: 14px !important; letter-spacing: 0; padding: 0 4px; }
.wo-left .size-table.is-tight .size-price-cell,
.wo-left .size-table.is-tighter .size-price-cell { font-size: 11px !important; letter-spacing: 0; }
.wo-left .size-table.is-tight .size-total-cell,
.wo-left .size-table.is-tighter .size-total-cell { font-size: 15px !important; letter-spacing: 0; }
.wo-left .size-table.is-tight .size-total-num,
.wo-left .size-table.is-tighter .size-total-num { font-size: 15px !important; letter-spacing: 0; }
.wo-left .size-table.is-tight thead th:not(.size-th-thumb):not(.size-th-color),
.wo-left .size-table.is-tighter thead th:not(.size-th-thumb):not(.size-th-color) { font-size: 12px !important; }
.wo-left .size-table.is-wide thead th:not(.size-th-thumb):not(.size-th-color):not(.size-th-total) { font-size: 12px !important; }
/* 2) 宽表不再用 fixed 布局硬挤，回到内容自适应 */
.wo-left .size-table.is-wide { table-layout: auto; }
/* 3) 尺码列统一最小宽度：2XL 这类表头不再被压出省略号；数量格数字不折行 */
.wo-left .size-table thead th:not(.size-th-thumb):not(.size-th-color):not(.size-th-total):not(.size-th-amt):not(.size-th-alloc) { min-width: 28px; }
.wo-left .size-table tbody td.wh-qty,
.wo-left .size-table td.size-price-cell { white-space: nowrap; }
/* 4) 放不下 → 整表横向滚动（明细区自带横滚条，可分配列 sticky 始终可见） */
.wo-left .size-table-wrap { overflow-x: auto !important; }

/* ===== r413b 一揽子统一（压过 .list-main .list-detail-wrap .cart-list 的旧基准字号） ===== */
.wo-left .list-detail-wrap .cart-list .size-table { font-size: 12px !important; }
.wo-left .list-detail-wrap .cart-list .size-table thead th { font-size: 12px !important; }
.wo-left .list-detail-wrap .cart-list .size-table tbody td.wh-qty { font-size: 14px !important; letter-spacing: 0; }
.wo-left .list-detail-wrap .cart-list .size-price-cell { font-size: 11px !important; letter-spacing: 0; }
.wo-left .list-detail-wrap .cart-list .size-total-cell { font-size: 15px !important; letter-spacing: 0; }
.wo-left .list-detail-wrap .size-table.is-wide { table-layout: auto !important; }

/* ===== r415 金额列不再截断：去掉 56px 钉死宽度，按内容自适应 ===== */
.wo-left .list-detail-wrap .size-table.has-thumb-col col.col-sp-amt { width: auto !important; }
.wo-left .size-table th.size-th-amt { min-width: 60px; }
.wo-left .size-table td.size-total-amt-cell,
.wo-left .size-table td.size-sum-amt { white-space: nowrap !important; }

/* ===== r415b 根因修复：has-thumb-col 全表 fixed 布局 + colgroup 钉死列宽 → 内容永不扩列 =====
   左列改回 auto 布局：colgroup 宽度降级为「最小宽度」，金额等内容宽了会自动撑开，放不下才横滚。 */
.wo-left .list-detail-wrap .cart-list .size-table.has-thumb-col { table-layout: auto !important; }
.wo-left .list-detail-wrap .cart-list .size-table.has-thumb-col col.col-sp-amt { width: 56px !important; }
.wo-left .list-detail-wrap .cart-list .size-table.has-thumb-col col.col-sp-qty { width: 38px !important; }

/* ===== r417 左列瘦身：把宽度还给中间列 =====
   1) 三栏配比：左 1.18fr→1.1fr，中右各 0.95fr（用户实测选定：左列 10 码款有富余，
      中列明细 447px 无溢出，预览变宽；总份数 3.0，左列恰超 1/3）
   2) 卡片内部横向省宽（数量字号 14px 不变，阅读不受影响）：
      格 padding 4→2px、尺码列最小宽 28→26px、缩略图 66/54→54/44px、
      可分配列 62→52px、金额列最小宽 60→54px、明细区右距 6→2px
   尺码特别多的款仍整表横滚，可分配列 sticky 常驻右缘 */
.list-split.wo-split { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.95fr) minmax(0, 0.95fr); }
.wo-left .list-detail-wrap { padding-right: 2px; }
.wo-left .list-detail-wrap .size-table th,
.wo-left .list-detail-wrap .size-table td { padding-left: 2px !important; padding-right: 2px !important; }
.wo-left .size-table thead th:not(.size-th-thumb):not(.size-th-color):not(.size-th-total):not(.size-th-amt):not(.size-th-alloc) { min-width: 26px; }
.wo-left .list-detail-wrap .cart-list .size-table.has-thumb-col col.col-sp-thumb { width: 54px !important; }
.wo-left .list-detail-wrap .cart-list .size-thumb-cell .color-thumb-sm { width: 44px; height: 44px; }
.wo-left .col-sp-alloc { width: 52px; }
.wo-left .size-table th.size-th-amt { min-width: 54px; }
.wo-left .list-detail-wrap .cart-list .size-table.has-thumb-col col.col-sp-amt { width: 54px !important; }
.wo-left .list-detail-wrap .cart-list .size-table.has-thumb-col col.col-sp-qty { width: 34px !important; }
.wo-left .list-detail-wrap .cart-list .size-table.has-thumb-col col.col-sp-color { width: 40px !important; }

/* ===== r419 设计稿删除按钮更醒目 =====
   原样式：半透明深灰底白 ×，贴深色设计稿/夜间模式下几乎看不见，用户误以为没有删除入口。
   改为白底深色 ×（两主题都清晰），hover 变红，尺寸加大到 26px。 */
.wo-design-del {
  width: 26px;
  height: 26px;
  background: rgba(255, 255, 255, 0.95);
  color: #334155;
  border: 1px solid rgba(15, 23, 42, 0.15);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.35);
}
html.dark .wo-design-del {
  background: rgba(23, 25, 29, 0.92);
  color: #e2e8f0;
  border-color: rgba(255, 255, 255, 0.18);
}
.wo-design-del:hover {
  background: var(--danger, #ef4444);
  color: #fff;
  border-color: transparent;
}

/* ===== r420 背面格子横向溢出修复（横图时整格被裁、删除按钮看不见） =====
   根因：grid 1fr 轨道的自动最小尺寸 + 格子 aspect-ratio 的传递最小宽：
   横图（宽>高）时每格最小宽被撑大，两格加起来超过传图区总宽，
   背面格被右缘裁掉，右上角 × 一起出界 → 用户以为没有删除入口。
   改 minmax(0,1fr) + min-width:0：格子宽度恒为传图区一半，
   横图只压缩显示高度（object-fit 容箱），不再横向溢出。 */
.wo-design { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.wo-design-slot { min-width: 0; }

/* ===== r421 横图溢出真修复：r420 没压住的残余传递宽 =====
   实测：轨道 237px 正确，但背面格 299px = min-height 140 × 宽高比 2.13 ——
   r395 给有图格的 min-height:140px 强制高度后，浏览器按 aspect-ratio 把高度
   传递成最小宽度，把格子撑出轨道 → 背面格右缘连同 × 一起被裁。
   去掉有图格的 min-height（高度由比例自然算），max-width:100% 兜底钳制残余传递。 */
.wo-sheet-wrap .wo-design.has-img .wo-design-slot { min-height: 0; }
.wo-design-slot { max-width: 100%; }

/* ===== r422 三栏表头统一：左列/中列补表头，与打印预览列基线对齐 =====
   预览列表头在卡片内（padding 12px），左中两列的表头用 12px 顶距对齐同一基线 */
.wo-left > .wo-preview-head,
.wo-sheet-wrap > .wo-preview-head { padding: 12px 2px 10px; }

/* ===== r423 左列/中列改为第三列同款卡片（表头进卡片，三列观感一致） =====
   预览列结构 = 灰卡片(border+radius+shadow+padding12) > 表头 > 白纸面。
   左列/中列照抄：卡片壳 + 表头回到卡内样式；左列内容区垫白纸面同 A4 观感。 */
.wo-left,
.wo-sheet-wrap {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  box-shadow: var(--shadow);
}
/* 表头回卡内：取消 r422 的外置 12px 顶距，与预览表头完全一致 */
.wo-left > .wo-preview-head,
.wo-sheet-wrap > .wo-preview-head { padding: 0 2px 10px; }
/* 左列内容区垫白纸面（亮 #fff / 暗 #17191d，同中间 A4 纸） */
.wo-left .draft-list-page {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
}
html.dark .wo-left .draft-list-page { background: #17191d; }
.wo-left > .wo-build { padding: 6px 2px 0; }

/* ===== r424 左列日期行移入表头区 =====
   前一天/日期/后一天 + 单/件/金额 从白纸首行上移到「货品清单」标题下方（卡片表头区内），
   白纸从明细卡片直接开始。行内样式块给 .list-day-head 的 14px 侧距改为贴卡内 2px 对齐标题。 */
.wo-left .list-day-head { padding: 0 2px 10px !important; }

/* ===== r427 左列表头压到与右列同高 =====
   .ldh-nav 此前无样式 = 浏览器默认按钮（高 ~24px+），左表头比右列「打印预览」表头高一截。
   紧凑幽灵按钮 + 两列表头统一高度，基线对齐观感一致。 */
.wo-left .list-day-head,
.wo-sheet-wrap > .wo-preview-head {
  align-items: center;
  height: 30px;
  padding: 0 2px 0 !important;
  box-sizing: content-box;
}
.ldh-nav {
  appearance: none;
  border: 1px solid var(--line, #e2e8f0);
  background: transparent;
  color: var(--ink-2, #64748b);
  font: 600 11.5px/1 var(--sans, inherit);
  padding: 4px 9px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.ldh-nav:hover:not(:disabled) { background: var(--primary-weak, rgba(79, 110, 242, 0.1)); color: var(--primary, #4f6ef2); border-color: currentColor; }
.ldh-nav:disabled { opacity: 0.35; cursor: default; }
.wo-left .list-day-date { font-size: 13px; }
.wo-left .list-day-week { font-size: 11.5px; }
.wo-left .list-day-sum { font-size: 11.5px; font-weight: 500; }

/* ===== r428 中列与预览列内容对齐 =====
   根因：.wo-preview 的左右 padding 被旧规则压成 6px（中列 12px），预览纸比加工单纸宽 11px，
   fitPrintPreview 算出 scale=1.022 把克隆内容放大 2.2%，越往下偏移越大（明细区差 10px/高度差 50px）。
   统一两卡 padding=12px → 两纸等宽 → scale≈1.0，两列内容逐像素 1:1 对齐。 */
.wo-preview { padding: 12px !important; }


/* r429 续：克隆壳容器本身不参与布局表现（list-main 只为命中中列的表格紧凑规则） */
.pp-scale .pp-clone-host { min-width: 0 !important; }

/* ===== r430 已分完的行（变灰）禁止拖动 ===== */
.wo-left tr.wo-drag-row.is-taken { cursor: not-allowed; }

/* ===== r431 左列网格：数量 / 金额 两列垫灰底（含表头、明细格、汇总格） ===== */
.wo-left .size-table thead th.size-th-total,
.wo-left .size-table td.size-total-cell,
.wo-left .size-table td.size-sum-amt,
.wo-left .size-table .size-price-row .size-sum-qty,
.wo-left .size-table .size-price-row .size-sum-amt {
  background: rgba(100, 116, 139, 0.16);
}
html.dark .wo-left .size-table thead th.size-th-total,
html.dark .wo-left .size-table td.size-total-cell,
html.dark .wo-left .size-table td.size-sum-amt,
html.dark .wo-left .size-table .size-price-row .size-sum-qty,
html.dark .wo-left .size-table .size-price-row .size-sum-amt {
  background: rgba(255, 255, 255, 0.09);
}
/* 已分完置灰行保持原置灰优先，灰底叠加不冲突 */
.wo-left tr.is-taken .size-table td.size-total-cell { background: rgba(100, 116, 139, 0.1); }

/* ===== r432 灰底修正：可分配列不垫灰 + 灰底格子框线加深 =====
   可分配列的 th/td 也带 size-th-total 类，被 r431 误伤；灰底与浅灰框线对比度低显"框线消失"。 */
.wo-left .size-table thead th.size-th-total.size-th-alloc,
.wo-left .size-table td.size-total-cell.size-alloc-cell { background: transparent; }
.wo-left .size-table thead th.size-th-total,
.wo-left .size-table td.size-total-cell,
.wo-left .size-table td.size-sum-amt,
.wo-left .size-table .size-price-row .size-sum-qty,
.wo-left .size-table .size-price-row .size-sum-amt {
  border-color: rgba(100, 116, 139, 0.45);
}

/* ===== r433 数量/金额列数字用商户专属色（--ma 色相，与色条/徽章同源） ===== */
.wo-left .size-table td.size-total-cell .size-total-num,
.wo-left .size-table td.size-total-cell span,
.wo-left .size-table td.size-sum-amt,
.wo-left .size-table .size-price-row .size-sum-qty,
.wo-left .size-table .size-price-row .size-sum-amt {
  color: hsl(var(--ma, 210), 70%, 42%);
  font-weight: 700;
}
html.dark .wo-left .size-table td.size-total-cell .size-total-num,
html.dark .wo-left .size-table td.size-total-cell span,
html.dark .wo-left .size-table td.size-sum-amt,
html.dark .wo-left .size-table .size-price-row .size-sum-qty,
html.dark .wo-left .size-table .size-price-row .size-sum-amt {
  color: hsl(var(--ma, 210), 80%, 68%);
}

/* ===== r434 数量/金额表头去底色；可分配数字改大红、分完 0 变灰 ===== */
.wo-left .size-table thead th.size-th-total:not(.size-th-alloc),
.wo-left .size-table thead th.size-th-total:not(.size-th-alloc) .size-price,
.wo-left .size-table thead th.size-th-total:not(.size-th-alloc) .size-name { background: transparent; }
/* 可分配：还有余量 → 大红；分完 0 → 灰 */
.wo-left .size-alloc-num { color: #e60012; }
.wo-left .size-alloc-num.is-part { color: #e60012; }
.wo-left .size-alloc-num.is-zero { color: var(--muted, #9aa3af); }
html.dark .wo-left .size-alloc-num,
html.dark .wo-left .size-alloc-num.is-part { color: #ff4d4f; }
html.dark .wo-left .size-alloc-num.is-zero { color: #6b7280; }

/* ===== r435 可分配数字配色修正：r433 商户色规则(.size-total-cell span)特异性更高罩住了它 =====
   用 4 类选择器压回：有余量大红、分完 0 灰。 */
.wo-left .size-table .size-alloc-cell .size-alloc-num { color: #e60012 !important; }
.wo-left .size-table .size-alloc-cell .size-alloc-num.is-part { color: #e60012 !important; }
.wo-left .size-table .size-alloc-cell .size-alloc-num.is-zero { color: var(--muted, #9aa3af) !important; }
html.dark .wo-left .size-table .size-alloc-cell .size-alloc-num,
html.dark .wo-left .size-table .size-alloc-cell .size-alloc-num.is-part { color: #ff4d4f !important; }
html.dark .wo-left .size-table .size-alloc-cell .size-alloc-num.is-zero { color: #6b7280 !important; }

/* ===== r436 单个尺码分完 → 该尺码格变灰（同行其他尺码不变） ===== */
.wo-left .size-table td.wh-qty.is-size-done {
  color: var(--muted, #9aa3af);
  background: rgba(100, 116, 139, 0.12);
  font-weight: 600;
}

/* ===== r437 价格行汇总「可分配」格补色补框线 =====
   r431-r435 的着色/框线规则只覆盖数量、金额格，漏了价格行汇总的 .size-sum-alloc：
   数字黑色、边框保持最浅 --line，夹在加深框线的灰底格中间显得断线。
   补齐：数字大红（与可分配列一致）、分完 0 变灰、框线与邻格同深。 */
.wo-left .size-table .size-price-row .size-sum-alloc {
  color: #e60012;
  border-color: rgba(100, 116, 139, 0.45);
}
.wo-left .size-table .size-price-row .size-sum-alloc.is-zero {
  color: var(--muted, #9aa3af);
}
html.dark .wo-left .size-table .size-price-row .size-sum-alloc {
  color: #ff4d4f;
}
html.dark .wo-left .size-table .size-price-row .size-sum-alloc.is-zero {
  color: #6b7280;
}

/* ===== r438 三列表头统一垂直居中：右列（打印预览）补进 r427 的 30px 居中规则 =====
   r427 只覆盖了 .wo-sheet-wrap（中列）和左列日期行，右列 .wo-preview 的表头
   仍是顶对齐（内容中心线 88.8 vs 左中 94），三列看表头不齐。 */
.wo-preview > .wo-preview-head {
  align-items: center;
  height: 30px;
  padding: 0 2px !important;
  box-sizing: content-box;
}

/* ===== r439 表头条带整体居中：标题在「卡片顶边 ↔ 下方内容」之间上下居中 =====
   此前卡片自带 12px 顶内距 + 表头 30px，文字中心(94)低于分 区中心(87.5)，上空下挤。
   改为：卡片顶内距归零，表头自成 44px 居中条带（文字上下各 ~12px），上下间距严格相等。 */
.wo-left,
.wo-sheet-wrap,
.wo-preview { padding-top: 0; }
.wo-left .list-day-head,
.wo-sheet-wrap > .wo-preview-head,
.wo-preview > .wo-preview-head {
  height: 44px;
  align-items: center;
  padding: 0 2px !important;
  box-sizing: content-box;
}

/* r439 续：r428 的 .wo-preview{padding:12px !important} 压住了上面的顶距归零，补同等优先级 */
.wo-preview { padding-top: 0 !important; }

/* ===== r440 三列等高：中列/右列与左列同为视口条带（top66 ~ 底边距40），纸张撑满、内容内滚 =====
   此前 align-items:start 下左列 854 / 中列 708 / 右列 694 不同高。
   中列：A4 比例改 auto，纸撑满卡内剩余高度（明细区 .wo-drop 原本就内滚）；
   右列：预览纸同样撑满，overflow 放开纵向滚动（预览超出首屏可滚，不再死裁）。 */
.wo-sheet-wrap,
.wo-preview {
  position: sticky;
  top: 66px;
  height: calc(100vh - 106px);
  min-height: 380px;
  display: flex;
  flex-direction: column;
}
.wo-sheet-wrap .wo-form {
  flex: 1 1 auto;
  min-height: 0;
  aspect-ratio: auto;
  margin-bottom: 0;
}
.wo-preview .pp-page {
  flex: 1 1 auto;
  min-height: 0;
  aspect-ratio: auto;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}
/* 新内滚区复用左列细滚动条 */
.wo-sheet-wrap .wo-drop::-webkit-scrollbar,
.wo-preview .pp-page::-webkit-scrollbar { width: 8px; height: 8px; }
.wo-sheet-wrap .wo-drop::-webkit-scrollbar-track,
.wo-preview .pp-page::-webkit-scrollbar-track { background: transparent; }
.wo-sheet-wrap .wo-drop::-webkit-scrollbar-thumb,
.wo-preview .pp-page::-webkit-scrollbar-thumb {
  background: rgba(120, 130, 150, 0.3);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

/* ===== r441 最大化利用页面：收紧上下留白，三列条带几乎顶满视口 =====
   原：页面上 10px / 下 40px 预留 → 卡片 top66 / 高 calc(100vh-106px)，底部一大条空隙。
   改：页面内距 8px，卡片 top64 / 高 calc(100vh-72px)，上下只剩对称的 8px 呼吸边。 */
.main.list-wide:has(.wo-split) { padding: 8px !important; }
.wo-left,
.wo-sheet-wrap,
.wo-preview {
  top: 64px;
  height: calc(100vh - 72px);
}

/* ===== r443 中列/右列纸张内滚区隐藏滚动条（滚轮仍可滚动） =====
   用户要求：中列不能出现滚动条（QS-2312 十三码+工艺行内容超高后 .wo-drop 出竖条）。
   保留滚动能力，仅隐藏滚动条本体；横向溢出一并封死。左列清单滚动条不受影响。 */
.wo-sheet-wrap .wo-drop,
.wo-preview .pp-page { scrollbar-width: none; -ms-overflow-style: none; }
.wo-sheet-wrap .wo-drop::-webkit-scrollbar,
.wo-preview .pp-page::-webkit-scrollbar { width: 0; height: 0; display: none; }
.wo-sheet-wrap .wo-drop-body { overflow-x: hidden; }

/* ===== r444 中列滚动条彻底根绝 =====
   现象：用户 Edge 中 QS-2312 表格底部仍出现横向滚动条（带两端箭头的经典样式）。
   无头环境 1100~1600px 全宽度复现不出 → 滚动条载体是表格外层 .size-table-wrap
   （r5281 规则给它 overflow-x:auto），极端窗口/缩放/数据下差 1px 就会出条。
   措施：中列所有内层容器一律禁滚动条；size-table-wrap 用 overflow-x:clip
   （比 hidden 更彻底，连程序滚动都禁止），表格压回容器宽度。 */
.wo-sheet-wrap .size-table-wrap,
.wo-sheet-wrap .list-detail-wrap,
.wo-sheet-wrap .cart-list,
.wo-sheet-wrap .cart-merchant,
.wo-sheet-wrap .cart-product-block {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.wo-sheet-wrap .size-table-wrap::-webkit-scrollbar,
.wo-sheet-wrap .list-detail-wrap::-webkit-scrollbar,
.wo-sheet-wrap .cart-list::-webkit-scrollbar,
.wo-sheet-wrap .cart-merchant::-webkit-scrollbar,
.wo-sheet-wrap .cart-product-block::-webkit-scrollbar { width: 0; height: 0; display: none; }
.wo-sheet-wrap .size-table-wrap { overflow-x: clip; max-width: 100%; }
@supports not (overflow-x: clip) {
  .wo-sheet-wrap .size-table-wrap { overflow-x: hidden; }
}
.wo-sheet-wrap .size-table { max-width: 100%; }
/* 尺码格数字输入框不允许撑出格宽（1280px 以下曾差 1px） */
.wo-sheet-wrap .wo-qty-input { min-width: 0; max-width: 100%; }

/* ===== r446 LOGO 区压扁 + LOGO 上传按钮 =====
   用户反馈：A4 版面上方 LOGO 区有点高；且 LOGO 要能点击上传。
   ① 表头内距 12px→4px、LOGO 字号 20→15、框内距 6px→3px，整行明显变薄；
   ② LOGO 框变成上传控件：无图时虚线框 + 悬停「点击上传」提示；有图时图片按原比例
      填进框（最高 34px），悬停出现 × 移除；数据存 localStorage("wo-logo")。 */
.wo-head { padding: 4px 14px; gap: 10px; }
.wo-logo {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  letter-spacing: 2px;
  padding: 3px 12px;
  min-height: 28px;
  min-width: 64px;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s, color 0.15s;
  /* r447：LOGO 不要边框（原 1px 虚线框去掉），悬停仅字色变主色提示可点
     r448：border 简写会把宽度重置为 medium(~3px)，has-img 再设 solid 就变粗边——
     两处一律显式 border:none 按死，任何状态都不出边框 */
  border: none;
}
.wo-logo,
.wo-logo.has-img { border: none; }
.wo-logo:hover { border-color: var(--primary); color: var(--primary); }
.wo-logo.has-img { padding: 2px 6px; color: var(--ink); }
.wo-logo-img { max-height: 34px; max-width: 140px; object-fit: contain; display: block; }
.wo-logo-hint {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  font-size: 9.5px;
  letter-spacing: 0;
  line-height: 1.5;
  text-align: center;
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.88);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
.wo-logo:hover .wo-logo-hint { opacity: 1; }
.wo-logo.has-img .wo-logo-hint { background: rgba(0, 0, 0, 0.38); color: #fff; }
.wo-logo-del {
  position: absolute;
  top: 0; right: 0;
  width: 15px; height: 15px;
  border: 0; padding: 0;
  border-radius: 0 7px 0 6px;
  background: var(--danger, #e5484d);
  color: #fff;
  font-size: 10px; line-height: 15px;
  text-align: center;
  cursor: pointer;
  display: none;
}
.wo-logo.has-img .wo-logo-del { display: block; }
.wo-logo-del:hover { filter: brightness(1.12); }
html.dark .wo-logo { background: rgba(255, 255, 255, 0.05); }
html.dark .wo-logo-hint { background: rgba(23, 25, 29, 0.85); color: #b9c0cc; }
/* 打印预览克隆里：提示与 × 都不出现，只留 LOGO 图/占位字 */
.pp-scale .wo-logo-hint,
.pp-scale .wo-logo-del { display: none !important; }

/* ===== r452 标题条按钮组（导出PDF / 提交加工单）+ 打印版式 ===== */
.wo-preview-actions { display: inline-flex; align-items: center; gap: 8px; }

/* 导出PDF：克隆的加工单按 A4 版式输出（190mm 内容宽 + 10mm 页边） */
@media print {
  body.print-table .pg-print-holder.wo-pdf-holder {
    display: block;
    width: 190mm;
    /* r453：内容水平居中（A4 210mm - 190mm = 左右各 10mm）；此前内容从 x=0 顶格开始、
       右侧留 20mm 空白，预览里看着"没居中、左边被截断"。
       r456：顶部留白 10mm→5mm（用户要求把顶部空间利用起来），纸高 277→287mm，
       上下各剩 5mm 对称；5mm 仍在多数打印机物理边距内。 */
    margin: 0 auto;
    padding: 5mm 0 0;
    height: auto;
    background: #fff;
  }
  body.print-table .pg-print-holder.wo-pdf-holder + .pg-print-holder.wo-pdf-holder { page-break-before: always; }
  body.print-table .wo-pdf-holder .wo-form {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 287mm;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: #fff;
    overflow: hidden;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  body.print-table .wo-pdf-holder .wo-head,
  body.print-table .wo-pdf-holder .wo-design { flex: 0 0 auto; }
  body.print-table .wo-pdf-holder .wo-design { flex: 0 0 30% !important; min-height: 40mm !important; }
  body.print-table .wo-pdf-holder .wo-design.has-img { flex: 0 0 30% !important; }
  body.print-table .wo-pdf-holder .wo-design-slot { min-height: 0; }
  body.print-table .wo-pdf-holder .wo-drop { flex: 1 1 auto; min-height: 0; overflow: visible; }
  body.print-table .wo-pdf-holder .wo-drop-body { overflow: visible; }
  body.print-table .wo-pdf-holder .size-table-wrap { overflow: visible !important; }
  body.print-table .wo-pdf-holder .wo-qty-input { border: 0; background: transparent; }
}

/* ===== r450 加工单标题条补回分隔线 =====
   用户反馈："加工单·日期"那条灰带没有框线了。
   原因：r445 中列纸张改 A4 居中后比卡片窄，原本"纸顶边"充当的标题条下缘线消失了，
   标题条悬在空白卡底上看着没框。给标题条补 1px 底边线（与卡片边框同色），右列
   预览条带同样处理保持一致（其纸张虽满宽，但两列并列时线要齐）。 */
.wo-sheet-wrap > .wo-preview-head,
.wo-preview > .wo-preview-head { border-bottom: 1px solid var(--line); }

/* ===== r449 传图区压扁：50% → 32%，明细区相应加大 =====
   用户反馈：A4 纸上默认的两个图片上传框太高（空着时半页都是绿底）。
   改为占纸张高度 32%（约 1/3），保底 110px；有图后仍由图片原始比例决定。
   右列预览克隆的 .pp-scale .wo-design 同步改，保持两列一致。 */
/* r483 与 PDF 1:1：屏幕传图区 32%→30%（打印态一直是 30%，此前屏幕多占 22px，
   导致同样的明细 PDF 放得下、屏幕却超出——两边明细容量不一致） */
.wo-sheet-wrap .wo-design { flex: 0 0 30% !important; min-height: 110px !important; }
/* r480 有图也是同样比例：图片只缩放在框内，绝不改动版面高度 */
.wo-sheet-wrap .wo-design.has-img { flex: 0 0 30% !important; height: auto !important; }
.pp-scale .wo-design { flex: 0 0 30%; min-height: 0; }
/* r483 明细字号三处同源：屏幕中列被 .list-main 命中成 11.5px，打印克隆体没有 .list-main
   祖先落回 12px → 行高不同、可容纳行数不同。统一 12px（与 PDF 一致），.wo-drop 作用域
   屏幕/预览克隆/PDF 克隆三处都存在，天然同源。 */
.wo-drop .size-table { font-size: 12px !important; }
/* r483 缩略图同源：屏幕命中 .list-main 作用域 54px，打印克隆没有 .list-main 落回基础 52px
   → 行高差 2px、可容纳行数不同。统一 54px。 */
.wo-drop .size-thumb-cell .color-thumb-sm { width: 54px !important; height: 54px !important; }
/* r483 货号行 1px 残差：baseline 对齐 + 11.5px 小数行高的亚像素舍入，屏幕 21px / 打印 20px
   （×每组=3px 累积差）。改垂直居中对齐消除，仅 .wo-drop 作用域不影响左侧清单。 */
.wo-drop .cart-product-line { align-items: center; }
/* 修复：display:block/inline-block 会顶掉 hidden 属性的 UA display:none，
   导致未上传时渲染出 alt 文本（LOGO 框旁冒出"店铺 LOGO"）。按死 hidden 态。 */
.wo-logo-img[hidden],
.wo-design-img[hidden] { display: none !important; }

/* ===== r445 中列恢复 A4 版面：上传区 + 拖入 SKU 排在一张 A4 纸上 =====
   用户要求：中间列默认 A4 大小，正面/背面图片上传与拖入的 SKU 明细都在一张 A4 纸版面上完成。
   实现：卡片设为 size 容器，纸在「表头条带(44px)以下、卡片内距以内」的可用空间里
   取最大 210:297 矩形（height 取 高约束 与 宽约束×297/210 的较小值，
   宽度由 aspect-ratio 推出），两向居中——宽屏时上下留灰边，观感如文档查看器。
   纸内布局沿用 r389：表头 + 设计稿上传区 + 明细区；内容超出按 r444 裁切，不出滚动条。 */
.wo-sheet-wrap { container: wo-sheet / size; }
/* r464：纸按 PDF 真实版面尺寸渲染（718×1085px = 190mm×287mm @96dpi），缩放交给 fitWoForm。
   此前 r445 纸高被卡片压短而字号不变 → 屏幕纸的明细区比 PDF 少装好几行 → 纸内滚屏；
   现在屏幕与 PDF 逐像素同源，PDF 不满一页屏幕就必然放得下。 */
.wo-form-scaler { position: relative; flex: 1 1 auto; min-height: 0; }
/* r473 多页：.wo-pages 承担绝对定位与整体缩放，纸张随流纵排（间距 = JS WO_PAGE_GAP 32px） */
.wo-pages {
  position: absolute;
  transform-origin: 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}
/* r478 翻页：加工单一次只显示一张 A4，其余页 display:none（fitWoForm 只按当前页算缩放） */
.wo-pages .wo-form.is-page-off { display: none !important; }
/* 页码胶囊 ‹ 1/2 ›：只有多于一张纸时出现 */
.wo-pager { display: inline-flex; align-items: center; gap: 2px; margin-right: 2px; }
.wo-pager[hidden] { display: none !important; }
.wo-pager-btn {
  width: 22px; height: 22px; padding: 0; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
  border: 1px solid var(--line-strong); border-radius: 6px;
  background: var(--card); color: var(--ink-2); cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.wo-pager-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.wo-pager-btn:disabled { opacity: 0.3; cursor: default; }
.wo-pager-idx {
  min-width: 36px; text-align: center;
  font-size: 12px; font-weight: 700; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.wo-pager-idx em { font-style: normal; font-weight: 500; color: var(--ink-2); opacity: 0.7; }
.wo-sheet-wrap .wo-form-scaler .wo-form {
  flex: none;  /* r471：A4 整页 210×297mm（794×1123px），padding 5mm/10mm 对应导出 PDF 页边距，
     内容区 190×287mm(718×1085px) 与此前完全一致；box-sizing:border-box 向内扣 */
  width: 794px !important;
  height: 1123px !important;
  padding: 5mm 10mm !important;
  aspect-ratio: auto !important;
  margin: 0 !important;
  border: 0; /* r483：去掉 1px 边框，内容高度 1085px 与打印 form(287mm=1084.7px) 对齐，此前差 1.8px；边界由红色虚线 outline 承担 */
  overflow: hidden;
}

/* ===== r459 压缩加工单表格行高：缩略图是方形的，上下缝隙收掉 =====
   用户要求压表格高度。行高被三处垂直内距撑着：缩略图格 4px(5263)、单元格 3px(1657)、
   数量输入框 4px(6047)。全部收到 1px；表头 6px→3px。.wo-drop 作用域：中列/预览/PDF 三处一致。
   注意：缩略图格规则必须与 5263 同特异性且置于其后才能赢过它的 !important。 */
.list-main .list-detail-wrap .size-thumb-cell { padding: 1px !important; }
.wo-drop .size-table td { padding-top: 1px !important; padding-bottom: 1px !important; }
.wo-drop .size-table th { padding-top: 3px !important; padding-bottom: 3px !important; }
.wo-drop .wo-qty-input { padding-top: 1px; padding-bottom: 1px; }
/* r459b：行高真凶是 .wh-qty { height:70px }（4244 行写死），覆盖之，行高交给缩略图决定；
   缩略图格内距用更高特异性压到 1px（5407 的 3px !important 同源更早），方形图上下不再有缝隙 */
.wo-drop .size-table tbody td.wh-qty { height: auto !important; }
.list-main .list-detail-wrap .cart-list .size-table .size-thumb-cell { padding: 1px !important; }

/* ===== r461 左列清单表格行高同步压缩（用户要求左列与中列一致） =====
   上轮 r459/r460 只压了 .wo-drop（中列/预览/PDF）；左列 .wo-left 同样被
   .wh-qty{height:70px} 与 3px 垂直内距撑着。此处对齐：td 1px / th 3px /
   数量格高度自适应 / 缩略图格 1px。 */
.wo-left .size-table td { padding-top: 1px !important; padding-bottom: 1px !important; }
.wo-left .size-table th { padding-top: 3px !important; padding-bottom: 3px !important; }
.wo-left .size-table tbody td.wh-qty { height: auto !important; }
.wo-left .list-detail-wrap .size-table .size-thumb-cell { padding: 1px !important; }

/* ===== r462 左列缩略图居中 + 表格撑满把富余宽度均给尺码列 =====
   ① 居中：.color-thumb-sm 是 margin:0 auto，但 5408 的 margin-right:0 覆盖了右侧 auto
   → 左 auto 吃掉全部富余 ~7px，图偏右不居中。恢复左右对称。
   ② 均宽：table-layout:auto 下表格实测 502px、容器 548px，46px 富余没用上；
   width:100% 后浏览器把富余分给无固定宽度的尺码列。 */
.wo-left .size-thumb-cell .color-thumb-sm { margin: 0 auto !important; }
.wo-left .list-detail-wrap .size-table { width: 100%; }
/* r462b：46px 富余实际吃在两层容器内距上，收掉一部分均给表格列 */
.wo-left .list-detail-wrap { padding-left: 6px !important; padding-right: 4px !important; }
.wo-left .cart-list .cart-product-block { padding-left: 4px !important; padding-right: 4px !important; }

/* ===== r465 中列卡片首行（标题条带）与第二行（纸头 LOGO 行）压高 =====
   用户要求压缩。标题条带 44→34px；纸头行 padding 4px→2px、LOGO 框 28→20px、
   LOGO 图上限 34→24px（纸头行 ~37px→~24px）。纸在 PDF 同源版面内，PDF 同步变紧凑。 */
.wo-left .list-day-head,
.wo-sheet-wrap > .wo-preview-head,
.wo-preview > .wo-preview-head {
  height: 34px;
}
.wo-sheet-wrap .wo-head,
.wo-pdf-holder .wo-head { padding: 2px 14px !important; }
.wo-sheet-wrap .wo-logo,
.wo-pdf-holder .wo-logo { min-height: 20px; padding: 2px 10px; }
.wo-sheet-wrap .wo-logo-img,
.wo-pdf-holder .wo-logo-img { max-height: 24px !important; }

/* ===== r466 压缩加工单明细首行（表头）与第二行（价格行） =====
   用户要求。表头 th 垂直内距 3→2px、字号 12→11px；价格行 th/格内距 3→1px。
   置于 r459 之后，同特异性后位生效。中列/预览/PDF 三处一致。 */
.wo-drop .size-table thead th {
  padding-top: 2px !important;
  padding-bottom: 2px !important;
  font-size: 11px;
}
.wo-drop .size-table tr.size-price-row th,
.wo-drop .size-table .size-price-cell {
  padding-top: 1px !important;
  padding-bottom: 1px !important;
  font-size: 10.5px;
}

/* ===== r467 压缩加工单明细组头两行与组末尾间距 =====
   用户要求：徽章行（.cart-merchant-title）、货号行（.cart-product-head）、
   一组结束的末尾（.cart-product-block 垂直内距/边框区）都压一下。
   .wo-drop 作用域：中列/预览/PDF 三处一致。
   徽章行：padding 8→2px、badge 24→16px、字号 12→11px（行高 ~40→~20px）；
   货号行：margin-bottom 8→3px、货号字号 13→11.5px、名称 12→11px；
   组末尾：block 垂直内距 10→4px（水平沿用 6px），商户块外间距收 6→3px。 */
.wo-drop .cart-merchant-title { padding: 2px 8px; font-size: 11px; gap: 6px; }
.wo-drop .cart-merchant-badge { width: 16px; height: 16px; font-size: 10px; }
.wo-drop .cart-merchant-pill { padding: 1px 10px 1px 2px; gap: 5px; }
.wo-drop .cart-product-head { margin-bottom: 3px; }
.wo-drop .cart-product-line .cart-sku { font-size: 11.5px; }
.wo-drop .cart-product-line .cart-product-name { font-size: 11px; }
.wo-drop .cart-product-line .cart-prod-qty { font-size: 11px; }
.wo-drop .cart-product-block { padding-top: 4px !important; padding-bottom: 4px !important; }
.wo-drop .cart-merchant + .cart-merchant { margin-top: 3px; }

/* ===== r468 组与组之间间距再收 =====
   真凶：.cart-list 是 flex column + gap:10px（1364 行），组间实际 10px gap + r467 的 3px margin ≈ 13px。
   收为 gap 2px + margin-top 1px ≈ 3px。.wo-drop 作用域：中列/预览/PDF 三处一致。 */
.wo-drop .cart-list { gap: 2px; }
.wo-drop .cart-merchant + .cart-merchant { margin-top: 1px; }

/* ===== r469 中列 A4 轮廓线（用户要求：框出 A4 轮廓，知道内容到哪里会超出） =====
   ① 缩放区垫灰底（如 PDF 阅读器），白纸边界自然浮现；
   ② 纸加红色虚线轮廓（A4 版面边界）：outline 不占布局、不影响 fitWoForm 测量；
   ③ 预览克隆/PDF 克隆去掉虚线（各自已有边界，导出不能带线）。 */
.wo-form-scaler { background: #eef0f4; border-radius: 8px; }
html.dark .wo-form-scaler { background: #111318; }
.wo-sheet-wrap .wo-form-scaler .wo-form {
  outline: 2px dashed rgba(230, 0, 18, 0.75);
  outline-offset: -2px;
  box-shadow: 0 2px 12px rgba(22, 24, 29, 0.1);
}
.pp-scale .wo-form { outline: none; box-shadow: none; }
body.print-table .wo-form { outline: none; box-shadow: none; }

/* r471b：中列纸改 A4 整页(794×1123)后，5606/5620 的 max-width:100% 会把它
   截回缩放容器宽（CSS 规范 max-width 恒压过 width，无论 !important）。
   绝对定位的缩放版面必须解除 max-width 限制。 */
.wo-sheet-wrap .wo-form-scaler .wo-form { max-width: none !important; }
