/**
 * 温育银芽仓库系统 — 大按钮样式
 * 设计原则：字体≥24px，按钮≥60px，零打字，全选菜单
 */

:root {
  --primary: #1a73e8;
  --primary-light: #e8f0fe;
  --danger: #d32f2f;
  --success: #2e7d32;
  --warning: #f57c00;
  --gray: #9e9e9e;
  --gray-light: #f5f5f5;
  --text: #212121;
  --text-light: #757575;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,0.12);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, 'PingFang SC', 'Noto Sans SC', sans-serif;
  font-size: 24px;
  color: var(--text);
  background: var(--gray-light);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── 离线覆盖层 ─── */
.offline-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  z-index: 9999;
  pointer-events: all;
}
.offline-overlay.hidden { display: none; }

/* ─── 通用隐藏类（供 stats-after1400 等无专属 .X.hidden 规则的元素复用） ─── */
.hidden { display: none; }

/* ─── 页面容器 ─── */
.page {
  padding: 16px;
  max-width: 800px;
  margin: 0 auto;
  min-height: 100vh;
}
.page.hidden { display: none; }

/* ─── 标题 ─── */
.page-title {
  font-size: 32px;
  font-weight: 700;
  text-align: center;
  padding: 16px 0;
  color: var(--primary);
}

/* ─── 大按钮（首页4大按钮） ─── */
.big-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 120px;
  margin: 8px 0;
  padding: 24px 16px;
  font-size: 28px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
  box-shadow: var(--shadow);
}
.big-btn:active {
  transform: scale(0.96);
}
.big-btn.primary {
  background: var(--primary);
  color: white;
}
.big-btn.success {
  background: var(--success);
  color: white;
}
.big-btn.warning {
  background: var(--warning);
  color: white;
}
.big-btn.danger {
  background: var(--danger);
  color: white;
}
.big-btn.gray {
  background: var(--gray-light);
  color: var(--text);
}
.big-btn.disabled {
  background: var(--gray);
  color: white;
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}
.big-btn .icon {
  font-size: 40px;
  margin-bottom: 8px;
}

/* ─── 选择卡片（选人/选产品/选库位） ─── */
.select-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: calc(50% - 8px);
  min-height: 80px;
  margin: 4px;
  padding: 16px 8px;
  font-size: 20px;
  font-weight: 500;
  border: 2px solid var(--gray-light);
  border-radius: var(--radius);
  cursor: pointer;
  background: white;
  transition: all 0.15s;
}
.select-card:active {
  transform: scale(0.96);
}
.select-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}
.select-card .avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gray-light);
  margin-bottom: 4px;
  overflow: hidden;
}
.select-card .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.select-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
}

/* ─── 数量控制（±按钮） ─── */
.qty-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 16px 0;
}
.qty-btn {
  width: 64px;
  height: 64px;
  font-size: 32px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--primary);
  color: white;
}
.qty-btn:active { transform: scale(0.94); }
.qty-btn.minus { background: var(--danger); }
.qty-value {
  font-size: 36px;
  font-weight: 700;
  min-width: 80px;
  text-align: center;
}

/* ─── 快捷数量按钮 ─── */
.quick-qty {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 8px 0;
}
.quick-qty button {
  min-height: 48px;
  min-width: 64px;
  font-size: 20px;
  padding: 8px 16px;
  border: 2px solid var(--primary);
  border-radius: 8px;
  background: white;
  color: var(--primary);
  cursor: pointer;
  font-weight: 600;
}
.quick-qty button:active {
  background: var(--primary-light);
}

/* ─── 确认弹窗 ─── */
/* ─── Spec 104：录入防重提示弹窗 ─── */
.dupguard-overlay {
  position: fixed; inset: 0; z-index: 3000;
  background: rgba(17, 24, 20, .45);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.dupguard-box {
  width: 560px; max-width: 100%; background: #fff; border-radius: 18px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, .3); overflow: hidden;
}
.dupguard-head {
  background: #FFF6E6; border-bottom: 1px solid #F3E2C4;
  padding: 16px 22px; font-size: 18px; font-weight: 700; color: #B4690E;
}
.dupguard-body { padding: 20px 22px 8px; font-size: 16px; line-height: 1.75; }
.dupguard-hit {
  background: #F7FAF8; border: 1px solid #DDE5E0; border-left: 4px solid #B4690E;
  border-radius: 10px; padding: 12px 14px; margin: 12px 0;
}
.dupguard-q { font-size: 17px; font-weight: 700; margin: 6px 0 14px; }
.dupguard-actions { display: flex; gap: 12px; padding: 0 22px 22px; }
.dupguard-btn {
  flex: 1; padding: 15px; border: none; border-radius: 14px;
  font-size: 17px; font-weight: 700; cursor: pointer;
}
.dupguard-btn.dupguard-cancel { background: #F1F5F3; color: #44504A; }
.dupguard-btn.dupguard-continue { background: #B4690E; color: #fff; }

.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: white;
  border-radius: var(--radius);
  padding: 32px;
  max-width: 600px;
  width: 90%;
  text-align: center;
}
.modal-box .modal-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 16px;
}
.modal-box .modal-detail {
  font-size: 24px;
  color: var(--text-light);
  margin-bottom: 24px;
  line-height: 1.6;
}
.modal-box .modal-detail .weight {
  color: var(--primary);
  font-weight: 700;
  font-size: 28px;
}
.modal-box .modal-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
}
.modal-box .modal-actions button {
  min-height: 60px;
  min-width: 120px;
  font-size: 24px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
}
.modal-box .btn-confirm {
  background: var(--primary);
  color: white;
}
.modal-box .btn-cancel {
  background: var(--gray-light);
  color: var(--text);
}

