/* ============================================================
   外卖骑手配送路径智能规划与风险可视化系统 - 大屏样式
   1920x1080 优先，深色科技风
   ============================================================ */

/* ---------- 设计变量 ---------- */
:root {
  --bg-deep:      #0A1A2F;
  --bg-panel:     rgba(13, 32, 58, 0.55);
  --bg-card:      rgba(16, 38, 68, 0.45);
  --border:       rgba(0, 229, 255, 0.18);
  --border-soft:  rgba(255, 255, 255, 0.06);

  --cyan:    #00E5FF;
  --green:   #00E676;
  --red:     #FF3B30;
  --orange:  #FFB300;
  --text:    #D6E6F5;
  --text-dim:#7A94B0;

  --radius:  10px;
  --gap:     12px;
  --topbar-h: 60px;
  --bottombar-h: 170px;
  --left-w:  320px;
  --right-w: 360px;

  --glow-cyan: 0 0 12px rgba(0, 229, 255, 0.35), inset 0 0 12px rgba(0, 229, 255, 0.06);
}

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

html, body {
  width: 100%; height: 100%;
  background: var(--bg-deep);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 13px;
  overflow: hidden;
}

/* ---------- 整体背景：径向渐变光斑 ---------- */
body {
  background:
    radial-gradient(1200px 600px at 20% -10%,  rgba(0,229,255,0.08), transparent 60%),
    radial-gradient(900px 500px at 110% 110%,   rgba(0,230,118,0.06), transparent 60%),
    linear-gradient(180deg, #0A1A2F 0%, #071426 100%);
}

/* ---------- 屏幕容器 ---------- */
.screen {
  width: 100vw; height: 100vh;
  display: flex; flex-direction: column;
  padding: 10px;
  gap: var(--gap);
}

/* ---------- 毛玻璃通用卡片 ---------- */
.glass {
  background: var(--bg-card);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--glow-cyan);
}

/* ============================================================
   顶部栏
   ============================================================ */
.topbar {
  height: var(--topbar-h);
  flex-shrink: 0;
  display: flex; align-items: center;
  padding: 0 18px;
  justify-content: space-between;
}

.topbar-left .logo { display: flex; align-items: center; gap: 10px; }
.logo-icon {
  width: 26px; height: 26px; border-radius: 6px;
  background: linear-gradient(135deg, var(--cyan), #0077FF);
  box-shadow: 0 0 14px var(--cyan);
  position: relative;
}
.logo-icon::after {
  content: ""; position: absolute; inset: 6px;
  border: 2px solid rgba(255,255,255,0.85); border-radius: 3px;
  border-top-color: transparent;
}
.title {
  font-size: 18px; font-weight: 600; letter-spacing: 1px;
  background: linear-gradient(90deg, #fff, var(--cyan));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

.topbar-center { display: flex; gap: 18px; }
.global-filter { display: flex; align-items: center; gap: 6px; }
.filter-label { color: var(--text-dim); font-size: 12px; }

.select {
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 12px;
  outline: none;
  cursor: pointer;
}
.select:focus { border-color: var(--cyan); box-shadow: 0 0 8px rgba(0,229,255,0.4); }

.topbar-right { display: flex; align-items: center; gap: 16px; }
.status-item { display: flex; align-items: center; gap: 6px; }
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse 1.6s infinite;
}
.status-dot.online { background: var(--green); }
.status-text { color: var(--text-dim); font-size: 12px; }
.clock {
  font-family: "Consolas", monospace;
  color: var(--cyan); font-size: 14px;
  letter-spacing: 1px;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(1.25); }
}

/* ============================================================
   主体三栏
   ============================================================ */
.main {
  flex: 1;
  display: flex;
  gap: var(--gap);
  min-height: 0;
}

.sidebar {
  display: flex; flex-direction: column; gap: var(--gap);
  overflow-y: auto;
  padding-right: 2px;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(0,229,255,0.3); border-radius: 2px; }

.leftbar  { width: var(--left-w);  flex-shrink: 0; }
.rightbar { width: var(--right-w); flex-shrink: 0; }

/* ---------- 卡片通用 ---------- */
.card {
  padding: 12px 14px;
}
.card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border-soft);
}
.card-title {
  font-size: 13px; font-weight: 600; color: var(--text);
  letter-spacing: 0.5px;
  padding-left: 8px;
  border-left: 3px solid var(--cyan);
}
.card-tag {
  font-size: 10px; color: var(--text-dim);
  border: 1px solid var(--border-soft);
  padding: 1px 6px; border-radius: 3px;
  letter-spacing: 1px;
}

