/* ===== 基础与变量 ===== */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #1e293b;
  --text-secondary: #64748b;
  --border: #e2e8f0;
  --sidebar-bg: #0f172a;
  --sidebar-text: #94a3b8;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --info: #0891b2;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, .15);
}

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

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

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

/* ===== 侧边栏 ===== */
.sidebar {
  width: 230px;
  background: linear-gradient(180deg, #0f172a 0%, #16233d 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;
}

.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 {
  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 4px 14px rgba(37, 99, 235, .4);
}
.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, .86);
  backdrop-filter: blur(10px) saturate(1.4);
  -webkit-backdrop-filter: blur(10px) saturate(1.4);
  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, .7);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .05);
  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-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 10px;
  font-size: 12.5px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  margin-right: 6px;
  transition: all .15s;
}
.btn-sm.edit { color: var(--primary); border-color: #bfdbfe; }
.btn-sm.edit:hover { background: var(--primary-light); }
.btn-sm.del { color: var(--danger); border-color: #fecaca; }
.btn-sm.del:hover { background: #fee2e2; }

/* ===== 表格 ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  text-align: left;
  padding: 12px 14px;
  background: #f8fafc;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: .3px;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1;
}
tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  white-space: nowrap;
  transition: background .12s;
}
tbody tr:nth-child(even) { background: #fbfcfe; }
tbody tr:hover { background: #eff6ff; }
tbody tr:last-child td { border-bottom: none; }
.empty-row td { text-align: center; color: var(--text-secondary); padding: 40px; }

/* ===== 细滚动条 ===== */
.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; }

/* ===== 弹窗 ===== */
.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: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #06b6d4 100%);
  opacity: 0; visibility: hidden; transition: all .3s;
}
.login-mask.show { opacity: 1; visibility: visible; }
.login-mask::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,.1) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(255,255,255,.08) 0%, transparent 40%);
  pointer-events: none;
}
.login-card {
  width: 400px; max-width: 92vw; background: #fff;
  border-radius: 20px; overflow: hidden;
  box-shadow: 0 25px 60px rgba(0,0,0,.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, #2563eb, #06b6d4);
  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, #2563eb, #06b6d4);
  color: #fff; font-size: 15px; font-weight: 700; letter-spacing: 4px;
  cursor: pointer; transition: all .2s;
  box-shadow: 0 4px 14px rgba(37,99,235,.35);
}
.login-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(37,99,235,.45); }
.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;
}
.perm-all-label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.perm-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 14px;
}
.perm-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  background: #f8fafc; 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-cell { max-width: 320px; }
.perm-chip {
  display: inline-block; padding: 2px 8px; margin: 2px 3px;
  border-radius: 6px; font-size: 11.5px; font-weight: 500;
  background: #eff6ff; color: #2563eb; white-space: nowrap;
}

/* ===== 底部备案信息 ===== */
.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; }