/* ─── 成功动画 ─── */
.success-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(46,125,50,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}
.success-overlay.hidden { display: none; }
.success-icon {
  font-size: 120px;
  color: white;
  animation: successPop 0.5s ease;
}
@keyframes successPop {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

/* ─── 容量警告 ─── */
.capacity-warning {
  background: #fff3e0;
  border: 2px solid var(--warning);
  border-radius: var(--radius);
  padding: 16px;
  margin: 16px 0;
  text-align: center;
  font-size: 22px;
  color: var(--warning);
}
.capacity-warning .suggestion {
  font-size: 18px;
  color: var(--text-light);
  margin-top: 8px;
}

/* ─── 库存列表 ─── */
.inventory-list {
  background: white;
  border-radius: var(--radius);
  padding: 16px;
  margin: 8px 0;
}
.inventory-item {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-light);
  font-size: 22px;
}
.inventory-item:last-child { border-bottom: none; }
.inventory-item .product-name { font-weight: 600; }
.inventory-item .qty { color: var(--primary); font-weight: 700; }

/* ─── 流水列表 ─── */
.txn-item {
  background: white;
  border-radius: var(--radius);
  padding: 12px 16px;
  margin: 8px 0;
  font-size: 20px;
}
.txn-item .type-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  color: white;
}
.txn-item .type-badge.inbound { background: var(--success); }
.txn-item .type-badge.outbound { background: var(--primary); }
.txn-item .type-badge.transfer { background: var(--warning); }
.txn-item .type-badge.conversion { background: #7b1fa2; }
.txn-item .type-badge.spoilage { background: var(--danger); }

/* ─── 返回按钮 ─── */
.back-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 24px;
  font-weight: 600;
  color: var(--primary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 16px 0;
}
.back-btn:active { opacity: 0.7; }

/* ─── 分隔线 ─── */
.section-label {
  font-size: 20px;
  color: var(--text-light);
  padding: 12px 0 4px;
  font-weight: 600;
}

/* ─── 自定义包规输入 ─── */
.custom-weight-row {
  flex-direction: column;
  align-items: stretch;
  margin: 8px 0;
  padding: 12px;
  background: #fff3e0;
  border-radius: var(--radius);
  border: 2px solid #ffe0b2;
}
.custom-weight-input {
  width: 100%;
  padding: 16px;
  font-size: 28px;
  text-align: center;
  border: 2px solid var(--warning);
  border-radius: var(--radius);
  outline: none;
}
.custom-weight-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,115,232,0.2);
}

/* ─── 备注输入 ─── */
.remark-input {
  width: 100%;
  min-height: 60px;
  font-size: 20px;
  padding: 12px;
  border: 2px solid var(--gray-light);
  border-radius: var(--radius);
  resize: none;
}

/* ─── 交接班快照 ─── */
.snapshot-card {
  background: white;
  border-radius: var(--radius);
  padding: 16px;
  margin: 8px 0;
}
.snapshot-zone {
  font-size: 22px;
  font-weight: 600;
  color: var(--primary);
  margin: 4px 0;
}
.snapshot-row {
  display: flex;
  justify-content: space-between;
  font-size: 20px;
  padding: 4px 0;
}

/* ─── 顶部导航栏 ─── */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--primary);
  color: white;
  padding: 8px 16px;
  font-size: 24px;
  font-weight: 700;
}
.top-bar .offline-tag {
  font-size: 18px;
  background: var(--danger);
  padding: 4px 12px;
  border-radius: 6px;
}

/* ─── 滚动容器 ─── */
.scroll-area {
  overflow-y: auto;
  max-height: calc(100vh - 60px);
}

/* ─── 登录页 ─── */
.login-form {
  background: white;
  border-radius: var(--radius);
  padding: 32px 16px;
  margin: 16px 0;
  box-shadow: var(--shadow);
}
.login-input {
  width: 100%;
  padding: 16px;
  font-size: 28px;
  border: 2px solid var(--gray-light);
  border-radius: var(--radius);
  margin-bottom: 12px;
  outline: none;
}
.login-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,115,232,0.2);
}
.login-error {
  color: var(--danger);
  font-size: 20px;
  text-align: center;
  padding: 8px;
  margin-bottom: 12px;
}
.login-error.hidden { display: none; }

/* ─── 首页用户信息 ─── */
.home-user-info {
  text-align: center;
  font-size: 18px;
  color: var(--text-light);
  padding: 8px 0;
  margin-bottom: 8px;
}