/* ============================================================
   左侧：起终点
   ============================================================ */
.point-row {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
}
.point-label {
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #04121F;
  flex-shrink: 0;
}
.point-label.origin { background: var(--green); box-shadow: 0 0 8px var(--green); }
.point-label.dest   { background: var(--orange); box-shadow: 0 0 8px var(--orange); }

.point-input {
  flex: 1;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  padding: 6px 8px;
  color: var(--text);
  font-size: 12px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.point-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 8px rgba(0,229,255,0.3);
}

.btn-minus {
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(255,59,48,0.15);
  color: var(--red);
  border: 1px solid rgba(255,59,48,0.4);
  cursor: pointer;
  font-size: 14px; line-height: 1;
  flex-shrink: 0;
  transition: all .2s;
}
.btn-minus:hover { background: var(--red); color: #fff; }

.btn-add {
  width: 100%;
  margin-top: 4px;
  padding: 7px;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: 6px;
  color: var(--cyan);
  cursor: pointer;
  font-size: 12px;
  transition: all .2s;
}
.btn-add:hover { background: rgba(0,229,255,0.08); border-color: var(--cyan); }

/* ============================================================
   左侧：滑块
   ============================================================ */
.slider-group { margin-bottom: 12px; }
.slider-head {
  display: flex; justify-content: space-between;
  margin-bottom: 6px;
  font-size: 12px;
}
.slider-name { color: var(--text-dim); }
.slider-value { color: var(--cyan); font-family: Consolas, monospace; font-weight: 600; }

.slider {
  -webkit-appearance: none;
  width: 100%; height: 4px;
  background: linear-gradient(90deg, var(--cyan), rgba(0,229,255,0.15));
  border-radius: 2px;
  outline: none;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff;
  border: 3px solid var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
  cursor: pointer;
}
.slider::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 3px solid var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
  cursor: pointer;
}

/* ============================================================
   左侧：一键生成按钮
   ============================================================ */
