:root {
  /* ===== 品牌色系 ===== */
  --brand: #0ea5e9;
  --brand-dark: #0284c7;
  --brand-light: #e0f2fe;
  --brand-lighter: #f0f9ff;

  /* ===== 语义色 ===== */
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --success: #16a34a;
  --success-dark: #15803d;
  --success-light: #dcfce7;
  --danger: #dc2626;
  --danger-dark: #b91c1c;
  --danger-light: #fee2e2;
  --warning: #f59e0b;
  --warning-light: #fef3c7;

  /* ===== 灰阶 ===== */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* ===== 表格系统 ===== */
  --table-header-bg: #f1f5f9;
  --table-header-text: #1e293b;
  --table-header-border: #e2e8f0;
  --table-row-bg: #ffffff;
  --table-row-alt-bg: #f8fafc;
  --table-row-hover: #f1f5f9;
  --table-border: #e2e8f0;
  --table-font-size: 16px;
  --table-header-font-size: 15px;

  /* ===== 卡片系统 ===== */
  --card-bg: #ffffff;
  --card-border: #e2e8f0;
  --card-shadow: 0 2px 8px rgba(0,0,0,0.06);
  --card-shadow-hover: 0 8px 24px rgba(0,0,0,0.10);
  --card-radius: 12px;

  /* ===== 空状态 ===== */
  --empty-icon-size: 48px;
  --empty-text-color: #94a3b8;
  --empty-text-size: 15px;

  /* ===== 页面背景 ===== */
  --page-bg: #f8fafc;

  /* ===== 字体（黑体优先栈） ===== */
  --font-hei: "黑体", "SimHei", "Heiti SC", "Microsoft YaHei", "PingFang SC", sans-serif;

  /* ===== 间距/圆角/阴影 ===== */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-weight: 700 !important; }

body {
  font-family: var(--font-hei);
  font-size: 17px; line-height: 1.5;
  background: #ffffff;
  color: var(--gray-800);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

#app { min-height: 100dvh; }

/* ===== 通用组件 ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; border: none; border-radius: var(--radius);
  font-size: 16px; font-weight: 500; cursor: pointer; transition: all 0.15s;
  text-decoration: none; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:active { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:active { background: var(--success-dark); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:active { background: var(--danger-dark); }
.btn-outline { background: #fff; color: var(--gray-700); border: 1px solid var(--gray-300); }
.btn-outline:active { background: var(--gray-50); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 17px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; margin-bottom: 12px;
}

.input, .select, .textarea {
  width: 100%; padding: 10px 14px; border: 1px solid var(--gray-300);
  border-radius: var(--radius); font-size: 18px; background: #fff;
  transition: border-color 0.15s;
  -webkit-appearance: none; appearance: none;
}
/* 移动端 date 输入框保护：避免 APP WebView 中日期待号被截断 */
.input[type="date"], .input[type="month"] {
  min-width: 130px;
  padding-right: 8px;
  font-size: 16px;
  box-sizing: border-box;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--primary);
}

.label {
  display: block; font-size: 13px; font-weight: 500; color: var(--gray-600);
  margin-bottom: 4px;
}

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 20px;
  font-size: 12px; font-weight: 500;
}
.badge-blue { background: var(--primary-light); color: var(--primary-dark); }
.badge-green { background: #dcfce7; color: var(--success-dark); }
.badge-gray { background: var(--gray-100); color: var(--gray-900); }
.badge-red { background: #fee2e2; color: var(--danger-dark); }
.badge-orange { background: #fff7ed; color: #c2410c; }

/* ===== P0 统一表格组件 ===== */
.uni-table-wrap {
  border-radius: var(--card-radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--table-border);
  background: var(--card-bg);
}
.uni-table-wrap.has-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.uni-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--table-font-size);
  background: var(--card-bg);
}
.uni-table thead th {
  padding: 12px 16px;
  font-size: var(--table-header-font-size);
  font-weight: 700;
  color: var(--table-header-text);
  background: var(--table-header-bg);
  border-bottom: 2px solid var(--table-header-border);
  text-align: left;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}
.uni-table tbody td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--table-border);
  color: #1e293b;
  font-weight: 500;
}
.uni-table tbody tr:nth-child(even) { background: var(--table-row-alt-bg); }
.uni-table tbody tr:hover { background: var(--table-row-hover); transition: background 0.15s; }
.uni-table tbody tr:last-child td { border-bottom: none; }
.uni-table .col-num { text-align: right; font-variant-numeric: tabular-nums; }
.uni-table .col-center { text-align: center; }
.uni-table .col-actions { white-space: nowrap; text-align: center; }
.uni-table .col-actions .btn { margin: 0 2px; }

/* ===== P0 统一空状态 ===== */
.uni-empty {
  padding: 48px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.uni-empty-icon {
  font-size: var(--empty-icon-size);
  line-height: 1;
  opacity: 0.5;
}
.uni-empty-text {
  font-size: var(--empty-text-size);
  color: var(--empty-text-color);
  font-weight: 500;
}
.uni-empty-sub {
  font-size: 13px;
  color: #cbd5e1;
  font-weight: 400;
}

/* ===== P0 统一统计卡片 ===== */
.uni-stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--card-radius);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
  border-left: 4px solid var(--brand);
  transition: transform 0.25s cubic-bezier(0.16,1,0.3,1), box-shadow 0.25s;
}
.uni-stat-card:hover { transform: translateY(-2px); box-shadow: var(--card-shadow-hover); }
.uni-stat-card.accent-success { border-left-color: var(--success); }
.uni-stat-card.accent-warning { border-left-color: var(--warning); }
.uni-stat-card.accent-danger { border-left-color: var(--danger); }
.uni-stat-card.accent-primary { border-left-color: var(--primary); }
.uni-stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
  background: var(--brand-lighter);
}
.uni-stat-body { display: flex; flex-direction: column; min-width: 0; }
.uni-stat-label { font-size: 13px; color: #64748b; font-weight: 500; }
.uni-stat-value { font-size: 24px; font-weight: 800; color: #0f172a; line-height: 1.2; }
.uni-stat-unit { font-size: 14px; font-weight: 400; color: #94a3b8; margin-left: 3px; }

/* ===== P0 移动端抽屉导航 ===== */
.admin-drawer-overlay {
  display: none;
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.45);
  z-index: 9998;
  animation: dash3-fadeIn 0.2s;
}
.admin-drawer-overlay.open { display: block; }
.admin-drawer {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 280px;
  background: #fff;
  z-index: 9999;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.16,1,0.3,1);
  overflow-y: auto;
  box-shadow: 4px 0 24px rgba(0,0,0,0.15);
  display: flex; flex-direction: column;
}
.admin-drawer.open { transform: translateX(0); }
.admin-drawer-header {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  flex-shrink: 0;
}
.admin-drawer-header img { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; }
.admin-drawer-header .drawer-sys-name { font-size: 17px; font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-drawer-close { background: rgba(255,255,255,0.2); border: none; color: #fff; width: 32px; height: 32px; border-radius: 8px; font-size: 18px; cursor: pointer; flex-shrink: 0; }
.admin-drawer-nav { flex: 1; overflow-y: auto; padding: 8px 0; }
.admin-drawer-group-label { padding: 12px 20px 6px; font-size: 12px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.5px; }
.admin-drawer-item { display: flex; align-items: center; gap: 10px; padding: 12px 20px; font-size: 15px; color: #334155; text-decoration: none; transition: background 0.15s; cursor: pointer; }
.admin-drawer-item:hover { background: #f1f5f9; }
.admin-drawer-item.active { background: var(--brand-light); color: var(--brand-dark); font-weight: 700; border-left: 3px solid var(--brand); padding-left: 17px; }
.admin-drawer-item-icon { font-size: 18px; flex-shrink: 0; }
.admin-drawer-footer { padding: 12px 20px; border-top: 1px solid #e2e8f0; flex-shrink: 0; }

/* ===== 登录页 ===== */
.login-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100dvh; padding: 20px; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.login-card {
  background: #fff; border-radius: 20px; padding: 40px 30px;
  width: 100%; max-width: 380px; box-shadow: var(--shadow-lg);
}
.login-logo {
  text-align: center; margin-bottom: 24px;
}
.login-logo-img {
  max-width: 286px;
  max-height: 156px;
  width: auto;
  height: auto;
  margin: 0 auto 12px;
  display: block;
  object-fit: contain;
}
.login-logo .icon {
  width: 64px; height: 64px; margin: 0 auto 12px;
  background: var(--primary); border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; color: #fff;
}
.login-logo h1 { font-size: 14.67px; color: var(--gray-800); margin-top: 8px; }
.login-logo p { font-size: 14px; color: var(--gray-500); margin-top: 4px; }
.login-form .form-group { margin-bottom: 16px; }
.login-remember-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; padding: 0 2px;
}
.login-remember-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 14px; color: var(--gray-700); cursor: pointer; user-select: none;
}
.login-remember-label input[type="checkbox"] {
  width: 18px; height: 18px; cursor: pointer; accent-color: var(--primary);
}
.login-remember-select {
  padding: 4px 10px; border: 1px solid var(--gray-300); border-radius: 8px;
  font-size: 13px; color: var(--gray-700); background: #fff; cursor: pointer;
  outline: none;
}
.login-remember-select:disabled { opacity: 0.5; cursor: not-allowed; }
.login-error {
  background: #fee2e2; color: var(--danger-dark); padding: 10px 14px;
  border-radius: var(--radius); font-size: 14px; margin-bottom: 16px;
}
.login-hint {
  margin-top: 20px; padding: 12px; background: var(--gray-50);
  border-radius: var(--radius); font-size: 13px; color: var(--gray-500);
  line-height: 1.6;
}
.login-credit {
  margin-top: 24px; text-align: center; font-size: 12px;
  color: #000; letter-spacing: 0.5px;
}

/* ===== 布局 ===== */
.layout {
  max-width: 480px; margin: 0 auto; min-height: 100dvh;
  background: #ffffff; padding-bottom: 70px;
}
.layout.admin-layout { max-width: 100%; padding-bottom: 0; }

.topbar {
  background: #fff; padding: 10px 16px; position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow); display: flex; align-items: center; justify-content: space-between;
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
}
.topbar h2 { font-size: 24px; color: var(--gray-800); }
.qc-top-summary {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-800);
}
.qc-top-summary span { color: var(--gray-700); }
.qc-logout-btn {
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 600;
  color: #dc2626;
  border-color: #fca5a5;
  background: #fef2f2;
  white-space: nowrap;
}
.qc-logout-btn:hover {
  background: #fee2e2;
  border-color: #dc2626;
}
.qc-top-summary b {
  font-size: 28px;
  font-weight: 900;
  color: #dc2626;
  line-height: 1;
}
.topbar .user-info { display: flex; align-items: center; gap: 8px; }
.topbar .avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--primary);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 500;
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-logo {
  height: 52px;
  width: auto;
  object-fit: contain;
}

.content { padding: 16px; }

/* ===== 底部导航（扁平化老年版 n383） ===== */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; background: #fff; border-top: 2px solid #e2e8f0;
  display: flex; z-index: 100; padding-bottom: env(safe-area-inset-bottom, 0);
}
.tabbar-item {
  flex: 1; padding: 10px 0; text-align: center; cursor: pointer;
  color: #94a3b8; transition: color 0.15s;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.tabbar-item.active { color: #2563eb; }
.tabbar-item .tab-icon {
  width: 32px; height: 32px; margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
  line-height: 1; transition: transform 0.2s;
}
.tabbar-item .tab-icon svg {
  width: 26px; height: 26px; stroke-width: 2.2;
  stroke: currentColor; fill: none; stroke-linecap: round; stroke-linejoin: round;
}
.tabbar-item.active .tab-icon { transform: translateY(-2px); }
.tabbar-item .tab-label { font-size: 16px; margin-top: 4px; display: block; font-weight: 600; }
.tabbar-item.active .tab-label { font-weight: 700; }

.income-card {
  margin: 0 12px 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  padding: 18px 20px 20px;
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.28);
  position: relative;
  overflow: hidden;
}
.income-card::after {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 130px; height: 130px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  pointer-events: none;
}
.income-card-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
}
.income-card-balance {
  text-align: center;
  position: relative;
  z-index: 1;
}
.income-card-label {
  font-size: 13px;
  opacity: 0.9;
  margin-bottom: 6px;
}
.income-card-amount {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.income-card-btn {
  display: block;
  width: 100%;
  margin-top: 18px;
  padding: 13px 0;
  border: none;
  border-radius: 12px;
  background: rgba(255,255,255,0.22);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  z-index: 1;
  transition: background 0.15s;
}
.income-card-btn:active { background: rgba(255,255,255,0.32); }

.profile-section-label {
  font-size: 13px; font-weight: 600; color: var(--gray-400);
  padding: 16px 20px 6px; letter-spacing: 0.5px;
}
.profile-group {
  background: #fff; border-radius: 14px; overflow: hidden;
  margin: 0 12px; box-shadow: 0 1px 4px rgba(15,23,42,0.05);
}
.profile-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; cursor: pointer; transition: background 0.15s;
  border-bottom: 1px solid #f1f5f9;
}
.profile-item:last-child { border-bottom: none; }
.profile-item:active { background: #f8fafc; }
.profile-item-icon { font-size: 20px; width: 28px; text-align: center; flex-shrink: 0; }
.profile-item-text { flex: 1; font-size: 15px; font-weight: 500; color: var(--gray-700); }
.profile-item-hint { font-size: 13px; color: var(--gray-400); flex-shrink: 0; }
.profile-item-arrow { font-size: 18px; color: var(--gray-300); flex-shrink: 0; }

.profile-face-del {
  margin: 8px 12px 0; padding: 12px; text-align: center;
  border-radius: 12px; background: #fef2f2; color: #dc2626;
  font-size: 14px; font-weight: 500; cursor: pointer;
  border: 1px solid #fca5a5; transition: background 0.15s;
}
.profile-face-del:active { background: #fee2e2; }

.profile-pwd-box {
  margin: 8px 12px 0; padding: 16px;
  border-radius: 14px; background: #fff;
  box-shadow: 0 1px 4px rgba(15,23,42,0.05);
}

.profile-logout-btn {
  display: block; width: calc(100% - 24px); margin: 24px 12px 0;
  padding: 14px; border: 1.5px solid #fca5a5; border-radius: 14px;
  background: #fff; color: #dc2626; font-size: 16px; font-weight: 600;
  cursor: pointer; transition: all 0.15s; text-align: center;
}
.profile-logout-btn:active { background: #fef2f2; transform: scale(0.98); }

/* ===== 工人首页 ===== */
.welcome-card {
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  color: #fff; border-radius: 16px; padding: 20px; margin-bottom: 16px;
}
.welcome-card .greeting { font-size: 14px; opacity: 0.9; }
.welcome-card .name { font-size: 24px; font-weight: 600; margin-top: 4px; }
.welcome-card .date { font-size: 13px; opacity: 0.8; margin-top: 4px; }

.stat-grid {
  /* n923: 老 WebView(chrome38) 不支持 CSS Grid，基础层用老式 flex + 等分子元素；现代浏览器由下方 @supports 恢复 Grid，行为与之前完全一致 */
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-flex-wrap: wrap;
  flex-wrap: wrap;
  margin: 0 -4px 16px;
}
.stat-grid > * {
  -webkit-box-flex: 1;
  -webkit-flex: 1 1 0%;
  flex: 1 1 0%;
  min-width: 0;
  margin: 0 4px;
}
@supports (display: grid) {
  .stat-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin: 0 0 16px; }
  .stat-grid > * { margin: 0; }
}
.stat-card {
  background: #fff; border-radius: var(--radius); padding: 14px 10px; box-shadow: var(--shadow);
}
.stat-card .stat-label { font-size: 14px; color: var(--gray-500); }
.stat-card .stat-value { font-size: 26px; font-weight: 700; color: var(--gray-800); margin-top: 4px; }
.stat-card .stat-unit { font-size: 14px; color: var(--gray-400); margin-left: 2px; }
.stat-card.earnings .stat-value { color: var(--success-dark); }

/* ===== 工人首页（老年版大字 n383） ===== */
.worker-home-header {
  background: linear-gradient(135deg, #2563eb 0%, #4f46e5 50%, #7c3aed 100%);
  color: #fff;
  border-radius: 18px;
  padding: 12px 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.25);
  /* n929: 删 gap（老 WebView 不识别，会导致头像与名字间距不一致），间距统一走 .whh-avatar 的 margin-right */
}
/* n385: 原只保留LOGO；n929: 公司LOGO改为圆形个人头像（更大），与名字 10px 间距用 margin（老 WebView flex 不识别 gap） */
.whh-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
  color: #fff; font-size: 30px; font-weight: 800; line-height: 72px; text-align: center;
  margin-right: 10px; flex-shrink: 0; overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.25);
}
.whh-avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.whh-left { flex: 1; min-width: 0; }
.whh-name { font-size: 22px; font-weight: 700; }
.whh-level {
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  border-radius: 14px;
  padding: 8px 10px;
  text-align: center;
  min-width: 62px;
}
.whh-level-icon { font-size: 28px; line-height: 1; }
.whh-level-name { font-size: 14px; font-weight: 600; margin-top: 4px; }
.whh-level-days { font-size: 13px; opacity: 0.85; margin-top: 2px; }

