/* ===== 基础重置 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
/* v20260907BQ：根容器高度用 --app-height CSS 变量（由 JS 从 window.outerHeight 设置）。
   缓存 webclip 下 100dvh/layout viewport = 795，但 WebView 实际 = 物理屏 852，
   导致底部露底色。outerHeight 在独立模式下返回物理屏高，是唯一能稳定拿到 852 的值。
   兜底：未设置变量时用 100dvh。 */
:root {
  --app-height: 100dvh;
}
html, body {
  width: 100%;
  min-height: var(--app-height, 100dvh);
  margin: 0;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro SC", "SF Pro Text", "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Hiragino Sans GB", "Segoe UI", Roboto, "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; font-variant-numeric: tabular-nums;
}
/* #app 同样铺满，作为业务根容器 */
#app {
  min-height: var(--app-height, 100dvh);
  position: relative;
}
/* v20260907D：全站统一字体（按钮/输入框等不继承 body 字体的元素也统一） */
button, input, select, textarea, .mbn-item, .topbar-toggle, .fav-tag { font-family: inherit; }
body { background: #f0f0f0; color: #333; }
.hidden { display: none !important; }

/* ===== 弹窗遮罩（所有弹窗共用） ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0, 0, 0, 0.45);
  display: flex; align-items: center; justify-content: center;
}

/* ===== 登录弹窗专属样式 ===== */
/* v20260907BQ：登录页纯色底，去掉渐变和蓝色边框 */
#login-modal {
  background: #0d1840;
}
/* 移除渐变伪元素 */
#login-modal::before,
#login-modal::after {
  display: none !important;
}

.login-card {
  position: relative; z-index: 1;
  width: 400px; max-width: 90vw;
  background: rgba(13, 20, 40, 0.75);
  backdrop-filter: blur(24px) saturate(1.2);
  border: none;
  border-radius: 24px;
  padding: 44px 36px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255,255,255,0.05);
  animation: login-card-in 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* v20260907BW：登录页背景色统一为 #0d1840（与 PWA body 背景一致），
   消除亚像素缝隙导致的底部色块。card 和 modal 同色，body 也同色，三层无色差。 */