.btn-primary {
  position: relative;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: var(--radius);
  background: linear-gradient(90deg, #0077FF, var(--cyan));
  color: #04121F;
  font-size: 14px; font-weight: 700; letter-spacing: 2px;
  cursor: pointer;
  overflow: hidden;
  transition: transform .15s;
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary-glow {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  transform: translateX(-100%);
  animation: shine 3s infinite;
}
@keyframes shine {
  0%   { transform: translateX(-100%); }
  60%  { transform: translateX(100%); }
  100% { transform: translateX(100%); }
}

/* ============================================================
   左侧：历史记录
   ============================================================ */
.history-card { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.history-list {
  list-style: none; overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px;
}
.history-item {
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(0,0,0,0.2);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .2s;
  display: flex; justify-content: space-between; align-items: center;
}
.history-item:hover { border-color: var(--cyan); background: rgba(0,229,255,0.06); }
.history-item.active {
  border-color: var(--cyan);
  background: rgba(0,229,255,0.1);
  box-shadow: inset 3px 0 0 var(--cyan);
}
.history-main { display: flex; flex-direction: column; gap: 2px; }
.history-name { font-size: 12px; color: var(--text); }
.history-meta { font-size: 10px; color: var(--text-dim); }
.history-badge {
  font-size: 10px; padding: 2px 6px; border-radius: 3px;
}
.history-badge.safe   { background: rgba(0,230,118,0.15); color: var(--green); }
.history-badge.fast   { background: rgba(0,229,255,0.15); color: var(--cyan); }
.history-badge.normal { background: rgba(255,179,0,0.15); color: var(--orange); }

/* ============================================================
   中间地图区
   ============================================================ */
.map-area {
  flex: 1;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--glow-cyan);
  min-width: 0;
}
.map-canvas {
  position: absolute; inset: 0;
  background: #0B1E36;
}
/* 让 Leaflet 地图贴合深色 */
.map-canvas .leaflet-container { background: #0B1E36; }
.map-canvas .leaflet-control-attribution {
  background: rgba(0,0,0,0.4) !important; color: var(--text-dim) !important;
  font-size: 9px !important;
}

/* 地图上方悬浮工具条 */
.map-toolbar {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px;
  padding: 6px 14px;
  z-index: 1000;
  border-radius: 20px;
}
.tool-group { display: flex; gap: 4px; }
.tool-btn {
  background: transparent; border: none;
  color: var(--text-dim);
  padding: 4px 12px;
  border-radius: 14px;
  cursor: pointer;
  font-size: 12px;
  transition: all .2s;
}
.tool-btn.active {
  background: rgba(0,229,255,0.15);
  color: var(--cyan);
  box-shadow: inset 0 0 8px rgba(0,229,255,0.2);
}
.tool-divider { width: 1px; height: 18px; background: var(--border-soft); }

.tool-switch {
  display: flex; align-items: center; gap: 6px; cursor: pointer;
}
.tool-label { font-size: 12px; color: var(--text-dim); }
.switch-input { display: none; }
.switch-track {
  width: 28px; height: 14px; border-radius: 7px;
  background: rgba(255,255,255,0.15);
  position: relative;
  transition: background .2s;
}
.switch-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 10px; height: 10px; border-radius: 50%;
  background: #fff;
  transition: all .2s;
}
.switch-input:checked + .switch-track {
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(0,229,255,0.5);
}
.switch-input:checked + .switch-track .switch-thumb { left: 16px; }

/* 地图图例 */
.map-legend {
  position: absolute; left: 12px; bottom: 20px;
  padding: 10px 12px;
  z-index: 1000;
  border-radius: 8px;
  font-size: 11px;
}
.legend-title { color: var(--text-dim); margin-bottom: 6px; font-size: 11px; }
.legend-row { display: flex; align-items: center; gap: 6px; margin: 3px 0; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.legend-dot.low      { background: var(--green); box-shadow: 0 0 6px var(--green); }
.legend-dot.mid      { background: var(--cyan);   box-shadow: 0 0 6px var(--cyan); }
.legend-dot.high     { background: var(--red); box-shadow: 0 0 6px var(--red); }
.legend-dot.extreme  { background: var(--red);    box-shadow: 0 0 6px var(--red); }

/* 地图缩放控件 */
.map-controls {
  position: absolute; right: 12px; bottom: 20px;
  display: flex; flex-direction: column; gap: 4px;
  z-index: 1000;
}
.map-ctrl {
  width: 30px; height: 30px;
  background: var(--bg-panel);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--cyan);
  font-size: 16px;
  cursor: pointer;
  transition: all .2s;
}
.map-ctrl:hover { background: rgba(0,229,255,0.15); }

/* 事故点脉冲（占位示例） */
.accident-pin {
  position: absolute; z-index: 900;
  width: 24px; height: 24px;
  transform: translate(-50%, -50%);
}
.accident-icon {
  position: absolute; inset: 0;
  background: var(--red);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  box-shadow: 0 0 10px var(--red);
  z-index: 2;
}
.accident-pulse {
  position: absolute; inset: -6px;
  border-radius: 50%;
  border: 2px solid var(--red);
  animation: ring 1.5s infinite;
}
@keyframes ring {
  0%   { transform: scale(0.6); opacity: 1; }
  100% { transform: scale(1.8); opacity: 0; }
}

/* ============================================================
   右侧栏
   ============================================================ */
.kpi-row {
  display: flex; gap: 8px;
}
.kpi-card {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius);
  text-align: center;
}
.kpi-label { font-size: 11px; color: var(--text-dim); margin-bottom: 6px; }
.kpi-value {
  font-family: Consolas, monospace;
  font-size: 22px; font-weight: 700;
  color: var(--cyan);
}
.kpi-value.danger  { color: var(--red); }
.kpi-value.success { color: var(--green); }
.kpi-unit { font-size: 11px; color: var(--text-dim); margin-left: 2px; font-weight: 400; }
.kpi-trend { font-size: 10px; margin-top: 4px; }
.kpi-trend.up   { color: var(--green); }
.kpi-trend.down { color: var(--red); }

.chart-card {
  flex: 1;
  min-height: 0;
  display: flex; flex-direction: column;
}
.chart-box {
  flex: 1; min-height: 120px;
  /* 图表占位背景（开发期示意） */
  background:
    linear-gradient(180deg, rgba(0,229,255,0.03), transparent 1px) 0 0/100% 20%,
    transparent;
  border-radius: 6px;
}

/* ============================================================
   底部栏
   ============================================================ */
.bottombar {
  height: var(--bottombar-h);
  flex-shrink: 0;
  display: flex;
  gap: var(--gap);
}

.compare-card { flex: 1.2; display: flex; flex-direction: column; }
.compare-body {
  flex: 1;
  display: flex; align-items: center; justify-content: space-around;
  gap: 16px;
}
.compare-col { flex: 1; }
.compare-name {
  font-size: 13px; font-weight: 600;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--border-soft);
}
.compare-name.fast { color: var(--cyan); }
.compare-name.safe { color: var(--green); }
.compare-stats { display: flex; flex-direction: column; gap: 4px; }
.stat {
  display: flex; justify-content: space-between;
  font-size: 12px;
}
.stat-k { color: var(--text-dim); }
.stat-v { font-family: Consolas, monospace; color: var(--text); }
.stat-v.warn { color: var(--orange); }
.stat-v.good { color: var(--green); }
.compare-vs {
  font-size: 16px; font-weight: 700;
  color: var(--orange);
  padding: 8px 14px;
  border: 1px solid var(--orange);
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(255,179,0,0.4);
}

