/* ==========================================================================
   MarsWeb 设计系统 — 浅色清爽风 (Light Clean)
   仅作用于前端展示层，不涉及任何后端逻辑。
   与 Bootstrap 5 共存：本文件在其后加载，做增强与覆盖。
   ========================================================================== */

:root {
  /* 品牌色 */
  --brand:          #2563eb;   /* 主蓝 */
  --brand-600:      #1d4ed8;
  --brand-700:      #1e40af;
  --brand-soft:     #eff4ff;   /* 主蓝浅底 */
  --brand-ring:     rgba(37, 99, 235, .28);

  /* 语义色 */
  --ok:             #16a34a;
  --ok-soft:        #eafaf0;
  --warn:           #d97706;
  --warn-soft:      #fef6e7;
  --danger:         #dc2626;
  --danger-soft:    #fdecec;
  --info:           #0891b2;
  --info-soft:      #e8f7fb;
  --muted:          #64748b;

  /* 中性 / 表面 */
  --bg:             #f5f7fb;   /* 页面底 */
  --surface:        #ffffff;   /* 卡片面 */
  --surface-2:      #f8fafc;   /* 次级面 */
  --line:           #e6eaf2;   /* 描边 */
  --line-strong:    #d3dae6;
  --ink:            #0f172a;   /* 主文字 */
  --ink-2:          #334155;   /* 次文字 */
  --ink-3:          #94a3b8;   /* 弱文字 */

  /* 尺寸 */
  --r-sm: 6px;
  --r:    10px;
  --r-lg: 14px;
  --r-xl: 18px;

  --sh-xs: 0 1px 2px rgba(15, 23, 42, .05);
  --sh-sm: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --sh:    0 4px 16px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
  --sh-lg: 0 12px 32px rgba(15, 23, 42, .10);

  --sidebar-w: 232px;
  --topbar-h:  60px;
  --font: "Inter", "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-600); }

/* 滚动条（细一点、干净一点） */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #cdd5e1; border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #b5bfcf; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ==========================================================================
   应用骨架：侧边栏 + 顶栏 + 内容区
   ========================================================================== */
.app {
  display: flex;
  min-height: 100vh;
}

/* ---------- 侧边栏 ---------- */
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: #0f172a;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 30;
}

.sidebar-brand {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  flex: 0 0 auto;
}
.sidebar-logo {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 15px;
  box-shadow: 0 2px 8px rgba(37, 99, 235, .5);
  flex: 0 0 auto;
}
.sidebar-title {
  font-size: 14.5px;
  font-weight: 600;
  color: #f1f5f9;
  letter-spacing: .2px;
  white-space: nowrap;
}
.sidebar-title small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: #64748b;
  letter-spacing: .3px;
}

.sidebar-section {
  padding: 16px 12px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #56657c;
}

.sidebar-nav {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 6px 10px 20px;
}
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); }

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 9px;
  color: #cbd5e1;
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 2px;
  transition: background .15s, color .15s;
  position: relative;
}
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(37,99,235,.95), rgba(37,99,235,.75));
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, .35);
}
.nav-item.active::before {
  content: "";
  position: absolute; left: -10px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0;
  background: #60a5fa;
}
.nav-item .ico { width: 17px; height: 17px; flex: 0 0 17px; opacity: .9; }
.nav-item .badge-count {
  margin-left: auto;
  font-size: 11px;
  background: rgba(255,255,255,.12);
  color: #e2e8f0;
  padding: 1px 7px;
  border-radius: 99px;
}

.sidebar-footer {
  flex: 0 0 auto;
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, .07);
}

/* ==========================================================================
   顶部横向导航版式（app-topnav）
   —— 功能模块放顶部，内容区占满整行宽度，一行显示更多信息
   ========================================================================== */
.app.app-topnav {
  display: block;          /* 覆盖默认的 flex 侧边栏布局 */
  min-height: 100vh;
}

.topnav {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 18px;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: var(--sh-xs);
}

.topnav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  padding-right: 16px;
  border-right: 1px solid var(--line);
  height: 100%;
}
.topnav-brand .sidebar-title { color: var(--ink); }
.topnav-brand .sidebar-title small { color: var(--ink-3); }

