/* ===== 基础与变量 ===== */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --bg: #edf1f7;
  --card: #ffffff;
  --text: #1e293b;
  --text-secondary: #64748b;
  --border: #e2e8f0;
  --sidebar-bg: #0d1730;
  --sidebar-text: #94a3b8;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --info: #0891b2;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 4px 14px rgba(15, 23, 42, .06);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, .14);
  /* 企业级背景层次：两束柔和品牌光晕 + 细网格纹理 */
  --bg-wash-blue: rgba(37, 99, 235, .07);
  --bg-wash-cyan: rgba(8, 145, 178, .055);
  --bg-grid-line: rgba(15, 23, 42, .028);
}

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

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 560px at 88% -8%, var(--bg-wash-blue), transparent 62%),
    radial-gradient(900px 520px at -8% 14%, var(--bg-wash-cyan), transparent 58%),
    linear-gradient(var(--bg-grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid-line) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 34px 34px, 34px 34px;
  background-attachment: fixed;
}

.app { display: flex; min-height: 100vh; }

/* ===== 侧边栏 ===== */
.sidebar {
  width: 230px;
  background:
    radial-gradient(560px 280px at 50% -6%, rgba(37, 99, 235, .28), transparent 62%),
    radial-gradient(420px 360px at 112% 104%, rgba(8, 145, 178, .18), transparent 60%),
    linear-gradient(180deg, #0b1326 0%, #101d3a 52%, #0c162b 100%);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform .25s ease;
  box-shadow: 1px 0 0 rgba(148, 163, 184, .08), 8px 0 32px rgba(11, 19, 38, .18);
}
/* 侧边栏细网格纹理（顶部实、底部渐隐） */
.sidebar::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(148, 163, 184, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, .05) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,.9), rgba(0,0,0,.25) 70%, transparent);
  mask-image: linear-gradient(180deg, rgba(0,0,0,.9), rgba(0,0,0,.25) 70%, transparent);
}
.logo, .nav, .sidebar-footer { position: relative; z-index: 1; }

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px;
  border-bottom: 1px solid rgba(148, 163, 184, .15);
}
.logo-icon {
  width: 40px; height: 40px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(37, 99, 235, .45), inset 0 1px 0 rgba(255,255,255,.25);
}
.logo-text h1 { color: #fff; font-size: 18px; letter-spacing: 1px; }
.logo-text span { font-size: 11px; color: var(--sidebar-text); }

.nav { flex: 1; padding: 14px 10px; display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 10px;
  color: var(--sidebar-text);
  cursor: pointer;
  user-select: none;
  transition: all .15s;
  font-size: 14px;
}
.nav-item:hover { background: rgba(148, 163, 184, .12); color: #e2e8f0; transform: translateX(2px); }
.nav-item.active {
  background: linear-gradient(135deg, #2563eb, #0891b2);
  color: #fff; font-weight: 600;
  box-shadow: 0 6px 16px rgba(37, 99, 235, .38), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.nav-item.active::before {
  content: ''; position: absolute; left: -10px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, #7dd3fc, #38bdf8);
  box-shadow: 0 0 10px rgba(56, 189, 248, .7);
}
.nav-icon { font-size: 16px; width: 20px; text-align: center; }

.sidebar-footer { padding: 14px; border-top: 1px solid rgba(148, 163, 184, .15); }
.btn-reset {
  width: 100%;
  padding: 9px;
  background: transparent;
  border: 1px solid rgba(148, 163, 184, .3);
  color: var(--sidebar-text);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  transition: all .15s;
}
.btn-reset:hover { border-color: var(--warning); color: #fbbf24; }

/* ===== 主内容区 ===== */
.main { flex: 1; margin-left: 230px; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  background: rgba(255, 255, 255, .8);
  backdrop-filter: blur(14px) saturate(1.5);
  -webkit-backdrop-filter: blur(14px) saturate(1.5);
  height: 62px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  box-shadow: var(--shadow);
  border-bottom: 1px solid rgba(226, 232, 240, .8);
  position: sticky;
  top: 0;
  z-index: 50;
}
.page-title { font-size: 19px; font-weight: 700; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.date-badge { color: var(--text-secondary); font-size: 13px; }
.user-badge { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
}
.menu-toggle {
  display: none;
  background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text);
}

.content { padding: 24px; }

/* ===== 页面切换 ===== */
.page { display: none; animation: fadeIn .25s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ===== 卡片 ===== */
.card {
  background: var(--card);
  border: 1px solid rgba(226, 232, 240, .75);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 6px 20px rgba(15, 23, 42, .06);
  margin-bottom: 20px;
  overflow: hidden;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
}
.card-header h3 { font-size: 15px; font-weight: 700; }
.card-body { padding: 20px; }

/* ===== 统计卡片 ===== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.stat-card {
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  border: 1px solid rgba(226, 232, 240, .8);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: #dbeafe; }
.stat-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.stat-icon.blue { background: var(--primary-light); }
.stat-icon.green { background: #dcfce7; }
.stat-icon.orange { background: #fef3c7; }
.stat-icon.purple { background: #ede9fe; }
.stat-icon.cyan { background: #cffafe; }
.stat-icon.red { background: #fee2e2; }
.stat-info .stat-label { font-size: 12.5px; color: var(--text-secondary); }
.stat-info .stat-value { font-size: 24px; font-weight: 800; line-height: 1.3; }
.stat-info .stat-sub { font-size: 12px; color: var(--text-secondary); }
.stat-info .stat-sub .up { color: var(--success); font-weight: 600; }

/* 仓库统计卡片：配色与任务明细仓库标签一致，点击联动筛选 */
.stat-card.wh-card { cursor: pointer; border: 2px solid transparent; }
.stat-icon.wh-icon-p { background: #fef3c7; color: #b45309; font-weight: 800; }
.stat-icon.wh-icon-b { background: #dbeafe; color: #1d4ed8; font-weight: 800; }
.stat-icon.wh-icon-j { background: #dcfce7; color: #15803d; font-weight: 800; }
.stat-card.wh-card.wh-p.active { border-color: #f59e0b; box-shadow: 0 0 0 3px #fef3c7; }
.stat-card.wh-card.wh-b.active { border-color: #3b82f6; box-shadow: 0 0 0 3px #dbeafe; }
.stat-card.wh-card.wh-j.active { border-color: #22c55e; box-shadow: 0 0 0 3px #dcfce7; }

/* ===== 图表网格 ===== */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.chart-card { margin-bottom: 0; }
.chart-wide { grid-column: 1 / -1; }
.chart-card .card-body { height: 300px; position: relative; padding: 16px 20px 12px; }
.chart-card .card-body.table-wrap { height: auto; max-height: 360px; overflow: auto; }
.chart-card canvas { border-radius: 8px; }
.card-title-group { display: flex; flex-direction: column; gap: 2px; }
.card-title-group .card-sub { font-size: 12.5px; color: var(--text-secondary); font-weight: 400; }

/* ===== 工具栏 ===== */
.toolbar { flex-wrap: wrap; gap: 12px; }
.toolbar-left { display: flex; gap: 10px; flex-wrap: wrap; }
.input-search, .select-filter {
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13.5px;
  outline: none;
  background: #fff;
  color: var(--text);
  transition: border-color .15s;
}
.input-search { width: 260px; }
.input-search:focus, .select-filter:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }

/* ===== 按钮 ===== */
.btn-primary {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff;
  border: none;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(37, 99, 235, .28);
}
.btn-primary:hover { background: linear-gradient(135deg, #1d4ed8, #2563eb); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(37, 99, 235, .38); }
.btn-primary:active { transform: translateY(0); }
.btn-outline {
  background: #fff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
}
.btn-outline:hover { background: #eff6ff; border-color: #93c5fd; transform: translateY(-1px); }
.btn-outline:active { transform: translateY(0); }
.btn-ghost {
  background: #fff;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13.5px;
  cursor: pointer;
  transition: all .15s;
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-link { background: none; border: none; color: var(--primary); font-size: 13px; cursor: pointer; }
.btn-link:hover { text-decoration: underline; }

.btn-sm {
  padding: 5px 12px;
  font-size: 12.5px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: #fff;
  cursor: pointer;
  margin-right: 4px;
  transition: all .15s;
  font-weight: 500;
  letter-spacing: .3px;
}
.btn-sm.edit { color: var(--primary); background: #eff6ff; }
.btn-sm.edit:hover { background: #dbeafe; }
.btn-sm.del { color: var(--danger); background: #fef2f2; }
.btn-sm.del:hover { background: #fee2e2; }

/* ===== 表格（高级感） ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
thead th {
  text-align: left;
  padding: 14px 16px;
  background: linear-gradient(180deg, #f1f5f9 0%, #eef2f7 100%);
  color: #475569;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .8px;
  text-transform: uppercase;
  border-bottom: 2px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 1;
}
thead th:first-child { border-radius: 0; }
thead th::before { content: ''; display: inline-block; width: 3px; height: 12px; margin-right: 8px; border-radius: 2px; background: linear-gradient(180deg, #2563eb, #06b6d4); vertical-align: -2px; opacity: .6; }
tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
  white-space: nowrap;
  transition: background .12s;
}
tbody tr { transition: background .15s, transform .12s; }
tbody tr:hover td { background: linear-gradient(90deg, #f8fafc 0%, #f1f5f9 100%); }
tbody tr:hover td:first-child { position: relative; }
tbody tr:hover td:first-child::before {
  content: ''; position: absolute; left: 0; top: 8px; bottom: 8px;
  width: 3px; border-radius: 2px; background: linear-gradient(180deg, #2563eb, #06b6d4);
}
tbody tr:last-child td { border-bottom: none; }
.empty-row td { text-align: center; color: var(--text-secondary); padding: 40px; }

/* 类型徽章：冷藏/干箱 */
.type-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px;
  font-size: 12px; font-weight: 600;
  border-radius: 14px;
  letter-spacing: .3px;
}
.type-badge.cold { background: #dbeafe; color: #1d4ed8; }
.type-badge.cold::before { content: '❄'; font-size: 11px; }
.type-badge.dry { background: #fef3c7; color: #b45309; }
.type-badge.dry::before { content: '📦'; font-size: 11px; }

/* 状态徽章：启用/未启用 */
.status-badge-row {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 500;
}
.status-badge-row::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
}
.status-badge-row.on::before { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.15); }
.status-badge-row.on { color: #16a34a; }
.status-badge-row.off::before { background: #94a3b8; box-shadow: 0 0 0 3px rgba(148,163,184,.15); }
.status-badge-row.off { color: #64748b; }
/* 物资库存状态：预警（橙）/ 缺货（红） */
.status-badge-row.warn::before { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.15); }
.status-badge-row.warn { color: #d97706; }
.status-badge-row.bad::before { background: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,.15); }
.status-badge-row.bad { color: #dc2626; }

/* 物资分类徽章 */
.cat-badge {
  display: inline-flex; align-items: center;
  padding: 4px 10px;
  font-size: 12px; font-weight: 600;
  border-radius: 14px;
  letter-spacing: .3px; white-space: nowrap;
}
.cat-badge.c1 { background: #dbeafe; color: #1d4ed8; }  /* 车辆配件-蓝 */
.cat-badge.c2 { background: #cffafe; color: #0e7490; }  /* 冷链耗材-青 */
.cat-badge.c3 { background: #ede9fe; color: #6d28d9; }  /* 办公物资-紫 */
.cat-badge.c4 { background: #fef3c7; color: #b45309; }  /* 劳保用品-琥珀 */
.cat-badge.c5 { background: #f1f5f9; color: #475569; }  /* 其他-灰 */

/* 物资库存数字 */
.stock-num { font-weight: 700; font-size: 14px; color: #16a34a; font-variant-numeric: tabular-nums; }
.stock-num.warn { color: #d97706; }
.stock-num.bad { color: #dc2626; }
.mat-name { font-weight: 600; color: #1e293b; }
.mat-remark { max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 车牌号 */
.plate-cell { font-family: "SF Mono", Consolas, monospace; font-weight: 700; color: #1d4ed8; letter-spacing: .8px; font-size: 13.5px; }

/* 司机姓名 */
.driver-cell { font-weight: 500; color: #1e293b; }

/* ===== 细滚动条 ===== */
.table-wrap::-webkit-scrollbar, .modal-body::-webkit-scrollbar, .content::-webkit-scrollbar { width: 8px; height: 8px; }
.table-wrap::-webkit-scrollbar-thumb, .modal-body::-webkit-scrollbar-thumb, .content::-webkit-scrollbar-thumb {
  background: #cbd5e1; border-radius: 999px;
}
.table-wrap::-webkit-scrollbar-thumb:hover, .modal-body::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
.table-wrap::-webkit-scrollbar-track, .modal-body::-webkit-scrollbar-track { background: transparent; }

.route-cell { color: var(--text); }
.route-arrow { color: var(--text-secondary); margin: 0 6px; }
.mono { font-family: "SF Mono", Consolas, monospace; font-weight: 600; color: var(--primary-dark); }

/* ===== 状态标签 ===== */
.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.tag-gray   { background: #f1f5f9; color: #475569; }
.tag-blue   { background: var(--primary-light); color: var(--primary-dark); }
.tag-green  { background: #dcfce7; color: #15803d; }
.tag-orange { background: #fef3c7; color: #b45309; }
.tag-red    { background: #fee2e2; color: #b91c1c; }
.tag-cyan   { background: #cffafe; color: #0e7490; }

/* 在线状态徽标（账号管理） */
.presence {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: default;
}
.presence-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
}
.presence.online  { background: #dcfce7; color: #15803d; }
.presence.online .presence-dot {
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, .55);
  animation: presence-pulse 1.8s ease-out infinite;
}
.presence.offline { background: #f1f5f9; color: #64748b; }
.presence.offline .presence-dot { background: #94a3b8; }
@keyframes presence-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, .55); }
  70%  { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* ===== 弹窗 ===== */
.modal-mask {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-mask.show { display: flex; animation: fadeIn .2s; }
.modal {
  background: #fff;
  border-radius: 14px;
  width: 520px;
  max-width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: popIn .2s ease;
}
@keyframes popIn { from { transform: scale(.95); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 16px; }
.modal-close { background: none; border: none; font-size: 16px; color: var(--text-secondary); cursor: pointer; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ===== 表单 ===== */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-item { display: flex; flex-direction: column; gap: 6px; }
.form-item.full { grid-column: 1 / -1; }
.form-item label { font-size: 13px; font-weight: 600; color: var(--text); }
.form-item label .req { color: var(--danger); }
.form-item input, .form-item select {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13.5px;
  outline: none;
  background: #fff;
  color: var(--text);
  transition: border-color .15s;
  width: 100%;
}
.form-item input:focus, .form-item select:focus { border-color: var(--primary); }
.form-item input[type="date"] { color: var(--text); }

/* ===== Toast ===== */
.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-80px);
  background: var(--sidebar-bg);
  color: #fff;
  padding: 11px 22px;
  border-radius: 10px;
  font-size: 14px;
  z-index: 300;
  opacity: 0;
  transition: all .3s ease;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

/* ===== 顶栏附加 ===== */
.sync-badge {
  font-size: 12.5px; color: var(--success); font-weight: 600;
  padding: 4px 10px; background: #dcfce7; border-radius: 999px;
  animation: syncPulse 2.4s ease-in-out infinite;
}
@keyframes syncPulse { 0%, 100% { opacity: 1; } 50% { opacity: .6; } }
.card-sub { font-size: 13px; color: var(--text-secondary); font-weight: 500; }

/* ===== 分段切换（趋势范围） ===== */
.seg-tabs { display: inline-flex; background: #f1f5f9; border-radius: 8px; padding: 3px; gap: 2px; }
.seg-tab {
  border: none; background: transparent; cursor: pointer;
  padding: 6px 14px; border-radius: 6px; font-size: 12.5px;
  color: var(--text-secondary); transition: all .15s;
}
.seg-tab.active { background: #fff; color: var(--primary); font-weight: 600; box-shadow: var(--shadow); }

/* ===== 筛选 Tabs（chip 风格） ===== */
.filter-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab-item {
  border: 1px solid var(--border); background: #fff; cursor: pointer;
  padding: 7px 16px; border-radius: 999px; font-size: 13px;
  color: var(--text-secondary); transition: all .15s; white-space: nowrap;
}
.tab-item:hover { border-color: var(--primary); color: var(--primary); }
.tab-item.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }

/* ===== 司机头像网格 ===== */
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}
.driver-card {
  background: linear-gradient(180deg, #ffffff 0%, #fafcff 100%);
  border: 1px solid rgba(226, 232, 240, .9);
  border-radius: 18px;
  padding: 30px 16px 22px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  cursor: pointer; transition: all .3s cubic-bezier(.4,0,.2,1);
  position: relative; overflow: hidden;
}
/* 顶部渐变饰条 */
.driver-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #2563eb, #06b6d4);
  transform: scaleX(0); transform-origin: left; transition: transform .35s;
}
/* 姓氏首字水印 */
.driver-card::after {
  content: attr(data-initial);
  position: absolute; right: 2px; bottom: -22px;
  font-size: 84px; font-weight: 800; line-height: 1;
  color: rgba(15, 23, 42, .045);
  pointer-events: none; user-select: none;
  transition: color .3s;
}
.driver-card:hover {
  border-color: rgba(37, 99, 235, .35);
  box-shadow: 0 14px 34px rgba(37, 99, 235, .14);
  transform: translateY(-4px);
}
.driver-card:hover::before { transform: scaleX(1); }
.driver-card:hover::after { color: rgba(37, 99, 235, .07); }

.driver-avatar-wrap { position: relative; margin-bottom: 6px; z-index: 1; transition: transform .3s; }
.driver-card:hover .driver-avatar-wrap { transform: scale(1.06); }
.avatar-circle {
  width: 62px; height: 62px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700; color: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .16), 0 0 0 4px #fff;
}
.avatar-circle.green { background: linear-gradient(135deg, #16a34a, #22c55e); }
.avatar-circle.blue  { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.avatar-circle.gray  { background: linear-gradient(135deg, #64748b, #94a3b8); }
.avatar-circle.orange{ background: linear-gradient(135deg, #d97706, #f59e0b); }

.status-dot {
  position: absolute; bottom: 2px; right: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  border: 3px solid #fff;
}
.status-dot.green { background: #22c55e; }
.status-dot.blue  { background: #3b82f6; }
.status-dot.gray  { background: #94a3b8; }
.status-dot.orange{ background: #f59e0b; }

.card-del {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  background: #f8fafc; border: none; cursor: pointer;
  font-size: 14px; width: 28px; height: 28px; border-radius: 8px;
  opacity: 0; transition: all .2s; display: flex; align-items: center; justify-content: center;
}
.driver-card:hover .card-del { opacity: 1; }
.card-del:hover { background: #fee2e2; }

.driver-name {
  font-size: 16.5px; font-weight: 700; color: var(--text);
  letter-spacing: .5px; z-index: 1;
}

.driver-status { display: flex; justify-content: center; z-index: 1; }
.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3.5px 13px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: .5px;
}
.status-badge::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}
.status-badge.green  { background: rgba(22, 163, 74, .08);  color: #15803d; border: 1px solid rgba(22, 163, 74, .25); }
.status-badge.blue   { background: rgba(37, 99, 235, .08);  color: #1d4ed8; border: 1px solid rgba(37, 99, 235, .25); }
.status-badge.gray   { background: rgba(100, 116, 139, .08); color: #475569; border: 1px solid rgba(100, 116, 139, .25); }
.status-badge.orange { background: rgba(217, 119, 6, .09);  color: #b45309; border: 1px solid rgba(217, 119, 6, .3); }
.empty { text-align: center; color: var(--text-secondary); padding: 40px; grid-column: 1 / -1; }

/* ===== 车辆类型徽章 ===== */
.type-badge {
  display: inline-block; padding: 3px 10px; border-radius: 8px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.type-badge.cold { background: #dbeafe; color: #1d4ed8; }
.type-badge.dry  { background: #fef3c7; color: #b45309; }

/* ===== 数量药丸 ===== */
.count-pill {
  display: inline-block; min-width: 26px; text-align: center;
  padding: 2px 9px; border-radius: 999px; font-weight: 700; font-size: 12.5px;
  background: var(--primary-light); color: var(--primary-dark);
}

/* ===== 分页 ===== */
.pagination {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  padding: 14px 20px; border-top: 1px solid var(--border);
}

/* ===== 过滤条件标签 ===== */
.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--primary-light); color: var(--primary-dark);
  border: 1px solid #bfdbfe;
  padding: 4px 10px 4px 12px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600;
  animation: chipIn .18s ease;
}
@keyframes chipIn { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
.chip-close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%;
  background: transparent; border: none; cursor: pointer;
  color: var(--primary-dark); font-size: 11px; line-height: 1;
  transition: background .15s;
}
.chip-close:hover { background: var(--primary); color: #fff; }

/* ===== 任务明细工具栏 ===== */
.toolbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.warehouse-tabs { display: inline-flex; background: #f1f5f9; border-radius: 8px; padding: 3px; gap: 2px; }
.wh-tab {
  border: none; background: transparent; cursor: pointer;
  padding: 6px 14px; border-radius: 6px; font-size: 12.5px;
  color: var(--text-secondary); transition: all .15s; white-space: nowrap;
}
.wh-tab:hover { color: var(--text); }
.wh-tab.active { background: #fff; color: var(--primary); font-weight: 600; box-shadow: var(--shadow); }

/* ===== 司机车次统计表格 ===== */
.rank-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 28px; height: 28px; padding: 0 6px;
  border-radius: 8px; font-weight: 700; font-size: 13px;
  background: #f1f5f9; color: var(--text-secondary);
}
.bar-cell { display: flex; align-items: center; gap: 10px; min-width: 140px; }
.bar-track {
  flex: 1; height: 8px; background: #f1f5f9; border-radius: 999px; overflow: hidden;
}
.bar-fill {
  height: 100%; background: linear-gradient(90deg, #2563eb, #06b6d4);
  border-radius: 999px; transition: width .3s ease;
}
.bar-label { font-size: 12px; color: var(--text-secondary); font-weight: 600; min-width: 36px; text-align: right; }
.text-muted { color: var(--text-secondary); font-size: 12.5px; }
.page-btn {
  border: 1px solid var(--border); background: #fff; cursor: pointer;
  padding: 7px 16px; border-radius: 8px; font-size: 13px;
  color: var(--text); transition: all .15s;
}
.page-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.page-btn:disabled { opacity: .45; cursor: not-allowed; }
.page-info { font-size: 13px; color: var(--text-secondary); }

/* ===== 响应式 ===== */
@media (max-width: 960px) {
  .chart-grid { grid-template-columns: 1fr; }
  .input-search { width: 180px; }
  .sync-badge { display: none; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .main { margin-left: 0; }
  .menu-toggle { display: block; }
  .date-badge { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .content { padding: 14px; }
  .avatar-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .toolbar { flex-direction: column; align-items: stretch; }
}

/* ===== 车次统计表格美化 ===== */
.trip-stat-table th {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 12.5px;
  letter-spacing: .3px;
  background: #f8fafc;
}
.trip-stat-table td { vertical-align: middle; }
.driver-name-cell { font-size: 14px; color: var(--text); }
.count-cell {
  display: flex; align-items: center; gap: 12px; min-width: 160px;
}
.count-pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 28px; padding: 0 10px;
  border-radius: 14px; font-weight: 700; font-size: 13px;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  color: #fff; box-shadow: 0 2px 6px rgba(37, 99, 235, .3);
}
.count-cell .bar-track { flex: 1; }
.wh-dist-cell { white-space: nowrap; }
.wh-tag {
  display: inline-block; padding: 3px 10px; margin: 2px 4px 2px 0;
  border-radius: 10px; font-size: 12px; font-weight: 600;
  white-space: nowrap;
}
.wh-tag.wh-p { background: #fef3c7; color: #b45309; }
.wh-tag.wh-b { background: #dbeafe; color: #1d4ed8; }
.wh-tag.wh-j { background: #dcfce7; color: #15803d; }
.vehicle-cell { font-size: 12.5px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }

/* ===== 登录页面 ===== */
.login-mask {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(1100px 720px at 12% 18%, rgba(59, 130, 246, .42), transparent 56%),
    radial-gradient(1000px 700px at 88% 86%, rgba(8, 145, 178, .32), transparent 55%),
    radial-gradient(700px 500px at 70% 6%, rgba(96, 165, 250, .18), transparent 60%),
    linear-gradient(135deg, #0a1128 0%, #10244e 46%, #0b3663 100%);
  opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s;
}
.login-mask.show { opacity: 1; visibility: visible; }
/* 细网格纹理（向四周渐隐） */
.login-mask::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 42px 42px;
  -webkit-mask-image: radial-gradient(120% 120% at 50% 38%, #000 25%, transparent 100%);
  mask-image: radial-gradient(120% 120% at 50% 38%, #000 25%, transparent 100%);
  pointer-events: none;
}
/* 底部地平线光带 */
.login-mask::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 42%;
  background: linear-gradient(180deg, transparent, rgba(37, 99, 235, .18));
  pointer-events: none;
}
.login-card {
  position: relative; z-index: 2;
  width: 400px; max-width: 92vw; background: #fff;
  border-radius: 20px; overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 30px 80px rgba(2, 8, 23, .55), 0 2px 8px rgba(2, 8, 23, .3);
  transform: translateY(20px) scale(.96);
  transition: all .35s cubic-bezier(.4,0,.2,1);
}
.login-mask.show .login-card { transform: translateY(0) scale(1); }

.login-brand {
  padding: 32px 24px 24px; text-align: center;
  background: linear-gradient(135deg, #1d4ed8, #0891b2);
  color: #fff;
}
.login-logo {
  width: 64px; height: 64px; margin: 0 auto 14px;
  background: rgba(255,255,255,.2); border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; backdrop-filter: blur(10px);
}
.login-brand h1 { font-size: 20px; font-weight: 700; margin: 0; letter-spacing: 1px; }
.login-brand p { font-size: 12px; opacity: .85; margin: 6px 0 0; letter-spacing: .5px; }

.login-form { padding: 28px 28px 24px; }
.login-form h2 {
  font-size: 17px; font-weight: 700; color: var(--text);
  margin: 0 0 20px; text-align: center;
}
.login-field {
  position: relative; margin-bottom: 16px;
}
.login-field .login-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  font-size: 16px; opacity: .5; pointer-events: none;
}
.login-field input {
  width: 100%; height: 46px; padding: 0 14px 0 42px;
  border: 1.5px solid #e2e8f0; border-radius: 10px;
  font-size: 14px; background: #f8fafc;
  transition: all .2s; outline: none;
}
.login-field input:focus {
  border-color: #2563eb; background: #fff;
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.login-btn {
  width: 100%; height: 46px; margin-top: 6px;
  border: none; border-radius: 10px;
  background: linear-gradient(135deg, #1d4ed8, #0891b2);
  color: #fff; font-size: 15px; font-weight: 700; letter-spacing: 4px;
  cursor: pointer; transition: all .2s;
  box-shadow: 0 6px 16px rgba(29, 78, 216, .32);
}
.login-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(29, 78, 216, .42); }
.login-btn:active { transform: translateY(0); }

.login-hint {
  margin-top: 18px; padding: 12px 14px;
  background: #f8fafc; border-radius: 10px;
  border-left: 3px solid #2563eb;
}
.hint-title { display: block; font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.hint-item { display: block; font-size: 12px; color: var(--text-secondary); line-height: 1.8; }

/* ===== 确认弹窗 ===== */
.confirm-modal { max-width: 380px; }
.confirm-body {
  padding: 28px 24px 8px;
  display: flex; align-items: flex-start; gap: 14px;
}
.confirm-icon {
  font-size: 28px; flex-shrink: 0; line-height: 1;
}
.confirm-msg {
  font-size: 15px; color: var(--text); line-height: 1.6;
  padding-top: 4px;
}
.confirm-modal .modal-footer {
  padding: 12px 24px 20px; justify-content: flex-end; gap: 10px;
}

/* ===== 用户徽章 ===== */
.user-badge {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px; background: #f1f5f9; border-radius: 20px;
  cursor: pointer; transition: all .15s; position: relative;
}
.user-badge:hover { background: #e2e8f0; }
.user-badge .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}
.user-role { font-size: 11px; color: var(--text-secondary); background: #e2e8f0; padding: 2px 8px; border-radius: 10px; }
.caret { font-size: 10px; color: var(--text-secondary); }
.user-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 180px; background: #fff; border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12); border: 1px solid #e2e8f0;
  overflow: hidden; opacity: 0; visibility: hidden;
  transform: translateY(-6px); transition: all .15s; z-index: 100;
}
.user-menu.show { opacity: 1; visibility: visible; transform: none; }
.user-menu-info { padding: 12px 14px; }
.um-username { font-weight: 700; font-size: 14px; color: var(--text); }
.um-role { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.user-menu-divider { height: 1px; background: #f1f5f9; }
.user-menu-item {
  width: 100%; text-align: left; padding: 10px 14px;
  background: none; border: none; cursor: pointer;
  font-size: 13px; color: var(--text); display: flex; align-items: center; gap: 8px;
}
.user-menu-item:hover { background: #f8fafc; }

/* ===== 权限矩阵 ===== */
.perm-matrix { border: 1px solid #e2e8f0; border-radius: 10px; overflow: hidden; }
.perm-matrix-header {
  background: #f8fafc; padding: 10px 14px; border-bottom: 1px solid #e2e8f0;
  display: grid; grid-template-columns: 1fr 140px; gap: 12px;
}
.perm-col-label { font-size: 12px; font-weight: 600; color: #64748b; letter-spacing: .3px; }
.perm-grid { padding: 8px 14px; }
.perm-row {
  display: grid; grid-template-columns: 1fr 140px; gap: 12px;
  padding: 8px 0; border-bottom: 1px dashed #f1f5f9;
}
.perm-row:last-child { border-bottom: none; }
.perm-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px;
  border-radius: 8px; cursor: pointer; transition: all .15s;
}
.perm-item:hover { background: #eff6ff; }
.perm-item input[type="checkbox"] { cursor: pointer; width: 16px; height: 16px; }
.perm-item span { font-size: 13px; color: var(--text); }
.perm-item.edit-col { justify-content: center; }
.perm-item.edit-col.disabled { cursor: default; }
.perm-item.edit-col.disabled:hover { background: transparent; }
.perm-na { color: #cbd5e1; font-size: 13px; }

/* ===== 账号管理表格 ===== */
.perm-cell { max-width: 360px; line-height: 1.8; }
.perm-chip {
  display: inline-block; padding: 2px 8px; margin: 2px 3px;
  border-radius: 6px; font-size: 11.5px; font-weight: 500;
  white-space: nowrap;
}
.perm-chip.view { background: #f1f5f9; color: #64748b; }
.perm-chip.edit { background: #dcfce7; color: #15803d; }
.perm-chip.admin { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #92400e; }

/* ===== 底部备案信息 ===== */
.site-footer {
  margin-top: auto;
  padding: 18px 20px 22px;
  text-align: center;
  font-size: 12.5px;
}
.site-footer a {
  color: #94a3b8;
  text-decoration: none;
  margin: 0 10px;
  transition: color .15s;
}
.site-footer a:hover { color: #2563eb; }
.site-footer a + a { margin-left: 0; }

/* 登录页备案（深色渐变背景） */
.login-footer {
  position: absolute;
  bottom: 20px; left: 0; right: 0;
  text-align: center;
  font-size: 12.5px;
  z-index: 1;
}
.login-footer a {
  color: rgba(255,255,255,.8);
  text-decoration: none;
  transition: color .15s;
}
.login-footer a:hover { color: #fff; text-decoration: underline; }

/* 公安备案警徽徽章（官方公安部图标） */
.police-link { display: inline-flex; align-items: center; gap: 5px; }
.police-badge {
  height: 16px; width: auto;
  vertical-align: middle;
  margin-right: 2px;
}

/* ============================================================
   运营数据大屏（深色科技风，仅作用于 #page-dashboard）
   ============================================================ */
:root {
  --screen-bg: #070d1f;
  --screen-panel: rgba(15, 28, 58, .72);
  --screen-panel-solid: #0e1c3c;
  --screen-line: rgba(96, 165, 250, .16);
  --screen-text: #dbeafe;
  --screen-text-dim: #7e93bd;
  --screen-cyan: #38bdf8;
  --screen-blue: #3b82f6;
}

/* 看板页激活时，顶栏融入深色大屏 */
body.screen-on .topbar {
  background: rgba(7, 13, 31, .72);
  border-bottom: 1px solid var(--screen-line);
  box-shadow: none;
}
body.screen-on .page-title { color: #e2ecff; }
body.screen-on .date-badge { color: var(--screen-text-dim); }
body.screen-on .user-badge { background: rgba(96, 165, 250, .12); }
body.screen-on .user-badge:hover { background: rgba(96, 165, 250, .22); }
body.screen-on .user-badge,
body.screen-on .user-badge .caret { color: #b8c9ec; }
body.screen-on .user-role { background: rgba(96, 165, 250, .18); color: #9cc2ff; }
body.screen-on .sync-badge { display: none; }
body.screen-on .menu-toggle { color: #dbeafe; }
body.screen-on .site-footer a { color: #55679a; }
body.screen-on .site-footer a:hover { color: #7dd3fc; }

/* 大屏页面容器：深邃底 + 光晕 + 细网格 */
.screen-page {
  --sp-card-radius: 12px;
  position: relative;
  margin: -24px;
  padding: 22px 24px 28px;
  min-height: calc(100vh - 62px);
  color: var(--screen-text);
  background:
    radial-gradient(1200px 620px at 50% -22%, rgba(37, 99, 235, .22), transparent 60%),
    radial-gradient(900px 520px at 108% 12%, rgba(8, 145, 178, .14), transparent 58%),
    radial-gradient(800px 600px at -10% 88%, rgba(37, 99, 235, .12), transparent 60%),
    linear-gradient(180deg, #081026 0%, #070d1f 46%, #060b1a 100%);
}
.screen-page::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(96, 165, 250, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(96, 165, 250, .05) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(130% 100% at 50% 0%, #000 30%, transparent 92%);
  mask-image: radial-gradient(130% 100% at 50% 0%, #000 30%, transparent 92%);
}
.screen-page > * { position: relative; z-index: 1; }

/* ===== 大屏头部 ===== */
.screen-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding-bottom: 16px; margin-bottom: 18px;
  border-bottom: 1px solid var(--screen-line);
}
.sh-title {
  display: flex; align-items: center; gap: 12px;
  font-size: 26px; font-weight: 800; letter-spacing: 4px;
  background: linear-gradient(180deg, #ffffff 30%, #8fc2ff 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 26px rgba(56, 189, 248, .25);
}
.sh-deco {
  width: 5px; height: 24px; border-radius: 3px;
  background: linear-gradient(180deg, #38bdf8, #2563eb);
  box-shadow: 0 0 12px rgba(56, 189, 248, .8);
}
.sh-sub {
  margin-top: 4px; margin-left: 17px;
  font-size: 10.5px; letter-spacing: 3px;
  color: var(--screen-text-dim);
  font-family: "SF Mono", Consolas, monospace;
}
.sh-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sh-clock {
  font-family: "SF Mono", Consolas, monospace;
  font-size: 15px; font-weight: 600; letter-spacing: 1.5px;
  color: #cfe4ff;
  padding: 5px 14px;
  background: rgba(56, 189, 248, .08);
  border: 1px solid rgba(56, 189, 248, .22);
  border-radius: 8px;
}
.sh-btn {
  padding: 7px 16px; border-radius: 8px; cursor: pointer;
  font-size: 13px; font-weight: 600;
  color: #e6f1ff;
  background: linear-gradient(135deg, #1d4ed8, #0891b2);
  border: 1px solid rgba(125, 211, 252, .35);
  box-shadow: 0 4px 14px rgba(29, 78, 216, .35);
  transition: all .15s;
}
.sh-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(29, 78, 216, .5); }
.sh-btn.ghost {
  background: rgba(96, 165, 250, .1);
  border: 1px solid rgba(96, 165, 250, .35);
  box-shadow: none;
}
.sh-btn.ghost:hover { background: rgba(96, 165, 250, .2); box-shadow: none; }

/* ===== KPI 指标带 ===== */
.screen-kpi {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
/* 运营效率指标带（3 项比率） */
.screen-rates {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
.rate-card.dim { opacity: .68; }
.kpi-card {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 16px;
  padding: 18px 20px;
  border-radius: var(--sp-card-radius);
  background:
    linear-gradient(135deg, rgba(30, 58, 110, .55), rgba(12, 24, 52, .72));
  border: 1px solid var(--screen-line);
  box-shadow: inset 0 1px 0 rgba(148, 190, 255, .08), 0 8px 24px rgba(2, 8, 23, .35);
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.kpi-card:hover {
  transform: translateY(-3px);
  border-color: rgba(56, 189, 248, .45);
  box-shadow: inset 0 1px 0 rgba(148, 190, 255, .12), 0 12px 32px rgba(2, 8, 23, .5);
}
/* 左侧竖光条 */
.kpi-card::before {
  content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--kpi-c, #38bdf8), transparent);
  box-shadow: 0 0 10px var(--kpi-c, #38bdf8);
}
/* 右下角光晕 */
.kpi-card::after {
  content: ''; position: absolute; right: -34px; bottom: -42px;
  width: 130px; height: 130px; border-radius: 50%;
  background: radial-gradient(circle, var(--kpi-c-soft, rgba(56,189,248,.16)), transparent 70%);
  pointer-events: none;
}
.kpi-icon {
  width: 52px; height: 52px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; border-radius: 13px;
  background: var(--kpi-c-soft, rgba(56,189,248,.14));
  border: 1px solid var(--kpi-c-border, rgba(56,189,248,.3));
  box-shadow: inset 0 0 14px rgba(56, 189, 248, .08);
}
.kpi-info { min-width: 0; }
.kpi-label { font-size: 13px; color: var(--screen-text-dim); letter-spacing: 1px; }
.kpi-value {
  font-family: "SF Mono", Consolas, "DIN Alternate", monospace;
  font-size: 32px; font-weight: 800; line-height: 1.25;
  color: var(--kpi-c, #38bdf8);
  text-shadow: 0 0 20px var(--kpi-c-glow, rgba(56,189,248,.45));
  font-variant-numeric: tabular-nums;
}
.kpi-unit { font-size: 13px; font-weight: 500; color: var(--screen-text-dim); margin-left: 5px; }
.kpi-sub { font-size: 11.5px; color: #64789f; margin-top: 1px; }

/* ===== 三仓车次卡 ===== */
.screen-wh-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
.screen-page .stat-card {
  position: relative; overflow: hidden;
  background: linear-gradient(150deg, rgba(21, 40, 82, .6), rgba(10, 20, 44, .78));
  border: 1px solid var(--screen-line);
  border-radius: var(--sp-card-radius);
  box-shadow: inset 0 1px 0 rgba(148,190,255,.07), 0 8px 24px rgba(2,8,23,.35);
  padding: 18px 20px;
}
.screen-page .stat-card:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(2,8,23,.55); }
.screen-page .stat-card .stat-label { color: var(--screen-text-dim); }
.screen-page .stat-card .stat-value {
  color: #f0f7ff;
  font-family: "SF Mono", Consolas, monospace;
  text-shadow: 0 0 18px rgba(125, 211, 252, .4);
}
.screen-page .stat-card .stat-sub { color: #5f729a; }
.screen-page .stat-card .stat-sub .up { color: #4ade80; }
.screen-page .wh-card { cursor: pointer; }
.screen-page .wh-card.active {
  border-color: rgba(56, 189, 248, .55);
  box-shadow: 0 0 0 1px rgba(56,189,248,.35), 0 10px 30px rgba(8,145,178,.28);
}
.screen-page .wh-card.active::after {
  content: ''; position: absolute; right: -30px; top: -30px;
  width: 100px; height: 100px; border-radius: 50%;
  background: radial-gradient(circle, rgba(56,189,248,.25), transparent 70%);
}

/* ===== 图表面板 ===== */
.screen-page .card {
  background: var(--screen-panel);
  border: 1px solid var(--screen-line);
  border-radius: var(--sp-card-radius);
  box-shadow: inset 0 1px 0 rgba(148,190,255,.06), 0 10px 30px rgba(2,8,23,.4);
  backdrop-filter: blur(4px);
}
.screen-page .card-header { border-bottom: 1px solid var(--screen-line); padding: 14px 18px; }
.screen-page .card-header h3 {
  color: #e6f1ff; font-size: 15px; letter-spacing: 1px;
  display: flex; align-items: center; gap: 9px;
}
.screen-page .card-header h3::before {
  content: ''; width: 4px; height: 14px; border-radius: 2px;
  background: linear-gradient(180deg, #38bdf8, #2563eb);
  box-shadow: 0 0 8px rgba(56,189,248,.7);
}
.screen-page .card-sub { color: var(--screen-text-dim) !important; }
.screen-page .card-body { padding: 14px 18px 12px; }
.screen-page .chart-card .card-body { height: 320px; }
.screen-page .chart-card .card-body.table-wrap { height: auto; max-height: 380px; }

/* 面板内分段控件（趋势范围 / 仓库 tab） */
.screen-page .seg-tabs,
.screen-page .warehouse-tabs {
  background: rgba(6, 14, 34, .7);
  border: 1px solid var(--screen-line);
  padding: 3px;
}
.screen-page .seg-tab { color: var(--screen-text-dim); }
.screen-page .seg-tab:hover { color: #cfe4ff; }
.screen-page .seg-tab.active {
  background: linear-gradient(135deg, #1d4ed8, #0891b2);
  color: #fff; box-shadow: 0 3px 10px rgba(29,78,216,.45);
}
.screen-page .wh-tab { color: var(--screen-text-dim); }
.screen-page .wh-tab:hover { color: #cfe4ff; }
.screen-page .wh-tab.active {
  background: linear-gradient(135deg, #1d4ed8, #0891b2);
  color: #fff; box-shadow: 0 3px 10px rgba(29,78,216,.45);
}

/* 筛选 chip */
.screen-page .filter-chip {
  background: rgba(56, 189, 248, .12);
  border: 1px solid rgba(56, 189, 248, .35);
  color: #bfe3ff;
}
.screen-page .chip-close { color: #7dd3fc; }
.screen-page .chip-close:hover { background: #38bdf8; color: #06101f; }

/* ===== 深色数据表格 ===== */
.screen-page table thead th {
  background: rgba(8, 18, 42, .9);
  color: #8fa8d6;
  border-bottom: 1px solid var(--screen-line);
}
.screen-page table thead th::before {
  background: linear-gradient(180deg, #38bdf8, #2563eb); opacity: .9;
}
.screen-page table tbody td { border-bottom: 1px solid rgba(96, 165, 250, .08); color: #cdd9f2; }
.screen-page tbody tr:hover td { background: rgba(56, 189, 248, .07); }
.screen-page .empty-row td { color: var(--screen-text-dim); }
.screen-page .mono { color: #7dd3fc; }
.screen-page .text-muted { color: #6b7fa8 !important; }

/* 分页 */
.screen-page .page-btn {
  background: rgba(96, 165, 250, .1);
  border: 1px solid var(--screen-line);
  color: #a9c6f5;
}
.screen-page .page-btn:hover:not(:disabled) { background: rgba(96, 165, 250, .22); color: #fff; }
.screen-page .page-btn:disabled { opacity: .38; }
.screen-page .page-info { color: var(--screen-text-dim); }

/* ===== 浏览器全屏投屏：隐藏侧栏/顶栏，大屏铺满 ===== */
html:fullscreen .app { display: block; }
html:fullscreen .sidebar,
html:fullscreen .topbar,
html:fullscreen .site-footer { display: none; }
html:fullscreen .main { margin-left: 0; }
html:fullscreen .content { padding: 0; }
html:fullscreen .screen-page {
  margin: 0; padding: 26px 30px 30px;
  min-height: 100vh; overflow: auto;
}
html:-webkit-full-screen .app { display: block; }
html:-webkit-full-screen .sidebar,
html:-webkit-full-screen .topbar,
html:-webkit-full-screen .site-footer { display: none; }
html:-webkit-full-screen .main { margin-left: 0; }
html:-webkit-full-screen .content { padding: 0; }
html:-webkit-full-screen .screen-page {
  margin: 0; padding: 26px 30px 30px;
  min-height: 100vh; overflow: auto;
}

@media (max-width: 1200px) {
  .screen-kpi { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .screen-page { margin: -14px; padding: 16px 14px 20px; }
  .screen-wh-grid { grid-template-columns: 1fr; }
  .sh-title { font-size: 21px; letter-spacing: 2px; }
  .kpi-value { font-size: 26px; }
}

/* 大屏页底部备案条融入深色（向两侧/底部铺满 content） */
body.screen-on .site-footer {
  background: #060b1a;
  border-top: 1px solid rgba(96, 165, 250, .12);
  margin: 0 -24px -24px;
}

/* 仓库卡图标：深色底上的霓虹半透明徽章 */
.screen-page .stat-icon.wh-icon-p { background: rgba(251, 191, 36, .14); color: #fbbf24; box-shadow: inset 0 0 12px rgba(251,191,36,.12); }
.screen-page .stat-icon.wh-icon-b { background: rgba(96, 165, 250, .14); color: #60a5fa; box-shadow: inset 0 0 12px rgba(96,165,250,.12); }
.screen-page .stat-icon.wh-icon-j { background: rgba(74, 222, 128, .14); color: #4ade80; box-shadow: inset 0 0 12px rgba(74,222,128,.12); }
.screen-page .stat-icon { border: 1px solid rgba(148, 190, 255, .18); }

/* ===== 环比数据下钻弹窗 ===== */
.mom-mask {
  display: none;
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(3, 7, 20, .66);
  backdrop-filter: blur(5px);
  align-items: center; justify-content: center;
  padding: 28px 18px;
}
.mom-mask.show { display: flex; animation: fadeIn .18s; }
.mom-modal {
  width: 100%; max-width: 820px; max-height: 88vh;
  display: flex; flex-direction: column;
  background: linear-gradient(165deg, #101f42 0%, #0a1530 60%, #081024 100%);
  border: 1px solid rgba(96, 165, 250, .32);
  border-radius: 14px;
  box-shadow: 0 0 0 1px rgba(56,189,248,.08), 0 24px 70px rgba(0,0,0,.6), 0 0 46px rgba(37,99,235,.18);
  overflow: hidden;
  animation: mom-pop .2s ease-out;
}
@keyframes mom-pop {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to { opacity: 1; transform: none; }
}
.mom-modal-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--screen-line);
  background: linear-gradient(90deg, rgba(56,189,248,.09), transparent 60%);
}
.mm-title {
  font-size: 17px; font-weight: 700; letter-spacing: 1px; color: #eaf3ff;
  display: flex; align-items: center; gap: 9px;
}
.mm-title::before {
  content: ''; width: 4px; height: 16px; border-radius: 2px;
  background: linear-gradient(180deg, #38bdf8, #2563eb);
  box-shadow: 0 0 8px rgba(56,189,248,.8);
}
.mm-sub { margin-top: 5px; margin-left: 13px; font-size: 12px; color: var(--screen-text-dim); }
.mm-close {
  background: rgba(96,165,250,.1); border: 1px solid var(--screen-line);
  color: #a9c6f5; width: 30px; height: 30px; border-radius: 8px;
  cursor: pointer; font-size: 13px; flex-shrink: 0; transition: all .15s;
}
.mm-close:hover { background: rgba(248,113,113,.2); border-color: rgba(248,113,113,.4); color: #fca5a5; }
.mom-modal-body { padding: 18px 22px; overflow-y: auto; flex: 1; }

/* 概要三卡 */
.mm-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.mm-sum {
  padding: 14px 16px; border-radius: 10px;
  background: rgba(96,165,250,.07);
  border: 1px solid var(--screen-line);
}
.mm-sum .ms-label { font-size: 12px; color: var(--screen-text-dim); margin-bottom: 5px; }
.mm-sum .ms-value {
  font-family: "SF Mono", Consolas, monospace;
  font-size: 26px; font-weight: 800; color: #eaf3ff; line-height: 1.2;
}
.mm-sum .ms-unit { font-size: 12px; color: var(--screen-text-dim); margin-left: 4px; font-weight: 500; }
.mm-sum.up { background: rgba(74,222,128,.09); border-color: rgba(74,222,128,.3); }
.mm-sum.down { background: rgba(248,113,113,.09); border-color: rgba(248,113,113,.3); }
.mm-sum.flat { background: rgba(148,163,184,.08); border-color: rgba(148,163,184,.25); }
.mm-sum.up .ms-value { color: #4ade80; text-shadow: 0 0 16px rgba(74,222,128,.4); }
.mm-sum.down .ms-value { color: #f87171; text-shadow: 0 0 16px rgba(248,113,113,.4); }
.mm-sum.flat .ms-value { color: #cbd5e1; }

/* 区块标题 */
.mm-section-title {
  font-size: 13px; font-weight: 600; color: #b8c9ec; letter-spacing: 1px;
  margin: 4px 0 10px; display: flex; align-items: center; gap: 8px;
}
.mm-section-title::before {
  content: ''; width: 3px; height: 12px; border-radius: 2px;
  background: #38bdf8; box-shadow: 0 0 6px rgba(56,189,248,.7);
}
.mm-section-title .mm-count { color: var(--screen-text-dim); font-weight: 400; font-size: 12px; }

/* 分仓库对比表 */
.mm-wh-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
.mm-wh-table th {
  text-align: left; font-size: 12px; font-weight: 600; color: #8fa8d6;
  padding: 9px 12px; background: rgba(8,18,42,.9);
  border-bottom: 1px solid var(--screen-line);
}
.mm-wh-table th.num, .mm-wh-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.mm-wh-table td { padding: 10px 12px; font-size: 13px; color: #cdd9f2; border-bottom: 1px solid rgba(96,165,250,.08); }
.mm-wh-table tbody tr:hover td { background: rgba(56,189,248,.05); }
.mm-delta-up { color: #4ade80; font-weight: 700; }
.mm-delta-down { color: #f87171; font-weight: 700; }
.mm-delta-flat { color: #8fa0c4; }
.mm-wh-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; }
.mm-wh-detail-scroll { max-height: 280px; overflow-y: auto; border: 1px solid var(--screen-line); border-radius: 8px; }
.mom-modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 22px; border-top: 1px solid var(--screen-line);
  background: rgba(8, 16, 36, .6);
}
@media (max-width: 640px) {
  .mm-summary { grid-template-columns: 1fr; }
}

/* ============================================================
   手机端适配（≤768 平板/大手机，≤480 手机）
   ============================================================ */
html, body { overflow-x: clip; } /* 防意外横向滚动，且不破坏 sticky 顶栏 */
.sidebar-overlay { display: none; }

@media (max-width: 768px) {
  /* 侧栏遮罩 */
  #sidebar.open ~ #sidebarOverlay {
    display: block;
    position: fixed; inset: 0; z-index: 90;
    background: rgba(3, 7, 20, .52);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    animation: fadeIn .2s;
  }

  /* 顶栏 */
  .topbar { padding: 0 14px; gap: 10px; height: 56px; }
  .page-title { font-size: 16px; }
  .topbar-right { gap: 10px; }

  /* 卡片 */
  .content { padding: 14px; }
  .card { margin-bottom: 14px; border-radius: 12px; }
  .card-header { padding: 12px 14px; flex-wrap: wrap; gap: 8px; }
  .card-body { padding: 14px; }

  /* 表格（外层 .table-wrap 已可横向滚动） */
  table { font-size: 12.5px; }
  thead th { padding: 10px 12px; white-space: nowrap; }
  table td { padding: 10px 12px; }

  /* 选项卡 / 分段控件：横向滑动 */
  .warehouse-tabs, .seg-tabs {
    display: flex; max-width: 100%; min-width: 0;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .warehouse-tabs::-webkit-scrollbar, .seg-tabs::-webkit-scrollbar { display: none; }
  .wh-tab, .seg-tab { white-space: nowrap; flex-shrink: 0; }

  /* 分页 */
  .pagination { gap: 8px; padding: 12px 10px; flex-wrap: wrap; }
  .page-btn { min-width: 34px; height: 34px; padding: 0 10px; }

  /* 通用弹窗 */
  .modal-mask { padding: 12px; }
  .modal-header { padding: 15px 16px; }
  .modal-body { padding: 16px; }
  .modal-footer { padding: 12px 16px; flex-wrap: wrap; }
  .modal-footer .btn { flex: 1; min-width: 110px; }

  /* 登录页 */
  .login-brand { padding: 26px 20px 20px; }
  .login-form { padding: 22px 20px 20px; }

  /* ===== 运营数据大屏 ===== */
  .screen-page { margin: -14px; padding: 14px 12px 18px; min-height: calc(100vh - 56px); }
  body.screen-on .site-footer { margin: 0 -14px -18px; }
  .screen-header { gap: 10px; padding-bottom: 12px; margin-bottom: 14px; }
  .sh-title { font-size: 19px; letter-spacing: 2px; gap: 9px; }
  .sh-deco { width: 4px; height: 19px; }
  .sh-sub { font-size: 9px; letter-spacing: 2px; margin-left: 13px; }
  .sh-right { width: 100%; gap: 8px; }
  .sh-clock { font-size: 13px; padding: 5px 11px; letter-spacing: .5px; }
  .sh-btn { padding: 7px 13px; font-size: 12.5px; white-space: nowrap; }

  .screen-kpi { gap: 10px; margin-bottom: 12px; }
  .kpi-card { gap: 11px; padding: 13px 14px; border-radius: 10px; }
  .kpi-icon { width: 42px; height: 42px; font-size: 20px; border-radius: 11px; }
  .kpi-label { font-size: 11.5px; letter-spacing: .5px; }
  .kpi-value { font-size: 22px; }
  .kpi-sub { font-size: 10.5px; }
  .screen-rates { gap: 10px; margin-bottom: 12px; }

  .screen-wh-grid { gap: 10px; margin-bottom: 12px; }
  .screen-page .stat-card { padding: 13px 14px; border-radius: 10px; }
  .screen-page .card-header { padding: 11px 13px; }
  .screen-page .card-body { padding: 12px 12px 10px; }
  .screen-page .chart-card .card-body { height: 270px; }
  .screen-page .chart-card .card-body.table-wrap { max-height: 320px; }
  .screen-page table { font-size: 12px; }
  .screen-page thead th, .screen-page table td { padding: 9px 10px; }

  /* 环比下钻弹窗 */
  .mom-mask { padding: 12px; }
  .mom-modal { max-height: 92vh; border-radius: 12px; }
  .mom-modal-header { padding: 14px 16px 11px; }
  .mom-modal-body { padding: 14px 16px; }
  .mom-modal-footer { padding: 12px 16px; flex-wrap: wrap; }
  .mom-modal-footer .sh-btn { flex: 1; min-width: 130px; }
  .mm-title { font-size: 15.5px; }
  .mm-wh-table td, .mm-wh-table th { padding: 8px 9px; font-size: 12px; }
  .mm-wh-detail-scroll { max-height: 240px; }
}

@media (max-width: 480px) {
  /* 顶栏只留头像 */
  .user-badge #userName, .user-badge .user-role, .user-badge .caret { display: none; }
  .topbar-right { gap: 8px; }
  .page-title { font-size: 15px; }

  /* KPI 两列紧凑化 */
  .kpi-card { gap: 9px; padding: 11px 12px; }
  .kpi-icon { width: 38px; height: 38px; font-size: 18px; }
  .kpi-label { font-size: 11px; }
  .kpi-value { font-size: 20px; }
  .kpi-sub { display: none; }

  /* 效率指标三列迷你卡：去图标居中，保证 390px 不溢出 */
  .screen-rates { gap: 8px; margin-bottom: 12px; }
  .rate-card { justify-content: center; gap: 0; padding: 10px 8px; }
  .rate-card .kpi-icon { display: none; }
  .rate-card .kpi-info { text-align: center; }
  .rate-card .kpi-label { font-size: 10px; letter-spacing: 0; }
  .rate-card .kpi-value { font-size: 18px; }

  /* 大屏头部按钮均分一行 */
  .sh-right { justify-content: space-between; }
  .sh-right .sh-btn { flex: 1; text-align: center; }
  .sh-clock { flex-basis: 100%; text-align: center; }

  .screen-page .chart-card .card-body { height: 248px; }
  .mm-sum .ms-value { font-size: 22px; }
}