.timeline-card { flex: 1; display: flex; flex-direction: column; }
.timeline-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.timeline-time {
  font-family: Consolas, monospace;
  color: var(--cyan); font-size: 16px; font-weight: 700;
}
.timeline-body {
  flex: 1;
  display: flex; align-items: center; gap: 12px;
}
.play-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #0077FF, var(--cyan));
  color: #04121F;
  border: none;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(0,229,255,0.5);
  flex-shrink: 0;
}
.timeline-track-wrap { flex: 1; position: relative; padding-top: 14px; }
.timeline-ticks {
  display: flex; justify-content: space-between;
  font-size: 9px; color: var(--text-dim);
  margin-bottom: 4px;
  font-family: Consolas, monospace;
}
.timeline-range {
  -webkit-appearance: none;
  width: 100%; height: 6px;
  background: linear-gradient(90deg, var(--cyan), var(--green), var(--orange), var(--red));
  border-radius: 3px;
  outline: none;
}
.timeline-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff;
  border: 3px solid var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
  cursor: pointer;
}
.speed-select { width: 60px; }

/* ============================================================
   响应式：小于 1600 时缩小字号
   ============================================================ */
@media (max-width: 1600px) {
  :root { --left-w: 280px; --right-w: 320px; --bottombar-h: 160px; }
  body { font-size: 12px; }
  .title { font-size: 16px; }
  .kpi-value { font-size: 18px; }
}

@media (max-width: 1366px) {
  :root { --left-w: 240px; --right-w: 280px; --bottombar-h: 150px; }
  .topbar-center .global-filter:nth-child(3) { display: none; }
}

/* ============================================================
   地图模块补充样式
   ============================================================ */