.topnav-menu {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.topnav-menu::-webkit-scrollbar { height: 0; }

.tnav-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 13px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 550;
  color: var(--ink-2);
  white-space: nowrap;
  flex: 0 0 auto;
  transition: background .15s, color .15s;
  position: relative;
}
.tnav-item:hover { background: var(--surface-2); color: var(--ink); }
.tnav-item .ico { width: 16px; height: 16px; display: inline-flex; flex: 0 0 16px; }
.tnav-item .ico svg { width: 16px; height: 16px; }
.tnav-item.active {
  background: var(--brand-soft);
  color: var(--brand-700);
}
.tnav-item.active::after {
  content: "";
  position: absolute; left: 13px; right: 13px; bottom: -11px;
  height: 2px; border-radius: 2px; background: var(--brand);
}

.topnav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  padding-left: 12px;
  border-left: 1px solid var(--line);
  height: 100%;
}

@media (max-width: 900px) {
  .topnav-brand .sidebar-title { display: none; }
  .topnav { padding: 0 10px; gap: 10px; }
}

/* ---------- 主区域 ---------- */
.main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ---------- 顶栏 ---------- */
.topbar {
  height: var(--topbar-h);
  flex: 0 0 var(--topbar-h);
  background: rgba(255, 255, 255, .85);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 22px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-title {
  font-size: 15.5px;
  font-weight: 650;
  color: var(--ink);
  letter-spacing: .1px;
}
.topbar-sub { font-size: 12px; color: var(--ink-3); font-weight: 400; margin-top: 1px; }
.topbar-spacer { flex: 1 1 auto; }

.topbar-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px;
  border-radius: 99px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-2);
  box-shadow: var(--sh-xs);
}

/* 用户菜单 */
.user-menu { position: relative; }
.user-btn {
  display: flex; align-items: center; gap: 9px;
  height: 38px; padding: 0 10px 0 6px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  font-size: 13px; color: var(--ink-2);
  box-shadow: var(--sh-xs);
  transition: border-color .15s, box-shadow .15s;
}
.user-btn:hover { border-color: var(--line-strong); box-shadow: var(--sh-sm); }
.avatar {
  width: 27px; height: 27px; border-radius: 50%;
  background: linear-gradient(135deg, #60a5fa, #2563eb);
  color: #fff; font-size: 12px; font-weight: 650;
  display: grid; place-items: center; flex: 0 0 auto;
}
.user-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 190px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh-lg);
  padding: 6px;
  display: none;
  z-index: 50;
}
.user-dropdown.open { display: block; }
.user-dropdown .dd-head {
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 5px;
}
.user-dropdown .dd-name { font-weight: 600; color: var(--ink); font-size: 13px; }
.user-dropdown .dd-role { font-size: 11.5px; color: var(--ink-3); }
.dd-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: 7px;
  font-size: 13px; color: var(--ink-2); cursor: pointer;
}
.dd-item:hover { background: var(--surface-2); color: var(--ink); }
.dd-item.danger { color: var(--danger); }
.dd-item.danger:hover { background: var(--danger-soft); }

/* ---------- 内容区 ---------- */
.content {
  flex: 1 1 auto;
  padding: 22px;
  min-width: 0;
}
.content.flush { padding: 0; }

/* ==========================================================================
   通用组件
   ========================================================================== */

/* 卡片 */
.card-x {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
}
.card-x-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.card-x-title { font-size: 14px; font-weight: 640; color: var(--ink); }
.card-x-body { padding: 18px; }

/* 统计卡片 */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  box-shadow: var(--sh-sm);
  position: relative;
  overflow: hidden;
}
.stat::after {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 3px;
  background: var(--brand); opacity: .9;
}
.stat.ok::after   { background: var(--ok); }
.stat.warn::after { background: var(--warn); }
.stat.danger::after { background: var(--danger); }
.stat .label { font-size: 12.5px; color: var(--ink-3); font-weight: 500; }
.stat .value { font-size: 26px; font-weight: 700; color: var(--ink); margin-top: 4px; letter-spacing: -.02em; }
.stat .foot { font-size: 12px; color: var(--ink-3); margin-top: 3px; }