@media (max-width: 1024px) and (display-mode: standalone) {
  #login-modal { background: #0d1840 !important; }
  .login-card {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: var(--app-height, 100dvh) !important;
    bottom: auto !important;
    width: 100vw !important;
    max-width: 100vw !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: hidden !important;
    border-radius: 0 !important;
    padding: calc(20px + env(safe-area-inset-top, 0px)) 36px calc(20px + env(safe-area-inset-bottom, 0px)) !important;
    box-shadow: none !important;
    background: #0d1840;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}
@media (max-width: 1024px) {
  body.pwa-standalone #login-modal { background: #0d1840 !important; }
  body.pwa-standalone .login-card {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: var(--app-height, 100dvh) !important;
    bottom: auto !important;
    width: 100vw !important;
    max-width: 100vw !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: hidden !important;
    border-radius: 0 !important;
    padding: calc(20px + env(safe-area-inset-top, 0px)) 36px calc(20px + env(safe-area-inset-bottom, 0px)) !important;
    box-shadow: none !important;
    background: #0d1840;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}
@keyframes login-card-in {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.login-header { text-align: center; margin-bottom: 32px; }
.login-icon {
  font-size: 52px; margin-bottom: 14px;
  display: inline-block;
  filter: drop-shadow(0 0 12px rgba(0, 212, 255, 0.4));
  animation: login-icon-float 3s ease-in-out infinite;
}
.login-icon img {
  display: block;
  width: 48px; height: 48px;
  border-radius: 12px;
}
@keyframes login-icon-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.login-card h1 {
  font-size: 23px; font-weight: 700; color: #fff; margin-bottom: 8px;
  background: linear-gradient(135deg, #ffffff, #a0c8e8);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.login-card p { font-size: 13px; color: #6b7a99; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 12px; color: #6b7a99; margin-bottom: 7px; letter-spacing: 0.5px; font-weight: 500; }
.form-group input {
  width: 100%; padding: 13px 16px;
  background: rgba(5, 10, 30, 0.5);
  border: 1px solid rgba(0, 212, 255, 0.12);
  border-radius: 12px;
  color: #fff; font-size: 15px; outline: none;
  transition: all 0.25s;
}
.form-group input::placeholder { color: #3a4868; }
.form-group input:focus {
  border-color: rgba(0, 212, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.08);
  background: rgba(5, 10, 30, 0.7);
}
.error-msg { color: #ff4757; font-size: 13px; min-height: 18px; margin-bottom: 8px; text-align: center; }
#login-btn {
  width: 100%; padding: 14px;
  background: linear-gradient(135deg, #00d4ff, #0099cc);
  border: none; border-radius: 12px;
  color: #001020; font-size: 16px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all 0.25s;
  box-shadow: 0 4px 16px rgba(0, 212, 255, 0.25);
}
#login-btn:hover { opacity: 0.95; box-shadow: 0 6px 24px rgba(0, 212, 255, 0.35); transform: translateY(-1px); }
#login-btn:active { transform: scale(0.98); }
#login-btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; transform: none; }
.login-footer {
  margin-top: 16px;
  text-align: center;
  font-size: 13px;
  color: #6b7a99;
}
.login-footer .register-link {
  color: #00d4ff;
  text-decoration: none;
  font-weight: 600;
  margin-left: 4px;
  transition: color 0.2s;
}
.login-footer .register-link:hover { color: #38e0ff; text-decoration: underline; }
.login-hint {
  margin-top: 12px;
  text-align: center;
  font-size: 11px;
  color: #4a5878;
  line-height: 1.6;
  padding: 10px 12px;
  background: rgba(0, 212, 255, 0.03);
  border-radius: 10px;
  border: 1px solid rgba(0, 212, 255, 0.06);
}
.login-hint b { color: #8aa8c8; }

/* ===== Spinner ===== */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: #00d4ff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 顶部栏 ===== */
.top-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: 56px;
  background: linear-gradient(180deg, rgba(22, 32, 52, 0.95) 0%, rgba(18, 26, 44, 0.92) 100%);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(0, 212, 255, 0.08);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  box-shadow: 0 1px 0 rgba(0, 212, 255, 0.03), 0 4px 24px rgba(0, 0, 0, 0.15);
}
.top-bar-left { display: flex; align-items: center; gap: 10px; }
.top-bar-left .logo { font-size: 22px; filter: drop-shadow(0 2px 4px rgba(0, 212, 255, 0.2)); }
.top-bar-left .title {
  font-size: 16px; font-weight: 600; color: #fff;
  letter-spacing: 0.3px;
  background: linear-gradient(135deg, #ffffff 0%, #b3d9ff 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.top-bar-right { display: flex; align-items: center; gap: 6px; }
.stat-item { display: flex; flex-direction: column; align-items: center; padding: 0 10px; }
.stat-label { font-size: 10px; color: #8b9bb4; letter-spacing: 0.5px; }
.stat-value { font-size: 16px; font-weight: 700; color: #00d4ff; font-variant-numeric: tabular-nums; }
.stat-value.gold { color: #ffd700; }
.stat-divider { width: 1px; height: 28px; background: rgba(255, 255, 255, 0.1); margin: 0 4px; }
.user-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 10px; margin-left: 6px;
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 18px;
  cursor: pointer;
  transition: all 0.2s;
  max-width: 180px;
}
.user-chip:hover { background: rgba(0, 212, 255, 0.15); border-color: rgba(0, 212, 255, 0.4); }
.user-avatar { font-size: 13px; opacity: 0.8; }
.user-email {
  font-size: 12px; color: #d1d5db;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}
.source-status-indicator {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 18px;
  font-size: 11px;
  color: #10b981;
  cursor: default;
  transition: all 0.3s;
  white-space: nowrap;
}
.source-status-indicator.warn {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.4);
  color: #f59e0b;
}
.source-status-indicator.error {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.4);
  color: #ef4444;
  animation: source-pulse 1.5s ease-in-out infinite;
}
.source-dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block;
}
.source-dot-ok { background: #10b981; box-shadow: 0 0 6px #10b981; }
.source-dot-warn { background: #f59e0b; box-shadow: 0 0 6px #f59e0b; }
.source-dot-error { background: #ef4444; box-shadow: 0 0 6px #ef4444; }
.source-status-text { font-weight: 600; }
@keyframes source-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.icon-btn {
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.15);
  color: #00d4ff;
  width: 36px; height: 36px;
  border-radius: 10px; cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease;
}
.icon-btn:hover {
  background: rgba(0, 212, 255, 0.18);
  border-color: rgba(0, 212, 255, 0.35);
  transform: translateY(-1px);
}
.icon-btn:active { transform: translateY(0); }
.icon-btn.off { color: #6b7a99; border-color: rgba(107, 122, 153, 0.2); }
.icon-btn.on { background: rgba(0, 255, 136, 0.12); border-color: rgba(0, 255, 136, 0.3); color: #00ff88; }
.icon-btn.loading { animation: spin 0.7s linear infinite; }
.icon-btn .auto-sec { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
/* 顶栏"显示线路 / 显示站点"切换按钮 */
.topbar-toggle {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 10px;
  font-size: 12px; font-weight: 600;
  color: #00d4ff;
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.topbar-toggle:hover { background: rgba(0, 212, 255, 0.18); border-color: rgba(0, 212, 255, 0.4); }
.topbar-toggle:not(.on) { color: #6b7a99; background: rgba(107, 122, 153, 0.06); border-color: rgba(107, 122, 153, 0.25); }

/* ===== 地图 ===== */
#map { position: absolute; top: 56px; left: 0; right: 0; bottom: 0; background: #e8e8e8; }
.leaflet-container { background: #e8e8e8; }
/* v20260916p：灰色底图切线路更清楚 —— 用 CSS 滤镜只对瓦片层变灰（高德 style=8 参数不返回灰度瓦片，滤镜 100% 生效；
   只过滤 .leaflet-tile-pane，车辆标记/编号标签（高 Pane）保持原色，灰底+彩标看线路最清楚。
   v20260916p：纯灰不保留色彩（grayscale(1)），brightness 提亮让灰度更浅不压线路 */
#map.gray .leaflet-tile-pane { filter: grayscale(1) brightness(1.15); }

/* ===== 车辆编号标签 ===== */
.bus-label {
  /* v20260907S修正：Leaflet 会用内联 style.transform 定位 divIcon 容器，
     把 transform 写在容器上会被覆盖 → 车号整体跑偏。故容器保持默认定位、
     pointer-events:none 只让文字本身响应点击（点文字→冒泡到容器→Leaflet 命中 marker）。 */
  pointer-events: none;
  cursor: pointer;
  display: inline-block !important;
  width: auto !important;
  height: auto !important;
  background: transparent;
  border: none;
}
.bus-label-text {
  display: inline-block;
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.75);
  color: #0066cc;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  border: 1px solid rgba(0, 102, 204, 0.6);
  white-space: nowrap;
  transform: translate(-50%, -100%); /* 视觉偏移在子元素上，容器被内联 transform 覆盖也不影响 */
  position: relative; /* 供 .bus-label-text::after 扩大手机点击命中区 */
  pointer-events: auto; /* v20260907S：点住显示的车号即可打开车辆详情 */
  cursor: pointer;
  user-select: none;
  text-shadow: 0 0 3px rgba(255, 255, 255, 0.5);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.bus-label-text.fav-line {
  color: #ffd700;
  border-color: rgba(255, 215, 0, 0.9);
}
.bus-label-text.fav-vehicle {
  color: #ff3b3b;
  border-color: rgba(255, 59, 59, 1);
  background: rgba(40, 0, 0, 0.85);
}
.bus-label-text.customer-vehicle {
  color: #a855f7;
  border-color: rgba(168, 85, 247, 1);
  background: rgba(30, 0, 50, 0.85);
}
.bus-label-text.searched {
  color: #00aa44;
  border-color: rgba(0, 170, 68, 0.9);
}
.bus-label-text.warn-vehicle {
  color: #fff;
  border-color: #ef4444;
  background: rgba(120, 0, 0, 0.9);
  font-size: 12px;
  font-weight: 800;
  animation: labelBlink 1.5s ease-in-out infinite;
}
.bus-label-text.no-gps-vehicle {
  color: #94a3b8;
  border-color: rgba(148, 163, 184, 0.7);
  background: rgba(30, 41, 59, 0.8);
  border-style: dashed;
}
@keyframes labelBlink {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
  50% { box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2); }
}

/* ===== 驻车位置标注（点车即定位） ===== */
.park-locate-icon {
  pointer-events: auto;
  cursor: pointer;
  display: inline-block !important;
  width: auto !important;
  height: auto !important;
  background: transparent;
  border: none;
}
.park-locate-pin {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(31, 58, 147, 0.95);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  border-radius: 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  white-space: nowrap;
  transform: translate(-50%, -100%);
  cursor: pointer;
  user-select: none;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
  animation: parkPinDrop 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.park-locate-pin::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -8px;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(31, 58, 147, 0.95);
  border-bottom: none;
}
@keyframes parkPinDrop {
  from { transform: translate(-50%, -150%) scale(0.7); opacity: 0; }
  to { transform: translate(-50%, -100%) scale(1); opacity: 1; }
}

/* 线路走向标签（地图上） */
.line-route-label { pointer-events: none; }
.line-route-label-text {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  background: rgba(255, 255, 255, 0.95);
  border: 1.5px solid #555;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(4px);
}
.line-route-label-text .line-route-num {
  font-size: 13px;
  font-weight: 800;
}
.line-route-label-text .line-route-dir {
  font-size: 9px;
  opacity: 0.7;
  font-weight: 500;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 站点 tooltip */
.station-tip-wrap.leaflet-tooltip {
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  padding: 4px 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  color: #1f2937;
  font-size: 12px;
  white-space: nowrap;
}
.station-tip {
  display: flex;
  align-items: center;
  gap: 6px;
}
.station-tip-idx {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px; height: 18px;
  background: #1f2937;
  color: #fff;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
}
.station-tip-name {
  font-weight: 600;
}
.station-tip-end {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  border-radius: 4px;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 600;
}

/* ===== 搜索面板 ===== */
.search-panel {
  position: fixed; top: 72px; left: 16px; z-index: 997;
  width: 420px; max-width: calc(100vw - 32px);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.04);
}
.search-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; cursor: move;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.9) 0%, rgba(241, 245, 249, 0.7) 100%);
  user-select: none;
}
.search-header:hover { background: linear-gradient(180deg, rgba(241, 245, 249, 0.95) 0%, rgba(236, 241, 248, 0.8) 100%); }
.panel-title { font-size: 14px; font-weight: 700; color: #1a2332; letter-spacing: 0.3px; }
.panel-resize-handle {
  position: absolute;
  right: 0; bottom: 0;
  width: 20px; height: 20px;
  cursor: nwse-resize;
  display: flex; align-items: flex-end; justify-content: flex-end;
  font-size: 12px; color: rgba(107, 122, 153, 0.5);
  padding: 2px 4px;
  user-select: none;
  z-index: 10;
}
.panel-resize-handle:hover { color: rgba(0, 102, 204, 0.8); }
.toggle-btn {
  background: none; border: none; color: #6b7a99;
  font-size: 20px; cursor: pointer; line-height: 1;
}
.panel-body { padding: 14px 16px; max-height: calc(100vh - 200px); max-height: calc(100dvh - 200px); overflow-y: auto; }
.panel-body.collapsed { display: none; }
#search-input, #fav-input, #fav-vehicle-input, #customer-input {
  width: 100%; padding: 10px 14px;
  background: rgba(245, 247, 250, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px; color: #1a2332; font-size: 14px; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
#search-input:focus, #fav-input:focus, #fav-vehicle-input:focus, #customer-input:focus {
  border-color: #3b82f6;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
#search-input { margin-bottom: 14px; }
.fav-section { margin-bottom: 14px; }
.customer-section {
  background: rgba(168, 85, 247, 0.04);
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(168, 85, 247, 0.1);
}
.section-label { font-size: 12px; color: #4a5568; margin-bottom: 8px; font-weight: 600; }
.fav-input-row { display: flex; gap: 6px; }
.fav-input-row input { flex: 1; }
.search-btn {
  flex-shrink: 0;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 6px;
  color: #60a5fa;
  cursor: pointer;
  font-size: 14px;
  padding: 6px 10px;
  transition: all 0.15s;
}
.search-btn:hover { background: rgba(59, 130, 246, 0.25); border-color: rgba(59, 130, 246, 0.5); }
.add-btn {
  padding: 0 14px;
  background: rgba(255, 215, 0, 0.15);
  border: 1px solid rgba(255, 215, 0, 0.4);
  color: #b8860b; border-radius: 8px; cursor: pointer; font-size: 13px;
  white-space: nowrap; font-weight: 600;
}
.add-btn:hover { background: rgba(255, 215, 0, 0.25); }
.add-btn.vehicle {
  background: rgba(255, 59, 59, 0.1);
  border-color: rgba(255, 59, 59, 0.3);
  color: #cc3333;
}
.add-btn.vehicle:hover { background: rgba(255, 59, 59, 0.2); }
.add-btn.customer {
  background: rgba(168, 85, 247, 0.1);
  border-color: rgba(168, 85, 247, 0.3);
  color: #7c3aed;
}
.add-btn.customer:hover { background: rgba(168, 85, 247, 0.2); }
.fav-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.fav-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  flex-wrap: nowrap;
  cursor: grab;
}
.fav-tag:active { cursor: grabbing; }
.fav-tag.dragging { opacity: 0.4; }
.fav-tag.drag-over {
  outline: 2px dashed #6366f1;
  outline-offset: 2px;
  background: rgba(99, 102, 241, 0.1) !important;
}
.fav-tag.drag-over-target {
  outline: 2px solid #4f46e5;
  outline-offset: 2px;
  background: rgba(99, 102, 241, 0.2) !important;
  transform: scale(1.05);
  transition: transform 0.1s ease;
}
.fav-tag.line-tag {
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.5);
  color: #b8860b;
  padding: 3px 8px 3px 6px;
}
.fav-tag.line-tag .line-tag-color {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
/* 线路走向"点亮"状态：整签蓝色高亮（点击标签切换，可多选） */
.fav-tag.line-tag.route-on {
  box-shadow: 0 0 0 2px #3366FF;
  background: rgba(51, 102, 255, 0.12);
  border-color: #3366FF !important;
}
.fav-tag.line-tag .line-tag-info {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px;
  font-size: 12px; line-height: 1;
  color: rgba(107, 122, 153, 0.55);
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}
.fav-tag.line-tag .line-tag-info:hover { color: #3366FF; background: rgba(51, 102, 255, 0.12); }
.fav-tag.line-tag .line-tag-num {
  font-weight: 700;
  font-size: 13px;
}
.fav-tag.line-tag .line-tag-dir {
  font-size: 10px;
  opacity: 0.75;
  font-weight: 500;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fav-tag.line-tag .line-tag-count {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  text-align: center;
}
.fav-tag.line-tag .line-tag-count.zero {
  background: rgba(0, 0, 0, 0.06);
  opacity: 0.5;
}
.fav-tag.vehicle-tag {
  background: rgba(255, 59, 59, 0.1);
  border: 1px solid rgba(255, 59, 59, 0.4);
  color: #cc3333;
}
/* 收藏车辆"点亮"状态：绿色高亮（点击标签切换，可多选；点亮后该车在线时实时显示在地图上） */
.fav-tag.vehicle-tag.sel-on {
  box-shadow: 0 0 0 2px #22c55e;
  background: rgba(34, 197, 94, 0.15);
  border-color: #22c55e !important;
}
.fav-tag.vehicle-tag.sel-on::before {
  content: '✓ ';
  color: #22c55e;
  font-size: 12px;
  font-weight: 800;
}
.fav-tag.customer-vehicle-tag {
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #7c3aed;
  white-space: nowrap;
  flex-wrap: nowrap;
  flex-shrink: 0;
}
.cust-vehicle-list {
  display: flex;
  flex-direction: column; /* v20260904R：客户车辆一台车一行（原 flex-wrap 一排多车） */
  gap: 4px;
  align-items: flex-start;
}
.fav-tag.offline {
  opacity: 0.6;
  filter: grayscale(0.3);
}
.fav-tag.online {
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.2) inset;
}
.vehicle-line-pill {
  display: inline-block;
  padding: 1px 6px;
  background: #1e3a5f;
  color: #fff;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  margin-right: 2px;
  min-width: 20px;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s;
}
.vehicle-line-pill:hover {
  background: #2e5a8f !important;
  text-decoration: underline;
}
.fav-tag.vehicle-tag .vehicle-line-pill { background: #8b2a2a; }
.fav-tag.line-tag .vehicle-line-pill { background: #8b6914; }
.vehicle-id-text {
  cursor: grab;
  font-weight: 600;
}
/* 车号光标与标签空白区一致（grab/grabbing、无链接下划线）；点击车号=点亮/熄灭该车（与空白区相同行为，v20260903K） */
.vehicle-id-text:hover { cursor: grab; text-decoration: none; }
.fav-tag .vehicle-id-text:active { cursor: grabbing; }
/* v20260904U：客户车辆车号/标签点击=打开该车发布信息（可点击），光标改手指；收藏车辆仍为抓手 */
.fav-tag.customer-vehicle-tag { cursor: pointer; }
.fav-tag.customer-vehicle-tag .vehicle-id-text { cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.fav-tag.customer-vehicle-tag .vehicle-id-text:hover { cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.fav-tag.customer-vehicle-tag .vehicle-id-text:active { cursor: pointer; }
.history-icon {
  cursor: pointer;
  opacity: 0.7;
  padding: 0 2px;
  font-size: 13px;
}
.history-icon:hover { opacity: 1; transform: scale(1.15); }
.vehicle-info-icon {
  cursor: pointer;
  opacity: 0.6;
  padding: 0 1px;
  font-size: 12px;
  vertical-align: middle;
  transition: opacity 0.15s;
}
.vehicle-info-icon:hover { opacity: 1; transform: scale(1.2); }
.park-locate-btn {
  cursor: pointer;
  opacity: 0.8;
  padding: 0 2px;
  font-size: 12px;
  vertical-align: middle;
  transition: opacity 0.15s;
}
.park-locate-btn:hover { opacity: 1; transform: scale(1.2); }
.line-detail-vehicle .vehicle-info-icon { font-size: 11px; margin-left: 2px; }
.fav-tag .remove {
  cursor: pointer; opacity: 0.6; font-size: 15px; line-height: 1;
}
.fav-tag .remove:hover { opacity: 1; }
.fav-empty { font-size: 12px; color: #999; display: block; padding: 4px 0; }
.checkbox-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: #4a5568; cursor: pointer; margin-top: 8px;
}
.checkbox-row input { accent-color: #0066cc; }

/* ===== 客户卡片 ===== */
.customer-list { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.customer-card {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.customer-card.selected {
  border-color: rgba(168, 85, 247, 0.5);
  box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.15);
}
.customer-header {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
}
.customer-name {
  font-size: 13px; font-weight: 600; color: #1a2332;
  cursor: pointer; flex: 0 1 auto;
}
/* 投放期徽章 */
.customer-period-badge {
  font-size: 11px;
  color: #2563eb;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.25);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s;
}
.customer-period-badge:hover {
  background: rgba(59, 130, 246, 0.2);
}
/* 负责销售徽章（可点击筛选） */
.customer-assign-badge {
  font-size: 11px;
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid rgba(124, 58, 237, 0.25);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s;
}
.customer-assign-badge:hover {
  background: rgba(124, 58, 237, 0.2);
  border-color: rgba(124, 58, 237, 0.4);
}
.customer-assign-badge.active-filter {
  background: rgba(124, 58, 237, 0.3);
  border-color: rgba(124, 58, 237, 0.6);
  color: #fff;
}
/* 延期车辆数徽章 */
.customer-extend-badge {
  font-size: 11px;
  color: #d97706;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 700;
  white-space: nowrap;
}
/* 最后下刊时间徽章（黄色椭圆） */
.customer-last-end-badge {
  font-size: 11px;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.customer-actions {
  display: flex; align-items: center; gap: 8px;
  margin-left: auto;
}
.customer-stat {
  font-size: 11px;
  color: #7c3aed;
  background: rgba(168, 85, 247, 0.1);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}
.customer-del {
  cursor: pointer; color: #999; font-size: 18px; line-height: 1;
}
.customer-del:hover { color: #cc3333; }

/* 下刊按钮（客户卡片） */
.customer-archive-btn {
  cursor: pointer;
  color: #b45309;
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.4);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  line-height: 1.3;
  user-select: none;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.customer-archive-btn:hover {
  background: rgba(251, 191, 36, 0.35);
  color: #92400e;
  border-color: #f59e0b;
}

/* 上移/下移按钮（客户卡 + 车辆tag通用） */
.move-btn {
  cursor: pointer;
  color: #6b7280;
  font-size: 10px;
  line-height: 1;
  padding: 2px 3px;
  border-radius: 3px;
  user-select: none;
  transition: background 0.12s, color 0.12s;
}
.move-btn:hover:not(.disabled) {
  background: rgba(59, 130, 246, 0.15);
  color: #1d4ed8;
}
.move-btn.disabled {
  opacity: 0.25;
  cursor: not-allowed;
}
.customer-vehicles {
  padding: 0 12px 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  margin-top: 4px;
  padding-top: 10px;
}
.cust-vehicle-input-row { display: flex; gap: 6px; margin-bottom: 8px; }
.cust-vehicle-input-row input {
  flex: 1; padding: 6px 10px;
  background: rgba(245, 247, 250, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 6px; font-size: 13px; outline: none;
}
.cust-vehicle-input-row input:focus { border-color: #7c3aed; }
.cust-vehicle-list { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.customer-online-tip {
  margin-top: 8px;
  font-size: 12px;
  color: #7c3aed;
  background: rgba(168, 85, 247, 0.08);
  padding: 6px 10px;
  border-radius: 6px;
  text-align: center;
}

/* ===== 图例 ===== */
.legend {
  position: fixed; top: 72px; right: 16px; z-index: 500;
  width: 180px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}
.legend-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; cursor: pointer;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  background: rgba(248, 249, 252, 0.8);
}
.legend-title { font-size: 13px; font-weight: 600; color: #1a2332; }
.legend-body { padding: 10px 14px; }
.legend-body.collapsed { display: none; }
.legend-item {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 0;
  font-size: 12px; color: #4a5568;
}
.legend-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 1.5px solid #fff;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}
.legend-dot.purple { background: #a855f7; }
.legend-dot.red { background: #ff3b3b; }
.legend-dot.gold { background: #ffd700; }
.legend-dot.green { background: #00aa44; }
.legend-dot.blue { background: #0066cc; }
.legend-line {
  display: inline-block;
  width: 18px; height: 3px;
  background: linear-gradient(90deg, #ef4444, #3b82f6, #10b981);
  border-radius: 2px;
  flex-shrink: 0;
}
.legend-toggle-sta {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  font-size: 12px; color: #1d4ed8;
  background: rgba(51, 102, 255, 0.08);
  border: 1px solid rgba(51, 102, 255, 0.35);
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.legend-toggle-sta:hover { background: rgba(51, 102, 255, 0.16); }

/* 收藏线路站名常显徽章（仿源站 line_map：蓝底白字小标签） */
.line-sta-icon { pointer-events: none; }
.line-sta-badge {
  display: inline-block;
  position: relative;
  transform: translate(-50%, -150%);
  padding: 2px 7px;
  font-size: 12px;
  color: #fff;
  background: #25a5f7;
  border-radius: 6px;
  line-height: 1.4;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

/* ===== 近期大事记悬浮窗（可拖动） ===== */
.events-window {
  position: fixed; top: 72px; left: 560px; z-index: 998;
  width: 360px; max-width: calc(100vw - 32px);
  min-width: 260px;
  max-height: calc(100vh - 88px);
  max-height: calc(100dvh - 88px);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  display: flex; flex-direction: column;
  resize: both;
}
/* 右下角调整手柄样式 */
.events-window::-webkit-resizer {
  width: 14px; height: 14px;
  background: linear-gradient(135deg, transparent 50%, #9ca3af 50%, #9ca3af 60%, transparent 60%, transparent 70%, #9ca3af 70%, #9ca3af 80%, transparent 80%);
  border-radius: 0 0 14px 0;
  opacity: 0.5;
}
.events-window::-webkit-resizer:hover {
  background: linear-gradient(135deg, transparent 50%, #6366f1 50%, #6366f1 60%, transparent 60%, transparent 70%, #6366f1 70%, #6366f1 80%, transparent 80%);
  opacity: 1;
}
/* 自绘右下角拖拽手柄：避免原生 resize 手柄被遮挡/失效，始终浮在浮窗内容之上 */
.events-resizer {
  position: absolute; right: 0; bottom: 0;
  width: 20px; height: 20px;
  z-index: 5;
  cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 48%, #9ca3af 48%, #9ca3af 58%, transparent 58%, transparent 68%, #9ca3af 68%, #9ca3af 78%, transparent 78%);
  border-radius: 0 0 14px 0;
  opacity: 0.55;
  touch-action: none;
}
.events-window:hover .events-resizer { opacity: 1; }
.events-resizer:hover { background: linear-gradient(135deg, transparent 48%, #6366f1 48%, #6366f1 58%, transparent 58%, transparent 68%, #6366f1 68%, #6366f1 78%, transparent 78%); opacity: 1; }
/* 收起状态下浮窗只剩标题栏，隐藏调整大小手柄 */
.events-window-body.collapsed ~ .events-resizer { display: none; }
.events-window.dragging {
  user-select: none; opacity: 0.92;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.28);
}
.events-window-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; cursor: move;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.08), rgba(99, 102, 241, 0.04));
}
.events-window-title {
  font-size: 13px; font-weight: 600; color: #1a2332;
  flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.events-window-actions { display: flex; gap: 4px; flex-shrink: 0; }
.events-window-btn {
  width: 24px; height: 24px; border: none; cursor: pointer;
  background: rgba(0, 0, 0, 0.05); border-radius: 6px;
  color: #4a5568; font-size: 13px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.events-window-btn:hover { background: rgba(0, 0, 0, 0.1); }
.events-window-body {
  padding: 8px 12px 12px;
  flex: 1 1 auto;
  min-height: 180px; /* 展开时最小高度（收起时 display:none 自动失效，窗口可坍缩成标题栏，不留白） */
  overflow-y: auto;
  font-size: 12px; color: #2d3748; line-height: 1.55;
}
.events-window-body.collapsed { display: none; }
.events-window-loading {
  text-align: center; padding: 20px 0; color: #9ca3af;
  font-size: 12px;
}
.events-window-error {
  text-align: center; padding: 14px 8px; color: #dc2626;
  font-size: 12px; line-height: 1.6;
}
.events-window-error a {
  display: inline-block; margin-top: 6px; padding: 4px 10px;
  background: #fee2e2; border-radius: 6px; color: #b91c1c;
  text-decoration: none; font-size: 11px;
}
.event-group { margin-bottom: 10px; }
.event-date {
  display: inline-block; padding: 2px 8px; margin-bottom: 4px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  color: #fff; border-radius: 10px; font-size: 11px; font-weight: 600;
}
.event-item {
  padding: 6px 8px; margin-bottom: 4px;
  background: rgba(99, 102, 241, 0.04);
  border-left: 2px solid #6366f1; border-radius: 4px;
  word-wrap: break-word;
  line-height: 1.6;
}

/* ===== 双层/单层车辆统计悬浮窗（大事记下方） ===== */
.doubledeck-window { top: 470px; left: 560px; }
.doubledeck-window .events-window-header {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.12), rgba(16, 185, 129, 0.04));
}
.dd-overview {
  display: flex; gap: 8px; margin-bottom: 8px;
}
.dd-card {
  flex: 1; text-align: center; padding: 8px 4px;
  border-radius: 10px; background: #f3f4f6;
  cursor: pointer; transition: transform 0.15s, box-shadow 0.15s;
}
.dd-card:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12); }
.dd-card.dd-card-active {
  outline: 2px solid #10b981; outline-offset: 1px;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}
.dd-card b { display: block; font-size: 20px; line-height: 1.2; }
.dd-card span { font-size: 11px; color: #4b5563; }
.dd-card.dd-double { background: linear-gradient(135deg, #fee2e2, #fecaca); border: 1px solid #fca5a5; }
.dd-card.dd-single { background: linear-gradient(135deg, #dcfce7, #bbf7d0); border: 1px solid #86efac; }
.dd-card.dd-unknown { background: #f0f0f0; border: 1px dashed #d1d5db; }
.dd-card.dd-double b { color: #b91c1c; }
.dd-card.dd-single b { color: #15803d; }
.dd-card.dd-unknown b { color: #6b7280; }
/* 配属口径（源站线路页全量）相关 UI */
.dd-line-roster-tag {
  display: inline-block; margin-left: 6px; padding: 1px 7px;
  font-size: 10px; font-weight: 600; color: #0e7490;
  background: #cffafe; border: 1px solid #a5f3fc; border-radius: 8px;
  vertical-align: 1px; white-space: nowrap;
}
.dd-roster-hint {
  padding: 6px 10px; margin: 6px 0 4px;
  font-size: 11px; color: #92400e; background: #fffbeb;
  border: 1px solid #fde68a; border-radius: 8px; line-height: 1.5;
}
.dd-collect-btn {
  flex-shrink: 0; margin-left: 6px; padding: 4px 10px;
  font-size: 11px; color: #0e7490; background: #ecfeff;
  border: 1px solid #a5f3fc; border-radius: 8px; cursor: pointer;
  min-height: 30px;
}
.dd-collect-btn:hover { background: #cffafe; }
.dd-collect-btn:disabled { opacity: 0.6; cursor: default; }
.md-metric.rl { background: rgba(14, 116, 144, 0.12); border-color: rgba(14, 116, 144, 0.35); }
.md-metric.rl b { color: #0e7490; }
/* 采集进度 */
.dd-progress { margin-bottom: 8px; }
.dd-progress .dd-progress-bar {
  height: 6px; border-radius: 6px; background: #e5e7eb; overflow: hidden;
}
.dd-progress .dd-progress-fill {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, #10b981, #34d399);
  transition: width 0.6s ease;
}
.dd-progress .dd-progress-text {
  display: flex; justify-content: space-between;
  font-size: 11px; color: #6b7280; margin-top: 3px;
}
.dd-progress .dd-progress-text .dd-running { color: #d97706; }
/* 区块标题 */
.dd-section-title {
  font-size: 12px; font-weight: 600; color: #374151;
  margin: 8px 0 4px;
}
/* 双层车型明细 */
.dd-model-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 8px; margin-bottom: 3px;
  background: #fff7ed; border: 1px solid #fed7aa; border-radius: 6px;
  font-size: 12px;
}
.dd-model-row b { color: #b91c1c; font-size: 14px; }
.dd-model-row.dd-model-click { cursor: pointer; transition: background 0.15s, color 0.15s; }
.dd-model-row.dd-model-click:hover { background: #ffedd5; }
/* 双层线路排行 */
.dd-line-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 3px 8px; margin-bottom: 2px;
  border-radius: 5px; font-size: 12px;
}
.dd-line-row.dd-line-click { cursor: pointer; transition: background 0.15s, color 0.15s; }
.dd-line-row.dd-line-click:hover { background: #e0f2fe; }
.dd-line-row.dd-line-click:hover .dd-line-name { color: #0369a1; }
.dd-line-row:nth-child(odd) { background: #f9fafb; }
.dd-line-row .dd-line-name { font-weight: 600; color: #1f2937; }
.dd-line-name-wrap {
  display: flex; align-items: center; gap: 6px; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 线路排行行内"始→终"走向旁注（v20260903N，仅追加行内文字不动布局） */
.dd-line-name-wrap .dd-line-dir {
  font-weight: 400; font-size: 11px; color: #64748b;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.dd-line-row .dd-line-count {
  background: #6366f1; color: #fff; border-radius: 999px;
  padding: 0 8px; font-size: 11px; font-weight: 600;
}
/* 双层车辆展开列表 */
.dd-vehicles-toggle {
  background: none; border: none; cursor: pointer;
  color: #6366f1; font-size: 12px; padding: 4px 0;
}
.dd-vehicles-list {
  max-height: 180px; overflow-y: auto; margin-top: 4px;
  border: 1px solid #e5e7eb; border-radius: 8px; padding: 6px;
  font-size: 11px; color: #4b5563;
}
.dd-vehicles-list .dd-v-row {
  display: flex; justify-content: space-between;
  padding: 2px 4px; border-radius: 4px;
}
.dd-vehicles-list .dd-v-row:nth-child(odd) { background: #f9fafb; }
.dd-vehicles-list .dd-v-line { color: #6b7280; }
.dd-empty {
  text-align: center; padding: 20px 8px; color: #9ca3af; font-size: 12px;
}
/* ===== 车型详情弹窗（md = model detail）===== */
.md-header {
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px 14px; margin-bottom: 10px;
  background: linear-gradient(135deg, #fef3c7, #fff7ed);
  border: 1px solid #fde68a; border-radius: 10px;
}
.md-title { font-size: 18px; font-weight: 700; color: #1f2937; }
.md-title .md-type {
  font-size: 12px; font-weight: 600; color: #b45309;
  background: #fef3c7; border: 1px solid #fcd34d;
  border-radius: 999px; padding: 2px 10px; margin-left: 6px;
  vertical-align: middle;
}
.md-metrics { display: flex; gap: 8px; }
.md-metric {
  flex: 1; text-align: center;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 8px;
  padding: 8px 0;
}
.md-metric b { display: block; font-size: 20px; color: #111827; }
.md-metric span { font-size: 11px; color: #6b7280; }
.md-metric.alg b { color: #059669; }
.md-metric.off b { color: #9ca3af; }
.md-section { margin-bottom: 12px; }
.md-section-title {
  font-size: 12px; font-weight: 600; color: #374151;
  margin: 8px 0 4px;
}
.md-line-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 5px 10px; margin-bottom: 3px;
  background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 6px;
  font-size: 13px; cursor: pointer; transition: background 0.15s, color 0.15s;
}
.md-line-row:hover { background: #e0f2fe; }
.md-line-row:hover .md-line-name { color: #0369a1; }
.md-line-name { font-weight: 600; color: #1f2937; }
.md-line-count {
  background: #6366f1; color: #fff; border-radius: 999px;
  padding: 0 9px; font-size: 11px; font-weight: 600;
}
.md-v-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 10px; margin-bottom: 2px;
  border-radius: 6px; font-size: 12px;
}
.md-v-row:nth-child(odd) { background: #f9fafb; }
.md-v-row .md-v-id { font-weight: 600; color: #1f2937; }
.md-v-row .md-v-id:hover { color: #0369a1; text-decoration: underline; }
.md-v-line { color: #6b7280; }
.md-v-status { font-size: 11px; }
.md-v-row .md-v-status { color: #9ca3af; }
.md-v-row.on .md-v-status { color: #059669; font-weight: 600; }
.md-error { text-align: center; padding: 40px 16px; color: #dc2626; font-size: 14px; }
.modal-btn {
  padding: 6px 16px; font-size: 13px; color: #fff;
  background: #10b981; border: none; border-radius: 8px; cursor: pointer;
}
.modal-btn:hover { background: #059669; }
/* ===== 管理双层车型弹窗（mm = model manager）===== */
.mm-tip {
  font-size: 12px; color: #374151; line-height: 1.6;
  background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 8px;
  padding: 8px 10px; margin-bottom: 10px;
}
.mm-add {
  display: flex; gap: 6px; margin-bottom: 10px;
}
.mm-add input {
  flex: 1; min-width: 0; padding: 7px 10px; font-size: 13px;
  border: 1px solid #d1d5db; border-radius: 8px; outline: none;
}
.mm-add input:focus { border-color: #10b981; box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.12); }
.mm-btn {
  flex-shrink: 0; padding: 7px 16px; font-size: 13px;
  border: none; border-radius: 8px; cursor: pointer;
  background: #e5e7eb; color: #374151;
}
.mm-btn.primary { background: #10b981; color: #fff; }
.mm-btn.primary:hover { background: #059669; }
.mm-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.mm-section-title {
  font-size: 12px; font-weight: 600; color: #374151; margin: 8px 0 4px;
}
.mm-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 10px; margin-bottom: 4px;
  background: #fff7ed; border: 1px solid #fed7aa; border-radius: 8px;
}
.mm-row .mm-model { font-weight: 600; color: #1f2937; font-size: 13px; }
.mm-del {
  flex-shrink: 0; font-size: 12px; cursor: pointer;
  border: 1px solid #fecaca; background: #fef2f2; color: #dc2626;
  border-radius: 6px; padding: 3px 10px;
}
.mm-del:hover { background: #fee2e2; }
/* 搜索/筛选工具条 */
.dd-toolbar {
  display: flex; gap: 6px; align-items: center; margin-bottom: 6px;
}
.dd-search {
  flex: 1; min-width: 0;
  padding: 5px 10px; font-size: 12px;
  border: 1px solid #d1d5db; border-radius: 8px;
  outline: none; background: #fff;
}
.dd-search:focus { border-color: #10b981; box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.12); }
.dd-filter {
  flex-shrink: 0; padding: 5px 6px; font-size: 12px;
  border: 1px solid #d1d5db; border-radius: 8px; background: #fff;
  outline: none; cursor: pointer; color: #374151;
}
.dd-filter:focus { border-color: #10b981; }
.dd-filter option { color: #374151; }
.dd-search-clear {
  flex-shrink: 0; border: none; cursor: pointer;
  background: rgba(0, 0, 0, 0.06); color: #6b7280;
  border-radius: 50%; width: 20px; height: 20px;
  font-size: 11px; line-height: 1; display: inline-flex;
  align-items: center; justify-content: center;
}
.dd-search-clear:hover { background: rgba(0, 0, 0, 0.12); color: #374151; }
.dd-hint {
  margin-top: 8px; padding: 6px 8px; border-radius: 6px;
  background: #f0f9ff; border: 1px solid #bae6fd;
  color: #0369a1; font-size: 11px; line-height: 1.5;
}
/* 数据时间显示 */
.dd-time {
  font-size: 11px; color: #6b7280; margin-bottom: 6px;
  background: #f3f4f6; border: 1px solid #e5e7eb; border-radius: 6px;
  padding: 4px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 双向合并小标 */
.dd-line-both {
  flex-shrink: 0;
  font-size: 10px; font-weight: 600; color: #b45309;
  background: #fef3c7; border: 1px solid #fcd34d;
  border-radius: 999px; padding: 1px 7px; margin-left: 6px;
}
/* 全车队/仅在线 模式切换 */
.dd-modebar {
  display: flex; gap: 6px; margin-bottom: 8px;
}
.dd-mode-btn {
  flex: 1; padding: 5px 0; font-size: 12px; cursor: pointer;
  border: 1px solid #d1d5db; border-radius: 8px; background: #fff;
  color: #4b5563; transition: all 0.2s;
}
.dd-mode-btn:hover { border-color: #10b981; color: #0f7a5c; }
.dd-mode-btn.active {
  background: linear-gradient(135deg, #10b981, #34d399);
  border-color: transparent; color: #fff; font-weight: 600;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.35);
}
.event-item a, a.event-link { color: #1976d2; text-decoration: none; }
.event-item a:hover, a.event-link:hover { text-decoration: underline; }
.event-item em { font-style: italic; color: #555; }
.event-item strong { font-weight: 700; color: #1e293b; }
.event-empty { text-align: center; padding: 14px 0; color: #9ca3af; }

/* ===== 车辆详情卡 ===== */
.bus-detail {
  position: fixed; bottom: 16px; left: 16px; z-index: 999;
  width: 320px; max-width: calc(100vw - 32px);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.25s ease;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.detail-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  background: rgba(248, 249, 252, 0.8);
}
.detail-line-badge {
  font-size: 16px; font-weight: 700; color: #0066cc;
  background: rgba(0, 102, 204, 0.1);
  padding: 3px 12px; border-radius: 6px;
}
.close-btn {
  background: none; border: none; color: #999;
  font-size: 24px; cursor: pointer; line-height: 1;
}
.close-btn:hover { color: #333; }
.detail-body { padding: 14px 16px; }
.detail-row {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}
.detail-label { font-size: 12px; color: #999; white-space: nowrap; }
.detail-value { font-size: 13px; color: #1a2332; text-align: right; word-break: break-all; }
/* 停运预警行 */
.detail-warn-row.hidden { display: none; }
.detail-warn-row {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(220, 38, 38, 0.04));
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 8px;
  padding: 8px 10px;
  margin: 6px 0;
}
.detail-warn-row .warn-text { color: #b91c1c; font-weight: 600; font-size: 13px; }
.detail-warn-row .warn-text b { color: #dc2626; font-size: 15px; }
/* 停运预警激活态：更醒目的红色高亮 + 脉冲动画 */
.detail-warn-row.warn-active {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.18), rgba(220, 38, 38, 0.10));
  border: 2px solid rgba(239, 68, 68, 0.55);
  animation: warn-pulse 1.6s ease-in-out infinite;
}
@keyframes warn-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50%      { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}
.detail-warn-row .warn-pill {
  display: inline-block;
  background: #dc2626;
  color: #fff;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  margin-right: 10px;
}
.detail-warn-row .warn-pill b {
  color: #fef08a;
  font-size: 15px;
  margin: 0 2px;
}
.detail-warn-row .warn-last-date {
  color: #6b7280;
  font-size: 12px;
  font-weight: 500;
}

/* 方向信息框 */
.detail-direction-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin: 8px 0;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.08), rgba(59, 130, 246, 0.06));
  border: 1px solid rgba(14, 165, 233, 0.2);
  border-radius: 10px;
}
.detail-direction-box.hidden { display: none; }
.detail-direction-arrow {
  font-size: 24px;
  color: #0284c7;
  flex-shrink: 0;
}
.detail-direction-info { flex: 1; min-width: 0; }
.detail-direction-route {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #1a2332;
  flex-wrap: wrap;
}
.detail-direction-route .dir-end {
  padding: 2px 8px;
  background: rgba(14, 165, 233, 0.12);
  border-radius: 5px;
  color: #0369a1;
  white-space: nowrap;
}
.detail-direction-route .dir-arrow {
  color: #0284c7;
  font-size: 11px;
  letter-spacing: -1px;
}
.detail-direction-current {
  font-size: 12px;
  color: #475569;
  margin-top: 4px;
  text-align: center;
}
.detail-actions {
  display: flex; gap: 8px; margin-top: 12px;
}
.detail-action-btn {
  flex: 1; padding: 10px;
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.3);
  color: #b8860b; border-radius: 8px; cursor: pointer; font-size: 13px;
  font-weight: 500;
}
.detail-action-btn:hover { background: rgba(255, 215, 0, 0.2); }
.detail-action-btn.active { background: rgba(255, 215, 0, 0.25); }
.detail-action-btn.vehicle {
  background: rgba(255, 59, 59, 0.1);
  border-color: rgba(255, 59, 59, 0.3);
  color: #cc3333;
}
.detail-action-btn.vehicle:hover { background: rgba(255, 59, 59, 0.2); }
.detail-action-btn.vehicle.active { background: rgba(255, 59, 59, 0.25); }
.detail-action-btn.history {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
  color: #047857;
  flex: 0.8;
}
.detail-action-btn.history:hover { background: rgba(16, 185, 129, 0.2); }

/* ===== 上线历史弹窗 ===== */
.history-overlay {
  background: rgba(15, 23, 42, 0.25);
  backdrop-filter: blur(4px);
}
.history-modal {
  width: min(960px, 94vw);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2), 0 8px 24px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid #e5e7eb;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  font-weight: 700;
  font-size: 15px;
  color: #0f172a;
  flex-shrink: 0;
  letter-spacing: 0.2px;
  gap: 10px;
}
.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.save-img-btn {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.save-img-btn:hover {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}
.save-img-btn:active {
  transform: translateY(0);
}
.save-img-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.modal-back-btn {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
  flex-shrink: 0;
}
.modal-back-btn:hover { background: #bae6fd; }
.modal-body {
  padding: 20px 24px 24px;
  overflow-y: auto;
  flex: 1;
  background: #ffffff;
}
.history-body { font-size: 13px; color: #1f2937; }
.history-loading {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 40px 0; color: #6b7280;
}
.history-error {
  padding: 20px; border-radius: 10px;
  background: rgba(255, 59, 59, 0.08);
  border: 1px solid rgba(255, 59, 59, 0.25);
  color: #991b1b;
  line-height: 1.6;
}
.history-empty {
  padding: 30px; text-align: center; color: #999; font-size: 13px;
}
.hist-summary {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
.hist-card {
  background: linear-gradient(135deg, rgba(249, 250, 251, 0.9), rgba(243, 244, 246, 0.9));
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  padding: 14px 16px;
  text-align: center;
}
.hist-card.big {
  background: linear-gradient(135deg, #e0f2fe, #bae6fd);
  border-color: rgba(14, 165, 233, 0.3);
}
.hist-card.good {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  border-color: rgba(16, 185, 129, 0.3);
}
.hist-card.warn {
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  border-color: rgba(239, 68, 68, 0.3);
}
.hist-card-label { font-size: 11px; color: #6b7280; font-weight: 600; letter-spacing: 0.5px; }
.hist-card-value {
  font-size: 28px; font-weight: 800; margin-top: 4px; color: #0369a1;
}
.hist-card-value.small { font-size: 22px; color: #1f2937; }
.hist-card-value.good-value { color: #047857; }
.hist-card-value.warn-value { color: #dc2626; }
.hist-card-sub { font-size: 12px; color: #475569; margin-top: 2px; }
.hist-section { margin-bottom: 22px; }
.hist-section-title {
  font-weight: 700; font-size: 13px; margin-bottom: 10px;
  color: #1a2332;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  letter-spacing: 0.3px;
  display: flex; align-items: center; gap: 4px;
}
/* 车号表标题行后的源站"之后上线车辆"参考（v20260903M：布局不变，仅追加行内文字） */
.hist-section-title .ld-online-after {
  font-weight: 400; font-size: 11px; color: #9ca3af; margin-left: 4px; white-space: nowrap;
  letter-spacing: 0;
}
.hist-line-list { display: flex; flex-direction: column; gap: 8px; }
.hist-line-row {
  display: grid;
  grid-template-columns: 90px 1fr 96px 180px;
  gap: 10px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.05);
  font-size: 12px;
}
.hist-line-name {
  font-weight: 700; color: #0369a1;
  padding: 3px 8px;
  background: rgba(14, 165, 233, 0.1);
  border-radius: 5px;
  text-align: center;
}
.hist-line-bar-wrap {
  height: 10px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 5px;
  overflow: hidden;
}
.hist-line-bar {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #34d399);
  border-radius: 5px;
}
.hist-line-days { color: #047857; font-weight: 600; text-align: right; }
.hist-line-range { color: #6b7280; text-align: right; font-variant-numeric: tabular-nums; }

.cal-wrap {
  display: flex; flex-direction: column; gap: 10px;
}
.hist-month-group {
  background: rgba(249, 250, 251, 0.5);
  border-radius: 8px;
  padding: 8px 10px;
}
.hist-month-title {
  font-size: 11px; font-weight: 700; color: #374151;
  margin-bottom: 6px; letter-spacing: 0.5px;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(24px, 1fr));
  gap: 3px;
}
.cal-cell {
  aspect-ratio: 1;
  font-size: 10px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px;
  color: #374151;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.cal-cell.cal-on {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(16, 185, 129, 0.3);
}
.cal-cell.cal-on-rep1 {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(59, 130, 246, 0.3);
}
.cal-cell.cal-on-rep2 {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(245, 158, 11, 0.3);
}
.cal-cell.cal-on-rep3 {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(139, 92, 246, 0.3);
}
.cal-cell.cal-off {
  background: rgba(0, 0, 0, 0.05);
  color: #9ca3af;
}
/* v20260915m：短时移动（源站有上线记录但跨站不足3站）→ 灰色斜纹，视觉上区分于纯未运营 */
.cal-cell.cal-weak {
  background: repeating-linear-gradient(45deg, rgba(0,0,0,0.05), rgba(0,0,0,0.05) 4px, rgba(0,0,0,0.11) 4px, rgba(0,0,0,0.11) 8px);
  color: #9ca3af;
}
.weak-check-hint {
  margin: 10px 12px 2px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #fff7ed;
  border: 1px dashed #f97316;
  color: #c2410c;
  font-size: 12px;
  animation: cal-live-pulse 1.6s ease-in-out infinite;
}
.weak-check-hint.done { animation: none; }
.cal-cell.cal-live {
  background: linear-gradient(135deg, #60a5fa 0%, #38bdf8 100%);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(56, 189, 248, 0.4);
  animation: cal-live-pulse 1.8s ease-in-out infinite;
}
@keyframes cal-live-pulse {
  0%, 100% { box-shadow: 0 1px 4px rgba(56, 189, 248, 0.4); }
  50% { box-shadow: 0 1px 8px rgba(56, 189, 248, 0.8); }
}
/* ===== 估算全勤（报废车无历史数据，按全勤估算） ===== */
/* 橙黄斜纹底 + 虚线边框 + ♻️ 图标，区别于真实正常运营 */
.cal-cell.cal-estimated {
  background: repeating-linear-gradient(
    45deg,
    #fef3c7 0px, #fef3c7 4px,
    #fde68a 4px, #fde68a 8px
  );
  color: #92400e;
  font-weight: 600;
  border: 1.5px dashed #f59e0b;
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.2);
  position: relative;
}
.cal-cell.cal-estimated::after {
  content: '♻️';
  position: absolute;
  top: -4px;
  right: -2px;
  font-size: 9px;
  line-height: 1;
}
/* 当同时有多车 on-rep 样式时，估算的覆盖在颜色之上（保留虚线） */
.cal-cell.cal-estimated.cal-on,
.cal-cell.cal-estimated.cal-on-rep1,
.cal-cell.cal-estimated.cal-on-rep2,
.cal-cell.cal-estimated.cal-on-rep3 {
  color: #92400e !important;
  box-shadow: inset 0 0 0 2px rgba(245, 158, 11, 0.4);
}
/* 卡片/预警中的估算全勤标签 */
.estimated-tag {
  display: inline-block;
  padding: 1px 6px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px dashed #f59e0b;
  color: #b45309;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 4px;
  vertical-align: middle;
}
.gap-item.estimated {
  background: rgba(245, 158, 11, 0.08);
  border: 1px dashed #f59e0b;
  opacity: 0.85;
}
.gap-item.estimated::before {
  content: '♻️';
  margin-right: 4px;
}
/* 详情车辆的实时运行中样式 */
.day-detail-vehicle.live {
  background: rgba(56, 189, 248, 0.1);
  border-left: 3px solid #38bdf8;
}
.cal-legend {
  display: flex; gap: 16px; margin-top: 10px;
  font-size: 12px; color: #6b7280;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}
.cal-legend .cal-cell {
  display: inline-flex;
  width: 14px; height: 14px;
  margin-right: 4px;
  vertical-align: middle;
}
.hist-footer {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed rgba(0, 0, 0, 0.08);
  color: #9ca3af;
  text-align: right;
}

/* ===== 投放期设置 ===== */
.cust-period-row {
  display: flex; align-items: center; gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 8px; padding: 6px 8px;
  background: rgba(245, 158, 11, 0.06);
  border: 1px dashed rgba(245, 158, 11, 0.25);
  border-radius: 6px;
  font-size: 11px;
  overflow: visible;
}
.cust-period-row .period-label { font-weight: 600; color: #92400e; white-space: nowrap; }
.cust-period-row input[type="date"] {
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 4px;
  padding: 2px 4px;
  font-size: 11px;
  width: 100px;
  min-width: 0;
  flex: 0 1 100px;
  background: #fff;
  color: #1a2332;
}
.cust-period-row .period-sep { color: #6b7280; flex-shrink: 0; }
.period-batch-btn {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.08);
  color: #92400e;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s;
}
.period-batch-btn:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.6);
}

/* 批量设置表单 */
.batch-form { max-width: 380px; }
.batch-form .batch-form-desc {
  font-size: 12px;
  color: #4b5563;
  margin-bottom: 10px;
  line-height: 1.6;
  padding: 8px 10px;
  background: rgba(59, 130, 246, 0.06);
  border-radius: 6px;
  border: 1px solid rgba(59, 130, 246, 0.15);
}
.batch-preview-row { align-items: flex-start; }
.batch-vehicle-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.batch-vehicle-item {
  font-size: 11px;
  padding: 2px 6px;
  background: rgba(124, 58, 237, 0.08);
  border-radius: 4px;
  color: #6b21a8;
  font-weight: 600;
}
.batch-old-end {
  font-size: 10px;
  color: #d97706;
  margin-left: 2px;
  font-weight: 400;
}

/* 下刊倒计时徽章 */
.end-days-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.1);
  color: #1d4ed8;
  margin-left: 2px;
  white-space: nowrap;
}
.end-days-badge.urgent {
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
  animation: end-days-pulse 1.5s ease-in-out infinite;
}
.end-days-badge.expired {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}
@keyframes end-days-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* 投放期横幅 */
.hist-period-banner {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.12), rgba(252, 211, 77, 0.08));
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 600;
  color: #92400e;
}

/* 投放期区块 */
.hist-period-block {
  background: #fffbeb;
  border: 2px solid #fcd34d;
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 4px;
}
.hist-period-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(245, 158, 11, 0.2);
}
.hist-period-icon { font-size: 18px; }
.hist-period-title {
  font-size: 15px; font-weight: 800; color: #92400e;
}
.hist-period-range {
  margin-left: auto;
  font-size: 12px; color: #b45309; font-weight: 600;
  background: rgba(245, 158, 11, 0.12);
  padding: 3px 10px;
  border-radius: 6px;
}
.hist-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, #d1d5db, transparent);
  margin: 20px 0;
}
.hist-overall-block {
  padding-top: 4px;
}

/* ===== 维修预警 ===== */
.gap-list { display: flex; flex-direction: column; gap: 6px; }
.gap-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 8px;
  font-size: 12px;
  color: #374151;
}
.gap-item.ongoing {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.35);
}
.gap-icon { font-size: 16px; }
.gap-range { font-weight: 600; color: #1a2332; font-variant-numeric: tabular-nums; }
.gap-days { color: #dc2626; font-weight: 600; }
.gap-resumed { color: #059669; font-weight: 500; margin-left: auto; }
.gap-resumed.missing { color: #dc2626; }
/* 调线空刊信息条：蓝紫色区分维修红色 */
.gap-item.transition-gap {
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid rgba(99, 102, 241, 0.2);
}
.gap-item.transition-gap .gap-days { color: #6366f1; }
.gap-item.transition-gap .gap-resumed.missing { color: #6366f1; }

/* ===== 单车维修停运预警分组 ===== */
.gap-vehicle-group {
  border: 1px solid rgba(234, 88, 12, 0.15);
  border-radius: 10px;
  overflow: hidden;
}
.gap-vehicle-header {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  background: rgba(234, 88, 12, 0.06);
  font-size: 12px;
}
.gap-vehicle-role {
  font-weight: 700; color: #c2410c;
  padding: 2px 8px; border-radius: 4px;
  background: rgba(234, 88, 12, 0.1);
  font-size: 11px;
}
.gap-vehicle-id {
  font-weight: 700; color: #1a2332;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}
.gap-vehicle-adstart { color: #6b7280; font-size: 11px; }
.gap-vehicle-adstart.unset { color: #ea580c; }
.gap-vehicle-group .gap-item { border-radius: 0; border-left: none; border-right: none; border-top: none; }
.gap-vehicle-group .gap-item:last-child { border-bottom: none; }

/* ===== 月度统计表 ===== */
/* 月度统计 - 横向柱状图 */
.month-chart {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 0;
}
.month-bar-row {
  display: grid;
  grid-template-columns: 56px 1fr 38px 56px;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  line-height: 1;
}
.month-bar-label {
  font-weight: 600;
  color: #1a2332;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}
.month-bar-track {
  height: 14px;
  background: rgba(0,0,0,0.06);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.month-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #34d399);
  border-radius: 4px;
  transition: width 0.3s;
  display: block;
}
.month-bar-rate {
  color: #059669;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-size: 12px;
}
.month-bar-counts {
  color: #6b7280;
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  text-align: right;
}

/* ===== 加载提示 ===== */
.loading-toast {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 999;
  background: rgba(26, 35, 50, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 212, 255, 0.15);
  border-radius: 10px;
  padding: 10px 20px;
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: #8b9bb4;
}

/* ===== Leaflet 控件覆盖 ===== */
.leaflet-popup-content-wrapper {
  background: rgba(255, 255, 255, 0.98) !important;
  color: #333 !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  border-radius: 10px !important;
}
.leaflet-popup-tip { background: rgba(255, 255, 255, 0.98) !important; }
.leaflet-control-zoom a {
  background: rgba(255, 255, 255, 0.9) !important;
  color: #333 !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
}
.leaflet-control-zoom a:hover { background: rgba(0, 0, 0, 0.05) !important; }
.leaflet-control-attribution {
  background: rgba(255, 255, 255, 0.7) !important;
  color: #666 !important;
}
.leaflet-control-attribution a { color: #999 !important; }

/* ===== 滚动条 ===== */
.panel-body::-webkit-scrollbar { width: 6px; }
.panel-body::-webkit-scrollbar-track { background: transparent; }
.panel-body::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 3px;
}
.panel-body::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.2); }

/* ===== 响应式 ===== */
@media (max-width: 640px) {
  .top-bar-left .title { display: none; }
  .stat-item { padding: 0 6px; }
  .search-panel { width: calc(100vw - 32px); }
  .bus-detail { width: calc(100vw - 32px); }
  .legend { width: 160px; top: auto; bottom: 16px; right: 16px; }
  .bus-detail { bottom: auto; top: 72px; }
}

/* ===== 换车功能 ===== */
.replace-icon {
  cursor: pointer;
  font-size: 12px;
  opacity: 0.5;
  transition: opacity 0.2s;
  margin-left: 2px;
}
.replace-icon:hover { opacity: 1; }

/* 换车按钮（旧车→新车） */
.swap-icon {
  cursor: pointer;
  font-size: 12px;
  opacity: 0.5;
  transition: opacity 0.2s, transform 0.2s;
  margin-left: 2px;
}
.swap-icon:hover {
  opacity: 1;
  transform: rotate(180deg);
}

/* 换车表单中的旧车信息块 */
.swap-old-info {
  background: #f3f4f6;
  border-left: 3px solid #6b7280;
  padding: 6px 8px;
  margin-bottom: 6px;
  font-size: 12px;
  color: #374151;
  border-radius: 3px;
}
.swap-form .replace-confirm-btn {
  background: #2563eb;
}
.swap-form .replace-confirm-btn:hover {
  background: #1d4ed8;
}

.replace-badge {
  display: inline-flex;
  align-items: center;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 600;
  margin-left: 2px;
}

.replace-form {
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  margin: 6px 0;
  overflow: hidden;
  max-width: 320px;
}
.replace-form-header {
  background: #f3f4f6;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #1f2937;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.replace-form-close {
  cursor: pointer;
  color: #6b7280;
  font-size: 16px;
}
.replace-form-close:hover { color: #ef4444; }
.replace-form-body {
  padding: 12px;
}
.replace-form-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.replace-form-row label {
  font-size: 12px;
  color: #6b7280;
  width: 56px;
  flex-shrink: 0;
}
.replace-form-row input[type="text"],
.replace-form-row input[type="date"] {
  flex: 1;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 13px;
  min-width: 0;
}
.replace-confirm-btn {
  width: 100%;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px;
  font-size: 13px;
  cursor: pointer;
  margin-top: 4px;
}
.replace-confirm-btn:hover { background: #2563eb; }

.existing-replacements {
  margin-top: 10px;
  border-top: 1px solid #e5e7eb;
  padding-top: 8px;
}
.existing-title {
  font-size: 11px;
  color: #6b7280;
  margin-bottom: 4px;
}
.existing-rep-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #374151;
  padding: 3px 0;
}
.rep-date { color: #9ca3af; font-size: 11px; }
.rep-del {
  cursor: pointer;
  color: #ef4444;
  font-weight: bold;
  margin-left: auto;
}

/* 多车汇总 */
.hist-multi-vehicle {
  margin: 12px 0;
}
.vehicle-summary-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.vehicle-summary-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
}
.vehicle-summary-item.main {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
}
.vehicle-summary-item.rep {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}
.vs-badge {
  background: #10b981;
  color: #fff;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}
.vs-badge.rep {
  background: #3b82f6;
}
.vs-id {
  font-weight: 700;
  color: #1f2937;
  min-width: 50px;
}
.vs-line {
  background: #f3f4f6;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
  color: #6b7280;
}
.vs-adstart {
  background: #fef3c7;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
  color: #92400e;
  font-weight: 600;
}
.vs-days {
  color: #6b7280;
  font-size: 12px;
  margin-left: auto;
}

/* ===== 客户投放期总览按钮 ===== */
.cust-overview-btn {
  width: 100%;
  margin-top: 8px;
  padding: 7px 10px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.1), rgba(168, 85, 247, 0.05));
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: 8px;
  color: #7c3aed;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.cust-overview-btn:hover {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(168, 85, 247, 0.1));
  border-color: rgba(168, 85, 247, 0.4);
}

/* ===== 总览日历渐变色 ===== */
.cal-cell.cal-on-min {
  background: #d1fae5;
  color: #065f46;
  font-weight: 600;
}
.cal-cell.cal-on-low {
  background: #6ee7b7;
  color: #064e3b;
  font-weight: 600;
}
.cal-cell.cal-on-mid {
  background: #34d399;
  color: #fff;
  font-weight: 600;
}

/* ===== 投放期总览弹窗 ===== */
.ov-overview {
  display: flex; flex-direction: column; gap: 14px;
}
.ov-period-header {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.08), rgba(168, 85, 247, 0.02));
  border-radius: 10px;
  border: 1px solid rgba(168, 85, 247, 0.15);
}
.ov-icon { font-size: 20px; }
.ov-title { font-size: 15px; font-weight: 700; color: #1a2332; flex: 1; }
.ov-range { font-size: 12px; color: #6b7280; font-weight: 500; }

.ov-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
@media (max-width: 600px) {
  .ov-stats-grid { grid-template-columns: repeat(2, 1fr); }
}
.ov-stat-card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}
.ov-stat-card.big {
  grid-column: span 2;
  background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
  border-color: #a7f3d0;
}
.ov-stat-card.big.good { background: linear-gradient(135deg, #f0fdf4, #d1fae5); border-color: #6ee7b7; }
.ov-stat-card.big.warn { background: linear-gradient(135deg, #fffbeb, #fef3c7); border-color: #fcd34d; }
.ov-stat-card.big.bad { background: linear-gradient(135deg, #fef2f2, #fee2e2); border-color: #fca5a5; }
/* 第一行：居中显示，两个大卡各占一半 */
.ov-stats-row1 {
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.ov-stats-row1 .ov-stat-card.big {
  grid-column: auto;
  max-width: none;
  width: auto;
}
/* 第二行：外框包裹，内部网格 */
.ov-stats-row2 {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  padding: 10px;
  margin-top: 10px;
}
.ov-stats-row2 .ov-stats-inner {
  grid-template-columns: repeat(3, 1fr);
}
.ov-stats-row2 .ov-stat-card {
  border: none;
  padding: 8px;
}
.ov-stat-label { font-size: 11px; color: #6b7280; font-weight: 600; letter-spacing: 0.5px; }
.ov-stat-value { font-size: 28px; font-weight: 800; color: #1f2937; margin: 2px 0; font-variant-numeric: tabular-nums; }
.ov-stat-card.big .ov-stat-value { font-size: 36px; }
.ov-stat-sub { font-size: 11px; color: #6b7280; }

/* 车辆明细行 */
.ov-v-list { display: flex; flex-direction: column; gap: 8px; }
.ov-v-row {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 8px;
  padding: 10px 12px;
}
.ov-v-row.online { border-left: 3px solid #10b981; }
.ov-v-top {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px;
}
.ov-v-status { font-size: 12px; }
.ov-v-line {
  background: #f3f4f6; border-radius: 4px;
  padding: 1px 6px; font-size: 11px;
  color: #6b7280; font-weight: 600;
}
.ov-v-id { font-weight: 700; color: #1f2937; min-width: 55px; }
.ov-v-days { color: #374151; font-weight: 600; margin-left: auto; }
.ov-v-maint {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: help;
  white-space: nowrap;
}
.ov-v-rate {
  font-weight: 700; font-size: 13px;
  min-width: 40px; text-align: right;
  font-variant-numeric: tabular-nums;
}
.ov-v-rate.good { color: #059669; }
.ov-v-rate.warn { color: #d97706; }
.ov-v-rate.bad { color: #dc2626; }

/* 维修/换车汇总卡片 */
.ov-maint-grid {
  display: flex; gap: 10px; flex-wrap: wrap;
}
.ov-maint-box {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  padding: 12px;
}
.ov-maint-box .ov-maint-list {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(0, 0, 0, 0.08);
}
.ov-maint-box .ov-maint-item {
  background: rgba(255, 247, 237, 0.5);
  border: 1px solid rgba(251, 146, 60, 0.3);
  border-left: 3px solid #f97316;
  border-radius: 6px;
}
.ov-stat-card.maint {
  background: linear-gradient(135deg, #fef2f2, #fee2e2);
  border: 1px solid #f87171;
  color: #991b1b;
}
.ov-stat-card.transition {
  background: linear-gradient(135deg, #fff7ed, #ffedd5);
  border: 1px solid #fb923c;
  color: #9a3412;
}
.ov-maint-list {
  display: flex; flex-direction: column; gap: 6px;
  margin-top: 6px;
}
.ov-maint-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  background: rgba(254, 226, 226, 0.4);
  border-left: 3px solid #ef4444;
  border-radius: 4px;
  font-size: 12px;
  flex-wrap: wrap;
}
.ov-maint-item.transition {
  background: rgba(255, 237, 213, 0.5);
  border-left-color: #f97316;
}
.ov-maint-vid {
  font-weight: 700;
  color: #1f2937;
  min-width: 55px;
}
.ov-maint-role {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 3px;
  padding: 0 4px;
  margin-right: 4px;
  vertical-align: 1px;
}
.ov-maint-line {
  color: #6b7280;
  font-size: 11px;
}
.ov-maint-sub {
  color: #6b7280;
  font-size: 11px;
}
.ov-maint-segs {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.ov-maint-seg {
  background: white;
  border: 1px solid #fca5a5;
  border-radius: 3px;
  padding: 2px 8px;
  font-size: 11px;
  color: #991b1b;
  white-space: nowrap;
}
.ov-maint-seg.ongoing {
  background: #fef2f2;
  border-color: #ef4444;
  color: #b91c1c;
  font-weight: 700;
}
.ov-maint-seg.transition {
  background: white;
  border-color: #fb923c;
  color: #9a3412;
}
.ov-v-bar-wrap {
  margin-top: 6px;
  height: 6px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 3px;
  overflow: hidden;
}
.ov-v-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s;
  background: #9ca3af;
}
.ov-v-bar.good { background: #10b981; }
.ov-v-bar.warn { background: #f59e0b; }
.ov-v-bar.bad { background: #ef4444; }
.ov-v-reps {
  margin-top: 6px;
  display: flex; flex-wrap: wrap; gap: 4px;
}
.ov-v-rep {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 600;
}

/* ===== 弹窗高度自适应调整 ===== */
.history-modal {
  max-height: 92vh;
}
.modal-body {
  padding: 20px 24px 26px;
  flex: 0 1 auto;
  min-height: 0;
}
/* 内容少时弹窗收缩，内容多时滚动且更宽松 */
.ov-overview { gap: 16px; }
.ov-stat-card { padding: 14px 12px; }
.ov-stat-value { font-size: 30px; }
.ov-stat-card.big .ov-stat-value { font-size: 38px; }
.ov-v-row { padding: 12px 14px; }
.cal-grid {
  grid-template-columns: repeat(auto-fill, minmax(26px, 1fr));
  gap: 4px;
}
.cal-cell { font-size: 11px; border-radius: 4px; }

/* ===== 上刊时间徽章（客户卡片内，醒目） ===== */
.ad-start-badge {
  display: inline-flex;
  align-items: center;
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #93c5fd;
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 700;
  margin-left: 2px;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.ad-start-badge:hover {
  background: #dbeafe;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}
.ad-start-badge.unset {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fb923c;
  animation: ad-start-pulse 2s ease-in-out infinite;
}
.ad-start-badge.inherited {
  background: #f0fdf4;
  color: #15803d;
  border-color: #86efac;
  border-style: dashed;
}
@keyframes ad-start-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(251, 146, 60, 0.4); }
  50% { box-shadow: 0 0 0 3px rgba(251, 146, 60, 0.15); }
}
.ad-end-badge {
  display: inline-flex;
  align-items: center;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 700;
  margin-left: 2px;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.ad-end-badge:hover {
  background: #fde68a;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}
.ad-end-badge.unset {
  background: #f1f5f9;
  color: #64748b;
  border-color: #cbd5e1;
}
.ad-end-badge.inherited {
  background: #fef9c3;
  color: #854d0e;
  border-color: #fde047;
  border-style: dashed;
}

/* 上刊时间提示横幅 */
.cust-ad-hint {
  margin: 6px 0 2px;
  padding: 8px 12px;
  background: linear-gradient(135deg, #fff7ed, #ffedd5);
  border: 1px solid #fb923c;
  border-radius: 8px;
  font-size: 12px;
  color: #9a3412;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ===== 总览内上刊时间标签 ===== */
.ov-v-adstart {
  display: inline-flex;
  align-items: center;
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 10px;
  font-weight: 600;
}
.ov-v-adstart.unset {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fb923c;
}

/* ===== 异常高亮 ===== */
.ov-v-row.has-abnormal {
  border-left: 3px solid #f59e0b;
  background: linear-gradient(90deg, rgba(255, 251, 235, 0.5), #fff 40%);
}
.ov-v-rep.has-abnormal {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fca5a5;
}

/* ===== 报废车标记 ===== */
.ov-v-row.scrapped {
  border-left: 3px solid #9ca3af;
  background: linear-gradient(90deg, rgba(243, 244, 246, 0.5), #fff 40%);
  opacity: 0.85;
}
.ov-v-scrapped-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  background: #e5e7eb;
  color: #4b5563;
  margin-left: 2px;
}
.vehicle-summary-item.scrapped {
  background: #f3f4f6;
  border-left: 3px solid #9ca3af;
}
.vs-scrapped-tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  background: #e5e7eb;
  color: #4b5563;
  margin-left: 4px;
}
.hvi-scrapped-tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  background: #fee2e2;
  color: #991b1b;
  margin-left: 4px;
}
.hvi-status.scrapped {
  color: #991b1b;
  font-weight: 700;
}
.hist-vehicle-info-card.scrapped {
  border: 1px dashed #9ca3af;
}
.vi-scrapped-banner {
  background: #fef2f2;
  color: #991b1b;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 6px;
  margin-top: 4px;
  text-align: center;
}
.vi-status.scrapped {
  color: #991b1b;
  font-weight: 700;
}

/* ===== 异常日历单元格 ===== */
.cal-cell.cal-abnormal {
  background: #fef3c7;
  color: #92400e;
  font-weight: 600;
}
.cal-cell.cal-partial-abnormal {
  background: #fde68a;
  color: #78350f;
  font-weight: 600;
}
/* ===== 空刊日历单元格（车辆跑别的线路，未在投放线路运营）→ 灰色 ===== */
.cal-cell.cal-idle {
  background: #e5e7eb;
  color: #4b5563;
  border: 1px dashed #6b7280;
  font-weight: 600;
  position: relative;
}
.cal-cell.cal-idle::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 3px,
    rgba(107, 114, 128, 0.18) 3px,
    rgba(107, 114, 128, 0.18) 6px
  );
  pointer-events: none;
}

/* ===== 调线空窗期日历单元格（原车已调线，现车尚未上刊的过渡期）→ 橙色虚框 ===== */
.cal-cell.cal-transition-gap {
  background: #ffedd5;
  color: #9a3412;
  border: 1px dashed #ea580c;
  font-weight: 700;
  position: relative;
}
.cal-cell.cal-transition-gap::after {
  content: '🔄';
  position: absolute;
  top: -4px;
  right: -2px;
  font-size: 8px;
  opacity: 0.7;
  pointer-events: none;
}

/* ===== 上线历史弹窗顶部车辆信息卡片 ===== */
.hist-vehicle-info-card {
  background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
  border: 1px solid #bae6fd;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.hist-vehicle-info-card.loading {
  display: flex; align-items: center; gap: 8px;
  color: #6b7280; font-size: 13px;
  padding: 12px 16px;
}
.hvi-header {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.hvi-icon { font-size: 20px; }
.hvi-id {
  font-size: 18px; font-weight: 700; color: #0c4a6e;
  letter-spacing: 0.5px;
}
.hvi-customer {
  font-size: 12px; color: #0369a1; background: #e0f2fe;
  padding: 2px 8px; border-radius: 10px; border: 1px solid #7dd3fc;
}
.hvi-empty {
  font-size: 12px; color: #9ca3af; background: #f3f4f6;
  padding: 2px 8px; border-radius: 10px; border: 1px solid #d1d5db;
}
.hvi-empty-desc {
  margin-top: 8px; font-size: 12px; color: #9ca3af; text-align: center;
}
.hist-vehicle-info-card.empty {
  background: #fafafa;
  border: 1px dashed #d1d5db;
}
.hvi-status {
  font-size: 11px; color: #15803d; background: #dcfce7;
  padding: 2px 8px; border-radius: 10px; border: 1px solid #86efac;
}
.hvi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.hvi-item {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  padding: 6px 10px;
  display: flex; flex-direction: column; gap: 2px;
}
.hvi-label {
  font-size: 12px; color: #64748b;
}
.hvi-value {
  font-size: 14px; font-weight: 600; color: #0f172a;
}
.hvi-link {
  font-size: 12px; color: #0284c7; text-decoration: none;
}
.hvi-link:hover { text-decoration: underline; }
.hvi-manual-tag {
  font-size: 11px; color: #92400e; background: #fef3c7;
  padding: 2px 8px; border-radius: 10px; border: 1px solid #fcd34d;
}
.hist-vehicle-info-card.manual {
  background: #fffbeb;
  border: 1px solid #fde68a;
}

/* ===== 线路走向标签与站点提示 ===== */
.line-route-label { background: transparent !important; border: none !important; }
/* v20260911g：路号牌子只显示线路号，尺寸缩小 */
.line-route-label-text {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.95);
  border: 1.5px solid;
  border-radius: 6px;
  padding: 1px 6px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  white-space: nowrap;
}
.line-route-num { font-size: 12px; font-weight: 700; line-height: 1.3; }
.line-route-dir { font-size: 10px; color: #6b7280; font-weight: 500; }
.station-tip { display: flex; flex-direction: column; gap: 2px; }
.station-tip-idx {
  font-size: 10px; color: #9ca3af; font-weight: 600;
}
.station-tip-name { font-size: 13px; font-weight: 600; color: #1f2937; }
.station-tip-end {
  font-size: 10px; color: #059669; font-weight: 700;
}
.station-tip-wrap {
  border: 1px solid rgba(0,0,0,0.1) !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12) !important;
}

/* ===== 日历日期点击交互 ===== */
.cal-cell.clickable {
  cursor: pointer;
  transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.15s ease, filter 0.15s ease;
}
.cal-cell.clickable:hover {
  transform: scale(1.25);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  filter: brightness(1.1);
  z-index: 2;
}
.cal-cell.selected {
  outline: 2px solid #3b82f6;
  outline-offset: 1px;
  transform: scale(1.15);
  z-index: 3;
}
.cal-click-hint {
  font-size: 11px;
  color: #6b7280;
  font-weight: 500;
  margin-left: 6px;
}

/* 当天运行详情卡片 */
.day-detail-card {
  margin-top: 12px;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.day-detail-header {
  padding: 10px 14px;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border-bottom: 1px solid #bfdbfe;
  font-size: 13px;
  font-weight: 700;
  color: #1e40af;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.day-detail-line-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  font-size: 13px;
}
.ddl-label {
  color: #6b7280;
  font-weight: 500;
  white-space: nowrap;
}
.ddl-value {
  font-weight: 600;
}
.ddl-value.on {
  color: #047857;
}
.ddl-value.off {
  color: #9ca3af;
}
.day-detail-empty {
  padding: 20px;
  text-align: center;
  color: #9ca3af;
  font-size: 13px;
}
.day-detail-vehicle-list {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 280px;
  overflow-y: auto;
}
.day-detail-vehicle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
}
.day-detail-vehicle.normal {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}
.day-detail-vehicle.abnormal {
  background: #fffbeb;
  border: 1px solid #fde68a;
}
.day-detail-vehicle.idle {
  background: #eff6ff;
  border: 1px dashed #93c5fd;
}
.day-detail-vehicle.weak {
  background: #f9fafb;
  border: 1px dashed #d1d5db;
}
.day-detail-v-status { font-size: 14px; }
.day-detail-v-line {
  background: #f3f4f6;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
  color: #6b7280;
  font-weight: 600;
}
.day-detail-v-id {
  font-weight: 700;
  color: #1f2937;
  min-width: 55px;
}
.day-detail-v-tag {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
}
.day-detail-vehicle.normal .day-detail-v-tag { color: #059669; }
.day-detail-vehicle.abnormal .day-detail-v-tag { color: #d97706; }
.day-detail-vehicle.idle .day-detail-v-tag { color: #2563eb; }
.day-detail-vehicle.weak .day-detail-v-tag { color: #9ca3af; }

/* ===== 收藏线路选中状态 ===== */
.fav-tag.line-tag.selected {
  background: rgba(0, 102, 204, 0.15);
  border-width: 2px;
  box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.2);
  transform: scale(1.05);
}

/* ===== 线路详情弹窗 ===== */
.line-detail-content { display: flex; flex-direction: column; gap: 14px; }
.ld-header-card {
  text-align: center;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(14, 165, 233, 0.05));
  border-radius: 12px;
  border: 1px solid rgba(59, 130, 246, 0.15);
}
.ld-header-line {
  font-size: 20px;
  font-weight: 800;
  color: #0c4a6e;
  margin-bottom: 6px;
  letter-spacing: 1px;
}
.ld-branch-slot { margin-left: 8px; }
.ld-branch-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: #1976d2;
  background: rgba(25, 118, 210, 0.08);
  padding: 2px 10px;
  border-radius: 10px;
  vertical-align: middle;
  letter-spacing: 0;
}
.ld-header-dir {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
  color: #0c4a6e;
}
.ld-header-dir .ld-dir-arrow {
  color: #0ea5e9;
  font-size: 16px;
  font-weight: 900;
}
.ld-header-sub {
  margin-top: 8px;
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
}
.ld-path-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 4px 0;
}
.ld-ps-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 13px;
  gap: 8px;
}
.ld-ps-label { color: #6b7280; font-size: 12px; }
.ld-ps-value { color: #0c4a6e; font-weight: 700; font-variant-numeric: tabular-nums; }
.ld-ps-source {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 600;
  border-radius: 4px;
  white-space: nowrap;
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #93c5fd;
}
/* 运营时刻表（v20260910e：收紧卡片内边距/间隙，降低浏览器端高度与留白） */
.ld-tt-list { display: flex; flex-direction: column; gap: 6px; padding: 0; }
.ld-tt-row {
  position: relative;
  display: flex; flex-direction: column; gap: 6px;
  padding: 10px 12px; background: #fff; border: 1px solid #eceff3; border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.ld-tt-row-expired { opacity: 0.6; background: #fef2f2; border-color: #fecaca; }
.ld-tt-expired {
  font-size: 10px; color: #dc2626; background: #fee2e2;
  border-radius: 4px; padding: 1px 6px; white-space: nowrap;
}
.ld-tt-head { display: flex; align-items: center; gap: 6px; }
.ld-tt-route { font-size: 14px; color: #1f2937; font-weight: 700; line-height: 1.3; flex: 1; min-width: 0; }
.ld-tt-body { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
/* weekday 徽章（源站：浅蓝灰底深灰字） */
.ld-tt-days {
  font-size: 12px; color: #455a64; background: #e8eef0;
  border-radius: 4px; padding: 2px 8px; white-space: nowrap;
}
/* 首/末时间徽章（源站：绿=首，红=末） */
.ld-tt-times { display: flex; gap: 8px; }
.ld-tt-time {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 14px; font-weight: 700; color: #111827;
  font-variant-numeric: tabular-nums;
  padding: 2px 8px 2px 4px; border-radius: 4px;
}
/* 多时段（如 专209 "6:00,15:30"）：每个时段占一行，保持徽章紧凑 */
.ld-tt-time-val { display: block; line-height: 1.3; }
.ld-tt-time-label {
  font-size: 11px; color: #fff; border-radius: 4px;
  padding: 1px 5px; white-space: nowrap; align-self: flex-start; margin-top: 0;
}
.ld-tt-time-first { background: #e7f6ef; }
.ld-tt-time-first .ld-tt-time-label { background: #2e7d32; }
.ld-tt-time-last { background: #fdecea; }
.ld-tt-time-last .ld-tt-time-label { background: #c62828; }
/* 最后更新日期（源站：灰色小字） */
.ld-tt-updated { font-size: 11px; color: #9ca3af; }
/* 回退卡片来源徽章：数据不是来自巴士档案站，明确标注 */
.ld-tt-source-badge {
  font-size: 10px; color: #b45309; background: #fef3c7; border: 1px solid #fcd34d;
  border-radius: 4px; padding: 1px 6px; white-space: nowrap; flex-shrink: 0;
}
.ld-tt-note { font-size: 12px; color: #6b7280; line-height: 1.5; }
.ld-tt-schedule {
  font-size: 12px; color: #6b7280; line-height: 1.6;
  white-space: pre-line; padding-top: 6px; border-top: 1px dashed #e5e7eb;
}
.ld-ps-source:has(+ .ld-ps-value) { margin-left: 4px; }
/* 运营时刻（线路详情，v20260903G，数据源：巴士档案站 buspedia.tt 首末班） */
.tt-source {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 500;
  color: #6b7280;
  background: #f3f4f6;
  border-radius: 4px;
  white-space: nowrap;
}
.tt-list { display: flex; flex-direction: column; gap: 8px; padding: 4px 0; }
.tt-item {
  padding: 10px 12px;
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.06), rgba(245, 158, 11, 0.02));
  border: 1px solid rgba(245, 158, 11, 0.16);
  border-left: 3px solid #f59e0b;
  border-radius: 8px;
}
.tt-item:nth-child(2) { border-left-color: #10b981; }
.tt-dir { font-size: 13px; font-weight: 600; color: #1f2937; margin-bottom: 4px; }
.tt-times { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.tt-first {
  padding: 2px 8px; border-radius: 6px;
  background: #ecfdf5; color: #047857;
  border: 1px solid #a7f3d0; font-size: 12px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.tt-last {
  padding: 2px 8px; border-radius: 6px;
  background: #fff7ed; color: #b45309;
  border: 1px solid #fed7aa; font-size: 12px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.tt-days { font-size: 11px; color: #6b7280; }
.tt-expired { font-size: 11px; color: #dc2626; background: #fee2e2; padding: 1px 6px; border-radius: 4px; }
.tt-note { margin-top: 4px; font-size: 11px; color: #9ca3af; line-height: 1.5; }
.ld-path-stats { display: flex; flex-direction: column; gap: 6px; }
.ld-path-stats:has(.ld-ps-item:nth-child(2)) {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 6px;
}
.ld-path-stats:has(.ld-ps-item:nth-child(2)) .ld-ps-item:first-child { grid-column: 1; }
.ld-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.ld-stat-card {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px 6px;
  text-align: center;
}
.ld-stat-card.online {
  background: #ecfdf5;
  border-color: #a7f3d0;
}
.ld-stat-value {
  font-size: 24px;
  font-weight: 800;
  color: #1f2937;
  line-height: 1.2;
}
.ld-stat-card.online .ld-stat-value { color: #059669; }
.ld-stat-label {
  font-size: 11px;
  color: #6b7280;
  margin-top: 4px;
  font-weight: 600;
}

/* ===== 每日运营统计表 ===== */
.ld-daily-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 8px;
}
.ld-daily-th {
  background: #f3f4f6;
  padding: 8px 6px;
  text-align: center;
  font-weight: 600;
  color: #374151;
  border-bottom: 2px solid #e5e7eb;
  white-space: nowrap;
  font-size: 12px;
}
.ld-daily-td {
  padding: 6px;
  text-align: center;
  border-bottom: 1px solid #f3f4f6;
  color: #6b7280;
  min-width: 50px;
}
.ld-daily-td.has-data {
  color: #059669;
  font-weight: 600;
  background: #ecfdf5;
}
.ld-daily-td.no-data {
  color: #d1d5db;
}
.ld-daily-td.total {
  font-weight: 700;
  color: #1f2937;
  background: #f9fafb;
}
.ld-daily-td:first-child {
  text-align: left;
  color: #1f2937;
  font-weight: 500;
}

/* ===== 日期范围切换按钮 ===== */
.ld-range-btn {
  padding: 4px 10px;
  font-size: 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.15s;
}
.ld-range-btn:hover {
  border-color: #9ca3af;
  color: #374151;
}
.ld-range-btn.active {
  background: #0c4a6e;
  color: #fff;
  border-color: #0c4a6e;
  font-weight: 600;
}

/* ===== 线路详情车号链接 ===== */
.line-detail-vehicle .vehicle-id-link {
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}
.line-detail-vehicle .vehicle-id-link:hover {
  background: #dbeafe;
  color: #0369a1;
  text-decoration: underline;
}
.line-detail-vehicle.offline .vehicle-id-link:hover {
  background: #f3f4f6;
  color: #6b7280;
}

.line-detail-vehicle-list {
  display: grid;
  /* v20260915s：桌面端固定一行 8 台车（原 flex-wrap 自动换行无固定列数） */
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  padding: 4px 0;
  align-items: stretch;
  /* v20260915x：整体左右居中，最右侧不再挤到边上、左右留白均匀 */
  justify-content: center;
}

/* v20260915s：详情弹窗"收藏"按钮（线路详情/车辆详情通用） */
.detail-fav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 10px;
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid #fbbf24;
  background: linear-gradient(135deg, #fef9c3, #fde68a);
  color: #92400e;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.detail-fav-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(251, 191, 36, 0.45);
}
.detail-fav-btn.fav-active {
  background: linear-gradient(135deg, #fde68a, #f59e0b);
  border-color: #f59e0b;
  color: #78350f;
}
.vi-header .detail-fav-btn { margin-top: 8px; }
.ld-header-card .detail-fav-btn { margin-top: 10px; }

/* ===== 线路车型统计 ===== */
.ld-model-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ld-model-item {
  position: relative;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 8px 12px;
  overflow: hidden;
}
.ld-model-bar {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  background: linear-gradient(90deg, rgba(59,130,246,0.10), rgba(59,130,246,0.04));
  transition: width 0.3s;
}
.ld-model-info {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ld-model-name {
  font-size: 13px;
  font-weight: 600;
  color: #1f2937;
}
.ld-model-fuel {
  font-size: 11px;
  padding: 1px 6px;
  background: #dbeafe;
  color: #1e40af;
  border-radius: 3px;
}
.ld-model-count {
  font-size: 12px;
  color: #6b7280;
  margin-left: auto;
  font-weight: 600;
}
.ld-model-name {
  cursor: pointer;
  transition: color 0.15s;
  user-select: none;
}
.ld-model-name:hover {
  color: #2563eb;
}
.ld-model-name:active {
  color: #1d4ed8;
}
.ld-model-arrow {
  font-size: 11px;
  color: #9ca3af;
  margin-left: 2px;
}
.ld-model-item-expanded {
  background: #eff6ff;
  border-color: #bfdbfe;
}
.ld-model-gallery {
  position: relative;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #e5e7eb;
}
.ld-model-gallery-title {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}
.line-detail-vehicle {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: default;
  transition: transform 0.15s, box-shadow 0.15s;
}
.line-detail-vehicle:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}
.line-detail-vehicle.online {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}
.line-detail-vehicle.offline {
  background: #f3f4f6;
  color: #6b7280;
  border: 1px solid #e5e7eb;
}
.line-detail-station-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  padding: 4px 0;
}
.line-detail-station {
  font-size: 12px;
  color: #4b5563;
  background: #f9fafb;
  padding: 2px 6px;
  border-radius: 4px;
}
.line-detail-text {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
  font-size: 13px;
  color: #374151;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 300px;
  overflow-y: auto;
  font-family: inherit;
}

/* ===== 班次信息可视化 ===== */
.schedule-card {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px;
}
.schedule-cards-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}
.schedule-time-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 8px;
  border-radius: 10px;
  text-align: center;
}
.schedule-time-card.first {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 1px solid #f59e0b;
}
.schedule-time-card.last {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  border: 1px solid #3b82f6;
}
.stc-icon { font-size: 24px; margin-bottom: 4px; }
.stc-label { font-size: 12px; color: #6b7280; font-weight: 600; }
.stc-time { font-size: 22px; font-weight: 800; color: #1f2937; font-variant-numeric: tabular-nums; margin-top: 2px; }
.schedule-other-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.schedule-other-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 12px;
}
.so-label { color: #6b7280; font-weight: 600; }
.so-time { color: #1f2937; font-weight: 700; font-variant-numeric: tabular-nums; }
.schedule-row {
  font-size: 13px;
  color: #374151;
  padding: 4px 0;
  border-bottom: 1px solid #f3f4f6;
}
.schedule-row:last-child { border-bottom: none; }
.schedule-text-info {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #f3f4f6;
}
.schedule-text-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  font-size: 12px;
}
.sti-label { color: #1e40af; font-weight: 600; }
.sti-value { color: #1e3a8a; font-weight: 500; }

/* ===== 停运预警明细弹窗样式 ===== */
.warn-detail-summary {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
  color: #991b1b;
}
.warn-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-bottom: 12px;
}
.warn-detail-table th,
.warn-detail-table td {
  border: 1px solid #e5e7eb;
  padding: 8px 10px;
  text-align: left;
  vertical-align: middle;
}
.warn-detail-table thead th {
  background: #f9fafb;
  font-weight: 700;
  color: #111827;
  position: sticky;
  top: 0;
  z-index: 1;
}
.warn-detail-table tbody tr.warn-row:hover {
  background: #fff7ed;
}
.warn-detail-table .last-ops-date {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-weight: 600;
  color: #1f2937;
}
.warn-detail-table .warn-diff {
  color: #dc2626;
  font-weight: 800;
  font-size: 15px;
}
.warn-detail-table .warn-tip {
  color: #9ca3af;
  font-weight: 400;
  font-size: 12px;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  white-space: nowrap;
}
.warn-detail-table .warn-status {
  color: #7c2d12;
  font-size: 13px;
}
.warn-detail-table .warn-vehicle-id a {
  color: #4f46e5;
  text-decoration: none;
  font-weight: 700;
}
.warn-detail-table .warn-vehicle-id a:hover {
  text-decoration: underline;
}
.warn-detail-footer {
  padding: 8px 4px;
  color: #6b7280;
  border-top: 1px dashed #e5e7eb;
  margin-top: 8px;
}
.customer-warn-badge {
  cursor: pointer !important;
  user-select: none;
  transition: transform 0.12s ease;
}
.customer-warn-badge:hover {
  transform: translateY(-1px) scale(1.04);
  filter: brightness(1.05);
}

/* ===== 3天未运行预警样式 ===== */
.warn-badge {
  display: inline-flex;
  align-items: center;
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  padding: 0 7px;
  font-size: 12px;
  font-weight: 700;
  margin-right: 4px;
  animation: warnPulse 2s ease-in-out infinite;
}
/* 总预警角标（客户管理标题右侧）：多客户同时预警时整体查看入口 */
.all-warn-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #ef4444, #f97316);
  color: #fff;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 700;
  margin-left: 8px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.45);
  animation: warnPulse 2s ease-in-out infinite;
  vertical-align: middle;
  white-space: nowrap;
}
.all-warn-badge b {
  font-size: 13px;
}
@keyframes warnPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.35); }
  50% { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.08); }
}
.warn-badge.warn-on-tag {
  font-size: 10px;
  padding: 1px 5px;
  margin-left: 0;
  margin-right: 2px;
}
.customer-vehicle-tag.warn {
  background: rgba(239, 68, 68, 0.1) !important;
  border: 2px solid #ef4444 !important;
  color: #b91c1c !important;
  animation: tagBlink 1.8s ease-in-out infinite;
  position: relative;
}
.customer-vehicle-tag.warn::before {
  content: '';
  position: absolute;
  top: -2px; left: -2px; right: -2px; bottom: -2px;
  border-radius: 8px;
  border: 2px solid #ef4444;
  animation: warnBorderPulse 1.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes warnBorderPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.02); }
}
@keyframes tagBlink {
  0%, 100% { background: rgba(239, 68, 68, 0.08); }
  50% { background: rgba(239, 68, 68, 0.22); }
}
/* 短期停运（1~3天）浅黄警示 */
.customer-vehicle-tag.short-offline {
  background: rgba(251, 191, 36, 0.08) !important;
  border: 1px dashed #d97706 !important;
}
.short-offline-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  border-radius: 5px;
  padding: 1px 4px;
  font-size: 10px;
  font-weight: 600;
  margin-left: 1px;
  text-align: center;
}
.unknown-badge {
  display: inline-flex;
  align-items: center;
  background: #f3f4f6;
  color: #6b7280;
  border: 1px solid #d1d5db;
  border-radius: 5px;
  padding: 1px 4px;
  font-size: 10px;
  font-weight: 600;
  margin-left: 1px;
}
.last-online-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
  background: #f0fdf4;
  color: #047857;
  border: 1px solid #86efac;
  border-radius: 5px;
  padding: 1px 4px;
  font-size: 10px;
  font-weight: 600;
  margin-left: 1px;
  text-align: center;
}
.warn-badge.warn-on-tag {
  font-size: 10px;
  padding: 1px 4px;
  margin-left: 0;
  margin-right: 2px;
  line-height: 1.1;
  text-align: center;
  flex-direction: column;
  border-radius: 5px;
  font-weight: 800;
}

/* ===== 车辆详情弹窗 ===== */
.vehicle-info-modal { padding: 8px 0; }
.vi-header {
  text-align: center;
  padding: 16px 12px;
  background: linear-gradient(135deg, #e0f2fe, #f0f9ff);
  border-radius: 10px;
  margin-bottom: 16px;
}
.vi-bus-id {
  font-size: 24px;
  font-weight: 800;
  color: #0c4a6e;
  margin-bottom: 6px;
}
.vi-license {
  font-size: 18px;
  font-weight: 700;
  color: #0369a1;
  margin-bottom: 4px;
}
.vi-status {
  font-size: 12px;
  color: #6b7280;
}
.vi-customer-banner {
  background: linear-gradient(90deg, #fef3c7, #fde68a);
  border: 1px solid #f59e0b;
  border-radius: 8px;
  padding: 8px 14px;
  margin-bottom: 14px;
  font-size: 14px;
  color: #78350f;
  text-align: center;
}
.vi-customer-banner b {
  color: #92400e;
  font-size: 15px;
}
.vi-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.vi-info-item {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 12px;
}
.vi-info-label {
  font-size: 11px;
  color: #6b7280;
  margin-bottom: 4px;
  font-weight: 500;
}
.vi-info-value {
  font-size: 15px;
  font-weight: 700;
  color: #1f2937;
}
.vi-footer {
  text-align: center;
  padding: 12px 0 4px;
}
.vi-buspedia-link {
  display: inline-block;
  padding: 8px 20px;
  background: #0ea5e9;
  color: #fff !important;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none !important;
  transition: background 0.15s;
}

/* ===== 车辆详情照片画廊 ===== */
.vi-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-top: 8px;
}
/* 车型详情弹窗内照片固定一行 4 张 */
#md-photos .vi-photo-grid {
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.vi-photo-item {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  background: #f9fafb;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.vi-photo-item:hover {
  border-color: #3b82f6;
  box-shadow: 0 2px 12px rgba(59, 130, 246, 0.18);
}
.vi-photo-thumb-wrap {
  width: 100%;
  background: #1f2937;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  position: relative;
}
.vi-photo-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s;
}
.vi-photo-item:hover .vi-photo-thumb-wrap img {
  transform: scale(1.04);
}
.vi-photo-error::after {
  content: '📷 图片加载失败';
  color: #9ca3af;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 120px;
}
.vi-photo-meta {
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: #fff;
}
.vi-photo-date {
  font-size: 11px;
  color: #6b7280;
  font-weight: 600;
}
.vi-photo-caption {
  font-size: 11px;
  color: #374151;
}
.vi-photo-thumb-wrap { position: relative; cursor: zoom-in; }
.vi-photo-thumb-wrap::after {
  content: '🔍';
  position: absolute;
  top: 6px; right: 6px;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 6px;
  font-size: 13px;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  z-index: 2;
}
.vi-photo-item:hover .vi-photo-thumb-wrap::after { opacity: 1; }

/* ===== 照片放大预览 Lightbox ===== */
/* v20260916a：打开时锁定 body，防止 pinch 缩放/滚动泄漏到背景页面（关闭后整页被放大无法缩小） */
body.lb-lock { overflow: hidden; touch-action: none; overscroll-behavior: none; }
.photo-lightbox {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  touch-action: none; /* 双指手势由 JS 处理，避免浏览器层 pinch-zoom 页面 */
  overscroll-behavior: none;
}
.photo-lightbox.hidden { display: none; }
.photo-lightbox-backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.92);
  cursor: zoom-out;
}
.photo-lightbox-img {
  position: relative;
  max-width: 92vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
  z-index: 1;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
}
.photo-lightbox-caption {
  position: relative;
  color: #fff;
  font-size: 13px;
  margin-top: 10px;
  text-align: center;
  max-width: 80vw;
  z-index: 1;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}
.photo-lightbox-hint {
  position: relative;
  color: rgba(255, 255, 255, 0.6);
  font-size: 11px;
  margin-top: 6px;
  z-index: 1;
}
/* v20260916af：电脑端提示右键保存，手机端提示长按保存到相册 */
.photo-lightbox-hint .hint-mobile { display: none; }
@media (max-width: 1024px) {
  .photo-lightbox-hint .hint-desk { display: none; }
  .photo-lightbox-hint .hint-mobile { display: inline; }
}

/* ===== 截图保存预览（v20260907U：移动端保存图片改用页内预览，替代 window.open(dataURL)） ===== */
.save-prev {
  position: fixed; inset: 0; z-index: 10001;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.save-prev.hidden { display: none; }
.save-prev-backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.72);
}
.save-prev-box {
  position: relative;
  width: 100%; max-width: 480px; max-height: 92vh;
  background: #fff; border-radius: 14px;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}
.save-prev-head {
  padding: 12px 16px;
  font-size: 14px; font-weight: 700; color: #0d1840;
  border-bottom: 1px solid #e5e7eb;
}
.save-prev-scroll {
  flex: 1; overflow: auto;
  min-height: 0; /* v20260907V：flex 子项允许收缩，否则图片超高时按钮区被挤出盒子外面看不到 */
  background: #f3f4f6;
  -webkit-overflow-scrolling: touch;
}
.save-prev-scroll img {
  display: block; width: 100%; height: auto;
}
.save-prev-actions {
  display: flex; gap: 10px; padding: 12px 16px;
  border-top: 1px solid #e5e7eb;
}
.save-prev-btn {
  flex: 1; padding: 11px 0;
  border: none; border-radius: 10px;
  background: #0066cc; color: #fff;
  font-size: 15px; font-weight: 700; cursor: pointer;
}
.save-prev-btn.secondary { background: #e5e7eb; color: #374151; }
.save-prev-btn:active { opacity: 0.85; }
.save-prev-hint {
  padding: 0 16px 12px;
  font-size: 12px; color: #9ca3af; text-align: center;
}

/* ===== 未收录车辆手动输入表单 ===== */
.manual-vehicle-form {
  padding: 15px;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}
.manual-form-row {
  display: flex;
  margin-bottom: 12px;
  align-items: center;
}
.manual-form-row label {
  width: 80px;
  font-size: 13px;
  color: #6b7280;
  text-align: right;
  padding-right: 10px;
  flex-shrink: 0;
}
.manual-form-row input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 13px;
  min-width: 0;
  transition: border-color 0.15s;
}
.manual-form-row input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}
.manual-save-btn {
  width: 100%;
  padding: 10px;
  background: #16a34a;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  margin-top: 4px;
  transition: background 0.15s;
}
.manual-save-btn:hover {
  background: #15803d;
}
.manual-edit-hint {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 8px;
  text-align: center;
}

/* ========================================
   移动端适配 (<= 1024px，覆盖手机横屏与平板)
   ======================================== */

/* 仅移动端显示 */
.mobile-only { display: none; }
.mobile-bottom-nav { display: none; }
/* 移动端抽屉"显示设置"开关区（桌面端隐藏） */
.mm-display-section { display: none; }

/* 仅桌面端显示的工具类（移动端隐藏） */
@media (max-width: 1024px) {
  .desktop-only { display: none !important; }
  .mobile-only { display: inline-flex !important; }

  /* ===== 顶部栏 ===== */
  .top-bar {
    height: 52px;
    padding: 0 12px;
    padding-top: env(safe-area-inset-top);
  }
  .top-bar-left .logo { font-size: 20px; }
  .top-bar-left .title { font-size: 14px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .top-bar-right { gap: 4px; }
  .stat-item { padding: 0 4px; min-width: 36px; }
  .stat-label { font-size: 9px; }
  .stat-value { font-size: 14px; }
  .stat-divider { width: 1px; height: 16px; }
  .icon-btn { padding: 6px; font-size: 16px; min-width: 36px; min-height: 36px; }
  /* 移动端菜单按钮 */
  #mobile-menu-btn { margin-right: 6px; }

  /* ===== 移动端侧边栏抽屉 ===== */
  .mobile-overlay {
    display: none;
    position: fixed; inset: 0; z-index: 998;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.25s;
  }
  .mobile-overlay.show { display: block; opacity: 1; }

  .search-panel {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 88vw; max-width: 360px;
    z-index: 999;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0;
    max-height: 100dvh;
    padding-top: env(safe-area-inset-top);
  }
  .search-panel.mobile-open { transform: translateX(0); }
  .search-header { padding: 14px 16px; }
  .panel-title { font-size: 14px; }
  .panel-body {
    padding: 12px;
    max-height: calc(100vh - 60px);
    max-height: calc(100dvh - 60px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* 搜索栏输入框加大 */
  #search-input, #customer-input, #fav-input, #fav-vehicle-input {
    font-size: 16px; /* iOS 不缩放 */
    padding: 10px 12px;
    min-height: 40px;
  }
  .fav-input-row { gap: 6px; }
  .add-btn {
    padding: 10px 14px;
    font-size: 14px;
    min-height: 40px;
  }

  /* 区块标签更紧凑 */
  .section-label { font-size: 12px; padding: 8px 0 4px; }
  .fav-section { margin-bottom: 12px; }

  /* 复选框加大触控目标 */
  .checkbox-row {
    padding: 10px 4px;
    font-size: 13px;
    min-height: 40px;
  }
  .checkbox-row input { width: 18px; height: 18px; }

  /* ===== 地图占满剩余空间 ===== */
  /* v20260907BM：不再写死 height:calc(100vh - ...)；fixed + top/right/bottom/left 四边拉伸，
     高度由视口决定（iOS PWA with viewport-fit=cover 下=物理屏高），避免固定 793px 底部露白 */
  #map {
    position: fixed;
    top: 52px; left: 0; right: 0; bottom: 0;
    width: 100vw;
  }
  /* Leaflet 控件位置调整 */
  .leaflet-control-zoom { margin-top: 12px !important; }
  .leaflet-control-attribution {
    font-size: 9px !important;
    padding: 2px 6px !important;
  }

  /* ===== 图例改为底部弹出 ===== */
  .legend {
    position: fixed;
    top: auto; right: 0; left: 0; bottom: 56px;
    width: 100vw; max-width: 100vw;
    border-radius: 16px 16px 0 0;
    max-height: 50vh;
    z-index: 997;
  }
  .legend-header { padding: 14px 16px; }
  .legend-body { padding: 8px 16px 16px; max-height: 40vh; overflow-y: auto; }

  /* ===== 车辆详情面板：底部抽屉式 ===== */
  .bus-detail {
    position: fixed;
    top: auto; left: 0; right: 0; bottom: 56px;
    width: 100vw; max-width: 100vw;
    border-radius: 16px 16px 0 0;
    max-height: 70vh;
    z-index: 996;
  }
  .bus-detail-header { padding: 14px 16px; }
  .bus-detail-body { padding: 12px 16px 20px; max-height: calc(70vh - 60px); }

  /* ===== 模态弹窗全屏化 ===== */
  .modal-overlay {
    padding: 0;
    align-items: stretch;
  }
  .modal {
    width: 100vw; max-width: 100vw;
    /* v20260907BM：去掉 height/max-height 硬编码，改为最小高度拉伸 */
    height: auto;
    min-height: 100vh;
    min-height: 100svh;
    max-height: none;
    border-radius: 0;
    overflow: hidden;
    /* v20260907BR：移除容器级 safe-area padding，由 header/body 各自承担，避免双重叠加导致顶部留白过大 */
    padding: 0;
  }
  .modal-header {
    padding: 14px 16px;
    padding-top: calc(14px + env(safe-area-inset-top));
    font-size: 16px;
  }
  .close-btn {
    width: 40px; height: 40px;
    font-size: 22px;
  }
  .modal-body {
    padding: 12px 14px;
    font-size: 14px;
    -webkit-overflow-scrolling: touch;
  }
  .history-body { padding: 12px 10px; }

  /* ===== 历史统计卡片网格：单列 ===== */
  .hist-cards-row {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px;
  }
  .hist-card { padding: 8px 6px; }
  .hist-card-value { font-size: 20px; }
  .hist-card-value.small { font-size: 16px; }
  .hist-card-label { font-size: 10px; }

  /* ===== 日历单元格触控友好 ===== */
  .cal-cell {
    min-width: 32px; min-height: 32px;
    font-size: 11px;
  }
  .cal-cell .cal-cell-num { font-size: 11px; }
  .cal-weekday { font-size: 10px; }

  /* ===== 预警/调线信息条 ===== */
  .gap-item {
    padding: 10px 12px;
    font-size: 13px;
    flex-wrap: wrap;
    gap: 6px;
  }
  .gap-range { font-size: 12px; }
  .gap-days { font-size: 12px; padding: 2px 6px; }

  /* ===== 客户总览 ===== */
  .ov-stats-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .ov-stat-card { padding: 10px 6px; }
  .ov-stat-value { font-size: 22px; }
  .ov-stat-card.big .ov-stat-value { font-size: 28px; }
  .ov-v-row { padding: 8px 10px; }
  .ov-v-id { font-size: 14px; min-width: 48px; }

  /* ===== 线路详情 ===== */
  .ld-stats { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .ld-stat-card { padding: 10px 6px; }
  .ld-stat-value { font-size: 20px; }
  .ld-path-stats { grid-template-columns: 1fr !important; }
  .ld-path-stats:has(.ld-ps-item:nth-child(2)) {
    grid-template-columns: 1fr !important;
  }
  .line-detail-vehicle-list {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)) !important;
    gap: 4px;
  }

  /* ===== 车号表车辆标签 ===== */
  .vehicle-tag, .fav-tag.vehicle-tag {
    padding: 6px 8px;
    font-size: 12px;
    min-height: 32px;
  }
  .vehicle-info-icon {
    font-size: 14px;
    min-width: 24px;
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .vehicle-id-text { font-size: 13px; }
  .remove {
    min-width: 24px; min-height: 24px;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* ===== 线路长度区块 ===== */
  .ld-ps-item {
    padding: 10px 12px;
    font-size: 14px;
  }
  .ld-ps-value { font-size: 16px; }
  .ld-ps-source { font-size: 11px; padding: 2px 6px; }

  /* ===== 底部导航栏（v20260907D：悬浮毛玻璃胶囊样式） ===== */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    width: min(92%, 430px);
    height: 58px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(20px) saturate(1.3);
    -webkit-backdrop-filter: blur(20px) saturate(1.3);
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 29px;
    box-shadow: 0 10px 30px rgba(13, 24, 64, 0.18), 0 2px 8px rgba(13, 24, 64, 0.08);
    padding: 0 8px;
    z-index: 995;
    justify-content: space-around;
    align-items: center;
  }
  /* 深色地图背景上胶囊的描边提亮（SVG 线性图标由 color 驱动，激活项变品牌蓝） */
  .mbn-item {
    flex: 1;
    height: 100%;
    background: transparent;
    border: none;
    color: #7a88a3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    cursor: pointer;
    transition: color 0.15s;
    -webkit-tap-highlight-color: transparent;
  }
  .mbn-item:active { color: #00d4ff; }
  .mbn-item.active { color: #00d4ff; }
  .mbn-icon { font-size: 18px; line-height: 1; }
  .mbn-label { font-size: 10px; font-weight: 600; }

  /* ===== 登录卡片移动端 ===== */
  .login-card {
    width: 100vw; max-width: 100vw;
    /* v20260907BM：不去写死 height:100vh；用 min-height 拉伸 + 内容可滚动 */
    height: auto;
    min-height: 100vh;
    min-height: 100svh;
    max-height: 100svh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 0;
    padding: 40px 24px;
    padding-top: calc(40px + env(safe-area-inset-top));
    padding-bottom: calc(40px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* v20260907BM：safe center（iOS17+）——内容超高时可从顶部滚动，避免 center+overflow 裁掉顶部标题 */
    justify-content: safe center;
  }
  .login-header { margin-bottom: 24px; }
  .login-icon { font-size: 40px; }
  .login-card h1 { font-size: 18px; }
  .form-group input {
    font-size: 16px; /* iOS 不缩放 */
    padding: 14px 16px;
  }
  #login-btn {
    padding: 16px;
    font-size: 16px;
    min-height: 48px;
  }

  /* ===== 防止文字选择（移动端体验） ===== */
  .top-bar, .mobile-bottom-nav, .legend-header, .search-header {
    -webkit-user-select: none;
    user-select: none;
  }

  /* ===== 滚动条隐藏（移动端原生体验） ===== */
  .panel-body::-webkit-scrollbar { display: none; }
  .panel-body { scrollbar-width: none; }

  /* ===== Leaflet 弹窗移动端 ===== */
  .leaflet-popup-content-wrapper {
    border-radius: 12px;
    max-width: 240px;
  }
  .leaflet-popup-content {
    font-size: 13px;
    margin: 10px 14px;
  }

  /* ===== 警告徽章触控 ===== */
  .warning-badge {
    min-width: 22px; min-height: 22px;
    font-size: 11px;
  }

  /* ===== 车辆号牌动画 ===== */
  .bus-number-label {
    font-size: 11px !important;
    padding: 2px 5px !important;
  }

  /* ===== 顶部栏：开关按钮移入抽屉，剩余元素统一对齐，右侧可横向滑动 ===== */
  .top-bar-right {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    align-items: center;
  }
  .top-bar-right::-webkit-scrollbar { display: none; }
  .topbar-toggle { display: none !important; }
  .top-bar-right .stat-item { height: 34px; justify-content: center; }
  .top-bar-right .icon-btn { height: 34px; }

  /* 抽屉"显示设置"开关区：两列开关，触控友好 */
  .mm-display-section { display: block !important; }
  .mm-toggle-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .mm-toggle-row {
    display: flex; align-items: center; gap: 8px;
    min-height: 40px; padding: 8px 10px;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 8px;
    font-size: 13px; color: #1f2937; font-weight: 500;
  }
  .mm-toggle-row input { width: 18px; height: 18px; accent-color: #20c997; flex-shrink: 0; }

  /* ===== 浮动统计窗口：移动端默认隐藏，点底部"统计"以底部抽屉打开 ===== */
  .events-window, .doubledeck-window { display: none !important; }
  .doubledeck-window.mobile-open {
    display: flex !important;
    position: fixed !important;
    left: 0 !important; right: 0 !important;
    top: auto !important; bottom: 56px;
    width: 100vw !important; max-width: 100vw !important;
    min-width: 0; min-height: 0;
    max-height: 78vh;
    border-radius: 16px 16px 0 0;
    z-index: 999;
  }
  .doubledeck-window.mobile-open .events-resizer { display: none; }

  /* ===== 客户卡片：名称不折行、头部/车辆行自动换行不截断 ===== */
  .customer-header { flex-wrap: wrap; gap: 6px; row-gap: 6px; }
  .customer-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; min-width: 0; }
  .customer-actions { flex-wrap: wrap; }
  .fav-tag.customer-vehicle-tag { flex-wrap: wrap; white-space: normal; row-gap: 4px; }
  .fav-tag.customer-vehicle-tag .last-online-badge,
  .fav-tag.customer-vehicle-tag .warn-badge,
  .fav-tag.customer-vehicle-tag .short-offline-badge,
  .fav-tag.customer-vehicle-tag .ad-start-badge,
  .fav-tag.customer-vehicle-tag .ad-end-badge { line-height: 1.4; }

  /* ===== 运营历史：线路分布行自适应（日期区间换行到第二行）====== */
  .hist-line-row { grid-template-columns: 64px 1fr 78px; gap: 8px; }
  .hist-line-range { grid-column: 2 / 4; text-align: left; margin-top: -2px; }

  /* ===== 车辆详情底部抽屉：值可断行、按钮等高对齐 ===== */
  .bus-detail .detail-value { word-break: keep-all; overflow-wrap: break-word; }
  /* v20260907BS：移除 .detail-actions 底部 safe-area——.bus-detail-body 已带 calc(20px + safe-area)，避免双重留白 */
  .detail-actions { gap: 8px; padding-bottom: 0; }
  .detail-action-btn {
    min-height: 40px;
    display: inline-flex; align-items: center; justify-content: center;
    gap: 4px; padding: 8px 10px; font-size: 12px;
  }

  /* ===== 统计抽屉：数字卡紧凑、进度条行不溢出 ===== */
  .dd-card b { font-size: 17px; }
  .dd-card span { font-size: 10px; }
  .dd-progress-text { flex-wrap: wrap; row-gap: 2px; }
}

/* ========================================
   说明：旧"平板适配(769px-1024px)"块随断点 768→1024 已并入移动端，
   平板（≤1024px）统一走移动端布局（含手机横屏）
   ======================================== */

/* ========================================
   超小屏适配 (<= 380px, iPhone SE)
   ======================================== */
@media (max-width: 380px) {
  .top-bar-left .title { display: none; }
  .stat-item { min-width: 32px; }
  .stat-label { font-size: 8px; }
  .stat-value { font-size: 13px; }
  .hist-cards-row { grid-template-columns: repeat(2, 1fr) !important; }
  .cal-cell { min-width: 28px; min-height: 28px; font-size: 10px; }
  .mbn-label { font-size: 9px; }
}

/* ===== 横屏适配 ===== */
@media (max-height: 500px) and (orientation: landscape) {
  /* v20260907I：横屏也要显示底部导航（基础规则 display:none 会把宽度>768 的横屏设备藏掉） */
  .mobile-bottom-nav { display: flex; height: 50px; bottom: 10px; border-radius: 25px; }
  .mbn-label { display: none; }
  .mbn-icon { font-size: 20px; }
  /* v20260907I：地图铺满视口底部，与竖屏一致 */
  #map { bottom: 0; }
}
.vi-buspedia-link:hover { background: #0284c7; }

/* ===== 用户管理面板 ===== */
.admin-panel {
  background: #fff;
  border-radius: 12px;
  width: 90vw; max-width: 540px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.admin-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
}
.admin-header h2 { font-size: 18px; margin: 0; color: #111827; }
.admin-close {
  cursor: pointer; font-size: 24px; color: #6b7280; line-height: 1;
}
.admin-close:hover { color: #ef4444; }
.admin-body { padding: 16px 20px; overflow-y: auto; flex: 1; }
.admin-section { margin-bottom: 20px; }
.admin-section h3 { font-size: 13px; color: #6b7280; margin: 0 0 8px; font-weight: 600; }
.admin-form-row {
  display: flex; gap: 6px;
}
.admin-form-row input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  min-width: 0;
}
.admin-form-row button {
  padding: 8px 14px;
  background: #2563eb; color: #fff;
  border: none; border-radius: 6px;
  font-size: 13px; cursor: pointer;
  white-space: nowrap;
}
.admin-form-row button:hover { background: #1d4ed8; }
.admin-source-ok {
  background: #ecfdf5; border: 1px solid #10b981;
  padding: 10px 12px; border-radius: 6px;
  font-size: 13px; color: #065f46;
}
.admin-source-warn {
  background: #fffbeb; border: 1px solid #f59e0b;
  padding: 10px 12px; border-radius: 6px;
  font-size: 13px; color: #92400e;
}
.admin-user-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0; border-bottom: 1px solid #f3f4f6;
}
.admin-user-name { flex: 1; font-weight: 600; color: #111827; font-size: 13px; }
.admin-user-time { font-size: 11px; color: #9ca3af; }
/* 角色徽章 + 设管理员按钮（v20260903N） */
.admin-role-badge {
  font-size: 11px; color: #92400e; background: #fef3c7; border: 1px solid #f59e0b;
  border-radius: 4px; padding: 0 6px; margin-left: 6px; font-weight: 400;
}
.admin-role-btn {
  padding: 4px 10px; background: #dbeafe; color: #1d4ed8;
  border: none; border-radius: 4px; font-size: 12px; cursor: pointer;
}
.admin-role-btn:hover { background: #bfdbfe; }
.admin-del-btn {
  padding: 4px 10px; background: #fee2e2; color: #dc2626;
  border: none; border-radius: 4px; font-size: 12px; cursor: pointer;
}
.admin-del-btn:hover { background: #fecaca; }
.admin-empty { color: #9ca3af; font-size: 13px; padding: 8px 0; }
@media (max-width: 600px) {
  .admin-panel { width: 100vw; max-width: 100vw; height: auto; max-height: none; border-radius: 0; }
  .admin-form-row { flex-direction: column; }
}

/* ===== 历史发布记录（下刊客户） ===== */
.archived-customer-list {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px dashed rgba(156, 163, 175, 0.5);
}
.archived-section-label {
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  padding: 6px 0 8px;
  user-select: none;
}
.archived-month-group {
  margin-bottom: 12px;
  background: rgba(249, 250, 251, 0.6);
  border-radius: 6px;
  padding: 8px;
  border-left: 3px solid #9ca3af;
}
.archived-month-header {
  font-size: 12px;
  font-weight: 600;
  color: #4b5563;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px dotted #e5e7eb;
}
.archived-customer-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.customer-item.archived {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  font-size: 12px;
  flex-wrap: wrap;
}
.archived-customer-name {
  font-weight: 600;
  color: #374151;
  flex: 0 0 auto;
  min-width: 60px;
}
.archived-customer-meta {
  display: flex;
  gap: 8px;
  flex: 1;
  color: #6b7280;
  font-size: 11px;
  flex-wrap: wrap;
}
.archived-customer-actions {
  display: flex;
  gap: 4px;
  flex: 0 0 auto;
}
.archived-action-btn {
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
  user-select: none;
  transition: background 0.12s, color 0.12s;
}
.archived-action-btn.view {
  color: #1d4ed8;
  background: rgba(59, 130, 246, 0.1);
}
.archived-action-btn.view:hover {
  background: rgba(59, 130, 246, 0.25);
}
.archived-action-btn.restore {
  color: #047857;
  background: rgba(16, 185, 129, 0.12);
}
.archived-action-btn.restore:hover {
  background: rgba(16, 185, 129, 0.3);
}
.archived-action-btn.delete {
  color: #dc2626;
  background: rgba(239, 68, 68, 0.1);
  font-size: 14px;
  line-height: 1;
}
.archived-action-btn.delete:hover {
  background: rgba(239, 68, 68, 0.25);
}
@media (max-width: 600px) {
  .customer-item.archived {
    font-size: 11px;
  }
  .archived-customer-meta {
    font-size: 10px;
  }
}

/* ===== 销售人员多选弹窗 ===== */
.sales-filter-panel {
  background: #fff;
  border-radius: 14px;
  width: 90vw; max-width: 420px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  overflow: hidden;
}
.sales-filter-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
}
.sales-filter-header h2 { font-size: 17px; margin: 0; color: #111827; }
.sales-filter-close {
  cursor: pointer; font-size: 24px; color: #6b7280; line-height: 1;
}
.sales-filter-close:hover { color: #ef4444; }
.sales-filter-body { padding: 14px 20px; overflow-y: auto; flex: 1; }
.sales-filter-hint {
  font-size: 12px; color: #6b7280; margin-bottom: 12px; line-height: 1.5;
}
.sales-filter-list {
  display: flex; flex-direction: column; gap: 4px;
}
.sales-filter-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  background: #fff;
}
.sales-filter-item:hover {
  background: #f9fafb;
  border-color: #c4b5fd;
}
.sales-filter-item.checked {
  background: rgba(124, 58, 237, 0.08);
  border-color: rgba(124, 58, 237, 0.4);
}
.sales-filter-item input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: #7c3aed;
  cursor: pointer;
  flex-shrink: 0;
}
.sales-filter-item-name {
  flex: 1;
  font-size: 14px;
  color: #111827;
  font-weight: 500;
}
.sales-filter-item-count {
  font-size: 11px;
  color: #6b7280;
  background: #f3f4f6;
  padding: 2px 8px;
  border-radius: 10px;
  flex-shrink: 0;
}
.sales-filter-empty {
  color: #9ca3af; font-size: 13px; padding: 16px 0; text-align: center;
}
.sales-filter-footer {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 12px 20px;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
}
.sales-filter-btn {
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
}
.sales-filter-btn.primary {
  background: #7c3aed;
  color: #fff;
  border-color: #7c3aed;
}
.sales-filter-btn.primary:hover { background: #6d28d9; }
.sales-filter-btn.secondary {
  background: #fff;
  color: #6b7280;
  border-color: #d1d5db;
}
.sales-filter-btn.secondary:hover { background: #f3f4f6; }
@media (max-width: 600px) {
  .sales-filter-panel { width: 100vw; max-width: 100vw; max-height: 100dvh; border-radius: 0; }
}

/* ========================================
   移动端系统化适配（iPhone 14 视口 390px 校准，v20260901AL）
   置于文件末尾以获得最高优先级：
   ① 顶栏/底栏安全区自适应，内容不挤压、子项统一垂直居中
   ② 移动端排版统一：字号≥11px、允许换行、杜绝截断
   ③ 弹窗/抽屉/卡片在窄屏下的对齐与可读性
   ======================================== */
@media (max-width: 1024px) {

  /* ---------- ① 顶栏：安全区自适应 + 子项统一定高对齐 ---------- */
  .top-bar {
    height: calc(52px + env(safe-area-inset-top, 0px));
    min-height: calc(52px + env(safe-area-inset-top, 0px));
    padding: 0 10px;
    padding-top: env(safe-area-inset-top, 0px);
    flex-wrap: nowrap;
    gap: 2px;
  }
  .top-bar-left, .top-bar-right { height: 100%; align-items: center; }
  .top-bar-left { flex: 0 0 auto; min-width: 0; }
  .top-bar-right { flex: 1 1 auto; min-width: 0; justify-content: flex-end; }
  /* 定高统一（34px），让"在线/收藏"统计、图标按钮、状态胶囊都严格一行居中对齐 */
  .top-bar-right .stat-item { height: 34px; min-height: 34px; padding: 0 6px; justify-content: center; }
  .top-bar-right .stat-divider { height: 18px; margin: 0 2px; }
  .top-bar-right .icon-btn { width: 36px; min-width: 36px; height: 34px; padding: 0; }
  .top-bar-right .stat-label,
  .top-bar-right .stat-value { line-height: 1.25; }
  .source-status-indicator { height: 34px; padding: 0 10px; }
  #mobile-menu-btn { width: 38px; height: 34px; }

  /* ---------- ② 地图/底栏：跟随 iPhone 安全区，不被刘海/Home条遮挡 ---------- */
  #map {
    top: calc(52px + env(safe-area-inset-top, 0px));
    bottom: 0; /* v20260907F：地图延伸到屏幕最底部，底部导航胶囊悬浮在地图之上，不再露出灰色页面底色 */
    /* v20260907BN：去掉 height:calc(...) —— top+bottom 四边拉伸决定高度，避免与 100vh 混算 */
  }
  /* 横屏时同样处理（覆盖下方横屏块） */
  .mobile-bottom-nav {
    height: 58px; /* v20260907D：安全区已并入 bottom 偏移，不再加高 */
  }
  .legend, .bus-detail {
    bottom: calc(68px + env(safe-area-inset-bottom, 0px));
  }
  .doubledeck-window.mobile-open {
    bottom: calc(68px + env(safe-area-inset-bottom, 0px));
  }

  /* ---------- ③ 排版统一：正文≥12px，允许换行，杜绝截断 ---------- */
  body { font-size: 14px; }
  .panel-body, .modal-body { overflow-wrap: break-word; }
  /* 详情行：值可换行，不挤压 */
  .detail-row { gap: 10px; }
  .detail-value { flex: 1; min-width: 0; }
  /* 客户总览车辆行：允许换行 */
  .ov-v-top { flex-wrap: wrap; row-gap: 4px; }
  .ov-v-row { font-size: 12px; }
  /* 历史线路分布：窄屏收紧，日期区间整行显示不截断 */
  .hist-line-row { grid-template-columns: 52px 1fr 70px; gap: 6px; }
  .hist-line-range { grid-column: 2 / 4; font-size: 11px; }
  .hist-line-days { font-size: 11px; }
  /* 线路标签：热门线路名放宽，避免右侧计数角标被截 */
  .fav-tag.line-tag .line-tag-dir { max-width: 96px; font-size: 11px; }
  .fav-tag.line-tag .line-tag-num { font-size: 14px; }

  /* ---------- ④ 弹窗/抽屉：头部吸顶，内容独立滚动 ---------- */
  /* v20260907BM：.modal 不再 height:100dvh，改 min-height 拉伸（全屏块会用 four-edge 覆盖） */
  .modal { height: auto; min-height: 100vh; min-height: 100dvh; }
  .modal-header { flex-shrink: 0; }
  .modal-body { overscroll-behavior: contain; touch-action: pan-y; }
  .bus-detail-header { flex-shrink: 0; }
  .bus-detail-body { overscroll-behavior: contain; touch-action: pan-y; }
  /* 统计抽屉标题/进度行宽度受限时不溢出 */
  .events-window-header, .doubledeck-window .events-window-header { flex-wrap: wrap; row-gap: 4px; }
  .dd-progress { min-width: 0; }

  /* ---------- ⑤ 触控目标与间距：外勤场景点按更稳 ---------- */
  .close-btn { flex-shrink: 0; }
  .archived-action-btn { min-height: 32px; display: inline-flex; align-items: center; }
  .customer-actions .icon-btn-like, .customer-actions button { min-height: 32px; }
  /* 登录卡片避免键盘弹出后被挤压 */
  .login-card { overflow-y: auto; }
}

/* ========================================
   移动端 v20260901AM：
   ① 顶栏隐藏logo/收藏统计，源站状态移左侧（safe-area 兜底横屏刘海/挖孔）
   ② 发布期三行布局（标签行/日期行/按钮行），日期输入 16px 防 iOS 聚焦缩放
   ③ 客户卡片头部：🏁最后下刊移到📅投放期徽章后面同一行
   ④ 客户车辆标签三段式卡片布局（车型行/日期行/操作行），杜绝截断与折行混乱
   ⑤ 筛选抽屉全宽，位于顶栏与底部导航之间，不覆盖上下区域
   ⑥ 移动端隐藏📊图例面板（无用），并移除底部导航"图例"按钮
   ======================================== */
@media (max-width: 1024px) {

  /* ---------- ① 顶栏 ---------- */
  /* 隐藏 logo 与"收藏"统计（保留"在线"），腾出移动端空间 */
  .top-bar-left .logo { display: none !important; }
  .top-bar-right .stat-item:has(#fav-count) { display: none !important; }
  /* 顶栏左右预留横屏刘海/挖孔安全区 */
  .top-bar {
    padding-left: calc(10px + env(safe-area-inset-left, 0px));
    padding-right: calc(10px + env(safe-area-inset-right, 0px));
  }
  /* 源站状态（已由JS移到顶栏左侧）：紧凑胶囊，不占右侧空间 */
  .top-bar-left .source-status-indicator {
    height: 30px;
    padding: 0 10px;
    font-size: 11px;
    flex-shrink: 1;
    min-width: 0;
    max-width: 170px;
  }
  .top-bar-left .source-status-indicator .source-status-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .top-bar-left .title { flex-shrink: 1; min-width: 0; }

  /* ---------- ② 发布期三行布局 ---------- */
  .cust-period-row { flex-wrap: wrap; gap: 6px; }
  .cust-period-row .period-label { flex: 1 1 100%; font-size: 12px; }
  .cust-period-row input[type="date"] {
    flex: 1 1 38%;
    width: auto;
    min-width: 0;
    height: 36px;
    font-size: 16px; /* iOS 聚焦不缩放 */
    padding: 4px 6px;
  }
  .cust-period-row .period-sep { flex: 0 0 auto; align-self: center; }
  .cust-period-row .period-batch-btn {
    flex: 1 1 45%;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    padding: 4px 6px;
  }

  /* ---------- ③ 客户卡片头部：🏁移到📅后面同一行 ---------- */
  .customer-header { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
  .customer-name { order: 1; flex: 0 1 auto; }
  .customer-assign-badge { order: 2; }
  .customer-period-badge { order: 3; }
  .customer-last-end-badge { order: 4; }
  .customer-extend-badge { order: 5; }
  .customer-actions { order: 6; margin-left: 0; }

  /* ---------- ④ 客户车辆标签：三段式卡片 ---------- */
  .fav-tag.customer-vehicle-tag {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 6px;
    width: 100%;
    box-sizing: border-box;
    padding: 5px 8px;
    min-height: 32px;
    white-space: nowrap;
    font-size: 12px;
    border-radius: 8px;
    flex-shrink: 1;
  }
  /* 第一段：移动/线路/车号/查询图标（不折行） */
  .fav-tag.customer-vehicle-tag .move-btn,
  .fav-tag.customer-vehicle-tag .vehicle-line-pill,
  .fav-tag.customer-vehicle-tag .vehicle-id-text,
  .fav-tag.customer-vehicle-tag .vehicle-info-icon,
  .fav-tag.customer-vehicle-tag .park-locate-btn {
    order: 0;
    white-space: nowrap;
  }
  .fav-tag.customer-vehicle-tag .vehicle-id-text { font-size: 14px; }
  /* 交互小图标统一加宽触控区 */
  .fav-tag.customer-vehicle-tag .move-btn,
  .fav-tag.customer-vehicle-tag .vehicle-info-icon,
  .fav-tag.customer-vehicle-tag .park-locate-btn,
  .fav-tag.customer-vehicle-tag .history-icon,
  .fav-tag.customer-vehicle-tag .replace-icon,
  .fav-tag.customer-vehicle-tag .swap-icon {
    min-width: 28px;
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
  }
  /* 第二段：运营/投放日期徽章 */
  .fav-tag.customer-vehicle-tag .last-online-badge,
  .fav-tag.customer-vehicle-tag .warn-on-tag,
  .fav-tag.customer-vehicle-tag .short-offline-badge,
  .fav-tag.customer-vehicle-tag .ad-start-badge,
  .fav-tag.customer-vehicle-tag .ad-end-badge,
  .fav-tag.customer-vehicle-tag .end-days-badge {
    order: 1;
    font-size: 10px;
    padding: 2px 5px;
    white-space: nowrap;
    min-height: 22px;
  }
  .fav-tag.customer-vehicle-tag .last-online-badge,
  .fav-tag.customer-vehicle-tag .short-offline-badge { min-width: 34px; }
  /* 第三段：操作图标整组右对齐（v20260903D：📜添加原车→📜原车徽章→📍原车→3天后→📊→🔄→×） */
  .fav-tag.customer-vehicle-tag .replace-icon { order: 2; margin-left: auto; }
  .fav-tag.customer-vehicle-tag .replace-badge { order: 3; }
  .fav-tag.customer-vehicle-tag .replace-badge + .park-locate-btn { order: 4; }
  .fav-tag.customer-vehicle-tag .end-days-badge { order: 5; }
  .fav-tag.customer-vehicle-tag .history-icon { order: 6; }
  .fav-tag.customer-vehicle-tag .swap-icon { order: 7; }
  .fav-tag.customer-vehicle-tag .remove { order: 8; margin-left: 2px; min-width: 28px; min-height: 28px; display: inline-flex; align-items: center; justify-content: center; }

  /* ---------- ⑤ 筛选抽屉：全宽，位于顶栏与底部导航之间 ---------- */
  .search-panel {
    top: calc(52px + env(safe-area-inset-top, 0px));
    bottom: calc(68px + env(safe-area-inset-bottom, 0px));
    left: 0;
    width: 100vw;
    max-width: 100vw;
    height: auto;
    padding-top: 0;
  }
  .search-panel .panel-body {
    max-height: calc(100% - 58px);
  }

  /* ---------- ⑥ 图例面板与底部导航"图例"按钮：移动端隐藏 ---------- */
  .legend { display: none !important; }
  .mobile-bottom-nav .mbn-item[data-action="toggle-legend"] { display: none !important; }
}

/* ========================================
   移动端 v20260901AN：
   ① 底部导航精简（去掉地图/刷新/图例，双指缩放+顶栏刷新已有）
   ② 隐藏地图 +/− 缩放控件（触摸屏双指放大缩小）
   ③「⚙️显示设置」从抽屉挪到顶栏左侧 logo 位置做成图标按钮，点击弹出开关面板
   ④ 源站会话状态、全局搜索框：移动端不再显示（与现有功能重复/占地方）
   ======================================== */
/* 弹出设置面板：默认隐藏（桌面端永远不显示） */
.mm-settings-popover { display: none; }
/* 账号弹层：默认隐藏（桌面端不出现） */
.user-popover { display: none; }

@media (max-width: 1024px) {

  /* ① 底部导航：去掉"地图""刷新"（顶栏已有 ⟳ 刷新） */
  .mobile-bottom-nav .mbn-item[data-action="show-map"],
  .mobile-bottom-nav .mbn-item[data-action="refresh"] { display: none !important; }

  /* ② 隐藏地图缩放 +/− 控件 */
  #map .leaflet-control-zoom { display: none !important; }

  /* ③ 显示设置：抽屉里不再展示该大块，收进弹出面板 */
  .panel-body > .mm-display-section { display: none !important; }
  .mm-settings-popover {
    display: block;
    position: fixed;
    top: calc(54px + env(safe-area-inset-top, 0px));
    left: 12px;
    z-index: 999;
    width: min(300px, calc(100vw - 24px));
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
    padding: 12px;
  }
  .mm-settings-popover.hidden { display: none !important; }
  .mm-settings-popover .fav-section { margin-bottom: 0; }
  .mm-settings-popover .mm-toggle-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .mm-settings-popover .mm-toggle-row {
    display: flex; align-items: center; gap: 8px;
    min-height: 40px; padding: 8px 10px;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 8px;
    font-size: 13px; color: #1f2937; font-weight: 500;
  }
  .mm-settings-popover .mm-toggle-row input { width: 18px; height: 18px; accent-color: #20c997; flex-shrink: 0; }

  /* ④ 源站会话状态与全局搜索框：移动端隐藏 */
  #source-status-indicator { display: none !important; }
  #search-input { display: none !important; }
}

/* ========================================
   移动端 v20260901AO：
   ① 车辆详情/统计弹窗改为整屏覆盖（顶栏与底部导航之间，不露地图）
   ② 账号按钮改为弹出账号面板，不再误触发登出
   ======================================== */
@media (max-width: 1024px) {

  /* 车辆详情：从顶栏下方一直到底部导航上方，整幅覆盖地图 */
  .bus-detail {
    top: calc(52px + env(safe-area-inset-top, 0px));
    bottom: calc(68px + env(safe-area-inset-bottom, 0px));
    max-height: none;
    height: auto;
    border-radius: 0;
    z-index: 996;
  }

  /* 统计抽屉：同样整幅覆盖地图 */
  .doubledeck-window.mobile-open {
    top: calc(52px + env(safe-area-inset-top, 0px));
    bottom: calc(68px + env(safe-area-inset-bottom, 0px));
    max-height: none;
    min-width: 0;
    min-height: 0;
    height: auto;
    border-radius: 0;
    z-index: 999;
    left: 0 !important; right: 0 !important;
    width: 100vw !important; max-width: 100vw !important;
  }

  /* 账号弹层（底部导航"账号"点击弹出） */
  .user-popover {
    display: block;
    position: fixed;
    right: 12px;
    bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    z-index: 999;
    width: min(240px, calc(100vw - 24px));
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
    padding: 12px;
  }
  .user-popover.hidden { display: none !important; }
  .user-pop-title { font-size: 12px; color: #6b7280; margin-bottom: 4px; }
  .user-pop-email {
    font-size: 14px; font-weight: 600; color: #1a2332;
    word-break: break-all; margin-bottom: 10px;
  }
  /* v20260907X：浏览器内使用时的"添加到主屏幕"全屏提示 */
  .user-pop-pwa-tip {
    margin: 0 0 10px;
    padding: 10px 12px;
    background: #eff8ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    color: #1e40af;
    font-size: 12px;
    line-height: 1.7;
  }
  .user-pop-btn {
    width: 100%; padding: 10px;
    background: #fee2e2; color: #dc2626;
    border: 1px solid #fca5a5; border-radius: 8px;
    font-size: 14px; font-weight: 600; cursor: pointer;
  }
  .user-pop-btn:active { background: #fecaca; }
}

/* ========================================
   移动端 v20260901AP：
   ① 筛选抽屉实底不透明，不再透出地图（毛边玻璃→纯白）
   ② 遮罩只遮到底部导航上方，不雾化/遮挡底部 icon
   ③ 统计弹窗改为自适应高度底部弹层（最高62vh），内容可滚动、车辆数可见
   ④ 左侧 ☰ 与底部"筛选"重复，去掉 ☰
   ⑤ 显示设置弹层加宽；打开时自动收回筛选抽屉
   ======================================== */
@media (max-width: 1024px) {

  /* ① 筛选抽屉：纯白实底 */
  .search-panel {
    background: #fff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    border-radius: 0;
  }
  .search-header { background: #f8fafc; }

  /* ② 遮罩不覆盖底部导航 */
  .mobile-overlay { bottom: calc(68px + env(safe-area-inset-bottom, 0px)); }

  /* ③ 统计弹窗：自适应高度底部弹层 */
  .doubledeck-window.mobile-open {
    top: auto;
    left: 0 !important; right: 0 !important;
    bottom: calc(68px + env(safe-area-inset-bottom, 0px));
    width: 100vw !important; max-width: 100vw !important;
    height: auto;
    max-height: 62vh;
    min-height: 0; min-width: 0;
    border-radius: 12px 12px 0 0;
    z-index: 999;
  }
  .doubledeck-window.mobile-open .events-window-body {
    max-height: calc(62vh - 46px);
    overflow-y: auto;
  }

  /* ④ 左侧 ☰ 与底部"筛选"重复：去掉 */
  #mobile-menu-btn { display: none !important; }

  /* ⑤ 显示设置弹层加宽 */
  .mm-settings-popover { width: min(340px, calc(100vw - 16px)); }
}

/* ========================================
   移动端 v20260901AQ：
   抽屉/车辆详情从屏幕最顶(y=0)覆盖到底部导航上方，背景实色，
   彻底杜绝顶部/右侧缝隙透出地图；内容区用 padding 让位给顶栏
   ======================================== */
@media (max-width: 1024px) {

  /* 筛选抽屉：白色背景从 y=0 铺满，顶栏盖在上面，任何安全区下都不露地图 */
  .search-panel {
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: calc(68px + env(safe-area-inset-bottom, 0px));
    width: auto;
    max-width: none;
    padding-top: calc(52px + env(safe-area-inset-top, 0px));
    display: flex;
    flex-direction: column;
  }
  .search-panel .panel-body {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* 车辆详情：同样从最顶铺满，正文区域滚动 */
  .bus-detail {
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: calc(68px + env(safe-area-inset-bottom, 0px));
    width: auto;
    max-width: none;
    padding-top: calc(52px + env(safe-area-inset-top, 0px));
    border-radius: 0;
  }
  .bus-detail .bus-detail-body {
    max-height: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ========================================
   移动端 v20260901AR：
   ① 筛选抽屉强制 left0/right0/宽度自适应（杜绝右侧露地图缝隙）
   ② 统计弹窗改回向上铺满（顶栏→底部导航之间），内容区滚动
   ③ 显示设置弹层左右对称（left/right 等距）
   ======================================== */
@media (max-width: 1024px) {

  /* ① 筛选抽屉：强制贴边铺满 */
  .search-panel {
    width: auto !important;
    max-width: none !important;
    left: 0 !important;
    right: 0 !important;
    top: 0 !important;
    bottom: calc(68px + env(safe-area-inset-bottom, 0px)) !important;
    padding-top: calc(52px + env(safe-area-inset-top, 0px)) !important;
  }

  /* ② 统计弹窗：从顶栏下铺到底部导航上，内容滚动 */
  .doubledeck-window.mobile-open {
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: calc(68px + env(safe-area-inset-bottom, 0px)) !important;
    width: auto !important;
    max-width: none !important;
    height: auto;
    max-height: none !important;
    min-height: 0;
    min-width: 0;
    padding-top: calc(52px + env(safe-area-inset-top, 0px)) !important;
    display: flex !important;
    flex-direction: column;
    border-radius: 0;
    z-index: 999;
  }
  .doubledeck-window.mobile-open .events-window-body {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* ③ 显示设置弹层：左右对称留白 */
  .mm-settings-popover {
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
  }
}

/* ========================================
   移动端 v20260901AV：
   ① 客户卡片头部第一行（名称+👤+📅）不折行，字多自动缩到小号
   ② 🏁最后下刊 与 操作按钮 同在一行（靠右）
   ③ 隐藏 ▲▼ 排序箭头，改用触摸拖动排序（客户/线路/车辆均可拖动）
   ======================================== */
@media (max-width: 1024px) {

  /* ① 第一行：名称 + 👤 + 📅 一直在一行，字多自动缩小 */
  .customer-header { align-items: center; }
  .customer-name,
  .customer-assign-badge,
  .customer-period-badge {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
  }
  .customer-name { flex: 1 1 auto; }
  .customer-assign-badge,
  .customer-period-badge { flex: 0 1 auto; font-size: clamp(9.5px, 2.7vw, 11px); padding: 2px 6px; }

  /* ② 🏁最后下刊徽章与操作按钮同一行（靠右） */
  .customer-last-end-badge { order: 5; flex: 0 1 auto; min-width: 0; font-size: clamp(9.5px, 2.7vw, 11px); }
  .customer-actions { order: 5; margin-left: auto; }

  /* ③ 隐藏所有 ▲▼ 排序箭头（移动端改用触摸拖动排序） */
  .move-btn { display: none !important; }

  /* 客户卡片拖动状态样式 */
  .customer-card.dragging { opacity: 0.4; }
  .customer-card.drag-over-target {
    outline: 2px dashed #6366f1;
    outline-offset: 2px;
    background: rgba(99, 102, 241, 0.08) !important;
  }
}

/* ========================================
   移动端 v20260901AW：
   ① 线路详情车辆标签 inline-flex 不折行（车号+🚍同行）
   ② 车号表 grid 左右 gap 等距
   ③ 所有弹窗统一改为底部抽屉（从下往上弹出），圆角顶部+穿透滚动
   ④ 客户/线路/车辆 三个独立底部弹窗样式
   ⑤ 移动端隐藏右上角"用户管理"按钮，功能移至账号弹层
   ⑥ 统计弹窗同样改为底部抽屉（与三个弹窗视觉一致）
   ======================================== */
@media (max-width: 1024px) {

  /* ① 线路详情车辆标签 inline-flex 不折行 */
  .line-detail-vehicle {
    display: inline-flex !important;
    flex-wrap: nowrap;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
  }

  /* ② 车号表 grid 左右 gap 等距（auto-fill 自适应 + 统一 gap） */
  .line-detail-vehicle-list {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;
    padding: 4px 0 !important;
  }
  .line-detail-vehicle-list .line-detail-vehicle {
    justify-content: center;
    font-size: 12px;
    padding: 4px 6px;
  }

  /* ③ 所有弹窗/模态框 → 底部抽屉 */
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .modal {
    width: 100vw; max-width: 100vw;
    max-height: 82vh; height: auto;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
    display: flex; flex-direction: column;
    animation: sheetUp 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    top: auto; left: 0; right: 0; bottom: 0;
  }
  @keyframes sheetUp {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
  }
  .modal-header {
    flex-shrink: 0;
    border-radius: 0;
  }
  .modal-body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 14px 16px 20px;
  }

  /* 车辆详情底部抽屉（与统计弹窗统一风格） */
  .bus-detail {
    top: auto !important;
    left: 0; right: 0;
    bottom: calc(68px + env(safe-area-inset-bottom, 0px));
    width: 100vw; max-width: 100vw;
    max-height: 82vh; height: auto;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
    display: flex; flex-direction: column;
    animation: sheetUp 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 996;
  }
  .bus-detail-header {
    flex-shrink: 0;
  }
  .bus-detail-body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* ④ 客户/线路/车辆 三个独立底部弹窗：从顶栏下方铺到底部导航上方（内容少时也到顶） */
  .mm-sheet {
    position: fixed;
    top: calc(52px + env(safe-area-inset-top, 0px));
    left: 0; right: 0;
    bottom: calc(68px + env(safe-area-inset-bottom, 0px));
    width: 100vw; max-width: 100vw;
    max-height: none;
    height: auto;
    background: #fff;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.15);
    z-index: 999;
    display: flex; flex-direction: column;
    overflow: hidden;
    animation: sheetUp 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .mm-sheet.hidden { display: none !important; }
  .mm-sheet-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    background: #f8fafc;
    flex-shrink: 0;
  }
  .mm-sheet-title { font-size: 15px; font-weight: 700; color: #1a2332; }
  .mm-sheet-close {
    background: none; border: none;
    font-size: 24px; color: #6b7280;
    line-height: 1; cursor: pointer;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
  }
  .mm-sheet-body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px;
  }

  /* ⑤ 移动端隐藏右上角"用户管理"按钮 */
  #admin-panel-btn { display: none !important; }

  /* 账号弹层"用户管理"按钮（管理员可见） */
  .user-pop-btn.admin {
    display: block;
    background: #eff6ff; color: #2563eb;
    border-color: #93c5fd;
    margin-bottom: 8px;
  }
  .user-pop-btn.admin:active { background: #dbeafe; }

  /* ⑥ 统计弹窗底部抽屉风格统一 */
  .doubledeck-window.mobile-open {
    top: auto !important;
    left: 0 !important; right: 0 !important;
    bottom: calc(68px + env(safe-area-inset-bottom, 0px));
    width: 100vw !important; max-width: 100vw !important;
    max-height: 82vh; height: auto;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
    display: flex !important; flex-direction: column;
    animation: sheetUp 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 999;
  }
  .doubledeck-window.mobile-open .events-window-body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    max-height: none;
  }

  /* 登录弹窗保持整屏居中（不做底部抽屉） */
  #login-modal { align-items: center; }
}

/* ========================================
   移动端 v20260901AY：
   ① 发布期：日期一行、客户名+运营线路一行
   ② 日历图例压缩为一行、整体居中
   ③ 近180天标题两行（主标题/副说明）
   ④ 数据来源小字一行居中
   ⑤ 车辆汇总：线路+上刊同行，天数文字多行
   ======================================== */
@media (max-width: 1024px) {

  /* ① 发布期运营情况：日期 / 客户+线路 各一行 */
  .hist-period-range {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    max-width: 100%;
  }
  .hist-period-range .hpr-date { white-space: nowrap; font-weight: 600; }
  .hist-period-range .hpr-meta { white-space: normal; word-break: break-word; }

  /* ② 日历图例：一行压缩 + 居中 */
  .cal-legend {
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 6px 8px;
    font-size: 10px;
    overflow: hidden;
  }
  .cal-legend > span {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
    flex-shrink: 1;
    min-width: 0;
  }
  .cal-legend .cal-click-hint {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 1;
    min-width: 0;
  }
  .cal-legend .cal-cell {
    width: 12px; height: 12px;
    min-width: 12px; min-height: 12px;
    font-size: 0;
    flex-shrink: 0;
    border-radius: 3px;
  }

  /* ②-v20260916d 再小屏（<=400px）：段落更多时字号再缩小、收紧间距，
     并隐藏非关键的"点击日期查看详情"提示，保证一行放得下、不叠加换行 */
  @media (max-width: 400px) {
    .cal-legend {
      gap: 4px 6px;
      font-size: 9px;
      line-height: 1.1;
    }
    .cal-legend .cal-cell {
      width: 10px; height: 10px;
      min-width: 10px; min-height: 10px;
      margin: 0;
    }
    .cal-legend .cal-click-hint {
      display: none;
    }
  }

  /* ③ 近180天标题：两行（主标题 / 副说明） */
  .hist-section-title {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
  .hist-section-title small {
    font-size: 10px;
    opacity: 0.75;
    font-weight: 400;
  }

  /* ④ 数据来源等 footnote 小字：一行居中 */
  #history-body > small,
  .history-body > small {
    display: block;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    margin: 6px auto 0;
  }

  /* ⑤ 车辆汇总：线路+上刊时间同行；天数文字多行 */
  .vehicle-summary-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 6px;
  }
  .vehicle-summary-item .vs-badge,
  .vehicle-summary-item .vs-id,
  .vehicle-summary-item .vs-line,
  .vehicle-summary-item .vs-adstart,
  .vehicle-summary-item .vs-scrapped-tag {
    white-space: nowrap;
  }
  .vehicle-summary-item .vs-days {
    flex-basis: 100%;
    white-space: normal;
    min-width: 0;
  }
}

/* ========================================
   移动端 v20260901AZ：
   底部导航换 SVG 图标（线路/车辆/统计/账号）、设置齿轮 SVG 尺寸；
   原车徽章移动端的紧凑样式
   ======================================== */
@media (max-width: 1024px) {
  .mbn-icon svg { width: 20px; height: 20px; display: block; margin: 0 auto; }
  #mm-gear-btn svg { width: 22px; height: 22px; display: block; pointer-events: none; }
  /* 原车徽章（随车号同排）紧凑显示 */
  .replace-badge { font-size: 10px; padding: 2px 5px; white-space: nowrap; }
}

/* ========================================
   移动端 v20260901BA：
   ① 客户卡片头部：名称 + 👤分配 + 📅投放期 三元素强制同一行，
      其余（⏰延期 / 🏁最后下刊 / 操作按钮）经包裹层换到下一行
   ② 统计弹窗与客户/线路/车辆底部弹窗完全统一：整幅面板
      （顶栏下方→底部导航上方）、头部吸顶、内容独立滚动
   ======================================== */
/* 桌面端：rest 包裹层不参与布局（display:contents 保持原排布不变） */
.customer-rest { display: contents; }

@media (max-width: 1024px) {

  /* ① 客户卡片头部：第一行固定 = 名称 + 分配 + 投放期 */
  .customer-header {
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
  }
  .customer-name {
    order: 0;
    flex: 1 1 auto;
    min-width: 0;
  }
  .customer-assign-badge,
  .customer-period-badge {
    order: 0;
    flex: 0 0 auto !important;
    white-space: nowrap;
  }
  /* 其余内容（⏰延期 / 🏁最后下刊 / 操作按钮）经包裹层强制换到第二行 */
  .customer-rest {
    order: 10;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    flex-basis: 100%;
    min-width: 0;
  }
  .customer-rest .customer-last-end-badge { order: 5; margin-left: 0; }
  .customer-rest .customer-actions { order: 5; margin-left: auto; }

  /* ② 统计弹窗 → 与客户/线路/车辆弹窗一致的整幅面板 */
  .doubledeck-window.mobile-open {
    position: fixed !important;
    top: calc(52px + env(safe-area-inset-top, 0px)) !important;
    left: 0 !important;
    right: 0 !important;
    bottom: calc(68px + env(safe-area-inset-bottom, 0px)) !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0;
    height: auto !important;
    max-height: none !important;
    min-height: 0;
    padding-top: 0 !important;
    background: #fff;
    border: none;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
    z-index: 999;
    display: flex !important;
    flex-direction: column;
    overflow: hidden;
    resize: none;
    animation: sheetUp 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .doubledeck-window.mobile-open .events-window-header {
    flex-shrink: 0;
    cursor: default;
  }
  .doubledeck-window.mobile-open .events-window-body {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none !important;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
  }

  /* ③ 底部导航5个图标：单色随文字状态（默认灰，激活项变品牌蓝）；设置齿轮保持白色 */
  .mobile-bottom-nav .mbn-icon svg * {
    fill: currentColor !important;
  }
  #mm-gear-btn svg * {
    fill: #ffffff !important;
  }
}

/* ========================================
   移动端 v20260901BG 修正：
   客户卡片"名称行"必须第一行——由于早期多个移动端块给各元素设了
   不同 order（1/2/3、5/6），此处用强约束统一收口：
   第一行 = 客户名称 + 👤分配 + 📅投放期；第二行 = ⏰/🏁/操作。
   order 仅对 .customer-header 的直接子项生效。
   ======================================== */
@media (max-width: 1024px) {
  .customer-header {
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
  }
  .customer-name {
    order: 0 !important;
    flex: 1 1 auto !important;
    flex-shrink: 1 !important;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .customer-assign-badge,
  .customer-period-badge {
    order: 1 !important;
    flex: 0 0 auto !important;
    white-space: nowrap;
  }
  .customer-extend-badge,
  .customer-last-end-badge {
    order: 2 !important;
  }
  .customer-rest {
    order: 9 !important;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    flex-basis: 100%;
    min-width: 0;
  }
  .customer-rest .customer-last-end-badge { order: 2 !important; margin-left: 0; }
  .customer-rest .customer-actions { order: 2 !important; margin-left: auto; }
}

/* ========================================
   v20260902A 权限：普通用户角色为只读
   隐藏客户卡片里所有"编辑/分配/移动/下刊/删除/改日期/批量/加车"等写控件，
   只保留查看相关（客户名/徽章/车辆标签/预警/详情/定位）。管理员不受影响。
   ======================================== */
body.role-user-readonly .customer-assign-badge,
body.role-user-readonly .move-btn,
body.role-user-readonly .customer-archive-btn,
body.role-user-readonly .customer-del,
body.role-user-readonly .cust-period-start,
body.role-user-readonly .cust-period-end,
body.role-user-readonly .period-batch-btn,
body.role-user-readonly .cust-vehicle-input-row,
body.role-user-readonly .cust-add-vehicle,
body.role-user-readonly .ad-start-badge,
body.role-user-readonly .ad-end-badge,
body.role-user-readonly .add-original-vehicle-row,
body.role-user-readonly .customer-sort-btn {
  display: none !important;
}
/* 只读时不显示空投放期"未设"的编辑暗示，避免误导 */
body.role-user-readonly .ad-start-badge.unset,
body.role-user-readonly .ad-end-badge.unset {
  display: none !important;
}
/* 归档客户列表同样隐藏其"恢复/删除"操作 */
body.role-user-readonly .archive-restore-btn,
body.role-user-readonly .archive-del-btn {
  display: none !important;
}
/* 客户名不可点击为编辑，仍可点击选中筛选车辆，故保留 */

/* ========================================
   移动端 v20260902C：
   车辆详情(.bus-detail) + 线路详情(#history-modal) 补齐为整幅面板，
   与客户/线路/车辆(.mm-sheet)、统计(.doubledeck-window.mobile-open) 完全统一：
   fixed 顶栏(52px+safe-top) 到底部导航(56px+safe-bottom)，头部吸顶，body 独立滚动，
   不再 82vh 抽屉/居中弹窗导致上方露出地图背景发白。
   ======================================== */
@media (max-width: 1024px) {
  /* 车辆详情：整幅面板 */
  /* 注意：.hidden{display:none!important} 定义在文件头，此处 display:flex!important
     会与其同优先级且更靠后 → 覆盖掉隐藏，导致 #bus-detail 隐形全屏拦截点击
     （统计/账号弹窗按钮点不动、客户操作被挡）。必须用更高优先级(双类)强制隐藏。 */
  .bus-detail.hidden { display: none !important; }
  .bus-detail {
    position: fixed !important;
    top: calc(52px + env(safe-area-inset-top, 0px)) !important;
    left: 0 !important;
    right: 0 !important;
    bottom: calc(68px + env(safe-area-inset-bottom, 0px)) !important;
    width: 100vw !important;
    max-width: 100vw !important;
    max-height: none !important;
    height: auto !important;
    border-radius: 16px 16px 0 0;
    display: flex !important;
    flex-direction: column;
    overflow: hidden;
    z-index: 999;
  }
  .bus-detail .detail-header { flex-shrink: 0; }
  .bus-detail .detail-body {
    flex: 1 1 auto !important;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    max-height: none !important;
  }

  /* 线路详情（history-modal）：整幅面板 */
  #history-modal {
    align-items: flex-end;
    justify-content: center;
    background: rgba(15, 23, 42, 0.25);
  }
  #history-modal .modal {
    position: fixed !important;
    top: calc(52px + env(safe-area-inset-top, 0px)) !important;
    left: 0 !important;
    right: 0 !important;
    bottom: calc(68px + env(safe-area-inset-bottom, 0px)) !important;
    width: 100vw !important;
    max-width: 100vw !important;
    max-height: none !important;
    height: auto !important;
    margin: 0 !important;
    border-radius: 16px 16px 0 0;
    display: flex !important;
    flex-direction: column;
    overflow: hidden;
  }
  #history-modal .modal-header { flex-shrink: 0; }
  #history-modal .modal-body {
    flex: 1 1 auto !important;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    max-height: none !important;
  }

  /* 线路排行数量标签：窄屏下防"8辆"被压缩换行成两行、标签被撑高（仅移动端） */
  .dd-line-row .dd-line-count {
    white-space: nowrap;
    flex-shrink: 0;
  }
}

/* ========================================
   移动端 v20260904AC（用户需求）：
   所有弹窗（除 设置⚙️ / 账号👤 / 登录）弹出区域上下都覆盖，
   充满整个屏幕（顶栏、底部导航一并被覆盖），
   覆盖此前"顶栏下方→底部导航上方"整幅面板的定位。
   ======================================== */
@media (max-width: 1024px) {
  /* 选择器提高到与 v20260902C 同/更高特异性，才能盖过其中间定位 !important */
  #history-modal .modal,
  #admin-modal .admin-panel,
  #sales-filter-modal .sales-filter-panel,
  #bus-detail.bus-detail,
  .doubledeck-window.mobile-open,
  .mm-sheet {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    /* v20260907BN：高度=四边拉伸铺满视口；max-height 一律取消（统计弹窗旧 62vh 上限会露底） */
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    /* v20260907BN：z 提到 1101，覆盖底部导航(pwa 下 1100) —— 弹窗打开时 Tab 一并被盖，不再上下互相叠 */
    z-index: 1101 !important;
    overflow: hidden;
  }
  /* 内容区统一占满剩余高度并独立滚动（覆盖旧 max-height:calc 各位） */
  .doubledeck-window.mobile-open .events-window-body,
  .mm-sheet .mm-sheet-body,
  #bus-detail.bus-detail .bus-detail-body,
  #admin-modal .admin-body,
  #sales-filter-modal .sales-filter-panel .sales-filter-body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  /* v20260907BN：全屏弹窗 header 固定不压缩（内容超高时只有内容区滚动） */
  .mm-sheet-header,
  .bus-detail-header,
  .doubledeck-window.mobile-open .events-window-header {
    flex-shrink: 0;
  }
  /* v20260907BM：删除 @supports(height:100dvh) 固定高度块——四边拉伸已自然适配，无需 dvh 补丁 */
  /* v20260907BS：移除容器级 padding-bottom——body 已带 calc(20px + env(safe-area-inset-bottom))，
     容器再加一层会形成底部空白白条。顶部让位统一交给各 header。 */
  .mm-sheet,
  #bus-detail.bus-detail,
  .doubledeck-window.mobile-open {
    padding-bottom: 0;
  }
  /* v20260907BS：history-modal 容器也不再加底部 safe-area，由 .modal-body 的 padding-bottom 承担 */
  #history-modal .modal {
    padding-bottom: 0;
  }
}

/* ========================================
   桌面端(浏览器) v20260904AD：隐藏筛选面板顶部的搜索输入框，
   仅影响 #search-input，移动端搜索抽屉中的输入框不受影响。
   ======================================== */
@media (min-width: 1025px) {
  #search-input { display: none !important; }
}

/* ========================================
   移动端 v20260907A（问题10/1/3/12 触控相关）：
   ① 统计搜索框输入字号提到16px，避免 iOS 点击输入时页面自动放大且无法缩小
   ② 标签/按钮 touch-action:manipulation，消除双击缩放延迟导致点击"时灵时不灵"
   ③ 地图车号标签扩大命中区，解决"点不准/没反应"
   ======================================== */
@media (max-width: 1024px) {
  /* v20260907BM：不再 height:100dvh 固定高度；改 min-height 并放开 height，内容自然铺到屏底 */
  html, body { height: auto; min-height: 100vh; min-height: 100dvh; }
  .dd-search, .dd-filter {
    font-size: 16px !important;
  }
  .fav-tag,
  .customer-card,
  .bus-label,
  .vehicle-id-text,
  .line-tag-num,
  .md-line-row,
  .md-v-id,
  [data-action] {
    touch-action: manipulation;
  }
  /* 车号标签扩大地图点击命中区（v20260907S：命中区从容器改到文字上，包裹显示出来的车号；
     文字 pointer-events:auto，伪元素扩展区域同样可点；容器不可见区域不留误触） */
  .bus-label-text::after {
    content: '';
    position: absolute;
    left: -20px; top: -20px; right: -20px; bottom: -20px;
  }
}

/* ========================================
   移动端 v20260907E / F：
   ① 顶栏改为悬浮毛玻璃胶囊（与底部导航同风格，仿 buspedia"上部悬浮"效果）
   ② 底部导航在无 backdrop-filter 支持的浏览器回退为纯白，避免半透明发灰
   ③ v20260907F：地图已延伸到屏幕最底部，Leaflet 版权标注上移到导航胶囊上方，避免被遮挡
   ======================================== */
@media (max-width: 1024px) {
  /* 顶栏悬浮胶囊：整体上移留白 + 左右内缩 + 圆角 + 毛玻璃 + 投影，悬浮于地图之上 */
  .top-bar {
    top: calc(6px + env(safe-area-inset-top, 0px));
    left: 10px;
    right: 10px;
    width: auto;
    height: 48px;
    min-height: 48px;
    padding: 0 12px;
    border-radius: 24px;
    background: rgba(13, 24, 64, 0.8);
    -webkit-backdrop-filter: blur(20px) saturate(1.3);
    backdrop-filter: blur(20px) saturate(1.3);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 8px 28px rgba(5, 10, 30, 0.35), 0 2px 8px rgba(5, 10, 30, 0.15);
  }
  .top-bar-left, .top-bar-right { height: 100%; }
  /* 地图全屏到底后，版权标注原始位置被导航胶囊盖住，上移到胶囊上方（10px 间隙 + 58px 胶囊 + 安全区） */
  .leaflet-control-attribution {
    margin-bottom: calc(68px + env(safe-area-inset-bottom, 0px));
  }
}

/* 无毛玻璃支持的老浏览器（部分安卓 WebView / 微信内嵌）：底部导航回退为纯白底，不再透出灰 */
@supports not ((backdrop-filter: blur(20px)) or (-webkit-backdrop-filter: blur(20px))) {
  .mobile-bottom-nav { background: #ffffff; }
}

/* ========================================
   独立 App（PWA standalone）系统性全屏修复 v20260907AL
   （整合原 AC/AD/AE 三块散装补丁，替代"盖色块/补白条"思路）
   背景：black-translucent + viewport-fit=cover 下页面延伸到物理屏，
   但 iOS 部分机型把布局视口算成"扣掉 Home 安全区"的高度 → 所有
   100vh/inset:0/fixed bottom:0 的全屏层都会短一个安全区，屏幕底部
   露出 body 底色（之前白块，AG 改深蓝后变成"蓝边"）。用户历次反馈
   全是同一个根的多种表现：登录底蓝边 / 地图底蓝边 / 弹窗底蓝边 /
   统计上被胶囊遮盖。
   系统性解法（v20260907AL）：
   ① 全屏层 bottom 统一向下越界一个 Home 安全区：
        bottom: calc(-1 * max(env(safe-area-inset-bottom, 0px), 60px))
      若视口已含安全区 → 越界部分画在屏外，不可见，无害；
      若视口不含安全区 → 越界正好补上缺口。任何情况下都不露底。
   ② 底部悬浮胶囊(z995)/顶栏胶囊(z1000)不动，弹层让位。
   ③ 统计抽屉限定最高高度，顶部文字不再钻到顶栏胶囊后面。
   ======================================== */
@media (max-width: 1024px) and (display-mode: standalone) {
  body { background: #0d1840 !important; }

  /* v20260907BQ：全屏 fixed 元素用 height: var(--app-height) 铺满物理屏。
     缓存 webclip 下 bottom:0 只到 layout viewport(795)，用 outerHeight(852) 设的变量才能铺满。 */
  #map {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    top: 0 !important;
    height: var(--app-height, 100dvh) !important;
    bottom: auto !important;
  }

  #login-modal,
  .modal-overlay {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    top: 0 !important;
    height: var(--app-height, 100dvh) !important;
    bottom: auto !important;
  }

  .modal {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    top: 0 !important;
    height: var(--app-height, 100dvh) !important;
    bottom: auto !important;
    max-height: none !important;
  }

  /* 用户管理面板 */
  .admin-panel {
    /* v20260907BM：高度交给全屏块四边拉伸，不写死 100vh */
    max-height: none;
  }
  /* v20260907BR：移除 admin-panel 容器级 safe-area padding，由 .admin-header 承担，避免双重叠加 */
  body.pwa-standalone #admin-modal .admin-panel {
    padding-top: 0;
  }

  /* v20260907BS：mm-sheet / bus-detail / sales-filter / admin-panel 也用 --app-height 铺满物理屏，
     否则 bottom:0 只到 layout viewport(795)，底部露出白条 */
  .mm-sheet,
  #bus-detail.bus-detail,
  #sales-filter-modal .sales-filter-panel,
  #admin-modal .admin-panel {
    top: 0 !important;
    height: var(--app-height, 100dvh) !important;
    bottom: auto !important;
    max-height: none !important;
  }

  /* 统计抽屉：全屏铺满（用 --app-height） */
  .doubledeck-window.mobile-open {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: var(--app-height, 100dvh) !important;
    bottom: auto !important;
    width: auto !important;
    max-width: none !important;
    max-height: none !important;
    border-radius: 0 !important;
  }
  .doubledeck-window.mobile-open .events-window-header {
    padding-top: env(safe-area-inset-top, 0px);
  }
  .doubledeck-window.mobile-open .events-window-body {
    flex: 1 1 auto !important;
    max-height: none !important;
  }

  .save-prev { padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
}

/* JS 命中 body.pwa-standalone 时的同款规则 */
@media (max-width: 1024px) {
  body.pwa-standalone {
    background: #0d1840 !important;
  }
  body.pwa-standalone #map {
    position: fixed;
    left: 0 !important;
    right: 0 !important;
    top: 0 !important;
    height: var(--app-height, 100dvh) !important;
    bottom: auto !important;
  }
  body.pwa-standalone #login-modal,
  body.pwa-standalone .modal-overlay {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    top: 0 !important;
    height: var(--app-height, 100dvh) !important;
    bottom: auto !important;
  }
  body.pwa-standalone .modal {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    top: 0 !important;
    height: var(--app-height, 100dvh) !important;
    bottom: auto !important;
    max-height: none !important;
  }
  body.pwa-standalone #admin-modal .admin-panel {
    padding-top: 0 !important;
  }
  /* v20260907BS：mm-sheet / bus-detail / sales-filter 也用 --app-height 铺满物理屏 */
  body.pwa-standalone .mm-sheet,
  body.pwa-standalone #bus-detail.bus-detail,
  body.pwa-standalone #sales-filter-modal .sales-filter-panel,
  body.pwa-standalone #admin-modal .admin-panel {
    top: 0 !important;
    height: var(--app-height, 100dvh) !important;
    bottom: auto !important;
    max-height: none !important;
  }
  body.pwa-standalone .doubledeck-window.mobile-open {
    top: 0 !important;
    height: var(--app-height, 100dvh) !important;
    bottom: auto !important;
    border-radius: 0 !important;
    max-height: none !important;
  }
  body.pwa-standalone .doubledeck-window.mobile-open .events-window-header {
    padding-top: env(safe-area-inset-top, 0px);
  }
  body.pwa-standalone .doubledeck-window.mobile-open .events-window-body {
    flex: 1 1 auto !important;
    max-height: none !important;
  }
  /* v20260907BG：PWA 独立模式下底部导航栏 z-index 提到最高，避免被地图盖住 */
  body.pwa-standalone .mobile-bottom-nav {
    z-index: 1100 !important;
  }
  /* v20260907BQ：详情页顶部留白优化——只保留 safe-area 避让状态栏，去掉额外 base padding */
  body.pwa-standalone .events-window-header,
  body.pwa-standalone .mm-sheet-header,
  body.pwa-standalone .modal-header,
  body.pwa-standalone .admin-header,
  body.pwa-standalone .sales-filter-header,
  body.pwa-standalone .bus-detail .detail-header {
    padding-top: env(safe-area-inset-top, 0px) !important;
    padding-bottom: 8px !important;
  }
}
@media (max-width: 1024px) {
  #admin-modal .admin-body,
  #history-modal .modal-body,
  #sales-filter-modal .sales-filter-panel .sales-filter-body,
  .search-panel .panel-body,
  .bus-detail .bus-detail-body,
  .doubledeck-window.mobile-open .events-window-body,
  .mm-sheet .mm-sheet-body {
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

/* ========================================
   关于本系统 / 登录页版权声明（v20260915a）
   样式对齐其他弹窗：独立 overlay 全屏 + 右上角关闭，app 端(safe-area)不露顶
   ======================================== */
.about-overlay {
  z-index: 10001; /* 高于登录弹窗(9999)，登录页点"关于"也能盖住 */
}
.about-overlay.hidden { display: none; }
.about-modal {
  background: #fff;
  color: #374151;
  display: flex;
  flex-direction: column;
}
/* v20260916a：head 已改用 .modal-header（继承 safe-area 适配），移除旧的 .about-head */
.about-body {
  font-size: 13.5px;
  line-height: 1.9;
  color: #4b5563;
}
.about-body p { margin: 0 0 12px; text-align: justify; }
.about-foot {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px dashed #e5e7eb;
  text-align: center;
  color: #9ca3af;
  font-size: 12px;
}
@media (min-width: 1025px) {
  .about-modal {
    width: min(560px, 88vw);
    max-height: 82vh;
    border-radius: 14px;
    overflow: hidden;
  }
}
/* 登录页版权 + 关于入口 */
.login-footer {
  margin-top: 14px;
  text-align: center;
}
.login-copyright {
  font-size: 10.5px;
  line-height: 1.8;
  color: #5a6a8f;
}
.login-about-link {
  margin-top: 8px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: #8aa8c8;
  font-size: 12px;
}
.login-about-link:active { opacity: 0.7; }
/* 地图版权标注：多行自动换行、可点击打开"关于本系统" */
.leaflet-control-attribution {
  max-width: 92vw;
  white-space: normal;
  line-height: 1.5;
  cursor: pointer;
}
@media (max-width: 1024px) {
  /* v20260916a：about-body 现基于 .modal-body（继承 padding 与滚动），
     底部 safe-area 由 .modal-body 的全局移动端规则承担，无需重复设置 */
}