/* 路段悬浮 tooltip */
.road-tooltip {
  background: rgba(10, 26, 47, 0.95) !important;
  border: 1px solid var(--cyan) !important;
  border-radius: 8px !important;
  box-shadow: 0 0 15px rgba(0,229,255,0.3) !important;
  color: var(--text) !important;
  padding: 8px 12px !important;
  font-size: 11px !important;
  white-space: nowrap;
}
.road-tooltip::before { display: none !important; }
.tip-title {
  font-weight: 700; color: var(--cyan);
  margin-bottom: 6px; padding-bottom: 4px;
  border-bottom: 1px dashed rgba(0,229,255,0.3);
}
.tip-row {
  display: flex; justify-content: space-between; gap: 16px;
  margin: 2px 0;
}
.tip-row span { color: var(--text-dim); }
.tip-row b { color: #fff; font-weight: 500; }

/* 事故点脉冲 */
.accident-pin-wrap { background: transparent; border: none; }
.accident-pin {
  position: relative; width: 24px; height: 24px;
}
.accident-icon {
  position: absolute; inset: 0;
  background: var(--red); color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  box-shadow: 0 0 10px var(--red);
  z-index: 2;
  cursor: pointer;
}
.accident-pulse {
  position: absolute; inset: -6px;
  border-radius: 50%;
  border: 2px solid var(--red);
  animation: ring 1.5s infinite;
  pointer-events: none;
}

/* 事故 popup */
.acc-popup-wrap .leaflet-popup-content-wrapper {
  background: rgba(10,26,47,0.95);
  border: 1px solid var(--red);
  border-radius: 8px;
  color: var(--text);
  box-shadow: 0 0 20px rgba(255,59,48,0.4);
}
.acc-popup-wrap .leaflet-popup-tip {
  background: rgba(10,26,47,0.95);
  border: 1px solid var(--red);
}
.acc-popup-title {
  color: var(--red); font-weight: 700; margin-bottom: 6px;
  padding-bottom: 4px; border-bottom: 1px dashed rgba(255,59,48,0.4);
}
.acc-row {
  display: flex; justify-content: space-between; gap: 16px;
  font-size: 11px; margin: 3px 0;
}
.acc-row span { color: var(--text-dim); }

/* 红绿灯点 */
.tl-wrap { background: transparent; border: none; }
.tl-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  border: 2px solid #fff;
}

/* 起终点 marker */
.pt-wrap { background: transparent; border: none; }
.pt-start, .pt-end {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px; color: #04121F;
  border: 2px solid #fff;
}
.pt-start { background: var(--green); box-shadow: 0 0 12px var(--green); }
.pt-end   { background: var(--orange); box-shadow: 0 0 12px var(--orange); }

/* Leaflet 默认控件颜色覆盖 */
.leaflet-bar a {
  background: var(--bg-panel) !important;
  color: var(--cyan) !important;
  border: 1px solid var(--border) !important;
}
.leaflet-popup-content-wrapper { border-radius: 8px; }

/* ============================================================
   路线发光 + 对比表格
   ============================================================ */