/* 徽章 */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600;
  padding: 2px 9px; border-radius: 99px;
  border: 1px solid transparent;
  line-height: 1.5;
}
.pill.ok     { background: var(--ok-soft);     color: var(--ok);     border-color: #bbf7d0; }
.pill.warn   { background: var(--warn-soft);   color: var(--warn);   border-color: #fde68a; }
.pill.danger { background: var(--danger-soft); color: var(--danger); border-color: #fecaca; }
.pill.info   { background: var(--info-soft);   color: var(--info);   border-color: #bae6fd; }
.pill.mute   { background: var(--surface-2);   color: var(--muted);  border-color: var(--line); }
.pill .dot   { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* 按钮（在 Bootstrap 之上做轻量增强） */
.btn { border-radius: 8px; font-weight: 550; font-size: 13.5px; transition: all .15s; }
.btn-primary { background: var(--brand); border-color: var(--brand); }
.btn-primary:hover, .btn-primary:focus { background: var(--brand-600); border-color: var(--brand-600); box-shadow: 0 0 0 .2rem var(--brand-ring); }
.btn-x { display: inline-flex; align-items: center; gap: 7px; }
.btn-x svg { width: 15px; height: 15px; }

/* 表单 */
.form-control, .form-select {
  border-radius: 8px;
  border-color: var(--line-strong);
  font-size: 13.5px;
  padding: 7px 11px;
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}
.form-label { font-size: 13px; font-weight: 550; color: var(--ink-2); margin-bottom: 5px; }

/* 表格：现代、紧凑、去条纹 */
.table-x {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
}
.table-x thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--surface-2);
  color: var(--ink-2);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: .02em;
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table-x tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  white-space: nowrap;
  vertical-align: middle;
}
.table-x tbody tr:hover { background: var(--brand-soft); }
.table-x tbody tr:last-child td { border-bottom: none; }
.table-x .strong { color: var(--ink); font-weight: 600; }
.table-x .mono { font-family: var(--mono); font-size: 12.5px; }

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--ink-3);
}
.empty-state .ico { font-size: 34px; opacity: .5; margin-bottom: 8px; }
.empty-state .t { font-size: 14px; color: var(--ink-2); font-weight: 550; }
.empty-state .d { font-size: 12.5px; margin-top: 3px; }

/* 提示 toast */
.toast-host {
  position: fixed; right: 20px; bottom: 20px; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
}
.toast-x {
  min-width: 240px; max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: var(--r);
  box-shadow: var(--sh-lg);
  padding: 12px 14px;
  font-size: 13px; color: var(--ink-2);
  animation: toastIn .22s ease;
}
.toast-x.ok     { border-left-color: var(--ok); }
.toast-x.warn   { border-left-color: var(--warn); }
.toast-x.danger { border-left-color: var(--danger); }
.toast-x .tt { font-weight: 600; color: var(--ink); margin-bottom: 2px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* 加载骨架/转圈 */
.spinner-x {
  width: 16px; height: 16px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   登录 / 注册（无侧边栏的全屏版式）
   ========================================================================== */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  background: var(--bg);
}
.auth-hero {
  position: relative;
  background:
    radial-gradient(900px 500px at 15% 10%, rgba(96,165,250,.35), transparent 60%),
    radial-gradient(700px 500px at 90% 90%, rgba(37,99,235,.45), transparent 55%),
    linear-gradient(150deg, #0f172a 0%, #172554 60%, #1e3a8a 100%);
  color: #e2e8f0;
  display: flex; flex-direction: column;
  justify-content: center;
  padding: 56px 60px;
  overflow: hidden;
}
.auth-hero::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(148,163,184,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148,163,184,.08) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(700px 500px at 70% 40%, #000, transparent 75%);
  -webkit-mask-image: radial-gradient(700px 500px at 70% 40%, #000, transparent 75%);
}
.auth-hero-inner { position: relative; z-index: 1; max-width: 460px; }
.auth-hero .kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: #93c5fd;
  background: rgba(59,130,246,.14);
  border: 1px solid rgba(96,165,250,.3);
  padding: 5px 12px; border-radius: 99px;
  margin-bottom: 22px;
}
.auth-hero h1 {
  font-size: 34px; line-height: 1.2; font-weight: 750; letter-spacing: -.02em;
  color: #f8fafc; margin: 0 0 14px;
}
.auth-hero p { font-size: 14.5px; color: #94a3b8; line-height: 1.7; margin: 0 0 30px; }
.auth-features { display: flex; flex-direction: column; gap: 14px; }
.auth-feature { display: flex; align-items: center; gap: 12px; font-size: 13.5px; color: #cbd5e1; }
.auth-feature .fi {
  width: 34px; height: 34px; flex: 0 0 auto;
  border-radius: 9px;
  background: rgba(96,165,250,.14);
  border: 1px solid rgba(96,165,250,.24);
  display: grid; place-items: center; color: #93c5fd;
}

.auth-panel {
  display: flex; align-items: center; justify-content: center;
  padding: 40px;
  background: var(--surface);
}
.auth-card { width: 100%; max-width: 380px; position: relative; }
.auth-card .brand-mini {
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 30px;
}
.auth-card .brand-mini .sidebar-logo { box-shadow: 0 3px 10px rgba(37,99,235,.4); }
.auth-card h2 { font-size: 23px; font-weight: 700; color: var(--ink); margin: 0 0 6px; letter-spacing: -.01em; }
.auth-card .sub { font-size: 13.5px; color: var(--ink-3); margin-bottom: 26px; }
.auth-field { margin-bottom: 15px; }
.auth-field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.auth-input { position: relative; }
.auth-input .form-control { height: 44px; padding-left: 40px; font-size: 14px; }
.auth-input .lead-ico {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: var(--ink-3); pointer-events: none; display: grid; place-items: center;
}
.auth-input .lead-ico svg { width: 17px; height: 17px; }
.auth-submit {
  width: 100%; height: 44px; margin-top: 8px;
  border: none; border-radius: 9px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff; font-size: 14.5px; font-weight: 620;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(37,99,235,.32);
  transition: transform .12s, box-shadow .15s;
}
.auth-submit:hover { transform: translateY(-1px); box-shadow: 0 9px 22px rgba(37,99,235,.4); }
.auth-submit:active { transform: none; }
.auth-alt { text-align: center; font-size: 13px; color: var(--ink-3); margin-top: 20px; }
.auth-alt a { font-weight: 600; }

.alert-x {
  font-size: 13px; border-radius: 9px; padding: 10px 13px; margin-bottom: 16px;
  display: flex; align-items: center; gap: 9px;
}
.alert-x.danger { background: var(--danger-soft); color: #b91c1c; border: 1px solid #fecaca; }

@media (max-width: 900px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
}

/* ==========================================================================
   实时位置页专用
   ========================================================================== */
.rt-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  height: 100%;
  min-height: 0;
}
@media (max-width: 1100px) {
  .rt-layout { grid-template-columns: 1fr; height: auto; }
}

.rt-side {
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.rt-side-head { padding: 14px 16px 10px; border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.rt-side-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; }
.rt-side-title .t { font-size: 13.5px; font-weight: 650; color: var(--ink); }

.rt-search { position: relative; }
.rt-search input {
  width: 100%; height: 36px;
  border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 0 11px 0 34px; font-size: 13px;
  background: var(--surface-2);
}
.rt-search input:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px var(--brand-ring); }
.rt-search .s-ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.rt-search .s-ico svg { width: 15px; height: 15px; }

.rt-list { flex: 1 1 auto; overflow-y: auto; padding: 8px; }
.veh-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 11px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .14s, border-color .14s;
  margin-bottom: 3px;
}
.veh-item:hover { background: var(--surface-2); }
.veh-item.sel { background: var(--brand-soft); border-color: #c7dbff; }
.veh-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; background: var(--ink-3); position: relative; }
.veh-dot.on  { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.veh-dot.off { background: #cbd5e1; }
.veh-meta { min-width: 0; flex: 1 1 auto; }
.veh-name { font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.veh-sub { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.veh-check { accent-color: var(--brand); width: 15px; height: 15px; flex: 0 0 auto; cursor: pointer; }

.rt-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.rt-toolbar {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.seg {
  display: inline-flex; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 9px; padding: 3px;
}
.seg label { margin: 0; }
.seg input { display: none; }
.seg span {
  display: block; padding: 5px 13px; border-radius: 7px;
  font-size: 12.5px; font-weight: 550; color: var(--ink-2); cursor: pointer;
  transition: background .15s, color .15s;
}
.seg input:checked + span { background: #fff; color: var(--brand); box-shadow: var(--sh-xs); }

#rt-map { flex: 1 1 auto; min-height: 320px; background: #e8edf5; }

/* ==========================================================================
   悬浮地图切换控件（下拉式）—— 浮在地图上方，点击展开选择，不占布局空间
   ========================================================================== */
.map-switch {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 600;
  font-size: 13px;
}
.map-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 11px;
  background: rgba(255, 255, 255, .96);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  box-shadow: var(--sh);
  color: var(--ink-2);
  font-weight: 550;
  cursor: pointer;
  user-select: none;
  backdrop-filter: blur(6px);
  transition: border-color .15s, box-shadow .15s;
}
.map-switch-btn:hover { border-color: var(--brand); box-shadow: var(--sh-lg); }
.map-switch-btn .mi { width: 16px; height: 16px; color: var(--brand); flex: 0 0 16px; }
.map-switch-btn .mi svg { width: 16px; height: 16px; }
.map-switch-btn .caret { width: 12px; height: 12px; color: var(--ink-3); transition: transform .18s; }
.map-switch.open .map-switch-btn .caret { transform: rotate(180deg); }

.map-switch-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 168px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--sh-lg);
  padding: 5px;
  overflow: hidden;
}
.map-switch.open .map-switch-menu { display: block; }
.map-switch-menu .ms-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px;
  border-radius: 7px;
  color: var(--ink-2);
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
}
.map-switch-menu .ms-item:hover { background: var(--surface-2); color: var(--ink); }
.map-switch-menu .ms-item.active { background: var(--brand-soft); color: var(--brand-700); font-weight: 600; }
.map-switch-menu .ms-item .tick { width: 14px; height: 14px; flex: 0 0 14px; opacity: 0; }
.map-switch-menu .ms-item.active .tick { opacity: 1; }

/* 地图右下角图例 */
.map-legend {
  position: absolute; right: 12px; bottom: 12px; z-index: 500;
  background: rgba(255,255,255,.94);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 12px; font-size: 12px; color: var(--ink-2);
  box-shadow: var(--sh);
  display: flex; flex-direction: column; gap: 6px;
}
.map-legend .lg { display: flex; align-items: center; gap: 7px; }
.map-legend .d { width: 8px; height: 8px; border-radius: 50%; }

/* 底部车辆数据卡片条 */
.rt-cards {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  max-height: 40%;
  overflow-y: auto;
}
.veh-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-xs);
  overflow: hidden;
}
.veh-card-head {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
}
.veh-card-head .n { font-size: 13px; font-weight: 640; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.veh-card-head .sp { margin-left: auto; flex: 0 0 auto; }
.veh-card-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 0;
}
.veh-card-grid .kv {
  padding: 9px 13px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
}
.veh-card-grid .kv:nth-child(2n) { border-right: none; }
.veh-card-grid .k { font-size: 11px; color: var(--ink-3); }
.veh-card-grid .v { font-size: 14px; font-weight: 620; color: var(--ink); margin-top: 1px; }
.veh-card-grid .v.sm { font-size: 12.5px; font-weight: 550; }

/* ==========================================================================
   信息列表（带表头、可横纵滚动）—— 替代卡片堆叠，一屏看更多字段
   ========================================================================== */
.info-table-wrap {
  flex: 0 0 auto;
  border-top: 1px solid var(--line);
  background: var(--surface);
  max-height: 46%;
  min-height: 160px;
  overflow: auto;              /* 横向 + 纵向滚动都交给这里 */
  position: relative;
}

table.info-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-size: 12.5px;
  white-space: nowrap;
}
table.info-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--surface-2);
  color: var(--ink-2);
  font-weight: 620;
  font-size: 12px;
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-strong);
  border-right: 1px solid var(--line);
}
table.info-table thead th:last-child { border-right: none; }