/* ─── 首页内嵌库存看板 ─── */
.home-kanban { padding: 0 4px; }
.kanban-loading { text-align: center; padding: 24px; color: var(--text-light); font-size: 20px; }
.home-wh-row { display: flex; gap: 8px; justify-content: space-between; }

/* ─── 首页看板：蛇形网格款式（复用 kanban.html 逻辑，hp- 前缀避免冲突） ─── */
.hp-wh-card {
  flex: 1;
  background: white;
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
  border: 2px solid transparent;
  box-shadow: var(--shadow);
  transition: transform 0.1s;
  display: flex;
  flex-direction: column;
}
.hp-wh-card:active { transform: scale(0.96); }
.hp-wh-header {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}
.hp-theme-cold       { border-color: #1a73e8; }
.hp-theme-air_cooled { border-color: #2e7d32; }
.hp-theme-normal     { border-color: #f57c00; }
.hp-theme-cold       .hp-wh-header { color: #1a73e8; }
.hp-theme-air_cooled .hp-wh-header { color: #2e7d32; }
.hp-theme-normal     .hp-wh-header { color: #f57c00; }

/* 蛇形网格：2列×3行（左列 A1→A2→A3 上到下，右列 A6→A5→A4 上到下） */
.hp-snake-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(3, auto);
  gap: 6px;
}
.hp-zone-cell {
  border-radius: 8px;
  padding: 10px 6px;
  text-align: center;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.hp-zone-code { font-size: 20px; font-weight: 700; }
.hp-zone-pct  { font-size: 18px; font-weight: 600; }

/* 容量变色（与 kanban.html 一致：绿/黄/红） */
.hp-cap-0    { background: #f5f5f5; color: #9e9e9e; }
.hp-cap-low  { background: #e8f5e9; color: #2e7d32; }
.hp-cap-mid  { background: #fff3e0; color: #f57c00; }
.hp-cap-high { background: #ffebee; color: #d32f2f; }
.hp-cap-full { background: #ffcdd2; color: #b71c1c; }

/* 底部整库容量条 */
.hp-cap-bar { margin-top: 10px; text-align: center; }
.hp-cap-track {
  height: 14px;
  background: #e0e0e0;
  border-radius: 7px;
  overflow: hidden;
  margin-bottom: 4px;
}
.hp-cap-fill { height: 100%; border-radius: 7px; }
.hp-cap-text { font-size: 15px; color: var(--text-light); }

.home-platform-card {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  background: #f5f5f5;
  border: 1px dashed #bdbdbd;
  border-radius: var(--radius);
  padding: 12px;
  margin-top: 10px;
  font-size: 20px;
}
.home-platform-card .hp-icon { font-size: 24px; }
.home-platform-card .hp-label { color: var(--text-light); }
.home-platform-card .hp-val { font-size: 26px; font-weight: 700; color: var(--primary); }
.home-platform-card .hp-unit { color: var(--text-light); font-size: 16px; }

/* ─── 首页操作区 ─── */
.home-op-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 4px 0;
}
.op-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 20px;
  font-weight: 600;
  color: white;
  box-shadow: var(--shadow);
  transition: transform 0.1s;
}
.op-card:active { transform: scale(0.96); }
.op-card.primary { background: var(--primary); }
.op-card.gray { background: var(--gray-light); color: var(--text); }
.op-card.danger { background: var(--danger); }
.op-card .op-icon { font-size: 30px; margin-bottom: 4px; }
.op-card.disabled { background: var(--gray); color: white; opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* ─── 首页看板明细 ─── */
.kanban-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 8px 4px;
}
.kd-cell {
  background: white;
  border-radius: var(--radius);
  padding: 10px;
  border: 2px solid transparent;
  box-shadow: var(--shadow);
}
.kd-code { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.kd-row {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  padding: 2px 0;
  color: var(--text-light);
}
.kd-empty { font-size: 18px; color: var(--gray); }
.kanban-detail-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  padding: 12px;
  background: white;
  border-radius: var(--radius);
  margin: 8px 4px;
  font-size: 18px;
}
.kd-total {
  width: 100%;
  text-align: center;
  font-weight: 700;
  color: var(--primary);
  font-size: 20px;
  margin-top: 4px;
}

/* ─── 出库线路卡片 ─── */
.route-grid .select-card {
  width: calc(33.3% - 8px);
  min-height: 60px;
  font-size: 18px;
}

/* ─── 数字键盘弹窗 ─── */
.numpad-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1500;
}
.numpad-overlay.hidden { display: none; }
.numpad-popup {
  background: white;
  border-radius: 16px;
  padding: 24px 20px;
  width: 340px;
  max-width: 92vw;
  text-align: center;
}
.numpad-popup .numpad-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.numpad-popup .numpad-display {
  font-size: 48px;
  font-weight: 700;
  color: var(--primary);
  padding: 8px 0 12px;
  min-height: 64px;
}
.numpad-popup .numpad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.numpad-popup .numpad-grid button {
  padding: 14px 0;
  font-size: 24px;
  font-weight: 700;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  background: #fafafa;
  cursor: pointer;
  min-height: 56px;
}
.numpad-popup .numpad-grid button:active { background: #e0e0e0; }
.numpad-popup .numpad-grid .fn-btn {
  background: #ffebee;
  border-color: #ef9a9a;
  color: #c62828;
}
.numpad-popup .numpad-quick {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  justify-content: center;
}
.numpad-popup .numpad-quick button {
  min-height: 40px;
  min-width: 56px;
  font-size: 18px;
  font-weight: 600;
  border: 2px solid var(--primary);
  border-radius: 8px;
  background: white;
  color: var(--primary);
  cursor: pointer;
  padding: 4px 12px;
}
.numpad-popup .numpad-quick button:active { background: var(--primary-light); }
.numpad-popup .numpad-actions {
  display: flex;
  gap: 10px;
}
.numpad-popup .numpad-actions button {
  flex: 1;
  padding: 14px 0;
  font-size: 20px;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  cursor: pointer;
}
.numpad-popup .numpad-actions .cancel { background: #f5f5f5; color: #616161; }
.numpad-popup .numpad-actions .ok { background: var(--primary); color: white; }
.numpad-popup .numpad-actions .ok:disabled { background: #bdbdbd; cursor: not-allowed; }

/* ─── 多选仓库卡片 ─── */
.zone-multi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.zone-card {
  background: white;
  border-radius: 10px;
  padding: 10px 6px;
  text-align: center;
  cursor: pointer;
  user-select: none;
  border: 3px solid #e0e0e0;
  transition: all 0.15s;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.zone-card:active { transform: scale(0.97); }
.zone-card .code {
  font-size: 22px;
  font-weight: 700;
  color: #333;
}
.zone-card .empty-hint {
  font-size: 14px;
  color: #bdbdbd;
  margin-top: 4px;
}
.zone-card.has-qty {
  border-color: var(--primary);
  background: var(--primary-light);
}
.zone-card.has-qty .code { color: var(--primary); }
.zone-card .qty-display {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  margin: 4px 0;
}
.zone-card .qty-controls {
  display: flex;
  gap: 4px;
  margin-top: 2px;
  flex-wrap: wrap;
  justify-content: center;
}
.zone-card .qty-controls button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  background: white;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
}
.zone-card .qty-controls button:active {
  background: var(--primary);
  color: white;
}
.zone-card .qty-controls .reset-btn {
  width: auto;
  border-radius: 6px;
  padding: 0 6px;
  border-color: #e57373;
  color: #d32f2f;
  font-size: 12px;
}

/* ─── 底部汇总条 ─── */
.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  padding: 12px 16px 24px;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
  z-index: 100;
}
.bottom-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.bottom-inner .info {
  font-size: 18px;
}
.bottom-inner .info strong {
  color: var(--primary);
}
.bottom-inner .info .remain {
  color: var(--warning);
  font-weight: 700;
}
.bottom-inner .btn-submit {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 28px;
  font-size: 20px;
  cursor: pointer;
  font-weight: 600;
}
.bottom-inner .btn-submit:disabled {
  background: #bdbdbd;
  cursor: not-allowed;
}

/* ─── 组长确认页 checkbox ─── */
.confirm-item {
  background: white;
  border-radius: var(--radius);
  padding: 12px 16px;
  margin: 8px 0;
  font-size: 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.confirm-item input[type="checkbox"] {
  width: 28px;
  height: 28px;
  margin-top: 4px;
  flex-shrink: 0;
  cursor: pointer;
}
.confirm-item .item-content {
  flex: 1;
}
.confirm-item .item-content .item-main {
  font-weight: 600;
}
.confirm-item .item-content .item-sub {
  font-size: 16px;
  color: var(--text-light);
  margin-top: 4px;
}
.confirm-item.suspect {
  border-left: 4px solid var(--danger);
}
.confirm-select-all {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 20px;
  font-weight: 600;
}
.confirm-select-all input[type="checkbox"] {
  width: 28px;
  height: 28px;
  cursor: pointer;
}
.batch-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.batch-actions button {
  flex: 1;
  min-height: 56px;
  font-size: 20px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
}
.batch-actions .btn-confirm-batch { background: var(--success); color: white; }
.batch-actions .btn-reject-batch { background: var(--danger); color: white; }
.batch-actions .btn-cancel-batch { background: var(--gray-light); color: var(--text); }

/* ─── 拒绝原因弹窗 ─── */
.reject-reason-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
  justify-content: center;
}
.reject-reason-grid button {
  min-height: 48px;
  min-width: 80px;
  font-size: 20px;
  padding: 8px 16px;
  border: 2px solid var(--danger);
  border-radius: 8px;
  background: white;
  color: var(--danger);
  cursor: pointer;
  font-weight: 600;
}
.reject-reason-grid button.selected {
  background: var(--danger);
  color: white;
}
.reject-reason-grid button:active { background: #ffebee; }

/* ─── 出库统计页 ─── */
.stats-date-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0;
}
.stats-date-row input[type="date"] {
  font-size: 24px;
  padding: 8px 12px;
  border: 2px solid var(--gray-light);
  border-radius: var(--radius);
}
.stats-period {
  font-size: 16px;
  color: var(--text-light);
}
.stats-summary {
  margin: 12px 0;
}

/* ─── 每日统计：指标卡 + 件数卡 ─── */
.stats-metric-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.stats-metric-card {
  background: white;
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow);
}
.stats-metric-card .sm-head {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}
.stats-metric-card .sm-head .sm-icon { margin-right: 4px; }
.stats-metric-card .sm-head strong { color: var(--primary); }
.stats-metric-card .sm-prod {
  font-size: 18px;
  color: var(--text-light);
  margin-bottom: 4px;
}
.stats-metric-card .sm-spec {
  font-size: 16px;
  color: var(--text);
  line-height: 1.5;
}
.stats-metric-card .sm-qty {
  font-size: 16px;
  color: var(--text-light);
  margin-top: 4px;
}
.stats-qty-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}
.stats-qty-card {
  background: white;
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
  box-shadow: var(--shadow);
  font-size: 18px;
  color: var(--text-light);
}
.stats-qty-card span { font-size: 22px; }
.stats-qty-card div {
  font-size: 26px;
  font-weight: 700;
  color: var(--primary);
  margin-top: 4px;
}
.stats-card {
  background: white;
  border-radius: var(--radius);
  padding: 16px 8px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stats-card .stats-icon { font-size: 32px; }
.stats-card .stats-qty {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
}
.stats-card .stats-weight {
  font-size: 16px;
  color: var(--text-light);
}
.stats-section {
  background: white;
  border-radius: var(--radius);
  padding: 16px;
  margin: 12px 0;
}
.stats-section .stats-section-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}
.stats-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 20px;
  border-bottom: 1px solid var(--gray-light);
}
.stats-row:last-child { border-bottom: none; }
.stats-row .stats-name { font-weight: 500; }
.stats-row .stats-val { color: var(--primary); font-weight: 700; }
.stats-empty {
  text-align: center;
  padding: 32px;
  color: var(--gray);
  font-size: 24px;
}

/* ─── 页面底部留白（给 bottom-bar 腾空间） ─── */
.page-with-bottom-bar {
  padding-bottom: 100px;
}

/* ─── 签名板弹窗 ─── */
.signature-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1600;
}
.signature-overlay.hidden { display: none; }
.signature-popup {
  background: white;
  border-radius: 16px;
  padding: 24px 20px;
  max-width: 640px;
  width: 92vw;
  text-align: center;
}
.signature-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}
.signature-canvas {
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  display: block;
  margin: 0 auto 16px;
  touch-action: none;
  background: #fff;
}
.signature-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.signature-actions .sig-clear {
  min-height: 56px;
  min-width: 120px;
  font-size: 22px;
  font-weight: 600;
  border: 2px solid #9e9e9e;
  border-radius: var(--radius);
  background: #f5f5f5;
  color: #616161;
  cursor: pointer;
}
.signature-actions .sig-confirm {
  min-height: 56px;
  min-width: 180px;
  font-size: 22px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius);
  background: var(--primary);
  color: white;
  cursor: pointer;
}
.signature-actions .sig-confirm:disabled {
  background: #bdbdbd;
  cursor: not-allowed;
}

/* ─── 直接出库流水类型标识 ─── */
.txn-item .type-badge.direct_outbound { background: #0277bd; }

/* ─── 出库整块按钮 ─── */
.block-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.block-card {
  background: white;
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  user-select: none;
  border: 3px solid #e0e0e0;
  transition: all 0.15s;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.block-card:active { transform: scale(0.97); }
.block-card .block-name {
  font-size: 22px;
  font-weight: 700;
  color: #333;
}
.block-card .block-stock {
  font-size: 14px;
  color: #9e9e9e;
  margin-top: 2px;
}
.block-card.has-qty {
  border-color: var(--primary);
  background: var(--primary-light);
}
.block-card.has-qty .block-name { color: var(--primary); }
.block-card .block-qty-display {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  margin: 4px 0;
}
.block-card .block-qty-controls {
  display: flex;
  gap: 4px;
  margin-top: 2px;
  flex-wrap: wrap;
  justify-content: center;
}
.block-card .block-qty-controls button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  background: white;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
}
.block-card .block-qty-controls button:active {
  background: var(--primary);
  color: white;
}
.block-card .block-qty-controls .reset-btn {
  width: auto;
  border-radius: 6px;
  padding: 0 6px;
  border-color: #e57373;
  color: #d32f2f;
  font-size: 12px;
}

/* ─── 差额说明弹窗 ─── */
.shortfall-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1700;
}
.shortfall-overlay.hidden { display: none; }
.shortfall-popup {
  background: white;
  border-radius: 16px;
  padding: 28px 24px;
  max-width: 600px;
  width: 92vw;
  text-align: center;
}
.shortfall-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--warning);
  margin-bottom: 16px;
}
.shortfall-detail {
  font-size: 22px;
  color: var(--text);
  margin-bottom: 20px;
  line-height: 1.6;
}
.shortfall-detail .deficit-line {
  margin: 4px 0;
  color: var(--danger);
  font-weight: 600;
}
.shortfall-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.shortfall-actions button {
  min-height: 72px;
  font-size: 24px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  padding: 12px;
}
.shortfall-makeup {
  background: var(--success);
  color: white;
}
.shortfall-makeup:active { opacity: 0.85; }
.shortfall-abort {
  background: var(--gray-light);
  color: var(--text);
  border: 2px solid #e0e0e0;
}
.shortfall-abort:active { opacity: 0.85; }

/* ─── Spec 087 操作回查 ─── */
.audit-tabs { display:flex; gap:8px; margin:8px 0 12px; flex-wrap:wrap; }
.audit-tab { flex:1; min-width:90px; padding:12px 8px; font-size:18px; border:2px solid #e0e0e0; background:#fff; border-radius:10px; color:var(--text); }
.audit-tab.active { border-color:var(--primary,#1976d2); background:var(--primary,#1976d2); color:#fff; }
.audit-filters { display:flex; flex-direction:column; gap:8px; margin-bottom:12px; }
.audit-filters label { font-size:18px; display:flex; flex-direction:column; gap:4px; }
.audit-select, .audit-input { font-size:20px; padding:10px; width:100%; box-sizing:border-box; border:2px solid #e0e0e0; border-radius:8px; }
.audit-list { display:flex; flex-direction:column; gap:8px; }
.audit-card { border:2px solid #e0e0e0; border-radius:10px; padding:10px 12px; background:#fff; }
.audit-card .ac-top { display:flex; justify-content:space-between; align-items:center; gap:8px; }
.audit-card .ac-type { font-size:18px; font-weight:700; }
.audit-card .ac-meta { font-size:15px; color:#666; margin-top:4px; }
.audit-card .ac-sig { display:inline-block; padding:2px 8px; border-radius:6px; font-size:14px; }
.sig-ok { background:#e8f5e9; color:#2e7d32; }
.sig-no { background:#f5f5f5; color:#999; }
.audit-detail-box { max-width:640px; max-height:80vh; overflow-y:auto; }
.audit-detail-body { font-size:16px; line-height:1.7; }
.audit-detail-body .kv { display:flex; justify-content:space-between; border-bottom:1px dashed #eee; padding:4px 0; }
.audit-detail-body .kv .k { color:#888; }
.audit-detail-body .old { color:#e53935; text-decoration:line-through; }
.audit-detail-body .new { color:#2e7d32; font-weight:700; }
.audit-detail-body .warn { color:var(--warning,#f57c00); font-weight:700; }
.audit-detail-body input[type=number] { font-size:22px; padding:8px; width:100%; box-sizing:border-box; border:2px solid #e0e0e0; border-radius:8px; }
.audit-detail-body .locked { background:#f5f5f5; color:#888; padding:8px; border-radius:6px; }
.audit-pager { display:flex; gap:8px; justify-content:center; margin:12px 0; }
.audit-pager button { padding:8px 16px; font-size:16px; border:2px solid #e0e0e0; background:#fff; border-radius:8px; }
.audit-pager button:disabled { opacity:0.4; }
.audit-status { padding:2px 8px; border-radius:6px; font-size:14px; font-weight:700; }
.st-pending { background:#fff3e0; color:#e65100; }
.st-approved { background:#e8f5e9; color:#2e7d32; }
.st-rejected { background:#ffebee; color:#c62828; }

/* ─── Spec 089 仓库每日统计重做（照抄原型 v2，scoped 到 #page-stats） ─── */
#page-stats {
  --green:#2e7d32; --green-l:#e8f5e9; --green-d:#1b5e20;
  --blue:#1565c0; --blue-l:#e3f2fd;
  --orange:#e65100; --orange-l:#fff3e0;
  --red:#c62828; --red-l:#ffebee;
  --sgray:#607d8b; --sgray-l:#f5f7fa;
  --sborder:#e0e4e8;
}
#page-stats .stats-banner {
  background: var(--green-l);
  border: 1px solid #c8e6c9;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 15px;
  color: var(--green-d);
  margin: 12px 0 16px;
  line-height: 1.6;
}

/* 三大指标卡 */
#page-stats .metric-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-bottom: 16px; }
@media(max-width:560px){ #page-stats .metric-grid { grid-template-columns: 1fr; } }
#page-stats .metric-card { background:#fff; border-radius:12px; padding:16px; border:1px solid var(--sborder); box-shadow:0 1px 4px rgba(0,0,0,.05); }
#page-stats .mc-head { display:flex; align-items:center; gap:8px; margin-bottom:12px; padding-bottom:10px; border-bottom:2px solid var(--sgray-l); }
#page-stats .mc-icon { font-size:20px; }
#page-stats .mc-title { font-size:15px; font-weight:700; color:#37474f; }
#page-stats .mc-total { margin-left:auto; font-size:22px; font-weight:800; }
#page-stats .mc-total .unit { font-size:13px; font-weight:400; color:var(--sgray); margin-left:2px; }
#page-stats .prod-row { padding:10px 0; border-bottom:1px dashed #eee; }
#page-stats .prod-row:last-child { border-bottom:none; }
#page-stats .prod-line { display:flex; align-items:baseline; gap:8px; margin-bottom:5px; }
#page-stats .prod-name { font-size:15px; font-weight:700; color:var(--green-d); min-width:60px; }
#page-stats .prod-w { font-size:16px; font-weight:800; color:#263238; }
#page-stats .prod-w .unit { font-size:12px; font-weight:400; color:var(--sgray); }
#page-stats .spec-line { display:flex; flex-wrap:wrap; gap:6px; padding-left:4px; }
#page-stats .spec-chip { font-size:12.5px; background:var(--sgray-l); border:1px solid var(--sborder); border-radius:6px; padding:3px 9px; color:#455a64; }
#page-stats .spec-chip b { color:#263238; }
#page-stats .spec-chip.custom { background:var(--orange-l); border-color:#ffcc80; color:#bf360c; }
#page-stats .spec-chip.custom b { color:var(--orange); }
#page-stats .spec-chip .eq { color:var(--sgray); font-weight:400; }

/* 筐/包小卡片 */
#page-stats .qty-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin-bottom:16px; }
@media(max-width:560px){ #page-stats .qty-grid { grid-template-columns:repeat(2,1fr); } }
#page-stats .qty-card { background:#fff; border-radius:12px; padding:14px 16px; border:1px solid var(--sborder); cursor:pointer; transition:.15s; box-shadow:0 1px 4px rgba(0,0,0,.05); }
#page-stats .qty-card:hover { box-shadow:0 3px 10px rgba(0,0,0,.1); }
#page-stats .qty-head { display:flex; align-items:center; gap:8px; }
#page-stats .qty-ico { font-size:18px; }
#page-stats .qty-label { font-size:13px; color:var(--sgray); font-weight:600; }
#page-stats .qty-num { font-size:20px; font-weight:800; margin-top:2px; }
#page-stats .qty-num .unit { font-size:12px; font-weight:400; color:var(--sgray); }
#page-stats .qty-arrow { margin-left:auto; color:var(--sgray); font-size:12px; transition:.2s; }
#page-stats .qty-card.open .qty-arrow { transform:rotate(180deg); }
#page-stats .qty-detail { display:none; margin-top:10px; padding-top:10px; border-top:1px dashed var(--sborder); }
#page-stats .qty-card.open .qty-detail { display:block; }
#page-stats .qty-detail-row { display:flex; align-items:center; gap:8px; font-size:13px; padding:4px 0; }
#page-stats .qty-detail-row .pname { color:var(--green-d); font-weight:700; min-width:56px; }
#page-stats .qty-detail-row .pnum { font-weight:800; color:#263238; }
#page-stats .qty-detail-row .pnum .unit { font-size:11px; color:var(--sgray); font-weight:400; }
#page-stats .qty-detail-row .bar { flex:1; height:8px; background:var(--sgray-l); border-radius:4px; overflow:hidden; }
#page-stats .qty-detail-row .bar i { display:block; height:100%; background:var(--green); border-radius:4px; }

/* 按线路 / 下午2点后入库（复用 stats-section 白卡，行样式照原型） */
#page-stats .route-row { display:flex; align-items:baseline; gap:10px; padding:9px 0; border-bottom:1px dashed #eee; font-size:15px; flex-wrap:wrap; }
#page-stats .route-row:last-child { border-bottom:none; }
#page-stats .route-name { font-weight:700; color:var(--green-d); min-width:90px; }
#page-stats .route-prods { color:#37474f; display:flex; flex-wrap:wrap; gap:6px; }
#page-stats .route-prods .rp { background:var(--sgray-l); border-radius:6px; padding:2px 8px; font-size:12.5px; }
#page-stats .af-row { display:flex; align-items:baseline; gap:10px; padding:9px 0; border-bottom:1px dashed #eee; font-size:15px; flex-wrap:wrap; }
#page-stats .af-row:last-child { border-bottom:none; }
#page-stats .af-name { font-weight:700; color:var(--green-d); min-width:60px; }
#page-stats .af-empty { color:var(--sgray); font-size:15px; padding:14px; text-align:center; }
#page-stats .stats-hint { font-size:13px; color:var(--sgray); font-weight:400; }

/* ─── 方案A：自定义规格折叠 ─── */
.select-card.custom-fold { border: 2px dashed #e65100; background: #fff3e0; }
.custom-picker-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 1000; display: flex; align-items: center; justify-content: center; }
.custom-picker { background: #fff; border-radius: 14px; padding: 20px; width: 88%; max-width: 420px; max-height: 80vh; overflow-y: auto; }
.custom-picker-title { font-size: 18px; font-weight: 700; color: #e65100; margin-bottom: 12px; }
.custom-picker-sub { font-size: 13px; color: #757575; margin: 10px 0 6px; }
.spec-pick-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.spec-pick-btn { font-size: 16px; font-weight: 600; padding: 12px 16px; border-radius: 10px; border: 1.5px solid #e65100; background: #fff; color: #e65100; cursor: pointer; }
.spec-pick-btn:active { background: #fff3e0; }
.spec-pick-btn.new { background: #e65100; color: #fff; }
.custom-picker-close { display: block; width: 100%; margin-top: 14px; padding: 12px; border-radius: 10px; border: none; background: #f5f5f5; color: #616161; font-size: 15px; cursor: pointer; }

/* ─── 移动/平板适配：看板 2×2 网格（手机 + iPad 竖屏 768-834px 都覆盖） ─── */
@media(max-width: 900px) {
  .home-wh-row { flex-wrap: wrap; }
  .hp-wh-card { flex: 1 1 calc(50% - 8px); min-width: calc(50% - 8px); padding: 8px; }
  .hp-wh-header { font-size: 17px; margin-bottom: 5px; }
  .hp-snake-grid { gap: 4px; }
  .hp-zone-cell { padding: 7px 3px; }
  .hp-zone-code { font-size: 16px; }
  .hp-zone-pct  { font-size: 14px; }
  .hp-cap-bar { margin-top: 6px; }
  .hp-cap-text { font-size: 13px; }
  .hp-cap-track { height: 10px; }
  .kanban-detail-grid { grid-template-columns: 1fr; }
  .kd-cell { padding: 8px; }
  .kd-code { font-size: 17px; }
}

/* ─── Spec 098 Bean Pool ─── */
.pool-bar {
  display: flex;
  gap: 8px;
  margin: 8px 0 12px;
}
.pool-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 84px;
  padding: 10px 6px;
  font-size: 18px;
  font-weight: 600;
  border: 2px solid #e0e0e0;
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
}
.pool-card:active { transform: scale(0.96); }
.pool-card .pool-status {
  font-size: 14px;
  font-weight: 500;
  margin-top: 4px;
}
.pool-card.open { border-color: #fb8c00; color: #e65100; }
.pool-card.open.selected {
  background: #fff3e0;
  border-color: #e65100;
}
.pool-card.not-open,
.pool-card.rolled {
  border-style: dashed;
  color: #9e9e9e;
  cursor: not-allowed;
}
.pool-card.not-open.selected,
.pool-card.rolled.selected {
  background: #f5f5f5;
  border-color: #bdbdbd;
}
.pool-panel {
  background: #fff8f0;
  border: 2px solid #fb8c00;
  border-radius: var(--radius);
  padding: 12px;
  margin: 6px 0 14px;
}
.pool-hint {
  font-size: 16px;
  color: #e65100;
  margin-bottom: 8px;
  line-height: 1.4;
}
.pool-hint.locked {
  color: #9e9e9e;
}
.pool-object-toggle {
  display: flex;
  gap: 8px;
  margin: 8px 0 14px;
}
.pool-object-toggle .select-card {
  flex: 1;
}
.pool-object-toggle .select-card.selected {
  border-color: var(--warning);
  background: #fff3e0;
  color: #e65100;
}
.badge-pool {
  display: inline-block;
  background: #fff3e0;
  color: #e65100;
  border: 1px solid #fb8c00;
  border-radius: 4px;
  font-size: 13px;
  padding: 0 5px;
  margin-left: 6px;
}
.confirm-spec-row .badge-pool {
  vertical-align: middle;
}

/* ─── Spec 101 一键移库（zbt-） ─── */
/* 入口按钮：橙色描边标新（复用 big-btn，不加深色底改动） */
.big-btn.new-bulk-transfer {
  border: 2px solid #e65100;
}
/* 库位卡库存小字 */
.zbt-zone-card {
  position: relative;
}
.zbt-zone-card .zbt-stock-hint {
  font-size: 12px;
  color: #757575;
  margin-top: 4px;
  font-weight: 400;
}
.zbt-zone-card.selected .zbt-stock-hint {
  color: #fff;
  opacity: .9;
}
.zbt-zone-card.empty .zbt-stock-hint {
  color: #bdbdbd;
}
.zbt-zone-card.empty {
  cursor: not-allowed;
  opacity: .55;
}
/* 库存明细卡（选源后展示将移走的清单） */
.zbt-stock-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 10px;
}
.zbt-stock-card .zbt-prod-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px dashed #eee;
  font-size: 16px;
}
.zbt-stock-card .zbt-prod-line:last-child {
  border-bottom: none;
}
.zbt-spec-chip {
  background: #e3f2fd;
  color: #1565c0;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 13px;
  margin-left: 8px;
}
.zbt-spec-chip.custom {
  background: #fff3e0;
  color: #e65100;
}
.zbt-wt {
  color: #1a73e8;
  font-weight: 700;
  white-space: nowrap;
}
.zbt-stock-total {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  color: #1a73e8;
  padding: 10px 0 2px;
}
.zbt-stock-sub {
  text-align: center;
  font-size: 13px;
  color: #757575;
  padding-bottom: 6px;
}
/* 目标区叠加提示条 */
.zbt-target-hint {
  background: #fff8e1;
  border: 1px solid #ffcc02;
  color: #8a6d00;
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 12px;
}
.zbt-after-line {
  color: #2e7d32;
  font-weight: 700;
}
/* 确认弹窗逐规格清单 */
.zbt-confirm-list {
  background: #fafafa;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 15px;
  line-height: 1.9;
}