/* n398: 人脸录入卡片 */
.face-enroll-card {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; margin: 12px 0 4px;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border: 1px solid #93c5fd;
  border-radius: 14px; cursor: pointer;
  transition: all 0.15s; user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.face-enroll-card:active { transform: scale(0.98); }
.face-enroll-card .fec-icon { font-size: 24px; }
.face-enroll-card .fec-label { font-size: 16px; font-weight: 700; color: #1e3a8a; flex: 1; }

/* n928: 「更多功能」网格防变形重构——
   老 WebView(Blink 30-38) 旧版 flexbox 会把「百分比宽度+margin」的 flex 子项压缩到 min-content，
   导致按钮变成窄竖条、中文竖排（现场平板实拍复现）。
   基础层改为 inline-block 流式布局：不经过任何 flex 子项尺寸计算，任何引擎都不会收缩子项宽度；
   容器 font-size:0 消除 inline-block 空白符间隙（按钮内部字号全部显式声明，不受影响）；
   图标/文字/提示改 display:block + text-align:center 堆叠，兼容性最好；
   现代浏览器仍由下方 @supports 恢复 Grid。 */
/* n983: 本组件弃用 CSS Grid——部分定制/老 WebView（车间平板实拍复现）@supports 认为
   自己支持 grid，但 grid item 不拉伸、按 min-content 收缩 → 按钮变竖条、中文竖排。
   统一 inline-block + margin 布局，不经过任何 grid/flex 子项尺寸计算，任何引擎都安全。 */
.worker-home-actions {
  display: block;
  margin: 18px -6px;
  font-size: 0;
  text-align: center;
}
.wha-btn {
  display: inline-block;
  width: calc(50% - 12px);
  min-width: 140px;
  max-width: 100%;
  margin: 6px;
  padding: 24px 12px;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s;
  color: #fff;
  min-height: 140px;
  text-align: center;
  vertical-align: top;
  font-size: 16px;
}
.wha-btn:active { transform: scale(0.97); }
.wha-btn .wha-icon { display: block; font-size: 42px; line-height: 1; }
.wha-btn .wha-text { display: block; font-size: 19px; font-weight: 700; margin-top: 10px; }
.wha-btn .wha-hint { display: block; font-size: 15px; opacity: 0.95; margin-top: 6px; }
.wha-scan {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
}
.wha-order {
  /* n925: 红底（用户要求），高度较默认按钮 -30px（140-30=110） */
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  box-shadow: 0 6px 18px rgba(220, 38, 38, 0.35);
  min-height: 110px;
}
/* 首页精简：扫码计件占满整行 + 更多功能折叠 */
.wha-full {
  width: calc(100% - 12px);
}
.wha-more .wha-btn {
  width: calc(33.333% - 12px);
  min-width: 160px;
}
@media (max-width: 520px) {
  .wha-more .wha-btn {
    width: calc(50% - 12px);
    min-width: 140px;
  }
}
.wha-more-toggle {
  width: 100%; margin-top: 12px; padding: 13px 16px;
  background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0;
  border-radius: 14px; font-size: 16px; font-weight: 700; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.wha-more-toggle:active { background: #e2e8f0; }

/* ===== n983: grid 坏引擎降级（core.js 运行时探测，坏引擎给 <html> 挂 no-grid）=====
   仅影响探测失败的设备（grid item 收缩成 min-content 的定制/老 WebView）；
   正常浏览器不受影响。工人首页相关的网格组件在此兜底。 */
html.no-grid .stat-grid { display: block; font-size: 0; text-align: center; }
html.no-grid .stat-grid > * { display: inline-block; width: calc(33.333% - 10px); margin: 0 4px 10px; vertical-align: top; }
html.no-grid .stat-grid > *:first-child:nth-last-child(2),
html.no-grid .stat-grid > *:nth-child(2):nth-last-child(1),
html.no-grid .stat-grid > *:only-child { width: calc(50% - 10px); }
html.no-grid .ib-quick-grid { display: block; font-size: 0; text-align: center; }
html.no-grid .ib-quick-grid > * { display: inline-block; width: calc(25% - 12px); margin: 0 5px 10px; vertical-align: top; }
html.no-grid .ib-grid-frame { display: block; font-size: 0; text-align: center; }
html.no-grid .ib-grid-frame > * { display: inline-block; width: calc(50% - 12px); margin: 0 5px 12px; vertical-align: top; text-align: left; }
@media (max-width: 380px) {
  html.no-grid .ib-quick-grid > * { width: calc(50% - 12px); }
  html.no-grid .ib-grid-frame > * { width: calc(100% - 12px); }
}

.scan-btn-wrapper {
  margin: 20px 0;
}
.scan-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 100%; padding: 30px; background: var(--primary); color: #fff;
  border: none; border-radius: 20px; cursor: pointer; transition: all 0.15s;
  box-shadow: 0 4px 14px rgba(37,99,235,0.35);
}
.scan-btn:active { transform: scale(0.98); }
.scan-btn .scan-icon { font-size: 48px; line-height: 1; }
.scan-btn .scan-text { font-size: 18px; font-weight: 600; margin-top: 8px; }
.scan-btn .scan-hint { font-size: 13px; opacity: 0.8; margin-top: 4px; }

.section-title {
  font-size: 18px; font-weight: 600; color: var(--gray-700);
  margin: 20px 0 10px; display: flex; align-items: center; justify-content: space-between;
}

/* ===== 工人首页激励看板（图框式卡片布局） ===== */
.incentive-board { margin-top: 16px; }
.ib-section-title {
  font-size: 18px; font-weight: 700; color: var(--gray-800);
  margin: 20px 0 12px; display: flex; align-items: center; gap: 8px;
}
.ib-section-icon { font-size: 22px; }

/* 顶部工资大图框 */
.ib-salary-frame {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 1px solid #bae6fd; border-radius: 18px;
  padding: 16px; box-shadow: 0 6px 18px rgba(59, 130, 246, 0.12);
  margin-bottom: 14px; cursor: pointer; transition: transform 0.15s;
}
.ib-salary-frame:active { transform: scale(0.98); }
.ib-salary-head {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; flex-wrap: wrap; gap: 6px;
}
.ib-salary-title { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 800; color: #1e3a8a; }
.ib-salary-icon { font-size: 22px; }
.ib-salary-period { font-size: 12px; color: #64748b; font-weight: 600; background: #fff; padding: 3px 10px; border-radius: 20px; border: 1px solid #cbd5e1; }
.ib-salary-main { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.ib-salary-big { flex: 1 1 auto; }
.ib-salary-label { font-size: 13px; color: #475569; font-weight: 600; margin-bottom: 4px; }
.ib-salary-value { font-size: 32px; font-weight: 900; color: #2563eb; }
.ib-salary-badges { display: flex; gap: 8px; }
.ib-salary-badge { background: #fff; border-radius: 12px; padding: 10px 12px; text-align: center; border: 1px solid #e2e8f0; min-width: 64px; }
.ib-sb-num { font-size: 18px; font-weight: 800; color: #1e293b; }
.ib-sb-label { font-size: 11px; color: #64748b; font-weight: 600; margin-top: 2px; }
.ib-salary-deduct { margin-top: 10px; font-size: 13px; color: #dc2626; font-weight: 700; background: #fef2f2; padding: 6px 10px; border-radius: 10px; display: inline-block; }

/* 快捷激励小图框（4 列） */
.ib-quick-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px;
}
@media (max-width: 380px) { .ib-quick-grid { grid-template-columns: repeat(2, 1fr); } }
.ib-quick-box {
  background: #fff; border-radius: 14px; padding: 12px 6px; text-align: center;
  border: 1px solid #e2e8f0; box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.ib-quick-icon { font-size: 24px; line-height: 1; margin-bottom: 6px; }
.ib-quick-value { font-size: 15px; font-weight: 800; color: #1e293b; }
.ib-quick-label { font-size: 11px; color: #64748b; font-weight: 600; margin-top: 2px; }
.ib-quick-blue { border-top: 4px solid #3b82f6; }
.ib-quick-green { border-top: 4px solid #10b981; }
.ib-quick-orange { border-top: 4px solid #f59e0b; }
.ib-quick-purple { border-top: 4px solid #8b5cf6; }

/* 关键激励 2×2 图框网格 */
.ib-grid-frame {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px;
}
@media (max-width: 380px) { .ib-grid-frame { grid-template-columns: 1fr; } }
.ib-frame {
  background: #fff; border-radius: 16px; padding: 12px;
  border: 1px solid #e2e8f0; box-shadow: 0 4px 14px rgba(0,0,0,0.06);
  display: flex; flex-direction: column;
}
.ib-frame-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 6px;
}
.ib-frame-title { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 800; color: #1e293b; }
.ib-frame-icon { font-size: 18px; }
.ib-frame-tag { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 20px; white-space: nowrap; }
.ib-tag-info { background: #eff6ff; color: #1d4ed8; }
.ib-tag-success { background: #dcfce7; color: #15803d; }
.ib-tag-warning { background: #fef3c7; color: #b45309; }
.ib-frame-period { font-size: 11px; color: #64748b; font-weight: 600; }
.ib-frame-body { flex: 1; display: flex; flex-direction: column; gap: 8px; }

/* 图框内公共组件 */
.ib-grid-big { text-align: center; padding: 8px 0; }
.ib-gb-num { font-size: 28px; font-weight: 900; line-height: 1; }
.ib-gb-unit { font-size: 14px; font-weight: 600; margin-left: 2px; color: #94a3b8; }
.ib-gb-label { font-size: 12px; color: #64748b; font-weight: 600; margin-top: 6px; }
.ib-grid-metric { display: flex; flex-direction: column; gap: 5px; }
.ib-gm-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.ib-gm-row span { color: #64748b; }
.ib-gm-row strong { color: #1e293b; font-weight: 700; }
.ib-mini-progress { height: 7px; background: #e2e8f0; border-radius: 4px; overflow: hidden; margin-top: 4px; }
.ib-mini-fill { height: 100%; border-radius: 4px; }
.ib-grid-empty { text-align: center; color: #94a3b8; font-size: 13px; padding: 16px 0; }
.ib-tier-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.ib-tier-chip-mini { font-size: 11px; background: #f1f5f9; color: #475569; padding: 4px 8px; border-radius: 12px; font-weight: 600; }

/* 小环形图 */
.ib-ring-small { position: relative; width: 64px; height: 64px; flex-shrink: 0; }
.ib-ring-small svg { width: 100%; height: 100%; }
.ib-ring-small-val { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800; }

/* 质量分图框：左侧环 + 右侧指标 */
.ib-frame-quality .ib-frame-body { flex-direction: row; align-items: center; }

/* 本月激励图框 */
.ib-bonus-frame {
  background: #fff; border-radius: 16px; padding: 14px;
  border: 1px solid #e2e8f0; box-shadow: 0 4px 14px rgba(0,0,0,0.06); margin-bottom: 14px;
}
.ib-bonus-main { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.ib-bonus-total { flex: 1 1 auto; }
.ib-bt-label { font-size: 13px; color: #64748b; font-weight: 600; margin-bottom: 4px; }
.ib-bt-value { font-size: 28px; font-weight: 900; color: #2563eb; }
.ib-bonus-list { flex: 1 1 auto; display: flex; flex-direction: column; gap: 6px; min-width: 140px; }
.ib-bonus-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.ib-bonus-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.ib-bonus-label { color: #475569; flex: 1; }
.ib-bonus-value { font-weight: 800; }
.ib-att-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed #e2e8f0; }
.ib-att-icon { font-size: 18px; }
.ib-att-badge { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 20px; }

/* 工厂排名图框 */
.ib-rank-frame {
  background: #fff; border-radius: 16px; padding: 14px;
  border: 1px solid #e2e8f0; box-shadow: 0 4px 14px rgba(0,0,0,0.06); margin-bottom: 14px;
}
.ib-rank-body { display: flex; align-items: center; gap: 16px; margin: 10px 0; }
.ib-rank-badge-big { font-size: 48px; font-weight: 900; line-height: 1; min-width: 56px; text-align: center; }
.ib-rank-info { flex: 1; }
.ib-rank-value { font-size: 26px; font-weight: 900; color: #1e293b; }
.ib-rank-label { font-size: 13px; color: #64748b; font-weight: 600; margin-top: 4px; }
.ib-rank-progress-wrap { margin-top: 6px; }
.ib-rank-progress-bar { height: 8px; background: #e2e8f0; border-radius: 4px; overflow: hidden; }
.ib-rank-progress-fill { height: 100%; background: linear-gradient(90deg, #3b82f6, #06b6d4); border-radius: 4px; }
.ib-rank-percent { font-size: 12px; color: #64748b; font-weight: 600; margin-top: 6px; text-align: right; }
.ib-rank-empty-text { text-align: center; color: #94a3b8; padding: 20px 0; font-size: 14px; }

/* ===== 计数页面（n383 老年版：工序顶部横向滑动） ===== */
.count-page { padding: 0; }
/* 计件页禁止整页滚动，防止误触 */
.layout.count-layout-page {
  height: 100dvh;
  overflow: hidden;
  padding-bottom: 70px;
  display: flex;
  flex-direction: column;
}
.layout.count-layout-page .count-page {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}
/* n394: 计件页改为单列布局，计数器区域垂直居中 */
.count-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 0;
}
/* n386/n394: 工序选择改为顶部横向滑动 tab，优化滚动兼容性 */
.count-process-bar {
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  padding: 18px 12px 10px;
  scrollbar-width: none;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  /* 移除 scroll-snap，部分 WebView 会导致滚动卡顿或无法滚动 */
}
/* n692: 彻底放弃 flex gap（老 WebView 不识别），改用子元素 margin-right 撑开间距
   新老 WebView 一视同仁，不再依赖 @supports 兜底。 */
.count-process-bar > *:not(:last-child) { margin-right: 8px; }
.count-process-bar > *:first-child { margin-left: 0; }
.count-process-bar::-webkit-scrollbar { display: none; }
.count-process-tab {
  flex-shrink: 0;
  min-width: 100px;
  padding: 10px 10px 14px;
  border-radius: 14px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  background: #f1f5f9;
  border: 2px solid transparent;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-drag: none;
  user-select: none;
  position: relative;
}
.count-process-tab:active { transform: scale(0.96); }
.count-process-tab.active {
  background: #dc2626;
  color: #fff;
  border-color: #b91c1c;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
  transform: scale(1.06);
  z-index: 1;
}
.count-process-tab .cpt-name { font-size: 17px; font-weight: 700; line-height: 1.2; }
.count-process-tab.active .cpt-name { font-size: 18px; }
.count-process-tab .cpt-price { font-size: 13px; opacity: 0.8; line-height: 1.2; margin-top: 2px; }
.count-process-tab.active .cpt-price {
  font-size: 15px; font-weight: 800; opacity: 1;
  margin-top: 4px; margin-bottom: 2px;
  color: #fff;
}
.count-process-tab .cpt-qty { font-size: 14px; font-weight: 700; margin-top: 4px; }
.count-process-tab.active .cpt-qty { font-size: 16px; }
/* n383: 防误触遮罩 */
.count-process-tab.switching { pointer-events: none; opacity: 0.5; }

/* n394: 旧的 count-left/right 布局废弃，.count-right 也不再需要 */
.count-left { display: none !important; }
.count-right { width: 100%; }
.order-count-page { padding: 16px; }
.order-count-page .card { padding: 20px; }

/* ===== 订单选择列表（直接点击进入计件，替代 select） ===== */
.ord-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--gray-100, #f1f5f9);
}
.ord-list-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--gray-900, #0f172a);
}
.ord-list-count {
  font-size: 13px;
  color: var(--gray-500, #64748b);
  background: var(--gray-100, #f1f5f9);
  padding: 4px 10px;
  border-radius: 999px;
}
.ord-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}
.ord-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #fff;
  border: 2px solid var(--gray-200, #e2e8f0);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.ord-row:hover {
  border-color: var(--primary, #6366f1);
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
  transform: translateY(-1px);
}
.ord-row:active {
  transform: scale(0.98) translateY(0);
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
}
.ord-row.ord-row-disabled {
  opacity: 0.65;
  cursor: not-allowed;
  background: #f8fafc;
  border-color: var(--gray-200, #e2e8f0);
}
.ord-row.ord-row-disabled:active {
  transform: none;
  background: #f8fafc;
}
.ord-row-main { flex: 1; min-width: 0; }
.ord-row-no {
  font-size: 17px;
  font-weight: 700;
  color: var(--gray-900, #0f172a);
  line-height: 1.3;
  margin-bottom: 4px;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  letter-spacing: 0.2px;
}
.ord-row-name {
  font-size: 14px;
  color: var(--gray-700, #334155);
  line-height: 1.4;
  margin-bottom: 6px;
}
.ord-row-spec {
  color: var(--gray-500, #64748b);
  font-size: 13px;
  font-weight: 400;
}
.ord-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.ord-row-tag {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 600;
  line-height: 1.5;
}
.ord-row-tag-date {
  background: #dbeafe;
  color: #1e40af;
}
.ord-row-tag-warn {
  background: #fef3c7;
  color: #92400e;
}
.ord-row-arrow {
  font-size: 28px;
  color: var(--gray-400, #94a3b8);
  font-weight: 300;
  line-height: 1;
  transition: all 0.18s ease;
}
.ord-row:hover .ord-row-arrow {
  color: var(--primary, #6366f1);
  transform: translateX(4px);
}
.ord-list-empty {
  text-align: center;
  padding: 40px 16px;
}
.ord-list-empty .empty-icon { font-size: 48px; margin-bottom: 8px; }
.ord-list-empty .empty-text { color: var(--gray-500, #64748b); font-size: 14px; }
.order-count-info {
  background: var(--gray-50);
  border-radius: var(--radius);
  padding: 14px;
  margin-top: 16px;
}
.order-count-info-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-200);
  font-size: 14px;
}
.order-count-info-item:last-child { border-bottom: none; }
.order-count-info-item .oci-label { color: var(--gray-500); }
.order-count-info-item .oci-value { font-weight: 600; color: var(--gray-800); }

/* n411: 产品信息卡片严格按用户截图设计 */
.product-info-card {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border-radius: 0;
  padding: 14px 12px;       /* n593: 高度加 10px（n592 9/10 → 14/12） */
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.product-info-card .product-info-main { min-width: 0; }
.product-info-card .product-name { font-size: 20px; font-weight: 800; color: #2563eb; line-height: 1.2; }   /* n593: 13→20 (×1.5) */
.product-info-card .product-meta { font-size: 11px; color: #475569; margin-top: 2px; }                    /* n593: 8→11 (×1.4 同步) */
/* n930: 淡蓝卡中间空白处显示当前时间——flex:1 占据两块内容之间，居中大字号 */
.product-info-card .product-info-clock { flex: 1; min-width: 0; text-align: center; }
.product-info-clock .pic-time {
  font-size: 34px; font-weight: 800; color: #1d4ed8; line-height: 1.1;
  letter-spacing: 1px; font-variant-numeric: tabular-nums;   /* 等宽数字，秒跳动不抖动 */
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}
.product-info-clock .pic-sec { font-size: 22px; font-weight: 700; letter-spacing: 0; }
.product-info-clock .pic-date { font-size: 13px; font-weight: 700; color: #3b82f6; margin-top: 2px; }
.product-info-card .product-info-badge {
  flex-shrink: 0;
  font-size: 12px;           /* n593: 8→12 (×1.5) */
  font-weight: 700;
  color: #2563eb;
  background: rgba(255,255,255,0.75);
  padding: 5px 10px;
  border-radius: 999px;
}

.process-tabs {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 16px;
  -webkit-overflow-scrolling: touch;
}
.process-tab {
  padding: 8px 16px; background: #fff; border: 1px solid var(--gray-300);
  border-radius: 20px; font-size: 14px; white-space: nowrap; cursor: pointer;
  color: var(--gray-600); transition: all 0.15s;
}
.process-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 计件页顶部栏：头像+名字+当日净产值 */
.count-topbar {
  gap: 8px;
}
.count-topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.count-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.count-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
}
.count-topbar-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.count-topbar-center {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-shrink: 1;
  justify-content: center;
}
.count-net-label {
  font-size: 14px;
  color: var(--gray-500);
  white-space: nowrap;
}
.count-net-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--danger);
  white-space: nowrap;
}

/* 今日计件明细 */
.count-today-summary {
  margin-top: 20px;
  padding-bottom: 20px;
}
.count-summary-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-700);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--primary);
}
.count-summary-empty {
  text-align: center;
  padding: 24px;
  color: var(--gray-400);
  font-size: 14px;
}
.count-summary-group {
  margin-bottom: 10px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.count-summary-proc {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-dark);
  background: var(--primary-light);
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.count-summary-proc-price {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
}
.count-summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.count-summary-table th {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 50%, #818cf8 100%);
  color: #fff;
  padding: 6px 10px;
  text-align: left;
  font-weight: 600;
  border-bottom: 1px solid rgba(99,102,241,0.3);
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.count-summary-table td {
  padding: 6px 10px;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s;
}
.count-summary-table tbody tr:nth-child(even) { background: #f8fafc; }
.count-summary-table tbody tr:hover { background: #eef2ff; }
.count-summary-table tfoot td {
  font-weight: 700;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
  border-top: 2px solid #f59e0b;
  border-bottom: none;
}
.count-summary-table .col-num {
  text-align: right;
}
@media (max-width: 480px) {
  .count-topbar-name { font-size: 16px; }
  .count-net-label { font-size: 13px; }
  .count-net-value { font-size: 18px; }
  .count-summary-table { font-size: 13px; }
  .count-summary-table th, .count-summary-table td { padding: 6px 8px; }
}
.count-left {
  display: none;
}
.count-right {
  flex: 1; min-width: 0;
}
.count-right .product-info-card {
  margin-bottom: 12px;
}
@media (max-width: 480px) {
  .count-process-tab { min-width: 88px; padding: 12px 8px; }
  .count-process-tab .cpt-name { font-size: 16px; }
  .counter-section { padding: 0 12px 16px; gap: 12px; }
  .counter-set { gap: 8px; }   /* n699: 撤销 n698 的 margin-bottom:14px（硬撑间距让布局浮动），让 base 16px 自然控制 */
  .counter-set .counter-set-label { font-size: 15px; }
  .counter-set .input { width: 100px; font-size: 22px; padding: 9px 8px; }
  .counter-set .btn { font-size: 15px; padding: 10px 16px; }
  .counter-btn-sm { width: 64px; height: 56px; font-size: 30px; }
  .counter-main { gap: 16px; padding: 4px 0; margin-top: -5px; }   /* n700: 与 base 一致，0/+ 整组上移 5px */
  .counter-display .count-number { font-size: 64px; }
  .counter-btn { width: 104px; height: 104px; font-size: 52px; }
  .counter-btn.plus { width: 166px; height: 156px; }   /* n975: 宽 -20%（208→166），高 +50%（104→156） */
  .product-info-clock .pic-time { font-size: 28px; }
  .product-info-clock .pic-sec { font-size: 18px; }
  .product-info-clock .pic-date { font-size: 11px; }
  .counter-earnings { font-size: 22px; }
  .count-total-wage { font-size: 16px; padding: 12px 14px; margin-top: 5px; }   /* n702: 与 base 一致，固定 5px 间距 */
  .count-refresh-btn { width: 36px; height: 36px; }
  .count-refresh-btn svg { width: 20px; height: 20px; }
  .count-process-line { margin-top: 0; }   /* n699: 老平板间距由 base .counter-section > * + * 的 16px 统一控制 */
}

/* n683: 老平板（华为 pad 等 1200×1920）密度自适应——既不是 ≤480 小屏、也不是 >1400 桌面
  在 481-1400px 区间加大字号/间距/卡片尺寸，避免信息过密 */
@media (min-width: 481px) and (max-width: 1400px) {
  .content { padding: 20px; }

  /* 顶部工序滑动条 */
  .count-process-bar { padding: 28px 16px 16px; }
  /* n692: 媒体查询里子元素 margin 撑开间距，gap 没用（老 WebView 不识别） */
  .count-process-bar > *:not(:last-child) { margin-right: 14px; }
  .count-process-tab {
    min-width: 134px;
    padding: 18px 14px 20px;
    border-radius: 16px;
  }
  .count-process-tab .cpt-name { font-size: 21px; }
  .count-process-tab .cpt-price { font-size: 14px; margin-top: 3px; }
  .count-process-tab .cpt-qty { font-size: 17px; margin-top: 6px; }

  /* n689: 工序滑动条下方统一加大区段间距，工序→工时卡→产品卡不再挤成一坨 */
  .count-layout > .product-info-card { margin-top: 20px; }
  .count-layout > .counter-section { margin-top: 20px; }

  /* 工时卡片 */
  .work-session-card { margin-bottom: 18px !important; padding: 14px 22px !important; }

  /* 产品信息卡 */
  .product-info-card { padding: 22px 20px; margin-bottom: 22px; }
  .product-info-card > .product-info-badge { margin-left: 14px; }   /* n930: 中间插入时钟后改为直接子代选择器 */
  .product-info-card .product-name { font-size: 24px; }
  .product-info-card .product-meta { font-size: 13px; margin-top: 4px; }
  .product-info-card .product-info-badge { font-size: 14px; padding: 7px 14px; }
  /* n930: 平板上时钟更大更醒目 */
  .product-info-clock .pic-time { font-size: 46px; }
  .product-info-clock .pic-sec { font-size: 30px; }
  .product-info-clock .pic-date { font-size: 15px; margin-top: 4px; }

  /* n928: 工时测算按钮已移到首页「更多功能」，原 .count-layout > div:nth-of-type(4) 规则删除 */

  /* 计数器整段：更大间距 + 内边距 */
  .counter-section { padding: 4px 22px 32px; }
  /* n692: 子元素 margin-top 撑开比 gap 大 */
  .counter-section > * + * { margin-top: 30px; }

  /* 「− 设置 N 确定」行：放宽间距 + 输入框加大 */
  .counter-set { margin-top: 0; margin-bottom: 0; }   /* n699: 撤销 n695/n698 硬 margin，让 base 16px 自然间距控制，布局固定不浮动 */
  .counter-set > *:not(:last-child) { margin-right: 20px; }
  .counter-set .counter-set-label { font-size: 21px; }
  .counter-set .input { width: 152px; font-size: 28px; padding: 14px 12px; }
  .counter-set .btn { font-size: 20px; padding: 16px 28px; }

  /* 「−」按钮：加大触控区 */
  .counter-btn-sm { width: 84px; height: 76px; font-size: 36px; border-radius: 14px; }

  /* 工序名 + 钱数行 */
  .count-process-line { font-size: 26px; margin-top: 0; margin-bottom: 18px; }
  .count-process-line > *:not(:last-child) { margin-right: 18px; }

  /* 大数字 + 加号 */
  .counter-main { padding: 20px 0; margin-top: -5px; }                                 /* n699: 撤销 transform 避免漂移；n700: 与 base/≤480 一致，0/+ 整组上移 5px */
  .counter-main > .counter-plus-col { margin-left: 52px; }
  .counter-display .count-number { font-size: 104px; }
  .counter-btn { width: 152px; height: 152px; font-size: 72px; }
  .counter-btn.plus { width: 243px; height: 228px; }   /* n975: 宽 -20%（304→243），高 +50%（152→228） */

  /* 今日总工资卡 */
  .count-total-wage { font-size: 18px; padding: 16px 22px; transform: translateY(0); margin-top: 5px; }   /* n702: 与 base 一致，固定 5px 间距 */
  .count-total-wage > *:not(:last-child) { margin-right: 18px; }
  #tierProgressBar { margin-top: 12px; }

  /* 工人首页：头部、人脸卡、统计卡 */
  .worker-home-header { padding: 18px 20px; margin-bottom: 24px; }
  .face-enroll-card { margin: 20px 0 12px; padding: 16px 20px; }
  .stat-grid { margin-bottom: 24px; }
  .stat-card { padding: 18px 14px; }

  /* 工人首页：快捷操作按钮网格（n923: 删掉 .stat-grid/.worker-home-actions 子元素 margin-right 规则——flex 布局下会撑破显式宽度导致换行错乱，间距统一由子元素 margin/gap 负责） */
  .worker-home-actions { margin-top: 24px; margin-bottom: 24px; }
  .wha-btn { min-height: 170px; padding: 30px 16px; }
  .wha-btn.wha-order { min-height: 140px; }
  .wha-btn .wha-icon { font-size: 46px; }
  .wha-btn .wha-text { font-size: 21px; margin-top: 12px; }
  .wha-btn .wha-hint { font-size: 16px; margin-top: 8px; }
  .wha-more-toggle { margin-top: 18px; padding: 16px; font-size: 17px; }
  .wha-more { margin-top: 18px !important; }
}

/* n394: 计数器区域包裹，在剩余空间中垂直居中 */
/* n411: 计数器区域严格按用户截图重新设计 */
.counter-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0 16px 20px;
  /* n692: gap 不识别，改用子元素 margin-top 撑开 */
}
.counter-section > * + * { margin-top: 16px; }

/* 直接设置行：减号 | 直接设置 | 输入框 | 确定 */
/* n692: 子元素 margin-right 撑开间距，替代 gap */
.counter-set {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 4px;
}
.counter-set > *:not(:last-child) { margin-right: 12px; }
.counter-set .counter-set-label {
  font-size: 17px;
  font-weight: 700;
  color: var(--gray-700);
  flex-shrink: 0;
}
.counter-set .input {
  width: 120px;
  text-align: center;
  font-size: 24px;
  font-weight: 800;
  padding: 10px 6px;
  border-radius: 12px;
  border: 1.5px solid var(--gray-300);
  background: #fff;
}
.counter-set .btn {
  font-size: 17px;
  font-weight: 700;
  padding: 11px 22px;
  border-radius: 12px;
}
.counter-btn-sm {
  width: 64px;
  height: 56px;
  border-radius: 10px;
  border: none;
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: all 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.counter-btn-sm.minus {
  background: linear-gradient(180deg, #fb7185 0%, #e11d48 100%);
  color: #fff;
  box-shadow: 0 3px 8px rgba(225, 29, 72, 0.35);
}
.counter-btn-sm.minus:active { filter: brightness(0.92); transform: translateY(1px); }
.counter-btn-sm:disabled { opacity: 0.4; }

/* 大数字 + 加号 左右布局 */
/* n692: 去 gap，左右间距用 .counter-plus-col margin-left 撑开 */
.counter-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 8px 0;
  margin-top: -5px;        /* n700: 0/+ 整组（黑字「0」+ 绿色「+」）上移 5px，布局级固定偏移，不漂移 */
  /* n699: 撤销 n695 的 transform: translateY(-5px)，0/+ 整组位置由 padding/flex 决定，不上下浮动，布局固定 */
}
.counter-main > .counter-plus-col { margin-left: 10px; }  /* n955: 数字与+号间距 36→10px（数字右移贴近加号） */
/* n692: @supports 在老 WebView 上不可靠，干脆全面用 margin */
@supports not (gap: 1px) {
  /* 兜底：老 WebView + @supports 关键字被忽略——margin 已经写在外面，规则双重存在没问题 */
  .counter-main > .counter-plus-col { margin-left: 10px; }  /* n955: 36→10px */
}
.counter-display {
  text-align: center;
  padding: 0;
}
.counter-display .count-label { font-size: 16px; color: var(--gray-500); margin-top: 8px; }
.counter-display .count-number {
  font-size: 85px; font-weight: 800; color: #1e293b; line-height: 1; margin: 6px 0;   /* n593: 64→85 (×1.33 整体加大 1/3) */
}
/* n692: counter-plus-col 是 column flex，子元素垂直间距改用子元素 margin-bottom */
.counter-plus-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.counter-plus-col > *:not(:last-child) { margin-bottom: 14px; }
.counter-btn {
  width: 128px; height: 128px; border-radius: 50%; border: none;                       /* n593: 96→128 (×1.33) */
  font-size: 64px; font-weight: 300; cursor: pointer; transition: all 0.1s;            /* n593: 48→64 (×1.33) */
  display: flex; align-items: center; justify-content: center;
}
.counter-btn.plus {
  /* n928: 椭圆改圆角长方形 + 绿改红（更醒目） */
  background: linear-gradient(180deg, #f05252 0%, #b91c1c 100%);
  color: #fff;
  box-shadow: 0 8px 20px rgba(185, 28, 28, 0.45);
  /* n927: 宽度加倍保持大触控区；n928: border-radius 28px 圆角长方形（不再是椭圆） */
  /* n975: 用户要求 —— 宽度 -20%（256→205），高度 +50%（128→192），更好按 */
  width: 205px;
  height: 192px;
  border-radius: 28px;
}
.counter-btn.plus:active { filter: brightness(0.9); transform: translateY(1px) scale(0.99); box-shadow: 0 3px 10px rgba(185,28,28,0.5); }
.counter-btn:disabled { opacity: 0.4; }

/* n952: 老平板触控加固 —— 去掉点击后的系统焦点外框与灰色点击高亮（工人误以为「点不上」），
   改成明确的按压反馈；touch-action:manipulation 去掉老 WebView 的 300ms 双击缩放判定 */
.counter-btn, .counter-btn:focus, .counter-btn:focus-visible, .counter-btn:active,
.counter-btn-sm, .counter-btn-sm:focus, .counter-btn-sm:focus-visible, .counter-btn-sm:active,
.count-process-tab:focus, .count-process-tab:focus-visible, .count-process-tab:active,
.counter-set .btn:focus, .counter-set .btn:focus-visible,
.elderly-confirm .ec-btn:focus, .elderly-confirm .ec-btn:focus-visible {
  outline: none !important;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
.counter-btn, .counter-btn-sm, .count-process-tab, .counter-set .btn, .elderly-confirm .ec-btn {
  touch-action: manipulation;
}
.counter-btn:active, .counter-btn-sm:active { transform: translateY(1px) scale(0.99); }
.counter-btn-sm.minus:active { filter: brightness(0.92); }

/* n953/n954: 计数进行中工序锁定 —— 未选中的工序卡灰化（顶部提示条已按要求移除）
   （切换被 switchProcessSafe / _doSwitchProcess / switchProcess 三处硬拦，需先点「停止」） */
.count-process-bar.locked .count-process-tab { opacity: 0.42; }
.count-process-bar.locked .count-process-tab.active { opacity: 1; }
.count-process-bar.locked .count-process-tab.active:active { transform: none; }

/* n927: 计数页「开始」按钮放大两倍 + 呼吸光圈动画更醒目（-webkit- 前缀兼容老 WebView） */
@-webkit-keyframes wscPulse {
  0%, 100% { box-shadow: 0 3px 12px rgba(0,0,0,.3), 0 0 0 0 rgba(255,255,255,.6); }
  50%      { box-shadow: 0 3px 12px rgba(0,0,0,.3), 0 0 0 10px rgba(255,255,255,0); }
}
@keyframes wscPulse {
  0%, 100% { box-shadow: 0 3px 12px rgba(0,0,0,.3), 0 0 0 0 rgba(255,255,255,.6); }
  50%      { box-shadow: 0 3px 12px rgba(0,0,0,.3), 0 0 0 10px rgba(255,255,255,0); }
}
#wscBtn {
  -webkit-animation: wscPulse 1.6s ease-in-out infinite;
  animation: wscPulse 1.6s ease-in-out infinite;
}
.counter-earnings {
  font-size: 35px; color: var(--success-dark); font-weight: 800; line-height: 1;       /* n593: 26→35 (×1.33) */
}

/* n589: 工序名 + 钱数 居中行（与「设置」对齐） */
/* n692: 去 gap */
.count-process-line {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0;
  margin-bottom: 4px;
  font-size: 23px;          /* n593: 整体加大三分之一（17→23） */
  font-weight: 700;
  color: var(--gray-700);
  text-align: center;
}
.count-process-line > *:not(:last-child) { margin-right: 14px; }
.count-process-line .count-process-info { color: var(--gray-700); }
.count-process-line .count-process-earn { color: var(--success-dark); font-weight: 800; }

/* n590: 工时卡右侧「件/小时」+ 开始/暂停按钮（flex，rate 在 btn 左侧） */
/* n692: gap 改 margin-right */
.work-session-card .wsc-right { display: flex; align-items: center; }
.work-session-card .wsc-right > *:not(:last-child) { margin-right: 8px; }
.work-session-card .wsc-rate { white-space: nowrap; font-size: 12px; color: #64748b; }

/* 今日总工资卡片 */
/* n692: gap 改 margin-right */
.count-total-wage {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;          /* n594: 框高压缩 20%（18→14 ≈ ×0.8） */
  font-weight: 700;
  color: var(--gray-700);
  margin-top: 5px;          /* n702: 与上方 .counter-main（绿色+按钮）固定 5px 净间距，撤销 margin-top:auto 的浮动 + translateY(-10px) 负位移 */
  padding: 11px 16px;        /* n594: 14→11（×0.8 压缩 20%） */
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--gray-200);
  box-shadow: 0 2px 10px rgba(15,23,42,0.05);
}
.count-total-wage > *:not(:last-child) { margin-right: 14px; }
.count-total-wage .ctw-text { flex: 1; text-align: center; }
.count-refresh-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #818cf8 0%, #6366f1 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(99, 102, 241, 0.35);
}
.count-refresh-btn svg { width: 22px; height: 22px; }
.count-refresh-btn:active { filter: brightness(0.92); transform: scale(0.96); }

/* 工人计数页右下角返回按钮 */
.counter-back-row { display: flex; justify-content: flex-end; margin-top: 18px; }
.counter-back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px;
  background: #fff; color: #475569;
  border: 1.5px solid #cbd5e1; border-radius: 999px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 2px 6px rgba(15,23,42,0.06);
}
.counter-back-btn:hover {
  background: #f1f5f9; color: #1e293b;
  border-color: #94a3b8;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(15,23,42,0.1);
}
.counter-back-btn:active { transform: translateY(0); }

/* ===== 今日明细 ===== */
.detail-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; background: #fff; border-radius: var(--radius);
  margin-bottom: 8px; box-shadow: var(--shadow);
}
.detail-item .detail-left { flex: 1; }
.detail-item .detail-product { font-size: 17px; font-weight: 500; color: var(--gray-800); }
.detail-item .detail-process { font-size: 15px; color: var(--gray-500); margin-top: 2px; }
.detail-item .detail-right { text-align: right; }
.detail-item .detail-qty { font-size: 22px; font-weight: 700; color: var(--primary); }
.detail-item .detail-earnings { font-size: 15px; color: var(--success-dark); }

/* ===== 历史统计明细（老年版大字号 n388） ===== */
.history-date-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.history-date-filter .input[type="date"] {
  flex: 1 1 130px;
  min-width: 130px;
  padding: 10px 8px;
  font-size: 15px;
  box-sizing: border-box;
}
.history-day-card { margin-bottom: 12px; border-radius: 16px; box-shadow: var(--shadow); }
.history-day-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; background: linear-gradient(135deg, #2563eb, #4f46e5); color: #fff;
}
.history-day-title { font-size: 18px; font-weight: 700; }
.history-day-sub { font-size: 14px; opacity: 0.9; margin-top: 2px; }
.history-day-total { font-size: 20px; font-weight: 800; }
.history-detail-list { padding: 4px 12px 12px; background: #fff; }
.history-detail-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto auto;
  gap: 8px; align-items: center;
  padding: 10px 0; border-bottom: 1px dashed #e2e8f0;
  font-size: 15px; color: var(--gray-700);
}
.history-detail-row:last-child { border-bottom: none; }
.history-detail-row .hdr-product { font-weight: 600; color: var(--gray-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-detail-row .hdr-process { color: var(--gray-600); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-detail-row .hdr-qty { font-weight: 700; color: var(--primary); text-align: right; }
.history-detail-row .hdr-price { font-weight: 700; color: var(--success-dark); text-align: right; min-width: 58px; }

.empty-state {
  text-align: center; padding: 60px 20px; color: var(--gray-400);
}
.empty-state .empty-icon {
  font-size: 42px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  width: 88px; height: 88px; border-radius: 24px;
  margin-bottom: 16px;
  background: linear-gradient(145deg, #f8fafc 0%, #e2e8f0 100%);
  box-shadow:
    inset 0 3px 5px rgba(255,255,255,0.9),
    inset 0 -3px 6px rgba(100,116,139,0.15),
    0 6px 12px rgba(0,0,0,0.12),
    0 2px 4px rgba(0,0,0,0.06);
  position: relative;
  filter: saturate(1.15);
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.25s;
}
.empty-state .empty-icon::before {
  content: ''; position: absolute; top: 4px; left: 6px; right: 6px; height: 45%;
  border-radius: 16px 16px 50% 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.75) 0%, transparent 100%);
  pointer-events: none;
}
.empty-state:hover .empty-icon {
  transform: scale(1.05) translateY(-2px);
  box-shadow:
    inset 0 3px 5px rgba(255,255,255,0.9),
    inset 0 -3px 6px rgba(100,116,139,0.15),
    0 10px 20px rgba(0,0,0,0.15),
    0 3px 6px rgba(0,0,0,0.08);
}
.empty-state .empty-text { font-size: 15px; }

/* ===== 扫码页面 ===== */
.scan-page {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: #000; z-index: 1000; display: flex; flex-direction: column;
}
.scan-page .scan-header {
  padding: 16px; color: #fff; display: flex; align-items: center; gap: 12px;
}
.scan-page .scan-close { color: #fff; font-size: 24px; cursor: pointer; background: none; border: none; }
.scan-page .scan-title { font-size: 16px; }
#qr-reader { flex: 1; width: 100%; }
.scan-page .scan-instructions {
  padding: 20px; color: rgba(255,255,255,0.7); text-align: center; font-size: 14px;
}

/* ===== 管理后台 ===== */
.admin-nav {
  background: var(--gray-800); display: flex; overflow-x: auto;
  position: sticky; top: 0; z-index: 100;
}
.admin-nav-item {
  padding: 14px 20px; color: rgba(255,255,255,0.6); font-size: 14px;
  cursor: pointer; white-space: nowrap; border-bottom: 3px solid transparent;
  transition: all 0.15s;
}
.admin-nav-item.active { color: #fff; border-bottom-color: var(--primary); }

/* .admin-content 主样式已在顶部导航区块定义，此处旧规则已废弃 */

.admin-stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px; margin-bottom: 24px;
}

/* 工记录管理：5 张总汇卡片自适应布局 */
.rec-totals-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.rec-totals-grid .card { padding: 14px 16px; }
.rec-totals-grid .card > div:nth-child(2) { font-size: 22px; font-weight: 700; }
@media (max-width: 1280px) { .rec-totals-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px)  { .rec-totals-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px)  { .rec-totals-grid { grid-template-columns: 1fr; } }

table {
  width: 100%; border-collapse: collapse; background: #fff;
  border: 1px solid #e2e8f0; border-radius: 10px; overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
th, td {
  padding: 10px 14px; text-align: center; font-size: var(--table-font-size, 15px);
  border: 1px solid #f1f5f9;
  transition: background 0.15s;
}
th {
  background: linear-gradient(135deg, #6366f1 0%, #818cf8 50%, #a5b4fc 100%);
  color: #fff; font-weight: 600; letter-spacing: 0.3px;
  border: 1px solid rgba(99,102,241,0.25);
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
td { color: var(--gray-700); font-weight: 500; }
tbody tr:nth-child(even) { background: #f8fafc; }
tbody tr:hover { background: #eef2ff !important; }
tbody tr:hover td { color: var(--gray-800); }
tfoot td {
  font-weight: 700;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%) !important;
  color: #92400e;
  border-top: 2px solid #f59e0b !important;
}
tfoot tr:hover td { background: #fde68a !important; }
.table-wrap { overflow-x: auto; border-radius: 10px; }
.table-wrap table, #adminContent table, #app .content table, .pm-table {
  font-size: var(--table-font-size, 15px) !important;
}

/* === 人员管理表格：内外框 + 竖向框线 + 隔行变色 === */
.pm-table {
  border: 1px solid #cbd5e1 !important;
  border-radius: 10px;
  border-collapse: collapse;
  width: 100%;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  font-size: var(--table-font-size, 15px) !important;
  overflow: hidden;
}
.pm-table th,
.pm-table td {
  border: 1px solid #e2e8f0 !important;
  padding: 10px 12px !important;
  vertical-align: middle;
  font-weight: 500;
  transition: background 0.15s;
}
.pm-table th:nth-child(1), .pm-table td:nth-child(1) { min-width: 50px; }   /* 序号 */
.pm-table th:nth-child(2), .pm-table td:nth-child(2) { min-width: 70px; }   /* 图片 */
.pm-table th:nth-child(3), .pm-table td:nth-child(3) { min-width: 140px; }  /* 名称 */
.pm-table th:nth-child(4), .pm-table td:nth-child(4) { min-width: 90px; }   /* 编码 */
.pm-table th:nth-child(7), .pm-table td:nth-child(7) { min-width: 80px; }   /* 单价 */
.pm-table th:nth-child(8), .pm-table td:nth-child(8) { min-width: 80px; }   /* 库存 */
.pm-table th:nth-child(9), .pm-table td:nth-child(9) { min-width: 70px; }   /* 预警线 */
.pm-table th:nth-child(12), .pm-table td:nth-child(12) { min-width: 140px; white-space: nowrap; } /* 操作 */
.table-wrap { overflow-x: auto; border-radius: 10px; }
.table-wrap > table { width: 100%; }
.pm-table thead th {
  background: #f1f5f9 !important;
  font-weight: 700;
  color: #1e293b !important;
  border-bottom: 2px solid #e2e8f0 !important;
  border: 1px solid #e2e8f0 !important;
}
.pm-row-alt { background: #f0f4ff; }
.pm-row-alt:hover { background: #e0e7ff !important; }
.pm-table tbody tr:not(.pm-row-alt):nth-child(even) { background: #f8fafc; }
.pm-table tbody tr:not(.pm-row-alt):hover { background: #f1f5f9 !important; }
/* 人员管理：高亮大字列（姓名/用户名/角色/保底工资） — n283 */
.pm-table td.pm-cell-lg {
  font-size: 18px !important;
  font-weight: 700 !important;
  color: #0f172a;
  letter-spacing: 0.2px;
}
.pm-table td.pm-cell-lg .user-name-link { font-size: 18px; }
.pm-table td.pm-cell-lg .badge { font-size: 16px; padding: 4px 12px; }
/* 桌面端人员管理表格：浅灰文字加深以便清晰阅读 */
.pm-table td { color: var(--gray-900); }
.pm-table .text-gray { color: var(--gray-700) !important; }
.pm-table .badge[style*="color:#94a3b8"] { color: var(--gray-700) !important; }
.packing-record-table .pack-group-row td { background: #f1f5f9; border-top: 2px solid var(--gray-300) !important; }
.packing-record-table .pack-detail-row td { background: #fff; }
.packing-record-table .pack-detail-row td:first-child { padding-left: 24px !important; }
.packing-record-table .pack-detail-row td:nth-child(2),
.packing-record-table .pack-detail-row td:nth-child(3) { background: #fff; color: transparent; }
.pm-seq {
  text-align: center;
  font-weight: 700;
  color: var(--gray-500);
  font-size: 13px;
}
.pm-count-badge {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  background: rgba(79, 108, 255, 0.08);
  padding: 2px 12px;
  border-radius: 20px;
  margin-left: 8px;
  vertical-align: middle;
}
.pm-group-filter {
  width: auto;
  min-width: 140px;
  padding: 6px 12px;
  font-size: 13px;
}

.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); z-index: 500; display: flex;
  align-items: center; justify-content: center; padding: 20px;
}
.modal {
  background: #fff; border-radius: 16px; padding: 24px;
  width: 100%; max-width: 460px; max-height: 90vh; overflow-y: auto;
}
.modal h3 { font-size: 18px; margin-bottom: 20px; }
.modal .form-group { margin-bottom: 14px; }
.modal-actions {
  display: flex; gap: 12px; margin-top: 20px;
}
.modal-actions .btn { flex: 1; }

.sch-total-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border: 1px solid #93c5fd;
  border-radius: 10px; padding: 12px 16px; margin-bottom: 16px;
  font-size: 14px; color: var(--gray-600);
}
.sch-total-bar b { font-size: 22px; font-weight: 800; margin: 0 4px; }

.sch-daily-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
}
.sch-daily-date {
  min-width: 110px; font-size: 13px; color: var(--gray-600);
  font-weight: 600; background: var(--gray-50); padding: 6px 10px; border-radius: 6px;
  text-align: center;
}
.sch-daily-qty { width: 100px; text-align: center; font-weight: 700; font-size: 16px; }

.qr-modal-img {
  text-align: center; padding: 20px;
}
.qr-modal-img img { max-width: 100%; border-radius: var(--radius); }
.qr-modal-img .qr-info { margin-top: 12px; }
.qr-modal-img .qr-code { font-size: 20px; font-weight: 700; color: var(--gray-800); }

.toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  background: var(--gray-800); color: #fff; padding: 12px 24px;
  border-radius: var(--radius); font-size: 14px; z-index: 2000;
  animation: fadeIn 0.2s, fadeOut 0.3s 2s forwards;
}
.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }
.toast.warning { background: var(--warning, #f59e0b); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; } }

.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-sm { font-size: 13px; }
.text-gray { color: var(--gray-500); }
.text-success { color: var(--success-dark); }
.text-danger { color: var(--danger); }
.font-bold { font-weight: 600; }
.hidden { display: none !important; }

/* ===== 质检触控屏 ===== */
.qc-touch {
  max-width: 600px;
  margin: 0 auto;
  padding: 8px 0 32px;
}
.qc-config {
  background: white;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.qc-config-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.qc-config-row:last-child { margin-bottom: 0; }
.qc-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-700);
  min-width: 70px;
  white-space: nowrap;
}
.qc-select {
  flex: 1;
  height: 44px;
  font-size: 15px;
}
.qc-counters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.qc-counter-card {
  min-width: 0;
  overflow: hidden;
  border-radius: var(--radius);
  padding: 5px 16px;
  text-align: center;
  box-shadow: var(--shadow-md);
}
.qc-good {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border: 2px solid #86efac;
}
.qc-bad {
  background: linear-gradient(135deg, #fef2f2, #fee2e2);
  border: 2px solid #fca5a5;
}
.qc-counter-label {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}
.qc-good .qc-counter-label { color: #15803d; }
.qc-bad .qc-counter-label { color: #b91c1c; }
.qc-today-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 8px;
  margin-left: 6px;
  vertical-align: middle;
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
}
.qc-counter-display {
  font-size: 64px;
  font-weight: 800;
  line-height: 1.2;
  margin: 8px 0 16px;
  font-variant-numeric: tabular-nums;
}
.qc-good .qc-counter-display { color: #166534; }
.qc-bad .qc-counter-display { color: #991b1b; }
.qc-counter-hint {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 4px;
  text-align: center;
}
.qc-worker-inline {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(252, 165, 165, 0.5);
}
.qc-worker-inline .qc-select {
  width: 100%;
  flex: none;
}
.qc-pulse {
  animation: qcPulse 0.25s ease;
}
@keyframes qcPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}
.qc-counter-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.qc-btn-plus, .qc-btn-minus {
  height: 60px;
  border: none;
  border-radius: 10px;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.qc-btn-plus {
  background: #22c55e;
  color: white;
}
.qc-btn-plus:active {
  background: #16a34a;
  transform: scale(0.95);
}
.qc-good .qc-btn-minus {
  background: #f3f4f6;
  color: #6b7280;
}
.qc-good .qc-btn-minus:active {
  background: #e5e7eb;
  transform: scale(0.95);
}
.qc-bad .qc-btn-plus {
  background: #ef4444;
  color: white;
}
.qc-bad .qc-btn-plus:active {
  background: #dc2626;
  transform: scale(0.95);
}
.qc-bad .qc-btn-minus {
  background: #f3f4f6;
  color: #6b7280;
}
.qc-bad .qc-btn-minus:active {
  background: #e5e7eb;
  transform: scale(0.95);
}
.qc-btn-big {
  grid-column: span 2;
  height: 70px;
  font-size: 26px;
}
.qc-save-red {
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  border: none;
  border-radius: 10px;
  font-size: 17px;
  font-weight: 700;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: #fff;
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.4);
  cursor: pointer;
  transition: all 0.15s;
}
.qc-save-red:active {
  transform: scale(0.97);
  background: linear-gradient(135deg, #dc2626, #991b1b);
}
.qc-defect-section {
  background: white;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.qc-defect-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.qc-defect-header-btns {
  display: flex;
  gap: 10px;
  align-items: center;
}
.qc-save-btn {
  font-size: 17px !important;
  font-weight: 700 !important;
  padding: 10px 28px !important;
  border-radius: 10px !important;
  background: linear-gradient(135deg, #2563eb, #1e40af) !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4) !important;
  white-space: nowrap;
}
.qc-defect-row {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  align-items: center;
}
.qc-defect-row .input {
  height: 40px;
  font-size: 14px;
}
.qc-quick-defects {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--gray-200);
}
.qc-chip {
  padding: 8px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--gray-300);
  background: var(--gray-50);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.qc-chip:active {
  background: var(--primary-light);
  border-color: var(--primary);
  transform: scale(0.95);
}
.qc-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.qc-note-input {
  height: 44px;
  font-size: 15px;
}
.qc-save-btn {
  height: 60px;
  font-size: 20px;
  font-weight: 700;
  border-radius: 12px;
}

/* ===== 今日累计弹窗 ===== */
.qc-summary-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
  justify-content: center;
  align-items: flex-start;
  padding: 20px;
  overflow-y: auto;
}
.qc-summary-panel {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 1100px;
  margin: 20px auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  overflow: hidden;
}
.qc-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: linear-gradient(135deg, #1e40af, #2563eb);
  color: #fff;
}
.qc-summary-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}
.qc-summary-close {
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  font-size: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.qc-summary-close:hover { background: rgba(255,255,255,0.35); }
.qc-summary-loading {
  padding: 60px;
  text-align: center;
  color: #6b7280;
  font-size: 16px;
}
.qc-summary-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 12px 24px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}
.qc-quick-btns, .qc-group-btns {
  display: flex;
  gap: 6px;
}
.qc-quick-btn {
  padding: 6px 16px;
  border: 1.5px solid #d1d5db;
  background: #fff;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #4b5563;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.qc-quick-btn:hover { border-color: #2563eb; color: #2563eb; }
.qc-quick-btn.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}
.qc-date-pickers {
  display: flex;
  align-items: center;
  gap: 6px;
}
.qc-date-input {
  width: 140px;
  height: 34px;
  font-size: 13px;
  padding: 0 8px;
}
.qc-date-sep { color: #9ca3af; font-size: 14px; }
.qc-section-title {
  padding: 12px 24px 6px;
  font-size: 16px;
  font-weight: 700;
  color: #1f2937;
  border-top: 1px solid #f3f4f6;
}
.qc-section-title:first-of-type { border-top: none; }
.qc-detail-title {
  display: flex;
  align-items: center;
  gap: 35px;
}
.qc-order-select {
  padding: 5px 10px;
  font-size: 13px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  max-width: 320px;
}
.qc-worker-table-wrap {
  padding: 0 24px 12px;
  overflow-x: auto;
}
.qc-summary-totals {
  display: flex;
  gap: 12px;
  padding: 16px 24px;
  background: #f8fafc;
  flex-wrap: wrap;
}
.qc-total-card {
  flex: 1;
  min-width: 120px;
  text-align: center;
  padding: 12px 8px;
  border-radius: 10px;
}
.qc-total-good { background: #f0fdf4; border: 1px solid #86efac; }
.qc-total-bad { background: #fef2f2; border: 1px solid #fca5a5; }
.qc-total-deduct { background: #fffbeb; border: 1px solid #fcd34d; }
.qc-total-records { background: #eff6ff; border: 1px solid #93c5fd; }
.qc-total-num {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
}
.qc-total-good .qc-total-num { color: #166534; }
.qc-total-bad .qc-total-num { color: #991b1b; }
.qc-total-deduct .qc-total-num { color: #b45309; }
.qc-total-records .qc-total-num { color: #1e40af; }
.qc-total-label {
  font-size: 13px;
  color: #6b7280;
  margin-top: 2px;
}
.qc-summary-table-wrap {
  padding: 0 24px 16px;
  overflow-x: auto;
}
.qc-summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--table-font-size, 15px);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.qc-summary-table th {
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 50%, #3b82f6 100%);
  color: #fff;
  padding: 10px 8px;
  text-align: center;
  font-weight: 600;
  white-space: nowrap;
  position: sticky;
  top: 0;
  border-right: 1px solid rgba(255,255,255,0.25);
  text-shadow: 0 1px 2px rgba(0,0,0,0.12);
}
.qc-summary-table th:last-child { border-right: none; }
.qc-summary-table th:first-child { border-radius: 0; }
.qc-summary-table th:last-child { border-radius: 0; }
.qc-summary-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #e5e7eb;
  border-right: 1px solid #eef2f7;
  vertical-align: middle;
  text-align: center;
  transition: background 0.15s;
}
.qc-summary-table td:last-child { border-right: none; }
.qc-summary-table tbody tr:nth-child(even) {
  background: #f0f4ff;
}
.qc-summary-table tbody tr:hover {
  background: #e0e7ff !important;
}
.qc-summary-footer {
  display: flex;
  gap: 12px;
  justify-content: center;
  padding: 12px 24px 20px;
}
.qc-edit-panel {
  background: #fff;
  border-radius: 16px;
  width: 460px;
  max-width: 92vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

/* ===== 质检管理区汇总看板 ===== */
.qc-manage-board {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 0;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.qc-manage-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
}
.qc-manage-quick,
.qc-manage-date,
.qc-manage-view {
  display: flex;
  gap: 6px;
  align-items: center;
}
.qc-manage-view {
  margin-left: auto;
}
.qc-worker-filter {
  display: flex;
  gap: 8px;
  align-items: center;
}
.qc-defect-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-start;
}
.qc-defect-tag {
  display: inline-block;
  padding: 2px 8px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.qc-defect-table th,
.qc-defect-table td {
  padding: 10px 12px;
  vertical-align: middle;
}
.qc-defect-table thead th {
  background: linear-gradient(135deg, #7c2d12 0%, #b91c1c 50%, #dc2626 100%);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.12);
}
.qc-defect-table tbody tr:nth-child(even) { background: #fef2f2; }
.qc-defect-table tbody tr:hover { background: #fee2e2 !important; }
.qc-checker-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.qc-checker-tag {
  display: inline-block;
  padding: 2px 8px;
  background: #fef3f2;
  border: 1px solid #fecdca;
  color: #b42318;
  border-radius: 10px;
  font-size: 12px;
  white-space: nowrap;
}
.qa-defect-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.qa-defect-type {
  min-width: 100px;
}
.qc-manage-board .qc-summary-totals {
  background: #fff;
}
.qc-edit-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.qc-edit-row label {
  width: 80px;
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  text-align: right;
}
.qc-edit-row .input {
  flex: 1;
}

/* ===== 班组卡片 ===== */
.group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.group-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.group-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}
.group-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-800);
}
.group-meta {
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 4px;
}
.group-actions {
  display: flex;
  gap: 8px;
}
.group-members {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.group-member-tag {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
}
.group-remark {
  font-size: 13px;
  color: var(--gray-500);
  border-top: 1px solid var(--gray-100);
  padding-top: 10px;
}

/* ===== 排产看板卡片 ===== */
.schedule-list {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}
.schedule-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.schedule-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}
.schedule-order {
  font-size: 17px;
  font-weight: 700;
  color: var(--gray-800);
}
.schedule-meta {
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 4px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
}
.schedule-meta .badge {
  vertical-align: middle;
  margin-left: 2px;
}
.schedule-progress-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.schedule-progress-bar {
  flex: 1;
  height: 10px;
  background: var(--gray-100);
  border-radius: 5px;
  overflow: hidden;
}
.schedule-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--success));
  border-radius: 5px;
  transition: width 0.4s ease;
}
.schedule-progress-text {
  font-size: 13px;
  color: var(--gray-600);
  white-space: nowrap;
  font-weight: 600;
}
.schedule-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}
.schedule-stat {
  background: var(--gray-50);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
}
.schedule-stat span {
  display: block;
  font-size: 12px;
  color: var(--gray-500);
  margin-bottom: 2px;
}
.schedule-stat b {
  font-size: 18px;
  color: var(--gray-800);
}
.schedule-dates {
  display: grid;
  gap: 8px;
}
.schedule-date-item {
  display: grid;
  /* 前 2 列固定宽（日期/班组），其余用 minmax 让明细通长到大卡宽度，跟上方 5 个统计卡片对齐 */
  grid-template-columns: 110px 110px minmax(80px, 1fr) minmax(80px, 1fr) minmax(70px, 1fr) minmax(70px, 1fr) minmax(60px, 1fr) minmax(80px, 1fr) minmax(90px, 1fr);
  align-items: center;
  gap: 8px;
  font-size: 13px;
  background: var(--gray-50);
  padding: 8px 10px;
  border-radius: 8px;
}
.schedule-date {
  font-weight: 600;
  color: var(--gray-700);
}
.schedule-date-group {
  color: var(--gray-600);
}
.schedule-date-qty, .schedule-date-actual, .schedule-date-good, .schedule-date-bad, .schedule-date-waste {
  color: var(--gray-600);
}
.schedule-date-status {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.schedule-date-status .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  line-height: 1;
}
.schedule-date-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.schedule-date-item {
  grid-template-columns: 110px 110px minmax(80px, 1fr) minmax(80px, 1fr) minmax(70px, 1fr) minmax(70px, 1fr) minmax(60px, 1fr) minmax(80px, 1fr) minmax(90px, 1fr) !important;
  align-items: center !important;
}
.schedule-dates-head {
  display: grid;
  grid-template-columns: 110px 110px minmax(80px, 1fr) minmax(80px, 1fr) minmax(70px, 1fr) minmax(70px, 1fr) minmax(60px, 1fr) minmax(80px, 1fr) minmax(90px, 1fr);
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-500);
  padding: 6px 10px;
  text-transform: uppercase;
}
.sch-alloc-bar {
  background: var(--gray-50);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 12px;
}
.sch-alloc-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--gray-600);
  margin-bottom: 8px;
}
.sch-alloc-row b {
  font-size: 20px;
  font-weight: 800;
  margin: 0 12px 0 2px;
}
.sch-alloc-progress {
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
}
.sch-alloc-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}
.sch-edit-info {
  background: var(--gray-50);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--gray-600);
  margin-bottom: 12px;
}
.sch-edit-info b { color: var(--gray-800); font-weight: 700; }

/* ===== 排产分组配置 ===== */
.sch-group-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--gray-50);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
}
.sch-group-checkbox:hover {
  background: #eef2ff;
  border-color: #6366f1;
}
.sch-group-checkbox input:checked + span,
.sch-group-checkbox:has(input:checked) {
  /* 选中态由背景色提现 */
}
.sch-group-configs {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
  max-height: 360px;
  overflow-y: auto;
}
.sch-group-card {
  background: linear-gradient(135deg, #f0f9ff, #f5f3ff);
  border: 1px solid #c7d2fe;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 4px;
}
.sch-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 700;
  color: #1e3a8a;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed #c7d2fe;
}
.sch-group-sum {
  font-size: 13px;
  color: #2563eb;
  font-weight: 600;
  background: #dbeafe;
  padding: 2px 10px;
  border-radius: 12px;
}
.sch-daily-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.sch-daily-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sch-daily-date {
  width: 100px;
  font-size: 13px;
  color: #4b5563;
  font-weight: 500;
}
.sch-daily-qty {
  flex: 1;
  max-width: 140px;
}

@media (max-width: 640px) {
  .qc-summary-totals { gap: 8px; }
  .qc-total-card { min-width: 45%; }
  .qc-total-num { font-size: 22px; }
  .qc-summary-table { font-size: 13px; }
  .qc-summary-table th, .qc-summary-table td { padding: 6px 4px; }
  .qc-summary-toolbar { gap: 8px; }
  .qc-quick-btn { padding: 5px 12px; font-size: 13px; }
  .qc-date-input { width: 120px; }
  .qc-section-title { font-size: 14px; padding: 10px 16px 4px; }
  .qc-worker-table-wrap, .qc-summary-table-wrap { padding: 0 16px 12px; }
}

/* ===== 班组排产 ===== */
.schedule-view-header { align-items: center; }

/* n292：排产视图切换 — 按钮式 Tab（替代下拉 select） */
.sch-view-tabs {
  display: inline-flex;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.sch-view-tab {
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  -webkit-tap-highlight-color: transparent;
}
.sch-view-tab + .sch-view-tab {
  border-left: 1px solid #e2e8f0;
}
.sch-view-tab:hover:not(.active) {
  background: #f1f5f9;
  color: #1e293b;
}
.sch-view-tab.active {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15);
}
.sch-view-tab.active:hover {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
}
.grp-sch-kpi {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 10px;
  margin: 16px 0;
}
.grp-sch-kpi-item {
  border-radius: 10px;
  padding: 10px 6px;
  text-align: center;
  color: #fff;
  box-shadow: var(--shadow);
}
.grp-sch-kpi-label {
  font-size: 12px;
  opacity: 0.95;
  margin-bottom: 4px;
  white-space: nowrap;
}
.grp-sch-kpi-value {
  font-size: 16px;
  font-weight: 800;
  white-space: nowrap;
}
.grp-sch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr));
  gap: 16px;
}
.grp-sch-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s, transform 0.15s;
}
.grp-sch-card:hover {
  box-shadow: 0 4px 14px rgba(37,99,235,0.12);
  transform: translateY(-1px);
}
.grp-sch-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--gray-100);
}
.grp-sch-group-name {
  font-size: 16px;
  font-weight: 800;
  color: #2563eb;
}
.grp-sch-group-sum {
  font-size: 12px;
  color: var(--gray-600);
  font-weight: 600;
}
.grp-sch-card-body {
  flex: 1;
  font-size: 13px;
  color: var(--gray-700);
}
.grp-sch-info-row {
  margin-bottom: 5px;
  display: flex;
  align-items: center;
}
.grp-sch-info-label {
  color: var(--gray-500);
  white-space: nowrap;
}
.grp-sch-info-value {
  color: var(--gray-800);
  font-weight: 600;
}
.grp-sch-progress-wrap {
  margin: 6px 0 8px;
}
.grp-sch-progress-bar {
  height: 6px;
  background: var(--gray-100);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 4px;
}
.grp-sch-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #16a34a);
  border-radius: 4px;
  transition: width 0.4s ease;
}
.grp-sch-progress-text {
  font-size: 11px;
  color: var(--gray-500);
  text-align: right;
}
.grp-sch-more {
  font-size: 12px;
  color: var(--primary);
  margin-top: 4px;
}
.grp-sch-order {
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px dashed var(--gray-200);
}
.grp-sch-order:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
}
.grp-sch-order-more {
  padding-top: 6px;
}
/* n299/n302: carryover 排产样式 — 黄色暖色背景 + 顺延标签 + 跳转按钮 */
.grp-sch-order-carryover {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
}
.grp-sch-carryover-badge {
  display: inline-block;
  background: #f59e0b;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  margin-bottom: 4px;
}
.grp-sch-carryover-note {
  color: #b45309;
  font-size: 12px;
  margin-top: 4px;
  font-style: italic;
}
/* n302: carryover 横幅样式 */
.grp-sch-carryover-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 1px solid #f59e0b;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 13px;
  color: #92400e;
}
.grp-sch-carryover-banner-icon { font-size: 18px; flex-shrink: 0; }
.grp-sch-carryover-banner-text { flex: 1; }
.grp-sch-carryover-banner-text b { color: #b45309; }
.grp-sch-carryover-jump-btn {
  background: #f59e0b;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.grp-sch-carryover-jump-btn:hover { background: #d97706; transform: translateY(-1px); }
.grp-sch-carryover-jump-btn-sm {
  background: transparent;
  color: #d97706;
  border: 1px solid #f59e0b;
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 6px;
  transition: all 0.2s ease;
}
.grp-sch-carryover-jump-btn-sm:hover { background: #f59e0b; color: #fff; }
.grp-sch-total-progress {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--gray-200);
}
.grp-sch-total-progress .grp-sch-progress-fill {
  background: linear-gradient(90deg, #3b82f6, #2563eb);
}
.grp-sch-empty-row {
  color: var(--gray-400);
  font-size: 13px;
  text-align: center;
  padding: 12px 0;
}
.grp-sch-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.grp-sch-card-actions .btn {
  flex: 1;
}

/* ===== n249 老板驾驶舱扩展样式 ===== */
.grp-sch-kpi-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  text-align: left;
  color: #fff;
  box-shadow: var(--shadow);
  transition: transform 0.15s;
}
.grp-sch-kpi-item:hover {
  transform: translateY(-2px);
}
.grp-sch-kpi-item.grp-sch-kpi-alert {
  animation: grp-kpi-pulse 2s infinite;
}
@keyframes grp-kpi-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); }
}
.grp-sch-kpi-icon {
  font-size: 24px;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}
.grp-sch-kpi-body {
  flex: 1;
  min-width: 0;
}
.grp-sch-kpi-label {
  font-size: 12px;
  opacity: 0.95;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.grp-sch-kpi-value {
  font-size: 16px;
  font-weight: 800;
  margin-top: 2px;
  white-space: nowrap;
}

/* 班组卡片 - 来料行 */
.grp-sch-material-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
  padding: 6px 0;
  border-bottom: 1px dashed var(--gray-200);
}
.grp-sch-mat-chip {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
  background: var(--gray-100);
  color: var(--gray-700);
}
.grp-sch-mat-purple { background: #ede9fe; color: #6d28d9; }
.grp-sch-mat-blue { background: #dbeafe; color: #1d4ed8; }
.grp-sch-mat-red { background: #fee2e2; color: #dc2626; }
.grp-sch-mat-green { background: #dcfce7; color: #16a34a; }

/* ===== n258 班组排产页面两列布局 ===== */
/* 整体页面：左列 = 班组排产清单（每组独占一行竖排），右列 = 老板关注 + KPI + 趋势 + 异常机工 */
.grp-sch-page-grid {
  display: grid;
  grid-template-columns: minmax(380px, 0.9fr) minmax(420px, 1.3fr);   /* n285: 左列最小 380px，比例 0.9:1.3，确保并排 */
  gap: 20px;
  align-items: start;
}
.grp-sch-page-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;                 /* 防止 flex 子项内容溢出 */
}
.grp-sch-section-title {
  font-size: 16px;
  font-weight: 800;
  color: #1e40af;
  padding: 6px 12px;
  background: linear-gradient(90deg, #eff6ff, #fff);
  border-left: 4px solid #2563eb;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

/* 班组清单内部：始终单列竖排（每组独占一行） */
.grp-sch-grid {
  display: grid;
  grid-template-columns: 1fr;   /* 始终单列，覆盖下方所有断点 */
  gap: 16px;
}

/* 大屏：左右两列并排（班组清单 + 老板关注） — n285 调整到 0.9:1.3 + 左列最小 380px */
@media (min-width: 1100px) {
  .grp-sch-page-grid {
    grid-template-columns: minmax(380px, 0.9fr) minmax(420px, 1.3fr);
    gap: 22px;
  }
}
/* 极小屏（手机竖屏）：回退单列竖排 */
@media (max-width: 600px) {
  .grp-sch-page-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* 老板关注面板 */
.grp-boss-panel {
  background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
  border: 1px solid #bae6fd;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.08);
}
.grp-boss-panel-clear {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
}
.grp-boss-panel-clear .grp-boss-icon { font-size: 32px; }
.grp-boss-panel-clear .grp-boss-title {
  font-size: 16px;
  font-weight: 700;
  color: #065f46;
}
.grp-boss-panel-clear .grp-boss-subtitle {
  font-size: 12px;
  color: #047857;
  margin-top: 2px;
}
.grp-boss-panel-clear .grp-boss-meta {
  margin-left: auto;
  font-size: 13px;
  color: #047857;
}
.grp-boss-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(59, 130, 246, 0.15);
}
.grp-boss-panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  color: #1e40af;
}
.grp-boss-panel-icon { font-size: 20px; }
.grp-boss-panel-count {
  background: #1e40af;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}
.grp-boss-panel-smooth {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--gray-700);
}
.grp-boss-panel-smooth-label { color: var(--gray-600); }
.grp-boss-panel-smooth-value {
  font-weight: 700;
  font-size: 14px;
  padding: 2px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.7);
}
.grp-boss-panel-smooth-sub {
  font-size: 12px;
  color: var(--gray-500);
}
.grp-boss-alerts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.grp-boss-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.85);
}
.grp-boss-alert-icon {
  font-size: 22px;
  flex-shrink: 0;
}
.grp-boss-alert-body { flex: 1; min-width: 0; }
.grp-boss-alert-title {
  font-weight: 700;
  font-size: 13.5px;
  color: #1e293b;
  margin-bottom: 2px;
}
.grp-boss-alert-detail {
  font-size: 12px;
  color: var(--gray-600);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* 趋势图表 */
.grp-sch-trends-wrap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
.grp-sch-trend-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.grp-sch-trend-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 8px;
}
.grp-sch-trend-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--gray-800);
}
.grp-sch-trend-legend {
  display: flex;
  gap: 12px;
  font-size: 11.5px;
  color: var(--gray-600);
}
.grp-sch-trend-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: middle;
}
.grp-sch-trend-meta {
  font-size: 12px;
  color: var(--gray-600);
}
.grp-sch-trend-chart {
  width: 100%;
  overflow: hidden;
  min-height: 170px;
}

/* 异常机工面板 */
.grp-risk-panel {
  background: #fff;
  border: 1px solid #fed7aa;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.grp-risk-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--gray-200);
}
.grp-risk-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 14.5px;
  color: #9a3412;
}
.grp-risk-count {
  background: #fed7aa;
  color: #9a3412;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 10px;
}
.grp-risk-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 10px;
}
.grp-risk-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.06);
}
.grp-risk-icon {
  font-size: 24px;
  flex-shrink: 0;
}
.grp-risk-body { flex: 1; min-width: 0; }
.grp-risk-name {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 13.5px;
}
.grp-risk-name b { color: var(--gray-900); font-size: 14px; }
.grp-risk-group {
  font-size: 11px;
  color: var(--gray-500);
  background: var(--gray-100);
  padding: 1px 6px;
  border-radius: 8px;
}
.grp-risk-badge {
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 8px;
  margin-left: auto;
}
.grp-risk-reasons {
  font-size: 11.5px;
  color: var(--gray-600);
  margin-top: 3px;
  line-height: 1.5;
}
.grp-risk-stats {
  display: flex;
  gap: 12px;
  margin-top: 4px;
  font-size: 11px;
  color: var(--gray-500);
}
.grp-risk-actions {
  flex-shrink: 0;
}

/* 响应式：窄屏调整 KPI 列数 */
@media (max-width: 1200px) {
  .grp-sch-kpi { grid-template-columns: repeat(4, 1fr) !important; }
}
@media (max-width: 768px) {
  .grp-sch-kpi { grid-template-columns: repeat(2, 1fr) !important; }
  .grp-sch-trends-wrap { grid-template-columns: 1fr !important; }
  .grp-risk-list { grid-template-columns: 1fr !important; }
}
.grp-order-option {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.grp-order-option:hover {
  background: #eef2ff;
  border-color: var(--primary);
}
.grp-order-option-title {
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 4px;
}
.grp-order-option-meta {
  font-size: 13px;
  color: var(--gray-500);
}

/* ===== AI 智能排产 ===== */
.ai-sch-mini-stat {
  border-radius: 10px;
  padding: 10px 12px;
  text-align: center;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.ai-sch-mini-label {
  font-size: 11px;
  color: #4b5563;
  font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: 0.3px;
}
.ai-sch-mini-value {
  font-size: 16px;
  font-weight: 800;
  color: #1f2937;
  white-space: nowrap;
}
.ai-sch-warns::-webkit-scrollbar {
  width: 6px;
}
.ai-sch-warns::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}
.ai-sch-plan-list {
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}
.ai-sch-plan-list::-webkit-scrollbar {
  width: 6px;
}
.ai-sch-plan-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}
@media (max-width: 900px) {
  .ai-sch-params { grid-template-columns: repeat(2, 1fr) !important; }
  #aiSchResult > div:first-child { grid-template-columns: repeat(2, 1fr) !important; }
  .ai-sch-plan-day > div:nth-child(2) > div {
    grid-template-columns: 1fr 1fr 60px !important;
    font-size: 11.5px !important;
  }
}

@media (max-width: 1200px) {
  .grp-sch-kpi { grid-template-columns: repeat(5, 1fr); }
  /* n258: 班组清单始终单列（每组独占一行） */
  .grp-sch-grid { grid-template-columns: 1fr !important; }
}
@media (max-width: 900px) {
  /* n258: 班组清单始终单列（每组独占一行） */
  .grp-sch-grid { grid-template-columns: 1fr !important; }
}
@media (max-width: 640px) {
  .grp-sch-kpi { grid-template-columns: repeat(3, 1fr); }
  .grp-sch-grid { grid-template-columns: 1fr; }
}

/* ===== 个人主页 ===== */
.user-name-link {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.user-name-link:hover { text-decoration: underline; }

.profile-page {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.profile-left {
  width: 320px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.profile-right {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.profile-avatar-card {
  background: linear-gradient(135deg, #e0f2fe 0%, #f3e8ff 100%);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.12);
  position: relative;
  padding: 58px 20px 62px 20px;
  text-align: center;
  min-height: 320px;
}
.profile-avatar-wrap {
  width: 180px;
  height: 180px;
  margin: 0 auto;
  border-radius: 50%;
  overflow: hidden;
  border: 5px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
  position: relative;
}
.profile-avatar-corner {
  position: absolute;
  z-index: 3;
  max-width: 42%;
}
.profile-avatar-corner.top-left {
  top: 14px;
  left: 14px;
  text-align: left;
}
.profile-avatar-corner.top-right {
  top: 14px;
  right: 14px;
  text-align: right;
}
.profile-avatar-corner.bottom-left {
  bottom: 14px;
  left: 14px;
  text-align: left;
}
.profile-avatar-corner.bottom-center {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 3;
}
.profile-avatar-corner.bottom-right {
  bottom: 14px;
  right: 14px;
  text-align: right;
}
.profile-name-avatar {
  font-size: 17px;
  font-weight: 800;
  color: #1e1b4b;
  margin-bottom: 4px;
  line-height: 1.2;
}
.profile-role-avatar .badge,
.profile-avatar-corner.bottom-right .badge,
.profile-level-badge .badge {
  font-size: 11px;
  padding: 3px 8px;
  border: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.profile-role-avatar .badge {
  background: rgba(255, 255, 255, 0.95);
  color: var(--primary);
}
.profile-avatar-corner.bottom-right .badge {
  background: rgba(30, 27, 75, 0.85);
  color: #fff;
}
.profile-level-badge {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.profile-level-icon {
  font-size: 20px;
  line-height: 1;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.12));
}
.profile-level-name {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}
.profile-level-days {
  font-size: 11px;
  color: #4b5563;
  font-weight: 600;
  background: rgba(255,255,255,0.7);
  padding: 2px 7px;
  border-radius: 20px;
}
.profile-salary-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.profile-salary-label {
  font-size: 11px;
  color: #4b5563;
  font-weight: 600;
}
.profile-salary-value {
  font-size: 15px;
  font-weight: 900;
  color: #b45309;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  padding: 4px 10px;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
  border: 1px solid rgba(245, 158, 11, 0.25);
}
.profile-trend-badge {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.profile-trend-label {
  font-size: 10px;
  color: #4b5563;
  font-weight: 600;
}
.profile-trend-arrow {
  font-size: 28px;
  line-height: 1;
  font-weight: 900;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}
.profile-trend-arrow.up {
  color: #16a34a;
}
.profile-trend-arrow.down {
  color: #dc2626;
}
.profile-trend-arrow.flat {
  color: #6b7280;
}
.profile-avatar-cam-btn {
  position: absolute;
  bottom: 6px;
  right: 6px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  border: 3px solid #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 4;
  line-height: 1;
  transition: transform 0.2s, box-shadow 0.2s;
}
.profile-avatar-cam-btn:hover {
  transform: scale(1.12);
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.25);
}
.profile-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 72px;
  font-weight: 700;
  color: var(--gray-400);
  background: var(--gray-50);
}
.profile-info-card {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 1px solid rgba(14, 165, 233, 0.15);
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.1);
  padding: 18px 20px;
}
.profile-name {
  font-size: 20px;
  font-weight: 800;
  color: var(--gray-800);
  margin-bottom: 8px;
}
.profile-tag {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}
.profile-info-list {
  font-size: 13px;
}
.profile-info-row {
  display: flex;
  padding: 5px 0;
  border-bottom: 1px solid var(--gray-100);
}
.profile-info-row:last-child { border-bottom: none; }
.pi-label {
  width: 80px;
  color: var(--gray-500);
  flex-shrink: 0;
}
.pi-value {
  color: var(--gray-800);
  font-weight: 500;
  word-break: break-all;
}
.profile-info-wide {
  margin-bottom: 0;
}
.profile-info-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}
.profile-info-table td {
  width: 33.333%;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(14, 165, 233, 0.12);
  vertical-align: top;
}
.profile-info-table tr:last-child td { border-bottom: none; }
.profile-info-table .pi-label {
  display: inline-block;
  width: 72px;
  color: #0c4a6e;
  font-size: 13px;
  margin-right: 8px;
  flex-shrink: 0;
}
.profile-info-table .pi-value {
  display: inline;
  font-size: 15px;
  font-weight: 500;
  color: var(--gray-800);
}
.profile-bio-card {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid rgba(245, 158, 11, 0.15);
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.1);
  padding: 16px 18px;
}
.profile-bio-card h4 {
  font-size: 14px;
  font-weight: 700;
  color: #92400e;
  margin: 0 0 10px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.profile-bio-card h4::before {
  content: '✏️';
}
.profile-bio-text {
  font-size: 13px;
  line-height: 1.7;
  color: #78350f;
  white-space: pre-wrap;
  word-break: break-all;
}
.profile-bio-empty {
  color: #b45309;
  opacity: 0.7;
  font-style: italic;
}
.profile-ranking-card {
  background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
  border: 1px solid rgba(236, 72, 153, 0.15);
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(236, 72, 153, 0.08);
  padding: 14px 18px;
}
.profile-ranking-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.profile-ranking-row .pi-label {
  width: auto;
  margin-right: 0;
  color: #9d174d;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.ranking-value {
  font-size: 19px;
  color: #831843;
  font-weight: 700;
}
.rank-num {
  color: #dc2626;
  font-weight: 900;
  font-size: 27px;
}
.profile-stats-mini {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.psm-item {
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}
.psm-item:nth-child(1) { background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%); }
.psm-item:nth-child(2) { background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%); }
.psm-item:nth-child(3) { background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%); }
.psm-item:nth-child(4) { background: linear-gradient(135deg, #fde68a 0%, #fcd34d 100%); }
.psm-item:nth-child(5) { background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%); }
.psm-item:nth-child(6) { background: linear-gradient(135deg, #ccfbf1 0%, #99f6e4 100%); }
.psm-label {
  font-size: 12px;
  color: rgba(31, 41, 55, 0.7);
  margin-bottom: 6px;
  font-weight: 600;
}
.psm-value {
  font-size: 20px;
  font-weight: 800;
  color: #1f2937;
}
.profile-chart-card {
  background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
  border: 1px solid rgba(168, 85, 247, 0.15);
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(168, 85, 247, 0.1);
  padding: 18px 20px;
}
.profile-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: nowrap;
  gap: 12px;
}
.profile-chart-header h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  color: #581c87;
  white-space: nowrap;
  flex-shrink: 0;
}
.profile-chart-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  flex-shrink: 1;
  min-width: 0;
}
.profile-chart-controls .label {
  color: #7e22ce;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.profile-chart-controls .input,
.profile-chart-controls .select {
  width: auto;
  min-width: 110px;
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(168, 85, 247, 0.2);
}
.profile-chart-controls .btn-sm {
  flex-shrink: 0;
}
.profile-chart-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.chart-legend-inline {
  display: flex;
  align-items: center;
  gap: 12px;
}
.chart-legend-inline .legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.chart-legend-inline .legend-item i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.chart-legend-inline .legend-item b {
  font-weight: 700;
  margin-left: 1px;
}
.chart-legend-inline .legend-output { color: #2563eb; }
.chart-legend-inline .legend-output i { background: #2563eb; }
.chart-legend-inline .legend-good { color: #16a34a; }
.chart-legend-inline .legend-good i { background: #16a34a; }
.chart-legend-right {
  margin-left: auto;
  flex-shrink: 0;
}
.worker-chart-header-two-row {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}
.worker-chart-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.worker-chart-legend-row {
  justify-content: flex-start;
}
.worker-chart-controls-row {
  justify-content: flex-end;
}
.profile-chart-body {
  overflow-x: auto;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 12px;
  padding: 10px;
}
.profile-chart-body canvas {
  display: block;
  max-width: 100%;
}
.profile-output-table {
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.65);
  border-radius: 12px;
  padding: 10px;
}
.profile-output-table .table-wrap {
  max-height: 280px;
  overflow-y: auto;
}
.profile-output-table table {
  background: transparent;
}
.profile-output-table table td {
  font-size: 13px;
  font-weight: 600;
  padding: 10px 8px;
}
.profile-output-table table th {
  font-size: 11px;
  padding: 10px 8px;
  color: #581c87;
  background: rgba(168, 85, 247, 0.08);
}

/* ===== 个人主页主题样式 ===== */
.theme-sakura .profile-avatar-card {
  background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
  border-color: rgba(236, 72, 153, 0.2);
  box-shadow: 0 8px 24px rgba(236, 72, 153, 0.14);
}
.theme-sakura .profile-info-card {
  background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
  border-color: rgba(236, 72, 153, 0.15);
  box-shadow: 0 6px 20px rgba(236, 72, 153, 0.1);
}
.theme-sakura .profile-info-table td { border-bottom-color: rgba(236, 72, 153, 0.12); }
.theme-sakura .profile-info-table .pi-label { color: #9d174d; }
.theme-sakura .profile-ranking-card {
  background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%);
  border-color: rgba(225, 29, 72, 0.15);
  box-shadow: 0 6px 20px rgba(225, 29, 72, 0.08);
}
.theme-sakura .profile-chart-card {
  background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
  border-color: rgba(236, 72, 153, 0.15);
  box-shadow: 0 6px 20px rgba(236, 72, 153, 0.1);
}
.theme-sakura .profile-bio-card {
  background: linear-gradient(135deg, #fff0f5 0%, #fce7f3 100%);
  border-color: rgba(236, 72, 153, 0.15);
}

.theme-mint .profile-avatar-card {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  border-color: rgba(16, 185, 129, 0.2);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.14);
}
.theme-mint .profile-info-card {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border-color: rgba(16, 185, 129, 0.15);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.1);
}
.theme-mint .profile-info-table td { border-bottom-color: rgba(16, 185, 129, 0.12); }
.theme-mint .profile-info-table .pi-label { color: #065f46; }
.theme-mint .profile-ranking-card {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border-color: rgba(16, 185, 129, 0.15);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.1);
}
.theme-mint .profile-chart-card {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-color: rgba(22, 163, 74, 0.15);
  box-shadow: 0 6px 20px rgba(22, 163, 74, 0.1);
}
.theme-mint .profile-bio-card {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border-color: rgba(16, 185, 129, 0.15);
}

.theme-orange .profile-avatar-card {
  background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%);
  border-color: rgba(249, 115, 22, 0.2);
  box-shadow: 0 8px 24px rgba(249, 115, 22, 0.14);
}
.theme-orange .profile-info-card {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border-color: rgba(249, 115, 22, 0.15);
  box-shadow: 0 6px 20px rgba(249, 115, 22, 0.1);
}
.theme-orange .profile-info-table td { border-bottom-color: rgba(249, 115, 22, 0.12); }
.theme-orange .profile-info-table .pi-label { color: #9a3412; }
.theme-orange .profile-ranking-card {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border-color: rgba(249, 115, 22, 0.15);
  box-shadow: 0 6px 20px rgba(249, 115, 22, 0.1);
}
.theme-orange .profile-chart-card {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border-color: rgba(249, 115, 22, 0.15);
  box-shadow: 0 6px 20px rgba(249, 115, 22, 0.1);
}
.theme-orange .profile-bio-card {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border-color: rgba(249, 115, 22, 0.15);
}

.theme-violet .profile-avatar-card {
  background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
  border-color: rgba(139, 92, 246, 0.2);
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.14);
}
.theme-violet .profile-info-card {
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  border-color: rgba(139, 92, 246, 0.15);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.1);
}
.theme-violet .profile-info-table td { border-bottom-color: rgba(139, 92, 246, 0.12); }
.theme-violet .profile-info-table .pi-label { color: #5b21b6; }
.theme-violet .profile-ranking-card {
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  border-color: rgba(139, 92, 246, 0.15);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.1);
}
.theme-violet .profile-chart-card {
  background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
  border-color: rgba(168, 85, 247, 0.15);
  box-shadow: 0 6px 20px rgba(168, 85, 247, 0.1);
}
.theme-violet .profile-bio-card {
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  border-color: rgba(139, 92, 246, 0.15);
}

.theme-ink .profile-avatar-card {
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  border-color: rgba(75, 85, 99, 0.2);
  box-shadow: 0 8px 24px rgba(75, 85, 99, 0.14);
}
.theme-ink .profile-info-card {
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
  border-color: rgba(75, 85, 99, 0.15);
  box-shadow: 0 6px 20px rgba(75, 85, 99, 0.1);
}
.theme-ink .profile-info-table td { border-bottom-color: rgba(75, 85, 99, 0.12); }
.theme-ink .profile-info-table .pi-label { color: #374151; }
.theme-ink .profile-ranking-card {
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  border-color: rgba(75, 85, 99, 0.15);
  box-shadow: 0 6px 20px rgba(75, 85, 99, 0.1);
}
.theme-ink .profile-chart-card {
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
  border-color: rgba(75, 85, 99, 0.15);
  box-shadow: 0 6px 20px rgba(75, 85, 99, 0.1);
}
.theme-ink .profile-bio-card {
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  border-color: rgba(75, 85, 99, 0.15);
}

.theme-preview {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 13px;
}
.theme-preview:hover { transform: translateY(-2px); }
.theme-preview.active { border-color: var(--primary); box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25); }
.theme-preview-swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

@media (max-width: 768px) {
  .profile-page, .profile-page-mobile {
    flex-direction: column;
  }
  .profile-left,
  .profile-right {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .profile-ranking-card,
  .profile-chart-card,
  .profile-output-table {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .profile-info-table td {
    width: 50%;
    padding: 10px 8px;
  }
  .profile-info-table .pi-label {
    width: 60px;
    font-size: 12px;
  }
  .profile-info-table .pi-value {
    font-size: 14px;
  }
  .profile-ranking-row {
    flex-wrap: nowrap;
    gap: 8px;
  }
  .profile-ranking-row .select {
    min-width: 0;
    flex: 1 1 auto;
    padding: 8px 6px;
    font-size: 13px;
  }
  .ranking-value {
    font-size: 15px;
    white-space: nowrap;
  }
  .rank-num {
    font-size: 22px;
  }
  .profile-chart-header {
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }
  .profile-chart-header h3 {
    font-size: 16px;
  }
  .worker-chart-header-two-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .worker-chart-row {
    width: 100%;
    box-sizing: border-box;
  }
  .worker-chart-controls-row {
    justify-content: flex-start;
  }
  .worker-chart-controls-row .profile-chart-controls {
    width: 100%;
  }
  .worker-chart-controls-row .profile-chart-controls .input,
  .worker-chart-controls-row .profile-chart-controls .select {
    flex: 1 1 auto;
    min-width: 0;
  }
  .profile-chart-title-wrap {
    width: 100%;
    gap: 10px;
  }
  .chart-legend-inline {
    margin: 0;
    width: 100%;
    justify-content: flex-start;
    box-sizing: border-box;
  }
  .chart-legend-right {
    width: auto;
    margin-left: 0;
    justify-content: flex-end;
  }
  .profile-chart-controls {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 4px;
    width: auto;
  }
  .profile-chart-controls .input,
  .profile-chart-controls .select {
    min-width: 90px;
    padding: 6px 8px;
    font-size: 13px;
  }
  .profile-chart-controls .label {
    font-size: 11px;
  }
  .profile-chart-controls .input,
  .profile-chart-controls .select,
  .profile-chart-controls .btn {
    min-width: 0;
    flex: 1 1 auto;
    padding: 8px 4px;
    font-size: 12px;
  }
  .profile-chart-controls .input[type="date"] {
    min-width: 105px;
  }
  .worker-chart-controls .input[type="date"] {
    min-width: 92px;
    padding: 6px 2px;
    font-size: 11px;
  }
  .worker-chart-controls .select {
    min-width: 58px;
    padding: 6px 2px;
    font-size: 11px;
  }
  .worker-chart-controls .btn {
    min-width: 32px;
    max-width: 36px;
    padding: 6px 2px;
    font-size: 12px;
    flex: 0 0 auto;
  }
  .profile-output-table table td,
  .profile-output-table table th {
    font-size: 12px;
    padding: 8px 6px;
  }
}

/* ===== 生产大屏 ===== */
.dashboard-page {
  height: 100vh;
  overflow: hidden;
  background: #ffffff;
  color: #1f2937;
  padding: 10px 0 6px 0;
  font-family: var(--font-hei);
  display: flex;
  flex-direction: column;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  padding: 0 28px 6px 28px;
  border-bottom: 2px solid rgba(59, 130, 246, 0.3);
  position: relative;
  flex-shrink: 0;
}

.dashboard-logo {
  position: absolute;
  left: 28px;
  top: 50%;
  transform: translateY(-50%);
  height: 50px;
  width: auto;
  object-fit: contain;
}

.dashboard-title {
  font-size: 38px;
  font-weight: 800;
  color: #1e3a8a;
  letter-spacing: 4px;
  text-shadow: 0 0 20px rgba(59, 130, 246, 0.25);
}

.dashboard-time {
  position: absolute;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  text-align: right;
  font-size: 16px;
  color: #2563eb;
  line-height: 1;
  font-weight: 700;
  z-index: 2;
}

/* KPI 顶部指标 */
.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
  margin-bottom: 8px;
  padding: 0 28px;
  flex-shrink: 0;
}

.kpi-box {
  position: relative;
  padding: 8px 6px;
  border-radius: 10px;
  text-align: center;
  overflow: hidden;
  color: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
  min-height: 62px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.kpi-box::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 50%);
  border-radius: 10px;
  pointer-events: none;
}

.kpi-green { background: linear-gradient(135deg, #22c55e, #16a34a); }
.kpi-darkblue { background: linear-gradient(135deg, #1e3a8a, #172554); }
.kpi-magenta { background: linear-gradient(135deg, #db2777, #be185d); }
.kpi-red { background: linear-gradient(135deg, #dc2626, #b91c1c); }
.kpi-brown { background: linear-gradient(135deg, #9a3412, #7c2d12); }
.kpi-blue { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.kpi-purple { background: linear-gradient(135deg, #7c3aed, #6d28d9); }
.kpi-teal { background: linear-gradient(135deg, #0d9488, #0f766e); }
.kpi-orange { background: linear-gradient(135deg, #ea580c, #c2410c); }

.kpi-value {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 2px;
  z-index: 1;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.kpi-label {
  font-size: 12px;
  font-weight: 600;
  z-index: 1;
  opacity: 0.95;
}

/* 订单行 */
.dashboard-orders {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 28px 6px 28px;
  max-height: 140px;
  overflow: hidden;
}

.dash-order-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 16px;
  border-radius: 36px;
  color: #fff;
  position: relative;
  overflow: hidden;
  min-height: 52px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.15);
}

.dash-order-row::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0) 50%);
  pointer-events: none;
  border-radius: 40px;
}

/* 行配色 */
.row-theme-1 { background: linear-gradient(90deg, #b45309 0%, #d97706 30%, #f59e0b 100%); }
.row-theme-2 { background: linear-gradient(90deg, #991b1b 0%, #b91c1c 30%, #dc2626 100%); }
.row-theme-3 { background: linear-gradient(90deg, #7e22ce 0%, #9333ea 30%, #a855f7 100%); }
.row-theme-4 { background: linear-gradient(90deg, #1e40af 0%, #2563eb 30%, #3b82f6 100%); }
.row-theme-5 { background: linear-gradient(90deg, #9a3412 0%, #c2410c 30%, #ea580c 100%); }
.row-theme-6 { background: linear-gradient(90deg, #a16207 0%, #ca8a04 30%, #eab308 100%); }
.row-theme-7 { background: linear-gradient(90deg, #0f766e 0%, #0d9488 30%, #14b8a6 100%); }

.dash-order-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 60px;
  z-index: 1;
}

.dash-order-left .top-num {
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

.dash-order-left .bottom-num {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.85;
  line-height: 1;
  margin-top: 2px;
}

.dash-badge {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255,255,255,0.22);
  border: 2px solid rgba(255,255,255,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  z-index: 1;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.dash-order-no {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  color: #1f2937;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 900;
  z-index: 1;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(0,0,0,0.25);
}

.dash-order-info {
  min-width: 180px;
  max-width: 240px;
  z-index: 1;
}

.dash-order-product {
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-order-code {
  font-size: 14px;
  font-weight: 500;
  opacity: 0.9;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-order-metrics {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 1;
  font-size: 15px;
  font-weight: 600;
  font-family: 'Consolas', monospace;
  letter-spacing: 0.5px;
}

.dash-order-progress {
  flex: 1.5;
  height: 20px;
  background: #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  min-width: 120px;
  border: 1px solid #d1d5db;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.08);
}

.dash-progress-bar {
  height: 100%;
  border-radius: 12px;
  background: linear-gradient(90deg, #84cc16 0%, #22c55e 50%, #4ade80 100%);
  transition: width 0.6s ease;
  box-shadow: 0 0 15px rgba(74, 222, 128, 0.6);
  position: relative;
}

.dash-progress-bar::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0) 50%);
  border-radius: 12px;
}

.dash-order-rate {
  min-width: 70px;
  text-align: right;
  font-size: 26px;
  font-weight: 900;
  color: #fff;
  z-index: 1;
  text-shadow: 0 2px 6px rgba(0,0,0,0.3);
  flex-shrink: 0;
}

/* 底部时间 */
.dashboard-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  padding-top: 4px;
  flex-shrink: 0;
}

/* ====== n264 大屏：14张工人卡片 — 紫色渐变外框 / 矩形大照片 / 中间白大数字 / 底部黑色统计胶囊 ====== */

/* 工人卡片网格 — 固定6列×2行（n954: 7→6，卡片加宽、总高不变） */
.dashboard-workers {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  padding: 8px 18px 8px 18px;
  overflow: hidden;
  min-height: 0;
}

/* 工人卡片 — n306: 橙色实色背景 + 圆形排名徽章 + 名字 */
.dash-worker-card {
  position: relative;
  /* 橙色实色背景 — 设计图主色调 */
  background: linear-gradient(160deg, #fb6a2a 0%, #f04e14 55%, #d83b08 100%);
  border: none;
  border-radius: 18px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  box-shadow: 0 4px 14px rgba(216, 59, 8, 0.35), 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: transform .2s ease, box-shadow .2s ease;
  overflow: hidden;
}
.dash-worker-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(216, 59, 8, 0.45), 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 大照片 — 顶部方块（白底容器） */
.dash-worker-photo {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 0;
  border-radius: 10px 10px 0 0;
  overflow: hidden;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
  flex-shrink: 1;
}
.dash-worker-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

/* n964: 人像照片统一顶部对齐 — object-fit:cover 默认居中裁切，头像比例不符时头顶被裁掉 */
.whh-avatar-img, .count-avatar, .profile-avatar-img,
.salary-avatar, .wsd-avatar, .br-avatar, .dash-top-avatar, .dt-avatar,
.boss-rank-avatar, .tl-avatar { object-position: center top; }

/* n966: 大屏工人卡片 游戏风蹦数字特效（打怪式 +1，人名后 20px 弹出上飘淡出） */
@keyframes dashFxPop {
  0%   { opacity: 0; transform: translateY(10px) scale(0.3); }
  18%  { opacity: 1; transform: translateY(-4px) scale(1.35); }
  42%  { opacity: 1; transform: translateY(-20px) scale(1); }
  75%  { opacity: .9; transform: translateY(-48px) scale(.92); }
  100% { opacity: 0; transform: translateY(-78px) scale(.8); }
}
.dash-fx-num {
  position: absolute;
  font-size: 30px;
  font-weight: 900;
  color: #ffe14d;
  font-family: var(--font-hei);
  white-space: nowrap;
  letter-spacing: 1px;
  text-shadow: 0 2px 0 #7c2d12, 2px 0 0 #7c2d12, -2px 0 0 #7c2d12, 0 -2px 0 #7c2d12,
               2px 2px 0 #7c2d12, -2px 2px 0 #7c2d12, 2px -2px 0 #7c2d12, -2px -2px 0 #7c2d12,
               0 6px 14px rgba(0, 0, 0, 0.45);
  animation: dashFxPop 1.25s ease-out forwards;
  will-change: transform, opacity;
  pointer-events: none;
}
.dash-fx-num.dash-fx-big {
  font-size: 44px;
  color: #fff;
  text-shadow: 0 3px 0 #b45309, 3px 0 0 #b45309, -3px 0 0 #b45309, 0 -3px 0 #b45309,
               3px 3px 0 #b45309, -3px 3px 0 #b45309, 3px -3px 0 #b45309, -3px -3px 0 #b45309,
               0 8px 18px rgba(0, 0, 0, 0.5);
}

/* n306: 排名 + 名字行 — 圆形徽章 + 名字横排 */
.dash-worker-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 4px;
  flex-shrink: 0;
}

/* 圆形排名徽章 — 蓝灰色圆形 + 白色数字（n954: 36→42） */
.dash-worker-rank {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.85);
  color: #f04e14;
  font-size: 23px;
  font-weight: 900;
  border-radius: 50%;
  font-family: var(--font-hei);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 工人名字 — 白色粗体大字（n954: 22→26） */
.dash-worker-name {
  flex: 1;
  font-size: 26px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

/* 黑色统计胶囊 — n264: 圆角胶囊黑底白字（n954: 随字号加大加厚） */
.dash-worker-stats {
  background: #1a1a1a;
  border-radius: 999px;
  display: flex;
  align-items: center;
  padding: 9px 4px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  margin: 2px 4px 4px;
}
.stat-segment {
  flex: 1;
  text-align: center;
  color: #fff;
  font-size: 19px;
  font-weight: 800;
  white-space: nowrap;
  letter-spacing: 0.3px;
}
.stat-segment-divider {
  width: 1px;
  height: 21px;
  background: rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
}

/* 产值排行 — 精简横向条（TOP 5） */
.dashboard-rank {
  flex-shrink: 0;
  margin: 4px 18px 2px;
  padding: 4px 0;
}
.dash-rank-strip {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.dash-rank-chip {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.7);
  border: none;
  border-radius: 10px;
  transition: transform .2s ease, box-shadow .2s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}
.dash-rank-chip:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15); }
.dash-rank-chip.rank-gold,
.dash-rank-chip.rank-silver,
.dash-rank-chip.rank-bronze {
  background: rgba(255, 255, 255, 0.7);
  border: none;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}
.chip-medal { font-size: 22px; font-weight: 900; flex-shrink: 0; }
.chip-name { font-size: 15px; font-weight: 700; color: #1f2937; white-space: nowrap; flex-shrink: 0; min-width: 50px; }
.chip-bar-wrap {
  flex: 1;
  height: 12px;
  background: rgba(15, 23, 42, 0.08);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  min-width: 40px;
}
.chip-bar {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #2563eb);
  border-radius: 6px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.dash-rank-chip.rank-gold .chip-bar { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.dash-rank-chip.rank-silver .chip-bar { background: linear-gradient(90deg, #cbd5e1, #94a3b8); }
.dash-rank-chip.rank-bronze .chip-bar { background: linear-gradient(90deg, #d97706, #b45309); }
.chip-val { font-size: 15px; font-weight: 800; color: #1e40af; flex-shrink: 0; }
.dash-rank-chip.rank-gold .chip-val { color: #b45309; }
.dash-rank-chip.rank-silver .chip-val { color: #475569; }
.dash-rank-chip.rank-bronze .chip-val { color: #92400e; }
.chip-qty { font-size: 13px; color: #64748b; font-weight: 600; flex-shrink: 0; }

.dash-empty { padding: 20px; text-align: center; color: #94a3b8; font-size: 14px; font-style: italic; }

@media (max-width: 900px) {
  .dashboard-workers { grid-template-columns: repeat(4, 1fr); }
  /* n306: 圆形徽章固定尺寸，名字缩小 */
  .dash-worker-rank { width: 30px; height: 30px; font-size: 17px; }
  .dash-worker-name { font-size: 18px; }
  .dash-rank-strip { flex-wrap: wrap; }
  .dash-rank-chip { flex: 1 1 45%; }
}

.dash-datetime-pill {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(90deg, #1e40af, #2563eb);
  color: #fff;
  padding: 6px 24px;
  border-radius: 24px;
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.25);
}

.dash-datetime-pill .time {
  font-size: 20px;
  font-weight: 900;
}

/* ====== n720 大屏：自主选择日期 ======
   注意：老 WebView 不支持 flex gap，统一用 margin 撑间距 */
.dash-date-ctrl {
  display: flex;
  align-items: center;
  margin-right: 18px;
}

.dash-date-nav,
.dash-date-today {
  height: 38px;
  min-width: 40px;
  padding: 0 10px;
  margin-right: 6px;
  border: 2px solid #93c5fd;
  border-radius: 10px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  font-family: var(--font-hei);
}

.dash-date-nav:active,
.dash-date-today:active {
  background: #dbeafe;
}

.dash-date-today {
  font-size: 16px;
  min-width: 68px;
  margin-right: 0;
}

.dash-date-input {
  height: 38px;
  padding: 0 10px;
  margin-right: 6px;
  border: 2px solid #93c5fd;
  border-radius: 10px;
  background: #ffffff;
  color: #1e3a8a;
  font-size: 18px;
  font-weight: 800;
  font-family: var(--font-hei);
}

.dash-date-state {
  margin-right: 18px;
  font-size: 16px;
  font-weight: 800;
  white-space: nowrap;
}

.dash-state-live { color: #059669; }
.dash-state-history { color: #d97706; }

/* 历史模式：标题与分隔线转琥珀色，避免被误认为实时数据 */
.dashboard-page[data-dash-mode="history"] .dashboard-title {
  color: #b45309;
}
.dashboard-page[data-dash-mode="history"] .dashboard-header {
  border-bottom-color: rgba(217, 119, 6, 0.6);
}

/* 响应式 */
@media (max-width: 1200px) {
  .dashboard-kpis { grid-template-columns: repeat(5, 1fr); }
  .kpi-value { font-size: 22px; }
  .kpi-label { font-size: 12px; }
  /* n720: 窄屏压缩日期控件 */
  .dash-date-ctrl { margin-right: 10px; }
  .dash-date-nav { height: 32px; min-width: 32px; font-size: 18px; padding: 0 6px; }
  .dash-date-input { height: 32px; font-size: 14px; padding: 0 6px; }
  .dash-date-today { height: 32px; font-size: 13px; min-width: 54px; }
  .dash-date-state { display: none; }
}

@media (max-width: 768px) {
  .dashboard-kpis { grid-template-columns: repeat(3, 1fr); }
  .dash-order-row { flex-wrap: wrap; border-radius: 20px; }
  .dash-order-progress { flex: 1 1 100%; order: 5; margin-top: 8px; }
  .dash-order-rate { order: 6; width: 100%; text-align: left; margin-top: 8px; }
  .kpi-value { font-size: 18px; }
  .dashboard-title { font-size: 24px; }
  /* n720: 小屏仅保留日期选择 + 今日 */
  .dash-date-nav { display: none; }
  .dash-date-input { height: 30px; font-size: 13px; }
  .dash-date-today { height: 30px; font-size: 12px; min-width: 48px; }
}

/* 多选组件 */
.multi-select {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  background: var(--gray-50);
  max-height: 160px;
  overflow-y: auto;
}
.multi-select-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid var(--gray-300);
  cursor: pointer;
  font-size: 13px;
  color: var(--gray-700);
  transition: all 0.15s;
  user-select: none;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.multi-select-item:hover {
  border-color: var(--primary);
  color: var(--primary);
}
/* 兼容旧 .selected class */
.multi-select-item.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.multi-select-item.selected .multi-select-check {
  color: #fff;
  font-weight: 700;
}
/* 纯 CSS 驱动选中样式 — :has(input:checked) */
.multi-select-item:has(input:checked) {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.multi-select-check {
  display: inline-block;
  width: 14px;
  text-align: center;
  font-size: 11px;
  color: transparent;
  line-height: 1;
}
/* 选中时 ✓ 图标自动出现 */
.multi-select-item:has(input:checked) .multi-select-check {
  color: #fff;
  font-weight: 700;
}
.multi-select-item:has(input:checked) .multi-select-check::before {
  content: '✓';
}
.multi-select-item input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
}

/* ===== 系统设置页 ===== */
.settings-page { padding: 0; }
.settings-page .form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.settings-page .form-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ===== 模态框 ===== */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}
.modal-box {
  background: #fff; border-radius: 12px; padding: 24px;
  max-width: 600px; width: 90%; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 16px; color: var(--gray-800); }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* ===== 管理端子导航 ===== */
.admin-sub-nav {
  display: flex; gap: 0; margin-bottom: 16px;
  border-bottom: 2px solid var(--gray-200);
  overflow-x: auto;
}
.admin-sub-nav-item {
  padding: 8px 20px; cursor: pointer; white-space: nowrap;
  font-size: 14px; font-weight: 500; color: var(--gray-500);
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: all 0.2s;
}
.admin-sub-nav-item.active {
  color: var(--primary); border-bottom-color: var(--primary); font-weight: 700;
}
.admin-sub-nav-item:hover { color: var(--primary-dark); }

/* ===== 工人端设备借出 ===== */
.worker-equip-tabs {
  display: flex; gap: 0; margin-bottom: 12px;
  border-bottom: 2px solid var(--gray-200);
}
.we-tab {
  padding: 8px 16px; cursor: pointer; font-size: 14px;
  color: var(--gray-500); border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: all 0.2s;
}
.we-tab.active {
  color: var(--primary); border-bottom-color: var(--primary); font-weight: 700;
}
.we-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px; padding: 12px 0;
}
.we-card {
  background: #fff; border: 1px solid var(--gray-200); border-radius: 10px;
  padding: 14px; text-align: center; transition: box-shadow 0.2s;
}
.we-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
.we-card-name { font-size: 15px; font-weight: 700; color: var(--gray-800); }
.we-card-spec { font-size: 12px; color: var(--gray-500); margin-top: 4px; }
.we-card-price { font-size: 13px; color: var(--primary); margin-top: 6px; font-weight: 600; }
.we-card-stock { font-size: 13px; color: var(--success); margin-top: 4px; }
.we-card-stock.low { color: var(--danger); font-weight: 700; }
.we-card-img {
  width: 100%; height: 100px; object-fit: cover; border-radius: 8px;
  margin-bottom: 8px; cursor: pointer; border: 1px solid var(--gray-200);
}
.we-card-img-placeholder {
  width: 100%; height: 100px; border-radius: 8px; margin-bottom: 8px;
  background: var(--gray-100); display: flex; align-items: center; justify-content: center;
  font-size: 36px; border: 1px solid var(--gray-200);
}
.we-borrow-btn { margin-top: 10px; width: 100%; }
.we-borrow-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== 徽章扩展 ===== */
.badge-green { background: #dcfce7; color: #166534; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-gray { background: #f3f4f6; color: var(--gray-900); }

/* ===== 表单网格 ===== */
.form-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.form-row { display: flex; flex-direction: column; gap: 4px; }
.form-row .label { font-size: 13px; font-weight: 600; color: var(--gray-600); }

/* 注册页水平表单：字左框右 */
.reg-form-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
}
.reg-form-row .reg-label {
  flex-shrink: 0; width: 75px; font-size: 14px; font-weight: 600;
  color: var(--gray-600); text-align: right;
}
.reg-form-row .input,
.reg-form-row .select {
  flex: 1; min-width: 0;
}
.reg-form-row .text-danger { color: var(--danger); }

@media (max-width: 768px) {
  .settings-page .form-grid, .form-grid { grid-template-columns: 1fr; }
  .we-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .we-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .we-card { padding: 10px; }
  .modal-box { padding: 16px; border-radius: 8px; }
}

/* ===== 后整打包页面美化 ===== */
.pack-page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.pack-page-header h3 {
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 50%, #db2777 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.pack-stat-row { display: flex; gap: 16px; margin-bottom: 20px; }
/* 顶部统计卡：6 个更紧凑 */
.pack-stat-row-top { gap: 12px; flex-wrap: wrap; }
.pack-stat-row-top .pack-stat-card { flex: 1 1 calc(16.66% - 12px); min-width: 140px; padding: 18px 12px; }
.pack-stat-row-top .pack-stat-card .pack-stat-icon { font-size: 22px; margin-bottom: 4px; }
.pack-stat-row-top .pack-stat-card .pack-stat-num { font-size: 16px; }
.pack-stat-row-top .pack-stat-card .pack-stat-label { font-size: 12px; }
.pack-stat-card.pack-stat-main {
  background: linear-gradient(135deg, #16a34a 0%, #059669 100%);
  color: #fff;
  border-color: #16a34a;
  box-shadow: 0 4px 14px rgba(16,185,129,.25);
}
.pack-stat-card.pack-stat-main:hover { box-shadow: 0 8px 24px rgba(16,185,129,.4); }
.pack-stat-card.pack-stat-production { background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%); color: #fff; }
.pack-stat-card.pack-stat-shipped { background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%); color: #fff; }
.pack-stat-card.pack-stat-unshipped { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); color: #fff; }
.pack-stat-card {
  flex: 1; text-align: center; padding: 22px 16px; border-radius: 16px;
  position: relative; overflow: hidden; transition: transform .3s cubic-bezier(.16,1,.3,1), box-shadow .3s;
  border: 1px solid rgba(0,0,0,.08);
}
.pack-stat-card:hover { transform: translateY(-6px) scale(1.02); box-shadow: 0 12px 30px rgba(0,0,0,.15); }
.pack-stat-card .pack-stat-icon { font-size: 26px; margin-bottom: 6px; display: block; }
.pack-stat-card .pack-stat-num {
  font-size: 18px; font-weight: 800; line-height: 1.2;
}
.pack-stat-card .pack-stat-label { font-size: 13px; opacity: .9; margin-top: 4px; font-weight: 500; }
.pack-stat-card.pack-stat-total {
  background: #5b67e0;
  color: #fff;
}
.pack-stat-card.pack-stat-packed {
  background: #16a34a;
  color: #fff;
}
.pack-stat-card.pack-stat-loose {
  background: #e93b6a;
  color: #fff;
}
.pack-stat-card.pack-stat-packages {
  background: #ed8936;
  color: #fff;
}
.pack-stat-card::after {
  content: ''; position: absolute; top: -50%; right: -30%;
  width: 120px; height: 120px; border-radius: 50%;
  background: rgba(255,255,255,.1); pointer-events: none;
}

.pack-section-title {
  display: flex; align-items: center; gap: 8px; margin-bottom: 14px;
}
.pack-section-title h3 {
  color: #2563eb;
}
.pack-section-title .pack-section-bar {
  flex: 1; height: 3px; border-radius: 2px;
  background: #2563eb;
}

.packing-record-table thead th {
  background: linear-gradient(135deg, #065f46 0%, #059669 50%, #10b981 100%) !important;
  color: #fff !important;
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.packing-record-table .pack-group-row td {
  background: #ecfdf5 !important;
  border-top: 2px solid #6ee7b7 !important;
  font-weight: 700;
  color: #065f46;
}
.packing-record-table .pack-group-row:hover td {
  background: #d1fae5 !important;
}
.packing-record-table .pack-detail-row td { background: #fff; }
.packing-record-table .pack-detail-row:nth-child(even) td { background: #f0fdf4; }
.packing-record-table .pack-detail-row:hover td { background: #dcfce7; }
.packing-record-table .pack-detail-row td:first-child { padding-left: 24px !important; }
.packing-record-table .pack-detail-row td:nth-child(2),
.packing-record-table .pack-detail-row td:nth-child(3) { background: inherit; color: transparent; }

.pack-badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 13px; font-weight: 700; min-width: 40px; text-align: center;
}
.pack-badge-b { background: #dbeafe; color: #1e40af; }
.pack-badge-g { background: #dcfce7; color: #166534; }
.pack-badge-y { background: #fef3c7; color: #92400e; }
.pack-badge-p { background: #ede9fe; color: #5b21b6; }
.pack-badge-r { background: #fee2e2; color: #991b1b; }

/* 暗色数字：零散数低于打包阈值时显示 */
.pack-dim-text {
  opacity: 0.45;
  filter: grayscale(60%);
  font-weight: 400 !important;
}

/* 来料管理表格样式 */
.mat-summary-table thead th {
  background: linear-gradient(135deg, #0e7490 0%, #0891b2 50%, #06b6d4 100%) !important;
  color: #fff !important;
  text-shadow: 0 1px 2px rgba(0,0,0,0.12);
  font-size: 13px !important;
  padding: 8px 6px !important;
}
.mat-summary-table tbody tr:nth-child(even) { background: #f0f9ff; }
.mat-summary-table tbody tr:hover { background: #e0f2fe; }

.mat-badge {
  display: inline-block; padding: 2px 8px; border-radius: 12px;
  font-size: 12px; font-weight: 600;
}
.mat-badge-received { background: #dbeafe; color: #1e40af; }
.mat-badge-low { background: #fee2e2; color: #991b1b; }
.mat-badge-ok { background: #dcfce7; color: #166534; }

.mat-low { color: #dc2626; font-weight: 700; }
.mat-ok { color: #166534; font-weight: 700; }

.mat-bar-wrap {
  display: flex; align-items: center; gap: 6px; min-width: 100px;
}
.mat-bar-bg {
  flex: 1; height: 8px; background: #e2e8f0; border-radius: 4px; overflow: hidden; min-width: 60px;
}
.mat-bar-fill {
  height: 100%; border-radius: 4px; transition: width 0.3s;
}
.mat-bar-fill.ok { background: linear-gradient(90deg, #10b981, #34d399); }
.mat-bar-fill.low { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.mat-bar-text { font-size: 11px; color: #475569; font-weight: 600; min-width: 30px; }

/* 来料管理工具栏（漂亮布局：筛选+管理一行） */
.mat-toolbar {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  background: linear-gradient(135deg, #ecfeff 0%, #cffafe 100%);
  border: 1px solid #67e8f9;
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: 0 1px 2px rgba(8, 145, 178, 0.06);
}
.mat-toolbar-filters {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-width: 0;
  flex: 1;
}
.mat-toolbar-filters > select {
  width: auto;                 /* 覆盖全局 .select 的 width:100% */
  min-width: 120px; max-width: 180px;
}
.mat-toolbar-filters > input {
  width: auto;                 /* 覆盖全局 .input 的 width:100% */
  flex: 1; min-width: 180px; max-width: 260px;
}
.mat-toolbar-actions {
  display: flex; gap: 8px; align-items: center; flex-shrink: 0;
}

/* 弹窗右上角关闭按钮（×） */
.modal-close-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #f1f5f9;
  color: #64748b;
  border: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.modal-close-btn:hover {
  background: #fee2e2;
  color: #b91c1c;
  transform: scale(1.1);
}

/* 页面右上角关闭按钮（管理子页面） */
.page-close-btn {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: #f1f5f9;
  color: #64748b;
  border: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s;
}
.page-close-btn:hover {
  background: #fee2e2;
  color: #b91c1c;
  transform: scale(1.1);
}

.mat-item-row { font-size: 13px; }
.mat-item-row label { display: block; margin-bottom: 2px; }
.mt-8 { margin-top: 8px; }

.text-warning { color: #ea580c; font-weight: 600; }
.text-muted { color: #94a3b8; }

.pack-summary-table thead th {
  background: linear-gradient(135deg, #4338ca 0%, #4f46e5 50%, #6366f1 100%) !important;
  color: #fff !important;
  text-shadow: 0 1px 2px rgba(0,0,0,0.12);
  padding: 8px 5px !important;
  font-size: 13px;
  white-space: nowrap;
}
.pack-summary-table tbody td { padding: 8px 5px !important; white-space: nowrap; font-size: 13px; }
.pack-summary-table th, .pack-summary-table td { min-width: 0 !important; }
.pack-summary-table tbody tr:nth-child(even) { background: #f5f3ff; }
.pack-summary-table tbody tr:hover { background: #ede9fe !important; }
.pack-summary-table tr td:first-child { font-weight: 600; }

@keyframes packPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(37,99,235,.4); }
  50% { box-shadow: 0 0 0 6px rgba(37,99,235,0); }
}
.btn-pack-action { animation: packPulse 2s infinite; }

/* ===== 销售发货模块样式 ===== */
.ship-page { padding: 0; }
.ship-tabs {
  display: flex; gap: 4px; margin-bottom: 16px;
  border-bottom: 2px solid var(--gray-200, #e5e7eb);
  overflow-x: auto;
}
.ship-tab {
  padding: 10px 20px; border: none; background: none;
  font-size: 14px; font-weight: 600; cursor: pointer;
  color: var(--gray-500, #6b7280); white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: all .2s;
}
.ship-tab:hover { color: var(--primary, #2563eb); }
.ship-tab.active {
  color: var(--primary, #2563eb);
  border-bottom-color: var(--primary, #2563eb);
}

.ship-filter-bar, .ship-recon-bar {
  display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap;
  align-items: flex-end;
}
.ship-filter-bar > div, .ship-recon-bar > div { min-width: 120px; }

.ship-stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px; margin-bottom: 16px;
}
.ship-stat-card {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
  cursor: default;
}
.ship-stat-card[style*="cursor:pointer"]:hover {
  transform: translateY(-3px);
  border-color: rgba(99,102,241,0.5) !important;
  box-shadow: 0 8px 24px rgba(99,102,241,0.18) !important;
}
.ship-stat-card[style*="cursor:pointer"]:active { transform: translateY(-1px); }
.ship-stat-icon {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.ship-stat-card:hover .ship-stat-icon {
  transform: scale(1.06) rotate(-3deg);
}
.ship-stat-num { font-size: 22px; font-weight: 800; line-height: 1.1; }
.ship-stat-label { font-size: 12px; font-weight: 600; letter-spacing: 0.5px; }
.ship-stat-desc { font-size: 11px; color: #94a3b8; margin-top: 1px; }
.ship-stat-unit { font-size: 12px; color: #94a3b8; font-weight: 500; margin-left: 3px; }

/* ===== 利润分析 — 明亮玻璃态卡片 ===== */
.profit-card {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  padding: 20px 18px 16px;
  color: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12), inset 0 1px 0 rgba(255,255,255,0.2);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease;
  min-height: 132px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  isolation: isolate;
}
.profit-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 12px 32px rgba(0,0,0,0.12), inset 0 1px 0 rgba(255,255,255,0.9);
}
.profit-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 100% 0%, rgba(255,255,255,0.6) 0%, transparent 55%),
    radial-gradient(circle at 0% 100%, rgba(0,0,0,0.04) 0%, transparent 55%);
  pointer-events: none;
  z-index: 0;
}
.profit-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(45deg, rgba(0,0,0,0.015) 0 1px, transparent 1px 12px);
  pointer-events: none;
  z-index: 0;
}
.profit-card-icon {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 64px;
  height: 64px;
  opacity: 0.22;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
  z-index: 0;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.08));
}
.profit-card:hover .profit-card-icon {
  transform: scale(1.18) rotate(-8deg);
  opacity: 0.4;
}
.profit-card-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.profit-card-label {
  font-size: 11px;
  font-weight: 700;
  opacity: 0.75;
  letter-spacing: 1px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 5px;
}
.profit-card-value {
  font-size: 30px;
  font-weight: 900;
  line-height: 1.05;
  text-shadow: 0 1px 4px rgba(0,0,0,0.06);
  letter-spacing: -0.8px;
  font-family: var(--font-hei);
}
.profit-card-sub {
  font-size: 11px;
  opacity: 0.65;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.profit-card-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  background: rgba(0,0,0,0.06);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
  margin-left: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.profit-card-trend {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(0,0,0,0.06);
  padding: 2px 6px;
  border-radius: 5px;
  margin-left: 6px;
}

/* 利润分析 - 侧边对比卡 (明亮玻璃) */
.profit-side-card {
  position: relative;
  background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
  border-radius: 16px;
  padding: 20px 22px;
  color: #1e293b;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.profit-side-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
.profit-side-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 140px; height: 140px;
  background: radial-gradient(circle, rgba(99,102,241,0.1) 0%, transparent 70%);
  pointer-events: none;
}
.profit-side-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}
.profit-side-title-icon {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}
.profit-side-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 13px;
  color: #475569;
}
.profit-side-row + .profit-side-row {
  border-top: 1px solid rgba(0,0,0,0.06);
}
.profit-side-row strong {
  font-weight: 700;
  font-size: 15px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', monospace;
}
.profit-side-row .pos { color: #16a34a; }
.profit-side-row .neg { color: #dc2626; }
.profit-side-row .neu { color: #334155; }
.profit-side-row .blue { color: #2563eb; }
.profit-side-row .orange { color: #ea580c; }

/* 利润分析 - 成本明细明亮表 */
.profit-detail-card {
  position: relative;
  background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
  border-radius: 16px;
  padding: 22px 24px;
  color: #1e293b;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.06);
}
.profit-detail-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(251,146,60,0.1) 0%, transparent 70%);
  pointer-events: none;
}
.profit-detail-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}
.profit-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.profit-detail-table th {
  text-align: left;
  padding: 10px 12px;
  background: rgba(0,0,0,0.03);
  color: #64748b;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.profit-detail-table th:first-child { border-radius: 8px 0 0 8px; }
.profit-detail-table th:last-child { border-radius: 0 8px 8px 0; }
.profit-detail-table td {
  padding: 12px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  color: #334155;
}
.profit-detail-table tr:hover td { background: rgba(0,0,0,0.02); }
.profit-detail-table tr.total-row td {
  background: linear-gradient(90deg, rgba(251,146,60,0.12) 0%, rgba(0,0,0,0) 100%);
  font-weight: 800;
  color: #c2410c;
  border-top: 2px solid rgba(251,146,60,0.3);
  border-bottom: none;
}
.profit-detail-table .bar-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}
.profit-detail-table .bar-bg {
  flex: 1;
  height: 6px;
  background: rgba(0,0,0,0.06);
  border-radius: 3px;
  overflow: hidden;
  min-width: 60px;
}
.profit-detail-table .bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 利润页面头部 - 明亮玻璃 */
.profit-page-header {
  background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
  border-radius: 16px;
  padding: 18px 24px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #0f172a;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.06);
  position: relative;
  overflow: hidden;
}
.profit-page-header::before {
  content: '';
  position: absolute;
  top: -50%; right: -10%;
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(99,102,241,0.15) 0%, transparent 70%);
  pointer-events: none;
}
.profit-page-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 1;
}
.profit-page-header-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}
.profit-page-period {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #64748b;
  position: relative;
  z-index: 1;
}
.profit-page-period-chip {
  background: rgba(99,102,241,0.1);
  color: #4f46e5;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 600;
  border: 1px solid rgba(99,102,241,0.2);
}
.profit-close-btn {
  background: rgba(0,0,0,0.04);
  border: 1px solid rgba(0,0,0,0.08);
  color: #475569;
  width: 32px; height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease;
  position: relative;
  z-index: 1;
}
.profit-close-btn:hover {
  background: rgba(239,68,68,0.12);
  color: #dc2626;
  border-color: rgba(239,68,68,0.2);
}

/* 利润 tabs - 明亮高端 */
.profit-tabs {
  display: flex;
  gap: 6px;
  margin: 30px 0 18px;
  background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
  padding: 6px;
  border-radius: 16px;
  border: 1px solid rgba(99,102,241,0.15);
  box-shadow:
    0 4px 16px rgba(0,0,0,0.06),
    inset 0 1px 0 rgba(255,255,255,0.8);
  width: 100%;
  backdrop-filter: blur(12px);
  position: relative;
}
.profit-tabs::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(99,102,241,0.25) 0%, rgba(139,92,246,0.1) 50%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.profit-tab {
  flex: 1;
  padding: 11px 22px;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  border-radius: 11px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  z-index: 1;
}
.profit-tab svg {
  opacity: 0.7;
  transition: all 0.3s ease;
}
.profit-tab:hover {
  color: #334155;
  background: rgba(0,0,0,0.03);
}
.profit-tab:hover svg { opacity: 1; transform: scale(1.1); }
.profit-tab.active {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
  color: #fff;
  box-shadow:
    0 4px 16px rgba(99,102,241,0.35),
    0 0 0 1px rgba(255,255,255,0.1) inset,
    0 1px 0 rgba(255,255,255,0.2) inset;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.profit-tab.active svg { opacity: 1; }
.profit-tab.active::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 3px;
  background: linear-gradient(90deg, #6366f1, #a855f7);
  border-radius: 2px;
  box-shadow: 0 0 12px rgba(139,92,246,0.5);
}

/* 利润网格容器 - 2列 */
.profit-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 900px) {
  .profit-grid-2 { grid-template-columns: 1fr; }
}

/* 发货表单 */
.ship-form .ship-qty-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px;
}
.ship-form .ship-qty-row.two-col {
  grid-template-columns: 1fr 1fr;
}

/* 发货详情 */
.ship-detail-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.ship-detail-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px;
  margin-bottom: 20px; padding: 16px; background: #f9fafb; border-radius: 8px;
}
.ship-detail-item { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.ship-detail-label { color: var(--gray-500, #6b7280); min-width: 80px; }

.ship-section { margin-bottom: 20px; }
.ship-section-title {
  font-size: 15px; font-weight: 700; margin-bottom: 10px;
  padding-left: 10px; border-left: 3px solid var(--primary, #2563eb);
}

/* 发货照片 */
.ship-photo-area {
  display: flex; flex-wrap: wrap; gap: 10px;
}
.ship-photo-item {
  position: relative; width: 100px; height: 100px;
}
.ship-photo-item img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 8px;
  cursor: pointer; border: 1px solid var(--gray-200, #e5e7eb);
}
.ship-photo-del {
  position: absolute; bottom: -8px; right: -8px;
  padding: 2px 6px; font-size: 11px; border-radius: 4px;
}
.ship-photo-upload {
  width: 100px; height: 100px; border: 2px dashed var(--gray-300, #d1d5db);
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--gray-400, #9ca3af); font-size: 13px;
  transition: all .2s;
}
.ship-photo-upload:hover {
  border-color: var(--primary, #2563eb);
  color: var(--primary, #2563eb);
  background: #eff6ff;
}

/* 结清弹窗 */
.settle-info {
  padding: 12px; background: #f9fafb; border-radius: 8px; margin-bottom: 16px;
  font-size: 13px; line-height: 1.8;
}
.settle-info div { display: flex; justify-content: space-between; }

/* 对账区域 */
.ship-recon-section { margin-bottom: 24px; }
.ship-recon-section h4 {
  font-size: 15px; font-weight: 700; margin: 0 0 10px 0;
  padding-left: 10px; border-left: 3px solid var(--primary, #2563eb);
}

/* 趋势图 */
.ship-trend-chart-wrapper {
  background: #fff; border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 12px; padding: 16px; overflow-x: auto;
}

/* 产品贡献 */
.ship-product-list { display: flex; flex-direction: column; gap: 10px; }
.ship-product-card {
  display: flex; align-items: center; gap: 16px; padding: 16px;
  background: #fff; border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 12px; transition: box-shadow .2s;
}
.ship-product-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.06); }
.ship-product-rank {
  font-size: 18px; font-weight: 800; color: var(--primary, #2563eb);
  min-width: 36px; text-align: center;
}
.ship-product-info { flex: 1; }
.ship-product-name { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.ship-product-code { font-size: 12px; color: var(--gray-400, #9ca3af); font-weight: 400; }
.ship-product-bar {
  height: 6px; background: var(--gray-100, #f3f4f6); border-radius: 3px;
  overflow: hidden; margin-bottom: 6px;
}
.ship-product-bar-fill {
  height: 100%; background: linear-gradient(90deg, #2563eb, #7c3aed);
  border-radius: 3px; transition: width .3s;
}
.ship-product-stats {
  display: flex; gap: 16px; font-size: 12px; color: var(--gray-500, #6b7280);
}
.ship-product-pct {
  font-size: 20px; font-weight: 800; color: var(--primary, #2563eb);
  min-width: 60px; text-align: right;
}

/* 成功按钮 */
.btn-success {
  background: var(--success, #059669); color: #fff; border: none;
}
.btn-success:hover { background: var(--success-dark, #047857); }

/* badge-yellow */
.badge-yellow {
  background: #fef3c7; color: #92400e;
}

/* ===== 发货/对账表格增强 ===== */
.ship-table { width: auto; min-width: 100%; overflow: visible !important; }
.ship-table thead th {
  background: linear-gradient(135deg, #0f766e 0%, #0d9488 50%, #14b8a6 100%) !important;
  color: #fff !important;
  text-shadow: 0 1px 2px rgba(0,0,0,0.12);
  padding: 8px 6px !important;
  font-size: 13px;
  white-space: nowrap;
}
.ship-table tbody td { padding: 8px 6px !important; white-space: nowrap; font-size: 13px; }
.ship-table th, .ship-table td { min-width: 0 !important; }
.ship-table tbody tr:nth-child(even) { background: #f0fdfa; }
.ship-table tbody tr:hover { background: #ccfbf1 !important; }

/* 对账汇总表 */
.recon-table { width: auto; min-width: 100%; overflow: visible !important; }
.recon-table thead th {
  background: linear-gradient(135deg, #6b21a8 0%, #7c3aed 50%, #a855f7 100%) !important;
  color: #fff !important;
  text-shadow: 0 1px 2px rgba(0,0,0,0.12);
  white-space: nowrap;
}
.recon-table th, .recon-table td { min-width: 0 !important; }
.recon-table tbody tr:nth-child(even) { background: #faf5ff; }
.recon-table tbody tr:hover { background: #f3e8ff !important; }

/* 通用表格首列加粗 */
.table-wrap table td:first-child,
#adminContent table td:first-child {
  font-weight: 500;
}

/* ==================== 订单管理 4 标签页 + 打包页面不出现横向滚动 ==================== */
.tabs-nav {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 2px solid #e2e8f0;
  flex-wrap: wrap;
}
.tab-btn {
  padding: 8px 14px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  color: #64748b;
  border-radius: 6px 6px 0 0;
  transition: all 0.2s;
  position: relative;
  font-weight: 500;
}
.tab-btn:hover { background: #f1f5f9; color: #334155; }
.tab-btn.active {
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #fff;
  box-shadow: 0 2px 6px rgba(79,70,229,0.3);
}
.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: #4f46e5;
}
.tab-count {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 8px;
  border-radius: 10px;
  background: rgba(255,255,255,0.25);
  font-size: 11px;
  font-weight: 700;
}
.tab-btn:not(.active) .tab-count { background: #e2e8f0; color: #475569; }

/* 打包表格不允许横向滚动 */
.pack-table-wrap {
  overflow-x: visible !important;
  width: 100%;
}
.packing-record-table,
.pack-summary-table {
  width: 100% !important;
  min-width: 0 !important;
  table-layout: auto;
}
.packing-record-table thead th,
.pack-summary-table thead th {
  white-space: nowrap;
  padding: 10px 6px !important;
  font-size: 13px !important;
}
.packing-record-table tbody td,
.pack-summary-table tbody td {
  padding: 8px 6px !important;
  font-size: 13px !important;
  white-space: nowrap;
}
.packing-record-table .pack-detail-row td:nth-child(2),
.packing-record-table .pack-detail-row td:nth-child(3),
.packing-record-table .pack-detail-row td:nth-child(4) { background: inherit; color: transparent; }
/* 覆盖 detail-row 第3-4列透明样式（已加上#列，原来第2-3列透明，现在调整为第3-4列） */
.packing-record-table .pack-detail-row td:nth-child(4),
.packing-record-table .pack-detail-row td:nth-child(5) { background: inherit; color: transparent; }
/* 操作按钮紧凑 */
.btn-pack-action { padding: 3px 8px !important; font-size: 12px !important; }

/* 顺延提示 banner */
.carryover-alert {
  animation: slideInDown 0.3s ease-out;
}
@keyframes slideInDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== 刷脸登录样式 ===== */
.face-video-wrap {
  position: relative;
  display: inline-block;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid #e2e8f0;
  background: #000;
}
.face-video-wrap video {
  display: block;
  width: 320px;
  height: 240px;
  object-fit: cover;
  transform: scaleX(-1);
}
.face-video-wrap canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: scaleX(-1);
}
.face-status {
  font-size: 14px;
  color: #64748b;
  padding: 8px 0;
}
.face-status.face-error {
  color: #dc2626;
}
.face-status.face-ready {
  color: #059669;
}
.face-result {
  min-height: 24px;
}
.face-success {
  color: #059669;
  font-size: 16px;
  font-weight: 600;
  padding: 8px;
}
#faceLoginBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* ===== 免打卡计件 toggle 开关 ===== */
.pm-toggle {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 22px;
  cursor: pointer;
  vertical-align: middle;
}
.pm-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.pm-toggle-slider {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 22px;
  transition: background 0.25s ease;
}
.pm-toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.pm-toggle input:checked + .pm-toggle-slider {
  background: #22c55e;
}
.pm-toggle input:checked + .pm-toggle-slider::before {
  transform: translateX(20px);
}
.pm-toggle:hover .pm-toggle-slider {
  filter: brightness(0.95);
}
.pm-batch-bar {
  animation: pmBarSlide 0.3s ease;
}
@keyframes pmBarSlide {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== 工资表格专用样式（加照片、操作列两行、紧凑列宽、无横向滚动） ===== */
.salary-table-wrap {
  overflow-x: visible;
  border-radius: 10px;
  width: 100%;
}
.salary-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 16px;
  border: 1px solid #c7d2fe;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(99,102,241,0.08);
}
.salary-table thead th {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #fff;
  font-weight: 600;
  padding: 8px 4px;
  text-align: center;
  border-bottom: 2px solid #c7d2fe;
  font-size: 16px;
  white-space: nowrap;
}
.salary-table tbody td {
  padding: 6px 4px;
  border-bottom: 1px solid #e0e7ff;
  border-right: 1px solid #e0e7ff;
  vertical-align: middle;
  word-break: break-word;
  text-align: center;
}
.salary-table tbody td:last-child { border-right: none; }
.salary-table tbody tr:nth-child(even) { background: #eef2ff; }
.salary-table tbody tr:nth-child(odd) { background: #ffffff; }
.salary-table tbody tr:hover { background: #e0e7ff !important; }
.salary-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.salary-avatar-fallback {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 600;
}
.salary-name-cell {
  display: flex;
  align-items: center;
  justify-content: flex-start;  /* 左对齐（头像+姓名靠单元格左侧）*/
  gap: 6px;
  padding: 2px 0;
}
.salary-name-cell .user-name-link {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}
.salary-table thead th:first-child,
.salary-table tbody td:first-child {
  text-align: left;
}
.salary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  align-items: center;
  justify-content: flex-start;
}
.salary-actions .btn {
  padding: 3px 7px;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}
/* 工资统计表格内灰色文字加深，避免浅色背景看不清 */
.salary-table .text-gray,
.salary-table [style*="color:#94a3b8"],
.salary-table [style*="color: #94a3b8"] {
  color: var(--gray-900) !important;
}

/* ===== 视图 / 排序 按钮组（n294 改造）===== */
.salary-pill-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 3px 4px;
}
.salary-pill-tab {
  padding: 5px 12px;
  border: none;
  background: transparent;
  color: var(--gray-900);
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.salary-pill-tab:hover {
  background: #e2e8f0;
  color: #1e293b;
}
.salary-pill-tab.active {
  background: linear-gradient(135deg, #7c3aed, #6366f1);
  color: #fff;
  box-shadow: 0 1px 3px rgba(99, 102, 241, 0.3);
}

/* ===== 个人产值明细页 (wsd = Worker Salary Detail) ===== */
.wsd-page { max-width: 1100px; margin: 0 auto; }
.wsd-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; margin-bottom: 4px; flex-wrap: wrap; gap: 10px;
}
.wsd-header-left { flex-shrink: 0; }
.wsd-header-center { display: flex; align-items: center; gap: 14px; flex: 1; justify-content: center; }
.wsd-header-right { flex-shrink: 0; }
.wsd-avatar {
  width: 52px; height: 52px; border-radius: 50%; object-fit: cover;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15); flex-shrink: 0;
}
.wsd-avatar-fallback {
  background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700;
}
.wsd-header-info { text-align: left; }
.wsd-header-name { font-size: 20px; font-weight: 700; color: #1e293b; }
.wsd-header-meta { display: flex; align-items: center; gap: 10px; margin-top: 4px; flex-wrap: wrap; }
.wsd-meta-item { font-size: 12px; color: #64748b; }

.wsd-period-bar {
  background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
  border: 1px solid #bae6fd; border-radius: 8px;
  padding: 8px 16px; margin-bottom: 14px;
  font-size: 13px; color: #0369a1;
}

.wsd-stat-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 12px;
}
.wsd-stat-card {
  border-radius: 12px; padding: 16px 14px; display: flex; align-items: center; gap: 12px;
  color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.wsd-stat-icon { font-size: 26px; opacity: 0.85; }
.wsd-stat-body { flex: 1; min-width: 0; }
.wsd-stat-label { font-size: 12px; opacity: 0.85; margin-bottom: 2px; }
.wsd-stat-value { font-size: 22px; font-weight: 700; line-height: 1.1; }
.wsd-stat-sub { font-size: 11px; opacity: 0.75; margin-top: 2px; }
.wsd-stat-purple { background: linear-gradient(135deg, #a855f7, #7e22ce); }
.wsd-stat-blue { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.wsd-stat-red { background: linear-gradient(135deg, #f43f5e, #be123c); }
.wsd-stat-green { background: linear-gradient(135deg, #22c55e, #15803d); }
.wsd-stat-darkred { background: linear-gradient(135deg, #dc2626, #991b1b); }

.wsd-formula-bar {
  display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap;
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px;
  padding: 10px 16px; margin-bottom: 14px; font-size: 13px;
}
.wsd-formula-item { font-weight: 600; color: #334155; }
.wsd-formula-op { color: #94a3b8; font-weight: 700; font-size: 15px; }
.wsd-formula-result { font-weight: 800; font-size: 16px; color: #16a34a; }

.wsd-compare-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px;
}
.wsd-compare-card {
  border-radius: 10px; padding: 14px 16px; border-left: 4px solid;
}
.wsd-compare-purple { background: #faf5ff; border-color: #a855f7; }
.wsd-compare-teal { background: #f0fdfa; border-color: #14b8a6; }
.wsd-compare-title { font-size: 14px; font-weight: 700; margin-bottom: 10px; color: #334155; }
.wsd-compare-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; padding: 3px 0;
}

.wsd-section {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
  padding: 14px 16px; margin-bottom: 14px;
}
.wsd-section-title {
  font-size: 15px; font-weight: 700; color: #1e293b; margin: 0 0 10px;
  display: flex; align-items: center; gap: 8px;
}
.wsd-text-danger { color: #dc2626; }
.wsd-text-warning { color: #d97706; }
.wsd-count-badge {
  font-size: 11px; font-weight: 600; color: #64748b;
  background: #f1f5f9; border-radius: 10px; padding: 2px 8px;
}
.wsd-count-red { background: #fef2f2; color: #dc2626; }
.wsd-count-orange { background: #fffbeb; color: #d97706; }

.wsd-table-wrap { overflow-x: auto; }
.wsd-table {
  width: 100%; border-collapse: collapse; font-size: 14px;
  table-layout: fixed;
}
.wsd-table thead th {
  background: #e2e8f0; color: #1e293b; font-weight: 700;
  padding: 10px 6px; text-align: center; border-bottom: 2px solid #94a3b8;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wsd-table tbody td {
  padding: 8px 8px; border-bottom: 1px solid #e2e8f0; vertical-align: middle;
  text-align: center; word-break: break-all;
}
.wsd-table td.l { text-align: center; }
.wsd-table td.r { text-align: center; font-variant-numeric: tabular-nums; }
.wsd-table tbody tr:nth-child(even) { background: #f8fafc; }
.wsd-table tbody tr:nth-child(even):hover { background: #f1f5f9; }
.wsd-table tbody tr:hover { background: #f1f5f9; }
.wsd-table tfoot td { padding: 10px 8px; border-top: 2px solid #94a3b8; text-align: center; font-variant-numeric: tabular-nums; }
.wsd-table tfoot td.l { text-align: center; }
.wsd-table tfoot td.r { text-align: center; font-variant-numeric: tabular-nums; }

.wsd-chart-wrap {
  background: #fafafa; border-radius: 8px; padding: 8px;
  overflow-x: auto;
}
.wsd-chart-wrap canvas { max-width: 100%; }

.wsd-chart-header {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}
.wsd-chart-header .wsd-section-title {
  margin: 0;
  flex-shrink: 0;
}
.wsd-chart-legend {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  margin-left: 35px;
  flex-shrink: 0;
}
.wsd-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #475569;
  white-space: nowrap;
}
.wsd-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.wsd-footer-actions {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
  padding: 16px 0 8px;
}

@media (max-width: 768px) {
  .wsd-stat-grid { grid-template-columns: 1fr 1fr; }
  .wsd-compare-grid { grid-template-columns: 1fr; }
  .wsd-header-center { justify-content: flex-start; }
}


/* ===== 顶部导航栏（亮色调） ===== */
.admin-layout { display: flex; flex-direction: column; min-height: 100dvh; background: #f1f5f9; }
.admin-topnav {
  position: sticky; top: 0; z-index: 50;
  display: flex; flex-direction: row; align-items: center; gap: 6px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
  padding: 6px 14px 6px 28px; min-height: 60px;
  width: 100%; max-width: 100%; margin: 0;
  border-radius: 0;
  border-bottom: 1px solid #e2e8f0;
}

/* 品牌区：LOGO + 上下两行文字（名称 + 英文/副标题） */
.topnav-brand {
  display: flex; align-items: center; flex-shrink: 0; gap: 6px;
  padding-right: 0; max-width: 120px;
  border-right: none;
}
.topnav-logo {
  height: 32px; width: auto; max-width: 70px; max-height: 32px;
  border-radius: 8px; object-fit: contain; background: #f1f5f9;
}
.topnav-logo[src=""]{ display: none; }
.topnav-brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.topnav-brand-name {
  font-size: 16px; font-weight: 800; color: #0f172a;
  letter-spacing: 0.5px; white-space: nowrap;
}
.topnav-brand-sub {
  font-size: 10px; font-weight: 500; color: #64748b;
  white-space: nowrap; letter-spacing: 0.5px;
  margin-top: 2px;
}

/* 菜单区 */
.topnav-menu {
  display: flex; align-items: center; gap: 0;
  flex: 1; min-width: 0; justify-content: flex-start;
  margin-left: 0;
  overflow: visible;
}
.topnav-item { position: relative; display: flex; align-items: center; }
.topnav-standalone, .topnav-trigger {
  display: flex; align-items: center; gap: 4px;
  padding: 6px 8px; cursor: pointer;
  font-size: 14px; font-weight: 600; color: #1e293b;
  border-radius: 10px; transition: all 0.15s;
  white-space: nowrap; user-select: none;
  text-decoration: none;
  position: relative;
  border: none;
}
.topnav-icon {
  font-size: 16px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 6px;
  background: #f1f5f9;
  transition: background 0.15s;
}
.topnav-trigger:hover .topnav-icon { background: #e2e8f0; }
/* 双行文字：中文上、英文下 */
.topnav-text {
  display: flex; flex-direction: column;
  line-height: 1.15;
}
.topnav-label-cn {
  font-size: 15px; font-weight: 700; color: inherit;
}
.topnav-label-en {
  font-size: 9px; font-weight: 500; color: #94a3b8;
  letter-spacing: 0.5px; text-transform: uppercase;
  margin-top: 1px;
}
.topnav-caret { font-size: 11px; color: #64748b; margin-left: 2px; transition: transform 0.15s; align-self: center; }

/* 鼠标悬浮：绿色高亮（无描边，避免布局跳动） */
.topnav-standalone:hover,
.topnav-trigger:hover {
  border: none;
  background: #ecfdf5;
}
.topnav-standalone:hover .topnav-label-cn,
.topnav-trigger:hover .topnav-label-cn {
  color: #059669;
}
.topnav-standalone:hover .topnav-icon,
.topnav-trigger:hover .topnav-icon {
  background: #d1fae5;
}
/* 激活态：绿色高亮（无描边） */
.topnav-standalone.active,
.topnav-dropdown-wrap.contains-active > .topnav-trigger {
  border: none;
  background: #ecfdf5;
}
.topnav-standalone.active .topnav-label-cn,
.topnav-dropdown-wrap.contains-active > .topnav-trigger .topnav-label-cn {
  color: #059669;
}
.topnav-standalone.active .topnav-icon,
.topnav-dropdown-wrap.contains-active > .topnav-trigger .topnav-icon {
  background: #d1fae5;
}

/* n528: 兜底去除导航所有边框线（黑杠） */
.admin-topnav,
.topnav-brand,
.topnav-menu,
.topnav-right,
.topnav-standalone,
.topnav-trigger,
.topnav-dropdown-wrap,
.topnav-item,
.topnav-icon-btn,
.topnav-user {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}
.admin-topnav {
  box-shadow: 0 1px 3px rgba(0,0,0,0.06) !important;
  border-bottom: 1px solid #f1f5f9 !important;
}
.topnav-icon-btn {
  border: 1px solid #e2e8f0 !important;
  box-shadow: none !important;
}

/* 二级下拉面板（position:fixed，由 JS 实时算 left/top） */
.topnav-dropdown {
  position: fixed;  /* JS 会重写 */
  min-width: 168px;
  background: #fff; border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
  padding: 6px;
  opacity: 0; transition: opacity 0.15s, transform 0.15s;
  transform: translateY(-4px);
  pointer-events: none;
  z-index: 9999;
}
.topnav-dropdown.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.topnav-sub {
  display: block; padding: 9px 14px;
  font-size: 13px; color: #1e40af; border-radius: 6px;
  cursor: pointer; transition: all 0.12s;
  white-space: nowrap; text-decoration: none;
  border-left: 3px solid transparent;
}
.topnav-sub:hover { color: #2563eb; background: #eff6ff; }
.topnav-sub.active {
  color: #2563eb; font-weight: 600; background: #eff6ff;
  border-left-color: #2563eb;
}

/* 右侧用户区（flex 子元素自然靠右，不再绝对定位避免遮挡菜单） */
.topnav-right {
  display: flex; align-items: center; gap: 5px;
  flex-shrink: 0; flex-wrap: nowrap;
  padding-left: 0;
  margin-left: auto;
  background: #ffffff;
  z-index: 2;
}
.topnav-user { display: flex; align-items: center; gap: 6px; }
.topnav-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff; font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.topnav-user-meta { line-height: 1.3; }
.topnav-user-name { font-size: 12px; font-weight: 600; color: #1e293b; white-space: nowrap; }
.topnav-user-role { font-size: 10px; color: #94a3b8; }
/* 小图标按钮（报修 / 大屏 / 超管 / 消息）—— 缩小20% */
.topnav-icon-btn {
  background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0;
  border-radius: 8px; min-width: 36px; height: 36px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; transition: all 0.15s;
  padding: 0 8px;
}
/* P0-3: 移动端抽屉导航按钮（桌面端隐藏） */
.topnav-drawer-btn {
  display: none;
  background: var(--brand); color: #fff; border: none;
  border-radius: 8px; min-width: 40px; height: 40px; cursor: pointer;
  align-items: center; justify-content: center;
  font-size: 22px; transition: background 0.15s;
  flex-shrink: 0;
}
.topnav-drawer-btn:hover { background: var(--brand-dark); }
.topnav-icon-btn:hover {
  background: #e2e8f0; border-color: #cbd5e1;
  transform: translateY(-1px);
}
/* 刷新按钮旋转动画 */
@keyframes refresh-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.refresh-icon-wrap { display: inline-block; font-size: 14px; line-height: 1; }
.topnav-icon-btn.super {
  background: #7c3aed; color: white; border-color: #7c3aed;
  font-size: 11px; font-weight: 600;
}
.topnav-icon-btn.super:hover { background: #6d28d9; }
.topnav-logout {
  padding: 6px 12px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff; border: none; border-radius: 8px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 3px;
  transition: all 0.15s; white-space: nowrap;
  box-shadow: 0 2px 4px rgba(220,38,38,0.22);
  height: 36px;
}
.topnav-logout:hover { transform: translateY(-1px); box-shadow: 0 4px 8px rgba(220,38,38,0.32); }

/* ===== 内容区面包屑（一级菜单 + 当前分组下所有子链接） ===== */
.admin-breadcrumb {
  display: flex; align-items: center;
  /* 整体右移 35px、链接间距 35px */
  margin: 18px 24px 0 35px;
  padding: 12px 22px;
  background: linear-gradient(90deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  position: relative;
  flex-wrap: wrap;
  row-gap: 8px;
  gap: 35px;
}
.admin-breadcrumb::after {
  /* 链接底部柔美渐变线 */
  content: '';
  position: absolute;
  left: 22px; right: 22px; bottom: -1px; height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(37, 99, 235, 0.18) 20%,
    rgba(37, 99, 235, 0.45) 50%,
    rgba(37, 99, 235, 0.18) 80%,
    transparent 100%);
  border-radius: 2px;
  pointer-events: none;
}
.bc-level1 {
  display: inline-flex; align-items: center; gap: 8px;
  color: #0f172a; font-weight: 700; font-size: 16px;
  text-decoration: none; white-space: nowrap;
  transition: color 0.15s;
}
.bc-level1:hover { color: #2563eb; }
.bc-level1 .bc-icon { font-size: 18px; }
.bc-level1 .bc-text { letter-spacing: 0.3px; }
.bc-sep {
  color: #cbd5e1; font-size: 20px; font-weight: 300;
  user-select: none; flex-shrink: 0;
}
.bc-children {
  display: flex; align-items: center; flex-wrap: wrap;
  row-gap: 6px;
  gap: 35px;  /* 链接间距 35px */
  flex: 1; min-width: 0;
}
.bc-link {
  display: inline-block;
  padding: 7px 16px; border-radius: 999px;
  color: #475569; font-size: 14px; font-weight: 500;
  text-decoration: none; white-space: nowrap;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  transition: all 0.18s ease;
  position: relative;
  letter-spacing: 0.2px;
}
.bc-link:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.15);
}
.bc-link.active {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  color: #fff;
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.32);
}
.bc-link.active::after {
  /* 激活链接底部柔美下划线 */
  content: '';
  position: absolute;
  left: 18%; right: 18%; bottom: -3px; height: 2px;
  background: linear-gradient(90deg, transparent, #2563eb, transparent);
  border-radius: 2px;
}
@media (max-width: 1100px) and (min-width: 769px) {
  .admin-breadcrumb { gap: 22px; margin: 14px 16px 0 28px; padding: 10px 16px; }
  .bc-children { gap: 22px; }
  .bc-level1 { font-size: 15px; }
  .bc-link { padding: 6px 12px; font-size: 13px; }
}
@media (max-width: 768px) {
  .admin-breadcrumb { gap: 14px; margin: 10px 12px 0 20px; padding: 8px 12px; }
  .bc-children { gap: 14px; }
  .bc-sep { display: none; }
  .bc-level1 { font-size: 14px; }
  .bc-link { padding: 5px 10px; font-size: 12px; }
}

/* 主内容区 */
.admin-content {
  flex: 1; min-width: 0;
  padding: 20px 24px; width: 100%;
}

/* 旧 nav 样式降级为隐藏（兼容老缓存） */
.admin-nav { display: none !important; }
.topbar { display: none !important; }

@media (max-width: 768px) {
  .admin-topnav { padding: 6px 10px; gap: 6px; min-height: 0; flex-wrap: nowrap; max-width: 100%; margin: 0; border-radius: 0; align-items: center; }
  /* P0-3: 移动端恢复横向滚动菜单 */
  .topnav-menu { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .topnav-drawer-btn { display: none !important; }
  .topnav-brand { padding-right: 8px; gap: 6px; border-right: none; flex-shrink: 0; }
  .topnav-right { position: static; transform: none; gap: 3px; padding-left: 0; background: transparent; margin-left: auto; }
  .topnav-user { display: none; }
  .topnav-user-meta { display: none; }
  .topnav-logo { height: 36px; max-width: 100px; }
  .topnav-brand-name { font-size: 15px; letter-spacing: 0; }
  .topnav-brand-sub { font-size: 10px; }
  .topnav-icon-btn { min-width: 32px; height: 32px; font-size: 14px; padding: 0 6px; }
  .topnav-logout { padding: 5px 10px; font-size: 12px; height: 32px; }
  .admin-content { padding: 12px; }
}

/* ===== 大屏适配 1920×1080 ===== */
@media (min-width: 1600px) {
  :root { --table-font-size: 17px; }
  .admin-topnav { padding: 10px 28px 10px 48px; min-height: 84px; gap: 10px; }
  .topnav-logo { height: 67px; max-width: 220px; max-height: 67px; }
  .topnav-brand { max-width: 260px; }
  .topnav-brand-name { font-size: 24px; }
  .topnav-brand-sub { font-size: 12px; }
  .topnav-standalone, .topnav-trigger { padding: 10px 8px; font-size: 17px; gap: 10px; }
  /* 大屏：图标更大，右侧用户区更宽，预留更多空间避免遮挡 */
  .topnav-menu { overflow: visible; }
  .topnav-icon { font-size: 24px; width: 40px; height: 40px; border-radius: 9px; }
  .topnav-label-cn { font-size: 16px; }
  .topnav-label-en { font-size: 10px; }
  .topnav-sub { padding: 10px 16px; font-size: 14px; }
  .topnav-avatar { width: 36px; height: 36px; font-size: 15px; }
  .topnav-user-name { font-size: 13px; }
  .topnav-icon-btn { min-width: 40px; height: 40px; font-size: 16px; padding: 0 9px; }
  .topnav-logout { padding: 7px 14px; font-size: 13px; height: 40px; }
  .admin-content { padding: 24px 36px; }
  .rec-totals-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; }
  .rec-totals-grid .card { padding: 18px 20px; }
  .rec-totals-grid .card > div:nth-child(2) { font-size: 26px; }
  .grp-sch-kpi { grid-template-columns: repeat(9, 1fr); gap: 14px; }
  /* n258: 班组清单在超宽屏也保持单列（缝制一组、二组、三组竖向排列） */
  .grp-sch-grid { grid-template-columns: 1fr !important; gap: 16px; }
  .grp-sch-kpi-value { font-size: 18px; }
  .admin-stat-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
  .grp-sch-card { padding: 14px 16px; }
  .grp-sch-group-name { font-size: 17px; }
  th, td { padding: 12px 16px; }
  .pm-table th, .pm-table td { padding: 12px 14px !important; }
  .qc-summary-table th, .qc-summary-table td { padding: 12px 10px; }
}

/* ===== 小屏适配 1024×768 ===== */
@media (max-width: 1100px) and (min-width: 769px) {
  :root { --table-font-size: 14px; }
  /* admin-topnav 自己横向滚动；dropdown 用 fixed 定位不受 overflow 裁切 */
  .admin-topnav { padding: 8px 14px; min-height: 0; gap: 10px; max-width: 100%; margin: 0; border-radius: 0; flex-wrap: wrap; }
  .topnav-menu { flex: 1 1 100%; order: 3; gap: 2px; overflow-x: auto; justify-content: flex-start; margin-left: 0; }
  .topnav-menu::-webkit-scrollbar { height: 3px; }
  .topnav-menu::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }
  .topnav-brand { padding-right: 10px; gap: 6px; border-right: none; }
  .topnav-brand-name { font-size: 16px; letter-spacing: 1px; }
  .topnav-brand-sub { font-size: 11px; }
  .topnav-logo { height: 36px; max-width: 120px; }
  .topnav-standalone, .topnav-trigger { padding: 6px 8px; font-size: 13px; gap: 6px; }
  .topnav-icon { font-size: 16px; width: 28px; height: 28px; border-radius: 6px; }
  .topnav-label-cn { font-size: 13px; }
  .topnav-label-en { display: none; }
  .topnav-caret { font-size: 9px; }
  .topnav-sub { padding: 8px 12px; font-size: 12px; }
  .topnav-user-meta { display: none; }
  .topnav-avatar { width: 30px; height: 30px; font-size: 13px; }
  .topnav-icon-btn { min-width: 32px; height: 32px; font-size: 14px; padding: 0 6px; }
  .topnav-logout { padding: 5px 10px; font-size: 12px; height: 32px; }
  .topnav-right { padding-left: 10px; border-left: none; }
  .admin-content { padding: 14px 16px; }
  .rec-totals-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .rec-totals-grid .card { padding: 12px 14px; }
  .rec-totals-grid .card > div:nth-child(2) { font-size: 20px; }
  .grp-sch-kpi { grid-template-columns: repeat(5, 1fr); }
  /* n258: 班组清单在 1200px+ 宽屏也保持单列（缝制一组、二组、三组竖向排列） */
  .grp-sch-grid { grid-template-columns: 1fr !important; gap: 14px; }
  .admin-stat-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
  .profile-page { flex-direction: column; }
  .profile-left { width: 100%; }
  .schedule-date-item, .schedule-dates-head {
    grid-template-columns: 90px 90px 70px 70px 60px 60px 50px 50px 60px !important;
    font-size: 12px;
    gap: 4px;
    padding: 6px 8px;
  }
  th, td { padding: 8px 10px; }
  .pm-table th, .pm-table td { padding: 8px 10px !important; }
  .qc-summary-table th, .qc-summary-table td { padding: 8px 6px; }
  .modal { padding: 18px; max-width: 420px; }
}

/* ===== 设备借还记录-借用人头像 ===== */
.br-user { display: inline-flex; align-items: center; gap: 8px; }
.br-avatar-wrap { flex-shrink: 0; }
.br-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  object-fit: cover; border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  cursor: pointer; transition: transform 0.15s;
  display: block;
}
.br-avatar:hover { transform: scale(1.15); box-shadow: 0 3px 8px rgba(0,0,0,0.25); }
.br-avatar-fallback {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff; font-weight: 700; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
}



/* 仓库分类统计卡片 */
.wh-stat-card {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
}
.wh-stat-card:hover {
  transform: translateY(-3px);
  border-color: rgba(99,102,241,0.5) !important;
  box-shadow: 0 8px 24px rgba(99,102,241,0.18) !important;
}
.wh-stat-card:active { transform: translateY(-1px); }
.wh-stat-icon {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.wh-stat-card:hover .wh-stat-icon {
  transform: scale(1.08) rotate(-4deg);
}

/* ===== 打包计数页面 ===== */
.pack-count-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  margin-bottom: 8px;
}
.pack-count-att-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.pack-count-att-badge.att-ok {
  background: #d1fae5;
  color: #065f46;
}
.pack-count-att-badge.att-warn {
  background: #fef3c7;
  color: #92400e;
}
.pack-count-warn-box {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 1px solid #f59e0b;
  border-radius: 12px;
  padding: 16px 20px;
  text-align: center;
  color: #78350f;
  margin-bottom: 16px;
}
.pack-count-section {
  margin-bottom: 16px;
}
.pack-order-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}
.pack-order-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #fff;
  border: 1.5px solid var(--gray-200);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.pack-order-item:hover { border-color: var(--primary); background: #f0f7ff; }
.pack-order-item.selected {
  border-color: var(--primary);
  background: linear-gradient(135deg, #eff6ff, #f0f7ff);
  box-shadow: 0 2px 8px rgba(99,102,241,0.15);
}
.pack-order-item .poi-num {
  width: 28px; height: 28px;
  background: var(--gray-100); color: var(--gray-500);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; flex-shrink: 0;
}
.pack-order-item.selected .poi-num {
  background: var(--primary); color: #fff;
}
.pack-order-item .poi-main { flex: 1; min-width: 0; }
.pack-order-item .poi-order { font-size: 15px; font-weight: 700; color: #1e293b; }
.pack-order-item .poi-product { font-size: 13px; color: var(--gray-500); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pack-order-item .poi-right { text-align: right; flex-shrink: 0; }
.pack-order-item .poi-unpacked { font-size: 13px; color: #dc2626; }
.pack-order-item .poi-unpacked b { font-size: 16px; }
.pack-order-item .poi-ipp { font-size: 11px; color: var(--gray-400); margin-top: 2px; }
.pack-count-info-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.pack-count-info-card {
  background: #f8fafc;
  border-radius: 10px;
  padding: 12px 8px;
  text-align: center;
}
.pci-label {
  font-size: 11px;
  color: #64748b;
  margin-bottom: 4px;
}
.pci-value {
  font-size: 20px;
  font-weight: 700;
  color: #1e293b;
}
.pci-value.pci-warn { color: #dc2626; }
.pci-value.pci-ok { color: #059669; }
.pack-count-input-section {
  background: #f8fafc;
  border-radius: 14px;
  padding: 20px 16px;
  margin-bottom: 16px;
}
.pack-count-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 12px;
}
.pcs-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  font-size: 28px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
}
.pcs-btn:active { transform: scale(0.92); }
.pcs-minus {
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  color: #dc2626;
  box-shadow: 0 2px 8px rgba(220,38,38,0.15);
}
.pcs-plus {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  color: #059669;
  box-shadow: 0 2px 8px rgba(5,150,105,0.15);
}
.pcs-input {
  width: 100px;
  height: 60px;
  text-align: center;
  font-size: 28px;
  font-weight: 800;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  color: #1e293b;
}
.pack-count-quick {
  display: flex;
  justify-content: center;
  gap: 8px;
}
.pack-count-result-section {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
}
.pcr-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 14px;
}
.pcr-label { color: #64748b; }
.pcr-value { font-weight: 700; color: #1e293b; }
.pcr-value small { font-size: 12px; font-weight: 400; color: #94a3b8; }
.pcr-highlight {
  border-top: 1px solid rgba(59,130,246,0.2);
  margin-top: 4px;
  padding-top: 10px;
}
.pcr-highlight .pcr-label { font-weight: 600; color: #1e40af; }
.pcr-highlight .pcr-value { font-size: 22px; color: #059669; }
.pack-count-salary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #fff;
  border-radius: 14px;
  padding: 14px 20px;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.pack-count-salary-bar:active { transform: scale(0.98); }

/* ===== 打包员工资明细页面 ===== */
.pack-salary-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.pack-salary-filter .input {
  flex: 1 1 130px;
  min-width: 130px;
  max-width: none;
  padding: 10px 8px;
  font-size: 15px;
  box-sizing: border-box;
}
.ps-salary-hero {
  background: linear-gradient(135deg, #2563eb, #4f46e5, #7c3aed);
  color: #fff;
  border-radius: 16px;
  padding: 24px 20px;
  text-align: center;
  margin-bottom: 16px;
}
.ps-hero-period { font-size: 12px; opacity: 0.85; }
.ps-hero-value { font-size: 36px; font-weight: 800; margin: 6px 0 2px; }
.ps-hero-label { font-size: 13px; opacity: 0.8; }
.ps-salary-breakdown {
  background: #f8fafc;
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 16px;
}
.ps-breakdown-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
  color: #475569;
}
.ps-bd-val { font-weight: 600; color: #1e293b; }
.ps-section-title {
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
  margin: 16px 0 10px;
  padding-left: 10px;
  border-left: 3px solid #2563eb;
}

@media (max-width: 480px) {
  .pack-count-info-grid { grid-template-columns: repeat(2, 1fr); }
  .pcs-btn { width: 48px; height: 48px; font-size: 24px; }
  .pcs-input { width: 80px; height: 50px; font-size: 22px; }
}

/* ===== 打包员工资明细：表格列宽固定，禁止横向滚动 ===== */
.ps-table-wrap {
  overflow-x: visible !important;
  border-radius: 10px;
}
.ps-daily-table,
.ps-detail-table {
  width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed;
}
.ps-daily-table thead th,
.ps-daily-table tbody td,
.ps-detail-table thead th,
.ps-detail-table tbody td {
  min-width: 0 !important;
  box-sizing: border-box;
}
/* 每日汇总：日期 26% | 包数 18% | 条数 26% | 产值 30% */
.ps-daily-table th:nth-child(1), .ps-daily-table td:nth-child(1) { width: 26%; }
.ps-daily-table th:nth-child(2), .ps-daily-table td:nth-child(2) { width: 18%; }
.ps-daily-table th:nth-child(3), .ps-daily-table td:nth-child(3) { width: 26%; }
.ps-daily-table th:nth-child(4), .ps-daily-table td:nth-child(4) { width: 30%; }
/* 明细记录：时间 32% | 包数 17% | 条数 23% | 产值 28% */
.ps-detail-table th:nth-child(1), .ps-detail-table td:nth-child(1) { width: 32%; }
.ps-detail-table th:nth-child(2), .ps-detail-table td:nth-child(2) { width: 17%; }
.ps-detail-table th:nth-child(3), .ps-detail-table td:nth-child(3) { width: 23%; }
.ps-detail-table th:nth-child(4), .ps-detail-table td:nth-child(4) { width: 28%; }
.ps-daily-table thead th,
.ps-detail-table thead th {
  white-space: nowrap;
  padding: 10px 4px !important;
  font-size: 12px !important;
}
/* 数字列表头居中 */
.ps-daily-table thead th:nth-child(2),
.ps-daily-table thead th:nth-child(3),
.ps-daily-table thead th:nth-child(4),
.ps-detail-table thead th:nth-child(2),
.ps-detail-table thead th:nth-child(3),
.ps-detail-table thead th:nth-child(4) {
  text-align: center;
}
.ps-daily-table tbody td,
.ps-detail-table tbody td {
  white-space: normal;
  word-break: break-word;
  padding: 8px 4px !important;
  font-size: 12px !important;
  line-height: 1.4;
}
.ps-daily-table tbody td:nth-child(1),
.ps-detail-table tbody td:nth-child(1) {
  padding: 8px 4px !important;
}
/* 数字列：包数 / 条数 / 产值 放大加粗 */
.ps-daily-table tbody td.ps-num,
.ps-detail-table tbody td.ps-num {
  font-size: 22px !important;
  font-weight: 700;
  text-align: center;
  vertical-align: middle;
  padding: 12px 4px !important;
}
/* 产值列：绿色居中 */
.ps-daily-table tbody td.ps-output,
.ps-detail-table tbody td.ps-output {
  color: #059669;
}
.ps-detail-table .ps-time-small {
  font-size: 11px;
  color: #64748b;
  line-height: 1.3;
}
@media (max-width: 380px) {
  .ps-daily-table thead th,
  .ps-detail-table thead th,
  .ps-daily-table tbody td,
  .ps-detail-table tbody td {
    padding: 6px 2px !important;
    font-size: 11px !important;
  }
  .ps-detail-table .ps-time-small { font-size: 10px; }
}

/* 返回首页按钮（漂亮版）：渐变胶囊 + 悬浮动效 */
.ps-back-home {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 320px;
  margin: 12px auto 16px;
  padding: 12px 20px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  position: relative;
  overflow: hidden;
}
.ps-back-home::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  transition: left 0.5s ease;
}
.ps-back-home:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(99, 102, 241, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  filter: brightness(1.05);
}
.ps-back-home:hover::before {
  left: 100%;
}
.ps-back-home:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}
.ps-back-icon {
  font-size: 18px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15));
}
.ps-back-text {
  font-size: 15px;
}
.ps-back-arrow {
  font-size: 22px;
  font-weight: 700;
  margin-left: 4px;
  line-height: 1;
  opacity: 0.85;
  transition: transform 0.2s ease;
}
.ps-back-home:hover .ps-back-arrow {
  transform: translateX(3px);
  opacity: 1;
}

/* 内联变体：放在 header 内的紧凑样式 */
.ps-back-home-inline {
  width: auto;
  max-width: none;
  margin: 0;
  padding: 8px 14px;
  font-size: 13px;
  border-radius: 999px;
  gap: 5px;
}
.ps-back-home-inline .ps-back-icon { font-size: 14px; }
.ps-back-home-inline .ps-back-text { font-size: 13px; }
.ps-back-home-inline .ps-back-arrow { display: none; }

/* ===== n120 首页清新仪表盘 ===== */
.dash-page { display: flex; flex-direction: column; gap: 18px; }
.dash-loading { padding: 40px; text-align: center; color: #94a3b8; font-size: 14px; }

/* KPI 卡片行 */
.dash-kpi-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.dash-kpi {
  background: #fff; border-radius: 12px; padding: 16px 18px;
  border-left: 4px solid #cbd5e1;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: transform 0.2s, box-shadow 0.2s;
}
.dash-kpi:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.dash-kpi-blue { border-left-color: #3b82f6; }
.dash-kpi-green { border-left-color: #10b981; }
.dash-kpi-amber { border-left-color: #f59e0b; }
.dash-kpi-violet { border-left-color: #8b5cf6; }
.dash-kpi-pink { border-left-color: #ec4899; }
.dash-kpi-label { font-size: 12px; color: #94a3b8; font-weight: 500; }
.dash-kpi-value { font-size: 26px; font-weight: 700; color: #0f172a; margin-top: 4px; line-height: 1.2; }
.dash-kpi-unit { font-size: 13px; color: #94a3b8; font-weight: 500; margin-left: 3px; }

/* 产销概览小条 */
.dash-summary-row {
  display: flex; align-items: center; gap: 0;
  background: #fff; border-radius: 10px; padding: 12px 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.dash-summary-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ds-label { font-size: 12px; color: #94a3b8; }
.ds-value { font-size: 18px; font-weight: 700; color: #0f172a; }
.ds-green { color: #059669; }
.ds-blue { color: #2563eb; }
.ds-amber { color: #d97706; }
.ds-sub { font-size: 12px; color: #94a3b8; font-weight: 400; }
.dash-summary-divider { width: 1px; height: 28px; background: #e2e8f0; margin: 0 8px; }

/* 区块通用 */
.dash-section {
  background: #fff; border-radius: 12px; padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.dash-section-title {
  font-size: 15px; font-weight: 700; color: #1e293b;
  margin-bottom: 14px; display: flex; align-items: center; gap: 6px;
}
.dash-section-icon { font-size: 16px; }
.dash-section-sub { font-size: 12px; color: #94a3b8; font-weight: 400; margin-left: 8px; }

/* TOP5 工人卡片 */
.dash-top-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.dash-top-card {
  display: flex; align-items: center; gap: 10px;
  background: #f8fafc; border-radius: 10px; padding: 12px 14px;
  border: 1px solid #e2e8f0;
  transition: border-color 0.2s;
}
.dash-top-card.dash-rank-1 { background: #fffbeb; border-color: #fde68a; }
.dash-top-card.dash-rank-2 { background: #f0f9ff; border-color: #bae6fd; }
.dash-top-card.dash-rank-3 { background: #fff7ed; border-color: #fed7aa; }
.dash-top-rank { font-size: 18px; width: 24px; text-align: center; flex-shrink: 0; }
.dash-top-avatar {
  width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.dash-top-avatar-text {
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff;
  background: #64748b;
}
.dash-top-avatar-text.dash-rank-1 { background: #f59e0b; }
.dash-top-avatar-text.dash-rank-2 { background: #0ea5e9; }
.dash-top-avatar-text.dash-rank-3 { background: #f97316; }
.dash-top-info { flex: 1; min-width: 0; }
.dash-top-name { font-weight: 600; font-size: 14px; color: #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-top-earnings { font-size: 15px; font-weight: 700; color: #dc2626; margin-top: 1px; }
.dash-top-meta { font-size: 11px; color: #94a3b8; margin-top: 1px; }

/* 表格通用 */
.dash-table-wrap { overflow-x: auto; }
.dash-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.dash-table thead th {
  padding: 8px 12px; font-weight: 600; color: #64748b;
  border-bottom: 2px solid #e2e8f0; white-space: nowrap;
  background: transparent;
}
.dash-table tbody td { padding: 8px 12px; border-bottom: 1px solid #f1f5f9; color: #334155; }
.dash-table tbody tr:hover { background: #f8fafc; }
.dash-table tfoot td { padding: 8px 12px; border-top: 2px solid #e2e8f0; color: #334155; }
.dt-left { text-align: left; }
.dt-right { text-align: right; }
.dt-center { text-align: center; }
.dt-bold { font-weight: 600; color: #0f172a; }
.dt-green { color: #059669; }
.dt-blue { color: #2563eb; }
.dt-amber { color: #d97706; }
.dt-red { color: #dc2626; }
.dt-sub { font-size: 11px; color: #94a3b8; }
.dt-sub-line { font-size: 11px; color: #94a3b8; margin-top: 1px; }
.dt-empty { padding: 24px 12px; text-align: center; color: #94a3b8; }
.dt-avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; margin-right: 8px; vertical-align: middle; }
.dt-avatar-text { display: inline-flex; align-items: center; justify-content: center; font-size: 12px; color: #fff; background: #6366f1; }
.dt-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.dt-badge-good { background: #dcfce7; color: #15803d; }
.dt-badge-mid { background: #fef3c7; color: #92400e; }
.dt-badge-low { background: #fee2e2; color: #b91c1c; }

/* 完成率标签 */
.dash-rate { display: inline-block; min-width: 38px; padding: 2px 8px; border-radius: 6px; font-weight: 700; font-size: 12px; }
.dash-rate-good { background: #dcfce7; color: #059669; }
.dash-rate-mid { background: #fef3c7; color: #b45309; }
.dash-rate-low { background: #fee2e2; color: #dc2626; }

/* 发货 + 销售 并排 */
.dash-dual { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* 费用小卡片 */
.dash-cost-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.dash-cost-card {
  background: #f8fafc; border-radius: 10px; padding: 12px 16px;
  border: 1px solid #e2e8f0; text-align: center;
}
.dcc-label { font-size: 12px; color: #64748b; }
.dcc-value { font-size: 20px; font-weight: 700; margin-top: 2px; color: #0f172a; }
.dcc-green { border-color: #bbf7d0; background: #f0fdf4; }
.dcc-green .dcc-value { color: #059669; }
.dcc-red { border-color: #fecaca; background: #fef2f2; }
.dcc-red .dcc-value { color: #dc2626; }
.dcc-blue { border-color: #bfdbfe; background: #eff6ff; }
.dcc-blue .dcc-value { color: #2563eb; }
.dcc-violet { border-color: #ddd6fe; background: #f5f3ff; }
.dcc-violet .dcc-value { color: #7c3aed; }

/* 响应式 */
@media (max-width: 1200px) {
  .dash-kpi-row { grid-template-columns: repeat(3, 1fr); }
  .dash-top-row { grid-template-columns: repeat(3, 1fr); }
  .dash-cost-cards { grid-template-columns: repeat(4, 1fr); }
  .dash-dual { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .dash-kpi-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .dash-kpi-value { font-size: 22px; }
  .dash-top-row { grid-template-columns: 1fr; }
  .dash-summary-row { flex-wrap: wrap; gap: 8px; }
  .dash-summary-divider { display: none; }
  .dash-summary-item { flex: 1 1 30%; }
  .dash-cost-cards { grid-template-columns: repeat(2, 1fr); }
  .dash-section { padding: 14px 16px; }
}

/* ===== 超级管理员面板 ===== */
.sa-layout {
  min-height: 100vh;
  background: #f0f4f8;
}
.sa-header {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4c1d95 100%);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  box-shadow: 0 2px 12px rgba(30, 27, 75, 0.3);
  position: sticky;
  top: 0;
  z-index: 100;
}
.sa-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sa-back-btn {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}
.sa-back-btn:hover { background: rgba(255,255,255,0.2); }
.sa-header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sa-header-title {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}
.sa-header-sub {
  color: rgba(255,255,255,0.6);
  font-size: 12px;
}
.sa-header-right {
  display: flex;
  align-items: center;
  gap: 4px;
}
.sa-tab-btn {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.6);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
}
.sa-tab-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.sa-tab-btn.sa-tab-active {
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-weight: 600;
}
.sa-logout-btn {
  background: rgba(239,68,68,0.2);
  border: 1px solid rgba(239,68,68,0.3);
  color: #fca5a5;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  margin-left: 8px;
  transition: all 0.2s;
}
.sa-logout-btn:hover { background: rgba(239,68,68,0.3); color: #fff; }
.sa-content {
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
}
.sa-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.sa-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
@media (max-width: 768px) {
  .sa-header { padding: 0 12px; height: auto; flex-direction: column; padding: 8px 12px; gap: 8px; }
  .sa-header-right { flex-wrap: wrap; justify-content: center; }
  .sa-tab-btn { padding: 6px 10px; font-size: 12px; }
  .sa-stats-row { grid-template-columns: repeat(2, 1fr); }
}

/* select 下拉框自定义箭头（弥补 appearance:none） */
select.input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23999' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

/* ===== 老板驾驶舱 ===== */
.boss-page {
  padding: 4px 0 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.boss-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.boss-kpi {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #ddd;
  transition: box-shadow 0.2s, transform 0.2s;
}
.boss-kpi:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}
.boss-kpi-gold { border-left-color: #f59e0b; }
.boss-kpi-green { border-left-color: #16a34a; }
.boss-kpi-blue { border-left-color: #2563eb; }
.boss-kpi-violet { border-left-color: #7c3aed; }
.boss-kpi-icon {
  font-size: 28px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #f8fafc;
  flex-shrink: 0;
}
.boss-kpi-gold .boss-kpi-icon { background: #fef3c7; }
.boss-kpi-green .boss-kpi-icon { background: #dcfce7; }
.boss-kpi-blue .boss-kpi-icon { background: #dbeafe; }
.boss-kpi-violet .boss-kpi-icon { background: #ede9fe; }
.boss-kpi-body { flex: 1; min-width: 0; }
.boss-kpi-label {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 2px;
}
.boss-kpi-value {
  font-size: 28px;
  font-weight: 800;
  color: #1e293b;
  line-height: 1.2;
  letter-spacing: -0.5px;
}
.boss-kpi-unit {
  font-size: 14px;
  font-weight: 500;
  color: #94a3b8;
  margin-left: 2px;
}
.boss-kpi-sub {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== Section 通用 ===== */
.boss-section {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px 22px;
}
.boss-section-title {
  font-size: 20px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.boss-section-icon { font-size: 22px; }

/* ====== 产能排行（n284 大字 + 头像 + 前三名突出） ====== */
.boss-rank-section {
  background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%);
  border-radius: 18px;
  padding: 22px 24px 26px;
  border: 2px solid #fde68a;
  box-shadow: 0 4px 18px rgba(251, 191, 36, 0.15);
  margin-bottom: 24px;
}
.boss-rank-title {
  font-size: 32px !important;       /* 比默认 20 大 60% */
  font-weight: 800 !important;
  line-height: 1.5 !important;     /* 行高加大 */
  color: #78350f !important;
  margin-bottom: 20px !important;
  letter-spacing: 0.5px;
  padding-bottom: 14px;
  border-bottom: 3px double #fcd34d;
}
.boss-rank-title .boss-section-icon {
  font-size: 38px;
  filter: drop-shadow(0 2px 4px rgba(251, 191, 36, 0.4));
}
.boss-rank-subtitle {
  margin-left: auto;
  font-size: 13px;
  font-weight: 500;
  color: #92400e;
  background: #fff;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid #fde68a;
}
.boss-rank-wrap {
  background: #fff;
  border-radius: 14px;
  padding: 6px;
  border: 1px solid #fde68a;
}
.boss-rank-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}
.boss-rank-table th {
  font-size: 14px;
  padding: 14px 12px;
  background: #fef3c7;
  color: #78350f;
  border-bottom: 2px solid #fde68a;
}
.boss-rank-table td {
  padding: 16px 12px;
  font-size: 16px;
  border-bottom: 1px solid #fef3c7;
}
.boss-rank-table tbody tr:last-child td { border-bottom: none; }
.boss-rank-medal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  box-shadow: 0 3px 8px rgba(0,0,0,0.15), inset 0 -3px 6px rgba(0,0,0,0.1);
}
.boss-rank-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f1f5f9;
  color: #475569;
  font-size: 15px;
  font-weight: 700;
}
.boss-rank-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  flex-shrink: 0;
}
.boss-rank-avatar-fb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  flex-shrink: 0;
}
.boss-rank-name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
}
.boss-rank-name-text { font-weight: 700; color: #0f172a; }
.boss-rank-trophy { font-size: 18px; margin-left: 4px; }

/* 前三名行背景色 + 月产值字号 */
.boss-rank-table tr.boss-podium-1 {
  background: linear-gradient(90deg, #fef3c7 0%, #fffbeb 100%) !important;
  font-weight: 700;
}
.boss-rank-table tr.boss-podium-1 td { font-size: 18px; }
.boss-rank-table tr.boss-podium-1 .bt-blue { font-size: 22px !important; }
.boss-rank-table tr.boss-podium-1 .boss-rank-avatar,
.boss-rank-table tr.boss-podium-1 .boss-rank-avatar-fb {
  width: 48px; height: 48px; font-size: 20px;
  border: 3px solid #fbbf24;
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.35);
}

.boss-rank-table tr.boss-podium-2 {
  background: linear-gradient(90deg, #f1f5f9 0%, #f8fafc 100%) !important;
}
.boss-rank-table tr.boss-podium-2 td { font-weight: 600; }

.boss-rank-table tr.boss-podium-3 {
  background: linear-gradient(90deg, #fed7aa 0%, #ffedd5 100%) !important;
}

.boss-rank-table tbody tr:hover { background: #fef9c3 !important; }
/* 覆盖原 :hover，与前程行样式优先级 PK 一下 */
.boss-ai-count {
  font-size: 12px;
  color: #64748b;
  font-weight: 400;
  margin-left: auto;
}
.boss-half { flex: 1; min-width: 0; }
.boss-dual {
  display: grid;
  gap: 14px;
  align-items: stretch;
}
.boss-dual-21 { grid-template-columns: 2fr 1fr; }
.boss-dual-13 { grid-template-columns: 1fr 3fr; }
.boss-dual-cell { min-width: 0; display: flex; flex-direction: column; }
.boss-dual-cell > .boss-section { flex: 1; }
.boss-empty {
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
  padding: 24px 0;
}

/* ===== 趋势图 ===== */
.boss-trend-chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 160px;
  padding-top: 10px;
}
.boss-trend-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
}
.boss-trend-bar {
  width: 100%;
  max-width: 64px;
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  border-radius: 6px 6px 0 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 6px;
  transition: height 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 16px;
  position: relative;
}
.boss-trend-bar:hover {
  background: linear-gradient(180deg, #60a5fa 0%, #3b82f6 100%);
}
.boss-trend-val {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0,0,0,0.18);
  letter-spacing: -0.5px;
}
.boss-trend-date {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
}

/* ===== 原料列表 ===== */
.boss-mat-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.boss-mat-item {
  padding: 4px 0;
}
.boss-mat-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}
.boss-mat-name {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 55%;
  flex-shrink: 1;
}
.boss-mat-qty {
  font-size: 14px;
  color: #475569;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: 8px;
}
.boss-mat-qty b {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  margin-right: 1px;
}
.boss-mat-qty-sep {
  color: #cbd5e1;
  margin: 0 2px;
  font-weight: 400;
}
.boss-mat-bar {
  height: 8px;
  background: #f1f5f9;
  border-radius: 4px;
  overflow: hidden;
}
.boss-mat-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}
.boss-mat-meta {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 3px;
}

/* ===== 客户列表 ===== */
.boss-cust-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.boss-cust-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.boss-cust-rank {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  background: #f1f5f9;
  color: #64748b;
}
.boss-cust-rank.rank-1 { background: #fef3c7; color: #92400e; }
.boss-cust-rank.rank-2 { background: #e2e8f0; color: #475569; }
.boss-cust-rank.rank-3 { background: #fed7aa; color: #9a3412; }
.boss-cust-info { flex: 1; min-width: 0; }
.boss-cust-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}
.boss-cust-name {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.boss-cust-pct {
  font-size: 14px;
  font-weight: 800;
  color: #2563eb;
}
.boss-cust-bar {
  height: 8px;
  background: #f1f5f9;
  border-radius: 4px;
  overflow: hidden;
}
.boss-cust-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #2563eb);
  border-radius: 4px;
  transition: width 0.5s ease;
}
.boss-cust-meta {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 3px;
}

/* ===== 表格 ===== */
.boss-table-wrap {
  overflow-x: auto;
}
.boss-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 18px;
}
.boss-table th {
  padding: 14px 12px;
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  background: #2563eb;
  border-bottom: none;
  white-space: nowrap;
}
.boss-table td {
  padding: 16px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  font-weight: 500;
}
.boss-table tbody tr:hover {
  background: #eff6ff;
}
.bt-left { text-align: left; }
.bt-right { text-align: right; }
.bt-center { text-align: center; }
.bt-bold { font-weight: 700; }
.bt-green { color: #16a34a; font-weight: 700; font-size: 18px; }
.bt-blue { color: #1d4ed8; font-weight: 700; font-size: 18px; }
.bt-empty { text-align: center; color: #94a3b8; padding: 30px 0; font-size: 16px; }
.boss-rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 18px;
  font-weight: 800;
  background: #f1f5f9;
  color: #475569;
}
.boss-rank-badge.boss-rank-1 { background: #fbbf24; color: #ffffff; }
.boss-rank-badge.boss-rank-2 { background: #94a3b8; color: #ffffff; }
.boss-rank-badge.boss-rank-3 { background: #f97316; color: #ffffff; }

/* ===== AI 分析 ===== */
.boss-ai-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
/* n286：AI 经营分析区最显眼样式 — 暖色渐变 + 阴影 + 大标题 */
.boss-ai-section {
  background: linear-gradient(135deg, #fef9f3 0%, #fef3e8 100%);
  border: 2px solid #f59e0b;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.15);
  border-radius: 14px;
}
.boss-ai-section-title {
  font-size: 26px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  margin-bottom: 16px !important;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  line-height: 1.4;
}
.boss-ai-section-icon {
  font-size: 36px !important;
  filter: drop-shadow(0 2px 4px rgba(245, 158, 11, 0.4));
}
.boss-ai-section-label {
  font-size: 26px;
  font-weight: 800;
  color: #0f172a;
}
.boss-ai-section-badge {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  padding: 5px 14px;
  border-radius: 20px;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
}
.boss-ai-pill {
  font-size: 13px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 16px;
  border: 1px solid transparent;
}
.boss-ai-pill-red {
  color: #991b1b;
  background: #fee2e2;
  border-color: #fca5a5;
}
.boss-ai-pill-orange {
  color: #92400e;
  background: #fef3c7;
  border-color: #fcd34d;
}
.boss-ai-pill-green {
  color: #166534;
  background: #dcfce7;
  border-color: #86efac;
}
.boss-ai-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 16px !important;
  line-height: 1.6;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.boss-ai-item:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.boss-ai-red {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border-left: 5px solid #dc2626;
}
.boss-ai-orange {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-left: 5px solid #f59e0b;
}
.boss-ai-green {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-left: 5px solid #16a34a;
}
.boss-ai-icon {
  flex-shrink: 0;
  font-size: 22px !important;
  margin-top: 2px;
}
.boss-ai-cat {
  flex-shrink: 0;
  font-size: 14px !important;
  font-weight: 700;
  color: #475569;
  background: #fff;
  padding: 3px 10px;
  border-radius: 5px;
  border: 1px solid #cbd5e1;
  margin-top: 2px;
}
.boss-ai-text {
  flex: 1;
  color: #1e293b;
  font-size: 16px !important;
  font-weight: 500;
}

/* ===== 响应式 ===== */
@media (max-width: 1200px) {
  .boss-kpi-row { grid-template-columns: repeat(2, 1fr); }
  .boss-dual { flex-direction: column; }
}
@media (max-width: 640px) {
  .boss-kpi-row { grid-template-columns: 1fr; }
  .boss-kpi-value { font-size: 22px; }
  .boss-trend-chart { height: 140px; }
  .boss-trend-val { font-size: 12px; font-weight: 800; }
  .boss-trend-date { font-size: 12px; font-weight: 600; }
}

/* ============================================================
 * 老年版（50+ 女性）专属样式
 * 依赖 core.js 在 body 上挂 xl-text / hc-mode class
 * ============================================================ */

/* ===== 二次确认弹窗（底部抽屉式，大按钮） ===== */
.elderly-overlay {
  position: fixed;
  /* n689: 老 WebView（Android 7.0 / Chrome 51 era）不识别 inset 简写， */
  /* 导致 position:fixed + align-items:flex-end 的 flex 撑不开、弹窗被甩回左上角被 tabbar 遮住。 */
  /* 拆成四个方向 + 显式 width/height 兜底，新 WebView 多余、不会出问题。 */
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100%;
  height: 100%;
  z-index: 20000;
  /* n693: 彻底废弃 opacity/rgba 组合 —— 老 WebView 不识别 rgba(...,0.5) 解析失败变 transparent， */
  /* 而 opacity 又是整层向下传递的属性，会把 .elderly-confirm 也变成 0.55 半透明， */
  /* 下面的「设置/数量/切换」按钮全透上来叠加，造成"弹窗半透+按钮挤一坨"的视觉。 */
  /* 改方案：display:none ↔ .show{display:flex} 硬切换，遮罩用独立 .elderly-mask solid #0f172a， */
  /* 新老 WebView 一视同仁，最稳。 */
  display: none;
  align-items: flex-end;
  justify-content: center;
}
/* n693: 独立遮罩层，solid 颜色，老 WebView 也能解析（不再依赖 rgba/hex8） */
.elderly-overlay .elderly-mask {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100%;
  height: 100%;
  background-color: #0f172a;
}
.elderly-overlay.show {
  display: flex;
}
.elderly-confirm {
  /* n689: 老 WebView flex-end 兜底时仍可能跑飞，给个 margin:auto 兜底垂直水平居中；
     现代 WebView 上 margin:auto 在 align-items:flex-end 容器里优先级低于 flex-align，
     但浮在最上层就能盖住 flex 错位，不影响新设备。 */
  margin: auto;
  width: 100%;
  /* n685: max-width 跟随设备宽度让平板足够宽；最小也要全屏铺得下 */
  max-width: 720px;
  /* n693: 必须 relative + z-index:1 浮在 .elderly-mask 之上，避免被遮罩盖住。
     同时去掉 !important 的 !important 链，改用直接 specificity 即可。 */
  position: relative;
  z-index: 1;
  background-color: #ffffff;
  border-radius: 20px 20px 0 0;
  padding: 0 20px 0;
  box-shadow: 0 -2px 0 #e2e8f0;
  /* n685: 用 ease-out 替代 cubic-bezier，老 WebView 对后者解析经常异常 */
  transform: translateY(100%);
  -webkit-transform: translateY(100%);
  transition: transform 0.25s ease-out;
  -webkit-transition: -webkit-transform 0.25s ease-out;
  display: flex; flex-direction: column;
  max-height: 85vh;
  -webkit-overflow-scrolling: touch;
}
.elderly-overlay.show .elderly-confirm {
  transform: translateY(0);
  -webkit-transform: translateY(0);
}
.elderly-confirm .ec-body {
  padding: 28px 20px 4px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}
.elderly-confirm .ec-title {
  font-size: 22px; font-weight: 800; color: #1e293b; text-align: center;
  /* n694: 标题与消息拉开距离，老平板大字模式下不再贴一起 */
  margin-bottom: 18px;
}
.elderly-confirm .ec-msg {
  font-size: 17px; color: #475569; text-align: center; margin-top: 14px; line-height: 1.6;
  /* n685: 消息含 \n 必须用 pre-line 才真正换行；长字段/产品名 break-word 防止溢出截断 */
  white-space: pre-line;
  word-break: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
  padding: 0 6px;
  box-sizing: border-box;
}
.elderly-confirm .ec-actions {
  /* n693: 老 WebView 不识别 flex gap，"取消"和"切换"贴在一起。改用普通 margin。 */
  /* n694: 加大上下 padding，按钮离消息更远、弹窗底部留白，整体不挤。 */
  display: flex;
  padding: 28px 20px 30px;
  flex-shrink: 0;
}
.elderly-confirm .ec-actions > .ec-btn:not(:last-child) { margin-right: 12px; }
.elderly-confirm .ec-btn {
  /* n693: 即使两个按钮 .ec-cancel/.ec-confirm flex:1，单边 margin-right 也只缩第二个 12px。
     视觉上一致的 12px 间距用 :not(:last-child) 即可。 */
  flex: 1; padding: 16px 0; border: none; border-radius: 14px;
  font-size: 19px; font-weight: 700; cursor: pointer;
}
.elderly-confirm .ec-cancel { background: #f1f5f9; color: #475569; }
.elderly-confirm .ec-confirm { background: linear-gradient(135deg,#2563eb,#1d4ed8); color: #fff; }
.elderly-confirm.danger .ec-confirm { background: linear-gradient(135deg,#ef4444,#b91c1c); }
.elderly-confirm .ec-btn:active { transform: scale(0.97); }

/* ===== 计件数字闪绿放大反馈 ===== */
.count-number.flash-green {
  animation: flashGreen 0.5s ease;
  color: #16a34a !important;
}
@keyframes flashGreen {
  0%   { transform: scale(1.25); color: #16a34a; }
  60%  { transform: scale(1.1);  color: #16a34a; }
  100% { transform: scale(1);    color: #1e293b; }
}

/* ===== 大字模式（.xl-text 挂在 body） ===== */
body.xl-text { font-size: 19px; line-height: 1.55; }
body.xl-text .wha-text { font-size: 23px; }
body.xl-text .wha-hint { font-size: 17px; }
body.xl-text .tab-label { font-size: 18px; }
body.xl-text .count-number { font-size: 80px !important; }
body.xl-text .counter-set .input { font-size: 30px; width: 148px; }
body.xl-text .counter-set-label { font-size: 20px; }
body.xl-text .count-label { font-size: 19px; }
body.xl-text .counter-earnings { font-size: 32px; }
body.xl-text .detail-product { font-size: 20px !important; }
body.xl-text .detail-process { font-size: 17px !important; }
body.xl-text .detail-qty { font-size: 26px !important; }
body.xl-text .stat-value { font-size: 30px; }
body.xl-text .history-day-title { font-size: 21px; }
body.xl-text .history-day-total { font-size: 25px; }
body.xl-text .income-card-amount { font-size: 32px; }
body.xl-text .profile-item-text { font-size: 20px; }
body.xl-text .section-title { font-size: 20px; }

/* ===== 高对比模式（.hc-mode 挂在 body，纯黑底白字/黄绿强调） ===== */
body.hc-mode { background: #000 !important; }
body.hc-mode, body.hc-mode * { color: #fff !important; }
body.hc-mode .layout, body.hc-mode .content, body.hc-mode .card,
body.hc-mode .count-page, body.hc-mode .counter-section, body.hc-mode .product-info-card,
body.hc-mode .income-card, body.hc-mode .profile-group, body.hc-mode .profile-item,
body.hc-mode .stat-card, body.hc-mode .detail-item, body.hc-mode .wha-btn,
body.hc-mode .tabbar, body.hc-mode .modal, body.hc-mode .elderly-confirm,
body.hc-mode .count-total-wage, body.hc-mode .history-day-card, body.hc-mode .ord-row,
body.hc-mode .ord-list, body.hc-mode .face-enroll-card, body.hc-mode .worker-home-header {
  background: #000 !important; border-color: #fff !important; box-shadow: none !important;
}
body.hc-mode .tabbar { border-top: 3px solid #fff !important; }
body.hc-mode .wha-btn { border: 3px solid #fff !important; }
body.hc-mode .wha-btn .wha-text { color: #ffeb3b !important; }
body.hc-mode .wha-btn .wha-hint { color: #fff !important; opacity: 1 !important; }
body.hc-mode .tabbar-item { color: #fff !important; }
body.hc-mode .tabbar-item.active { color: #ffeb3b !important; }
body.hc-mode a, body.hc-mode .link { color: #4fc3f7 !important; }
body.hc-mode input, body.hc-mode .input, body.hc-mode .select, body.hc-mode textarea {
  background: #000 !important; color: #fff !important; border: 2px solid #fff !important;
}
body.hc-mode .counter-btn.plus { background: #000 !important; border: 3px solid #00e676 !important; color: #00e676 !important; }
body.hc-mode .counter-btn-sm.minus { background: #000 !important; border: 3px solid #ff1744 !important; color: #ff1744 !important; }
body.hc-mode .counter-btn:disabled, body.hc-mode .counter-btn-sm:disabled { opacity: 0.4 !important; }
body.hc-mode .count-number { color: #fff !important; }
body.hc-mode .counter-earnings { color: #00e676 !important; }
body.hc-mode .elderly-confirm .ec-title, body.hc-mode .elderly-confirm .ec-msg { color: #fff !important; }
body.hc-mode .elderly-confirm .ec-cancel { background: #000 !important; color: #fff !important; border: 2px solid #fff !important; }
body.hc-mode .profile-logout-btn { background: #000 !important; color: #fff !important; border: 2px solid #fff !important; }
body.hc-mode .profile-logout-btn:active { background: #333 !important; }
body.hc-mode .profile-item-arrow { color: #fff !important; opacity: 1 !important; }

/* ============================================================
   tier-dashboard.js — 阶梯激励看板样式 (n526)
   ============================================================ */

.tier-dashboard-page { display: flex; flex-direction: column; gap: 16px; padding: 4px 0; }

/* Tabs */
.tier-dashboard-tabs { display: flex; gap: 4px; background: #f1f5f9; border-radius: 12px; padding: 4px; }
.tier-dashboard-tabs .tab {
  flex: 1; text-align: center; padding: 10px 12px; border-radius: 10px;
  font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.15s;
  color: #64748b; user-select: none;
}
.tier-dashboard-tabs .tab.active { background: #fff; color: #0f172a; box-shadow: 0 2px 6px rgba(0,0,0,0.06); }

/* Summary cards row */
.tier-summary-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.tier-summary-card {
  background: #fff; border-radius: 12px; padding: 16px; display: flex; align-items: center; gap: 12px;
  box-shadow: var(--card-shadow); border: 1px solid var(--card-border);
}
.tier-sc-icon { font-size: 28px; line-height: 1; }
.tier-sc-body { flex: 1; min-width: 0; }
.tier-sc-label { font-size: 13px; color: #64748b; margin-bottom: 4px; }
.tier-sc-value { font-size: 20px; font-weight: 800; color: #0f172a; }
.tier-sc-primary .tier-sc-value { color: #2563eb; }
.tier-sc-success .tier-sc-value { color: #16a34a; }
.tier-sc-warning .tier-sc-value { color: #d97706; }
.tier-sc-purple .tier-sc-value { color: #7c3aed; }
.tier-sc-total { background: linear-gradient(135deg, #f0fdf4, #ecfeff); border-color: #86efac; }
.tier-sc-total .tier-sc-value { color: #059669; }

/* Period bar */
.tier-period-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 16px; background: #f8fafc; border-radius: 8px; font-size: 13px; color: #64748b;
}
.tier-updated { font-size: 11px; color: #94a3b8; }

/* Pie chart card */
.tier-pie-card { background: #fff; border-radius: 12px; padding: 20px; box-shadow: var(--card-shadow); border: 1px solid var(--card-border); }
.tier-pie-container { display: flex; align-items: center; gap: 24px; margin-top: 12px; }
.tier-pie-svg { width: 180px; height: 180px; flex-shrink: 0; }
.tier-pie-center-total { font-size: 24px; font-weight: 800; fill: #0f172a; }
.tier-pie-center-label { font-size: 11px; fill: #94a3b8; }
.tier-pie-legend { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.tier-pie-legend-item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.tier-pie-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.tier-pie-name { font-weight: 600; color: #334155; min-width: 60px; }
.tier-pie-count { color: #64748b; }
.tier-pie-pct { margin-left: auto; font-weight: 700; color: #0f172a; }

/* Empty state */
.tier-empty { text-align: center; padding: 32px 16px; color: #94a3b8; font-size: 14px; }

/* Rank list */
.tier-rank-card { background: #fff; border-radius: 12px; padding: 20px; box-shadow: var(--card-shadow); border: 1px solid var(--card-border); }
.tier-rank-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.tier-rank-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: #f8fafc; border-radius: 10px; transition: background 0.15s;
}
.tier-rank-item:hover { background: #f1f5f9; }
.tier-rank-num { width: 28px; text-align: center; font-size: 16px; font-weight: 800; color: #94a3b8; flex-shrink: 0; }
.tier-rank-avatar {
  width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff; font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.tier-rank-info { flex: 1; min-width: 0; }
.tier-rank-name { font-size: 14px; font-weight: 600; color: #1e293b; margin-bottom: 4px; }
.tier-rank-bar-wrap { height: 6px; background: #e2e8f0; border-radius: 3px; overflow: hidden; }
.tier-rank-bar { height: 100%; border-radius: 3px; background: linear-gradient(90deg, #3b82f6, #8b5cf6); transition: width 0.4s ease; }
.tier-rank-stats { text-align: right; flex-shrink: 0; }
.tier-rank-qty { font-size: 15px; font-weight: 700; color: #0f172a; }
.tier-unit { font-size: 11px; color: #94a3b8; font-weight: 400; }
.tier-rank-earnings { font-size: 12px; color: #64748b; }
.tier-chip {
  padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; flex-shrink: 0;
}
.tier-chip-info { background: #dbeafe; color: #1d4ed8; }
.tier-chip-warning { background: #fef3c7; color: #d97706; }
.tier-chip-success { background: #dcfce7; color: #15803d; }
.tier-chip-purple { background: #f3e8ff; color: #7c3aed; }

/* Team bar chart */
.tier-team-card { background: #fff; border-radius: 12px; padding: 20px; box-shadow: var(--card-shadow); border: 1px solid var(--card-border); }
.tier-team-chart {
  display: flex; align-items: flex-end; gap: 16px; height: 160px;
  padding: 16px 8px 0; margin-top: 12px; border-bottom: 2px solid #e2e8f0;
}
.tier-team-col { display: flex; flex-direction: column; align-items: center; flex: 1; min-width: 0; position: relative; }
.tier-team-tooltip {
  position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
  background: #1e293b; color: #fff; padding: 8px 12px; border-radius: 8px; font-size: 12px;
  white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 0.15s; z-index: 10;
}
.tier-team-col:hover .tier-team-tooltip { opacity: 1; }
.tier-team-bar-group { display: flex; flex-direction: column; gap: 2px; align-items: center; width: 100%; }
.tier-team-bar-tier { width: 28px; border-radius: 4px 4px 0 0; transition: height 0.4s ease; min-height: 4px; }
.tier-team-bar-earn { width: 28px; border-radius: 0 0 4px 4px; transition: height 0.4s ease; min-height: 4px; }
.tier-team-label { font-size: 12px; font-weight: 600; color: #334155; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tier-team-meta { display: flex; gap: 8px; font-size: 11px; color: #64748b; margin-top: 2px; }
.tier-legend-inline { display: flex; align-items: center; gap: 8px; margin-left: auto; font-size: 12px; color: #64748b; }
.tier-legend-swatch { width: 12px; height: 8px; border-radius: 2px; display: inline-block; }
.tier-legend-swatch-qty { background: #3b82f6; }
.tier-legend-swatch-earn { background: #3b82f688; }
.tier-team-note { text-align: center; font-size: 12px; color: #94a3b8; margin-top: 8px; }

/* PK Tab styles */
.pk-ranking-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.pk-ranking-item {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: #f8fafc; border-radius: 12px; border-left: 4px solid transparent;
  transition: all 0.15s;
}
.pk-ranking-item:hover { background: #f1f5f9; }
.pk-rank-badge {
  width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px; flex-shrink: 0;
}
.pk-ranking-info { flex: 1; min-width: 0; }
.pk-ranking-name { font-size: 15px; font-weight: 700; color: #0f172a; margin-bottom: 4px; }
.pk-ranking-stats { display: flex; gap: 12px; font-size: 12px; color: #64748b; flex-wrap: wrap; }
.pk-ranking-score { text-align: right; flex-shrink: 0; min-width: 70px; }
.pk-score-value { font-size: 18px; font-weight: 800; color: #0f172a; }
.pk-score-bar { height: 4px; border-radius: 2px; margin-top: 4px; transition: width 0.4s; }
.pk-chart-container {
  display: flex; align-items: flex-end; gap: 12px; height: 180px;
  padding: 16px 8px 0; margin-top: 12px;
}
.pk-chart-col { display: flex; flex-direction: column; align-items: center; flex: 1; }
.pk-chart-value { font-size: 13px; font-weight: 700; color: #334155; margin-bottom: 4px; }
.pk-chart-bar { width: 36px; border-radius: 6px 6px 0 0; transition: height 0.4s; min-height: 8px; position: relative; }
.pk-chart-medal { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 14px; }
.pk-chart-label { font-size: 12px; font-weight: 600; color: #64748b; margin-top: 6px; }

/* Year-end tab styles */
.yr-config-list { display: flex; flex-wrap: wrap; gap: 10px; padding: 8px 0; }
.yr-config-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 14px;
  background: #f8fafc; border-radius: 8px; font-size: 14px;
}
.yr-config-years { font-weight: 700; color: #7c3aed; }
.yr-config-amount { font-weight: 800; color: #059669; }
.yr-config-desc { color: #64748b; font-size: 13px; }
.yr-action-bar { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.yr-status { font-size: 13px; margin-left: auto; }
.yr-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.yr-table th { background: #f1f5f9; padding: 10px 12px; text-align: left; font-weight: 600; color: #334155; font-size: 12px; }
.yr-table td { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; }
.yr-worker-cell { display: flex; align-items: center; gap: 8px; }
.yr-avatar {
  width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff; font-weight: 700; font-size: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .tier-summary-row { grid-template-columns: repeat(2, 1fr); }
  .tier-sc-total { grid-column: span 2; }
  .tier-pie-container { flex-direction: column; }
  .tier-pie-svg { width: 140px; height: 140px; }
  .pk-ranking-item { flex-wrap: wrap; }
  .tier-team-chart { height: 120px; }
}

/* ===== 2026-09-08 学徒练习模式（worker 端）===== */
.practice-bar { display: -webkit-flex; display: flex; align-items: center; justify-content: space-between; background: linear-gradient(135deg, #059669, #10b981); border-radius: 10px; padding: 8px 14px; margin: 0 0 8px; color: #fff; cursor: pointer; }
.practice-bar .pb-title { font-size: 15px; font-weight: 800; }
.practice-bar .pb-sub { font-size: 12px; font-weight: 600; opacity: .95; }
.practice-bar .pb-go { font-size: 18px; font-weight: 800; margin-left: 8px; }
.practice-tip { color: #92400e; font-size: 12.5px; line-height: 1.6; text-align: center; background: #fef3c7; border-radius: 8px; padding: 6px 8px; margin: 0 0 10px; }
.practice-procs { display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap; margin: 0 0 12px; }
.practice-chip { display: inline-block; border: 1.5px solid var(--primary); color: var(--primary); border-radius: 16px; padding: 6px 12px; margin: 0 8px 8px 0; font-size: 13px; font-weight: 700; background: #fff; }
.practice-chip.active { background: var(--primary); color: #fff; }
.practice-chip em { display: block; font-style: normal; font-size: 11px; font-weight: 600; opacity: .85; margin-top: 1px; }
.practice-row { display: -webkit-flex; display: flex; align-items: center; justify-content: space-between; }
.practice-big { -webkit-flex: 1; flex: 1; background: linear-gradient(135deg, #059669, #10b981); color: #fff; border: none; border-radius: 14px; font-size: 20px; font-weight: 800; padding: 16px 12px; box-shadow: 0 2px 8px rgba(5,150,105,.25); }
.practice-big:disabled { opacity: .6; }
.practice-today { text-align: center; font-size: 12px; color: #6b7280; line-height: 1.5; background: #f3f4f6; border-radius: 12px; padding: 10px 14px; margin-left: 10px; min-width: 74px; }
.practice-today b { font-size: 20px; color: #059669; }
.practice-modal .ec-body { padding-bottom: 6px; }

/* ===== 2026-09-08 学徒学习监测页（管理端）===== */
.tl-head { margin-bottom: 14px; }
.tl-head-title { font-size: 18px; font-weight: 800; color: var(--gray-800); margin-bottom: 10px; }
.tl-refresh { font-size: 12px; font-weight: 600; color: var(--primary); cursor: pointer; margin-left: 8px; text-decoration: underline; }
.tl-head-stats { display: -webkit-flex; display: flex; }
.tl-stat { -webkit-flex: 1; flex: 1; background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 10px 14px; margin-right: 10px; display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; }
.tl-stat:last-child { margin-right: 0; }
.tl-stat b { font-size: 24px; color: var(--primary); margin-right: 8px; }
.tl-stat span { font-size: 13px; color: #6b7280; font-weight: 600; }
.tl-card-head { display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; margin-bottom: 12px; }
.tl-avatar { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; background: #eef2ff; color: var(--primary); display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; -webkit-justify-content: center; justify-content: center; font-size: 20px; font-weight: 800; margin-right: 12px; }
.tl-who { -webkit-flex: 1; flex: 1; min-width: 0; }
.tl-name { font-size: 16px; font-weight: 800; color: var(--gray-800); display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; -webkit-flex-wrap: wrap; flex-wrap: wrap; }
.tl-meta { font-size: 12.5px; color: #6b7280; margin-top: 3px; }
.tl-actions { margin-left: 10px; white-space: nowrap; }
.tl-badge { display: inline-block; font-size: 11px; font-weight: 700; border-radius: 10px; padding: 2px 8px; margin-left: 8px; vertical-align: middle; }
.tl-badge-green { background: #d1fae5; color: #047857; }
.tl-badge-orange { background: #fef3c7; color: #b45309; }
.tl-badge-gray { background: #e5e7eb; color: #4b5563; }
.tl-badge-blue { background: #dbeafe; color: #1d4ed8; }
.tl-grid { border-top: 1px solid #f3f4f6; padding-top: 10px; display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap; }
.tl-cell { -webkit-flex: 2; flex: 2; min-width: 240px; padding: 6px 14px 6px 0; }
.tl-cell-num { -webkit-flex: 1; flex: 1; min-width: 150px; }
.tl-cell-label { font-size: 11.5px; color: #9ca3af; font-weight: 700; text-transform: uppercase; margin-bottom: 4px; }
.tl-cur { font-size: 14px; color: var(--gray-800); line-height: 1.5; }
.tl-cur-sub { font-size: 12px; color: #6b7280; margin-top: 2px; }
.tl-nums span { display: block; font-size: 12.5px; color: #6b7280; line-height: 1.7; }
.tl-nums b { font-size: 15px; color: var(--gray-800); margin-right: 3px; }
.tl-dist { font-size: 12px; line-height: 2; }
.tl-7chip { display: inline-block; background: #f3f4f6; color: #374151; border-radius: 10px; padding: 1px 8px; margin-right: 6px; font-weight: 600; }
@media (max-width: 720px) { .tl-cell { min-width: 100%; } }