.route-glow {
  filter: drop-shadow(0 0 6px #00E5FF) drop-shadow(0 0 12px rgba(0,229,255,0.6));
}

.point-input { appearance: none; -webkit-appearance: none; }

/* 对比表格 */
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.compare-table th, .compare-table td {
  padding: 5px 8px;
  text-align: center;
  border-bottom: 1px dashed var(--border-soft);
}
.compare-table th {
  color: var(--text-dim); font-weight: 500; font-size: 11px;
}
.compare-table th.col-a { color: #9AA5B1; }
.compare-table th.col-b { color: var(--green); }
.compare-table td:first-child { color: var(--text-dim); text-align: left; }
.compare-table td.col-a { color: #C9D4E0; font-family: Consolas, monospace; }
.compare-table td.col-b { color: var(--cyan); font-family: Consolas, monospace; }

/* 安全路径列绿色描边高亮 */
.compare-card.col-b-active {
  border-color: rgba(0, 230, 118, 0.5);
  box-shadow: 0 0 20px rgba(0, 230, 118, 0.25), inset 0 0 20px rgba(0,230,118,0.05);
}
.compare-card.col-b-active .col-b {
  background: rgba(0, 230, 118, 0.08);
  color: var(--green);
}
.compare-card.col-a-active .col-a {
  background: rgba(0, 229, 255, 0.08);
}

/* 结论句 */
.conclusion {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  background: rgba(0, 230, 118, 0.08);
  border-left: 3px solid var(--green);
  color: var(--green);
  font-size: 12px;
  letter-spacing: 0.5px;
  opacity: 0;
  transition: opacity .4s;
}
.conclusion.show { opacity: 1; }

/* ============================================================
   时间轴播放器
   ============================================================ */
.timeline-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
  gap: 12px;
}
.timeline-stats { display: flex; gap: 8px; flex: 1; justify-content: center; }
.ts-pill {
  font-size: 11px; color: var(--text-dim);
  padding: 3px 10px;
  border-radius: 12px;
  background: rgba(0,229,255,0.08);
  border: 1px solid rgba(0,229,255,0.2);
}
.ts-pill b { color: var(--cyan); font-family: Consolas, monospace; margin-left: 3px; }
.ts-pill.warn {
  background: rgba(255,59,48,0.08);
  border-color: rgba(255,59,48,0.3);
}
.ts-pill.warn b { color: var(--red); }

.timeline-track-wrap {
  flex: 1; position: relative;
  padding-top: 18px;
}
.timeline-peaks {
  position: absolute; top: 18px; left: 0; right: 0; height: 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.04);
  overflow: hidden;
}
.peak-bar {
  position: absolute; top: 0; bottom: 0;
  opacity: 0.35;
}
.peak-bar + .peak-bar { margin-left: 1px; }

.timeline-ticks {
  display: flex; justify-content: space-between;
  font-size: 9px; color: var(--text-dim);
  margin-top: 10px;
  font-family: Consolas, monospace;
}
.timeline-range {
  -webkit-appearance: none;
  width: 100%; height: 6px;
  background: linear-gradient(90deg, #00E676 0%, #00E5FF 30%, #FFB300 60%, #FF3B30 100%);
  border-radius: 3px;
  outline: none;
  margin-top: -4px;
}
.timeline-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff;
  border: 3px solid var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
  cursor: pointer;
}
.speed-select { width: 60px; }

/* ============================================================
   多单配送顺序（可拖拽）
   ============================================================ */
.order-card { flex-shrink: 0; }
.order-summary {
  display: flex; justify-content: space-around;
  padding: 6px 8px;
  margin-bottom: 8px;
  background: rgba(0,229,255,0.06);
  border-radius: 6px;
  font-size: 11px; color: var(--text-dim);
}
.order-summary b { color: var(--cyan); font-family: Consolas, monospace; margin-left: 3px; }

.order-list {
  list-style: none;
  display: flex; flex-direction: column; gap: 4px;
  max-height: 160px; overflow-y: auto;
}
.order-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  cursor: grab;
  transition: all .15s;
}
.order-item:hover { border-color: var(--cyan); }
.order-item.dragging {
  opacity: 0.4;
  border: 1px dashed var(--cyan);
}
.order-num {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--orange);
  color: #04121F;
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.order-name { flex: 1; font-size: 12px; color: var(--text); }
.order-drag { color: var(--text-dim); cursor: grab; font-size: 14px; }

/* 地图上的顺序编号徽章 */
.pt-wrap { background: transparent; border: none; }
.order-badge {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--orange);
  color: #04121F;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  border: 2px solid #fff;
  box-shadow: 0 0 10px var(--orange);
}

/* ============================================================
   加载动画 & 全局过渡
   ============================================================ */

/* 全局过渡 */
.card, .kpi-card, .glass, .tool-btn, .tool-switch, .order-item,
.history-item, .btn-add, .btn-minus, .map-ctrl, .play-btn,
.point-input, .select, .slider, .timeline-range {
  transition: all 0.3s ease;
}