/* 冻结前两列：复选框 + 车辆 */
table.info-table thead th.stick-1,
table.info-table tbody td.stick-1 {
  position: sticky; left: 0; z-index: 2;
  background: var(--surface);
}
table.info-table thead th.stick-1 { z-index: 4; background: var(--surface-2); }
table.info-table thead th.stick-2,
table.info-table tbody td.stick-2 {
  position: sticky; left: 38px; z-index: 2;
  background: var(--surface);
  box-shadow: 1px 0 0 var(--line);
}
table.info-table thead th.stick-2 { z-index: 4; background: var(--surface-2); }

table.info-table tbody td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  color: var(--ink-2);
  vertical-align: middle;
}
table.info-table tbody td:last-child { border-right: none; }
table.info-table tbody tr:hover td { background: var(--brand-soft); }
table.info-table tbody tr:hover td.stick-1,
table.info-table tbody tr:hover td.stick-2 { background: #e8f0ff; }
table.info-table tbody tr.offline td { color: var(--ink-3); }

table.info-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.info-table td.strong { font-weight: 620; color: var(--ink); }
table.info-table td.c {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.info-table .cell-name {
  display: flex; align-items: center; gap: 8px;
  max-width: 220px;
}
.info-table .cell-name .nm {
  font-weight: 620; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.info-table .cell-name .sub {
  font-size: 11px; color: var(--ink-3); font-family: var(--mono);
}

.info-table td.col-check { width: 38px; padding-left: 12px; padding-right: 0; }
.info-table input.veh-check { accent-color: var(--brand); width: 15px; height: 15px; cursor: pointer; }

/* 表头右侧工具条 */
.info-tools {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  flex: 0 0 auto;
  font-size: 12.5px;
  color: var(--ink-3);
}

/* ==========================================================================
   可搜索下拉选择（自带输入框过滤）
   ========================================================================== */
.picker {
  position: relative;
  display: inline-block;
  min-width: 230px;
  text-align: left;
}
.picker > input.picker-input {
  width: 100%;
  height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0 30px 0 11px;
  font-size: 13.5px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.picker > input.picker-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.picker .picker-caret {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  pointer-events: none; color: var(--ink-3);
}
.picker .picker-caret svg { width: 13px; height: 13px; display: block; }
.picker .picker-panel {
  display: none;
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  max-height: 300px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: var(--sh-lg);
  z-index: 800;
  padding: 5px;
}
.picker.open .picker-panel { display: block; }
.picker .picker-search {
  position: sticky; top: 0; background: var(--surface); padding: 3px 3px 6px; z-index: 2;
}
.picker .picker-search input {
  width: 100%; height: 31px;
  border: 1px solid var(--line-strong); border-radius: 7px;
  padding: 0 9px; font-size: 13px; background: var(--surface-2);
}
.picker .picker-search input:focus { outline: none; border-color: var(--brand); background: #fff; }
.picker .picker-opt {
  padding: 7px 10px; border-radius: 6px; font-size: 13px; color: var(--ink-2);
  cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.picker .picker-opt:hover { background: var(--surface-2); color: var(--ink); }
.picker .picker-opt.active { background: var(--brand-soft); color: var(--brand-700); font-weight: 600; }
.picker .picker-empty { padding: 10px; text-align: center; color: var(--ink-3); font-size: 12.5px; }

/* ==========================================================================
   紧凑筛选条（历史/状态页复用）
   ========================================================================== */
.filter-bar {
  display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-xs);
  padding: 11px 14px;
  margin-bottom: 12px;
}
.filter-bar .fb-field { display: flex; flex-direction: column; gap: 4px; }
.filter-bar .fb-field > label { font-size: 11.5px; color: var(--ink-3); }
.filter-bar .fb-field > .form-control,
.filter-bar .fb-field > .form-select { height: 34px; font-size: 13.5px; }
.filter-bar .fb-spacer { flex: 1 1 auto; }

/* ==========================================================================
   杂项 / 兼容旧页面
   ========================================================================== */
.resizer { width: 5px; cursor: col-resize; background: var(--line); user-select: none; }
.table-resizer { height: 5px; cursor: row-resize; background: var(--line); user-select: none; }

pre.log {
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  background: #0b1220;
  color: #cbd5e1;
  border-radius: var(--r);
  padding: 14px;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-all;
}

.text-muted { color: var(--ink-3) !important; }