/* 全屏加载遮罩 */
#loading {
  position: fixed; inset: 0;
  background: #0A1A2F;
  z-index: 99999;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 20px;
  transition: opacity 0.6s ease, visibility 0.6s;
}
#loading.hide { opacity: 0; visibility: hidden; }
.loader-ring {
  width: 56px; height: 56px;
  border: 3px solid rgba(0,229,255,0.15);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
.loader-text {
  color: var(--cyan);
  font-size: 14px; letter-spacing: 3px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 卡片依次入场 */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.screen .card, .screen .kpi-card, .screen .topbar {
  animation: fadeUp 0.5s ease both;
}
.screen .topbar           { animation-delay: 0.05s; }
.screen .leftbar .card:nth-of-type(1) { animation-delay: 0.10s; }
.screen .leftbar .card:nth-of-type(2) { animation-delay: 0.18s; }
.screen .leftbar .order-card          { animation-delay: 0.26s; }
.screen .rightbar .kpi-row            { animation-delay: 0.20s; }
.screen .rightbar .chart-card:nth-of-type(1) { animation-delay: 0.28s; }
.screen .rightbar .chart-card:nth-of-type(2) { animation-delay: 0.36s; }
.screen .rightbar .chart-card:nth-of-type(3) { animation-delay: 0.44s; }
.screen .bottombar .card:nth-of-type(1) { animation-delay: 0.50s; }
.screen .bottombar .timeline-card      { animation-delay: 0.58s; }

/* 地图淡入 */
.map-canvas { animation: fadeIn 1s ease 0.3s both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* 按钮 loading 态 */
.btn-primary.loading {
  pointer-events: none;
  opacity: 0.85;
}
.btn-primary.loading .btn-primary-glow { display: none; }
.btn-primary.loading::before {
  content: "";
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(4,18,31,0.3);
  border-top-color: #04121F;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

/* 对比卡片高亮过渡 */
.compare-card, .compare-card .col-a, .compare-card .col-b {
  transition: all 0.4s ease;
}
.compare-card.col-a-active .col-a {
  background: rgba(0,229,255,0.12);
  transition: background 0.4s ease;
}
.compare-card.col-b-active .col-b {
  background: rgba(0,230,118,0.12);
  transition: background 0.4s ease;
}
/* === v2 consistency and accessibility === */
.simulation-banner{position:fixed;right:18px;bottom:5px;color:#8eb0c5;z-index:2000;font-size:11px;pointer-events:none;text-shadow:0 1px 3px #081522}
.toast{position:fixed;top:85px;left:50%;transform:translate(-50%,-15px);opacity:0;pointer-events:none;z-index:4000;background:rgba(12,34,57,.97);padding:12px 20px;border:1px solid #00E5FF;border-radius:9px;color:#ecfaff;box-shadow:0 8px 28px #0008;transition:opacity .3s,transform .3s;max-width:min(90vw,550px);font-size:13px}
.toast.show{opacity:1;transform:translate(-50%,0)}
.order-item{cursor:grab;user-select:none}.order-item:active{cursor:grabbing}.order-item.dragging{opacity:.4}
.order-action{margin-top:9px}.order-action button{width:100%}
.compare-table th.col-a,.compare-table th.col-b{cursor:pointer;transition:background .3s,box-shadow .3s}
.compare-table th.active-route{background:rgba(0,229,255,.14);box-shadow:inset 0 -2px #00E5FF}
.chart-box{min-height:150px}
.risk-tooltip{background:#132b42!important;color:#eaffff!important;border:1px solid #3c7286!important;line-height:1.55}
.risk-tooltip:before{border-top-color:#132b42!important}
#loading.error{cursor:default;background:rgba(5,18,35,.96)}
@media(max-width:1000px){.simulation-banner{font-size:9px}.topbar-center{gap:4px}.global-filter{max-width:125px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important}}
.history-entry{font:inherit;display:block;text-align:left;background:transparent;color:#C6EBFC;cursor:pointer;border:0;width:100%;padding:4px 0;line-height:1.6}
.history-entry:hover{color:#00E5FF}
.timeline-card.is-peak{border-color:rgba(255,179,0,.7);box-shadow:0 0 18px rgba(255,179,0,.14)}

.map-toolbar{max-width:calc(100% - 18px);overflow-x:auto;white-space:nowrap;scrollbar-width:thin;gap:10px}
.map-toolbar .tool-group,.map-toolbar .tool-switch{flex-shrink:0}
.conclusion{font-size:11px;line-height:1.45}
.compare-table td{white-space:nowrap}
@media(max-width:1200px){.title{font-size:14px}.topbar-center{gap:5px}.topbar-right{gap:5px}.clock{font-size:10px}}
