@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;600;700&family=Sora:wght@500;600;700&display=swap');

:root {
  --bg: #eef3f1;
  --bg-elevated: #ffffff;
  --bg-muted: #f4f8f6;
  --sidebar: #0c2f2c;
  --sidebar-2: #164642;
  --line: #d5e3dd;
  --text: #142421;
  --text-2: #5b6f69;
  --text-3: #879992;
  --brand: #0f766e;
  --brand-2: #14b8a6;
  --brand-soft: #d9f5ef;
  --accent: #f59e0b;
  --danger: #e11d48;
  --warn: #d97706;
  --ok: #059669;
  --info: #0284c7;
  --shadow: 0 10px 30px rgba(12, 47, 44, 0.08);
  --radius: 14px;
  --radius-sm: 10px;
  --sidebar-w: 268px;
  --sidebar-w-collapsed: 72px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 13px;
  line-height: 1.5;
}
button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

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

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--sidebar) 0%, #0a2422 100%);
  color: #d7ebe6;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
  z-index: 20;
  transition: width .22s ease;
}
.app.sidebar-collapsed { --sidebar-w: var(--sidebar-w-collapsed); }
.app.sidebar-collapsed .brand h1,
.app.sidebar-collapsed .brand p,
.app.sidebar-collapsed .tenant,
.app.sidebar-collapsed .nav-tools,
.app.sidebar-collapsed .nav-section-title,
.app.sidebar-collapsed .nav-section-arrow,
.app.sidebar-collapsed .nav-item .label,
.app.sidebar-collapsed .sidebar-fold-label {
  display: none;
}
.app.sidebar-collapsed .brand { padding: 16px 10px; }
.app.sidebar-collapsed .brand .mark { margin: 0 auto 0; }
.app.sidebar-collapsed .nav-section-hd { justify-content: center; padding: 6px 4px; }
.app.sidebar-collapsed .nav-item { justify-content: center; padding: 8px 4px; }
.app.sidebar-collapsed .nav-item.active { box-shadow: inset 0 3px 0 #2dd4bf; }
.app.sidebar-collapsed .sidebar-fold-ico { transform: rotate(180deg); }
.app.sidebar-collapsed .nav-section.collapsed .nav-section-bd {
  max-height: 1200px; opacity: 1; pointer-events: auto;
}
.sidebar-fold {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin: 8px 10px 12px; padding: 8px 10px;
  border: 1px solid rgba(255,255,255,.1); border-radius: 8px;
  background: rgba(255,255,255,.04); color: #8fb5ad;
  cursor: pointer; font-size: 12px; flex-shrink: 0;
}
.sidebar-fold:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-fold-ico { font-size: 16px; line-height: 1; transition: transform .22s ease; }
.nav-tools {
  display: flex; gap: 6px; padding: 8px 14px 0;
}
.nav-tool-btn {
  flex: 1; padding: 4px 0; border: 1px solid rgba(255,255,255,.1);
  border-radius: 6px; background: transparent; color: #6f948c;
  font-size: 11px; cursor: pointer;
}
.nav-tool-btn:hover { color: #b7d4ce; background: rgba(255,255,255,.05); }
.brand {
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand .mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, #2dd4bf, #0f766e);
  display: grid; place-items: center;
  font-family: Sora, sans-serif; font-weight: 700; color: #052e2b;
  margin-bottom: 10px;
}
.brand h1 {
  font-family: Sora, "Noto Sans SC", sans-serif;
  font-size: 16px; font-weight: 700; color: #fff; letter-spacing: .02em;
}
.brand p { font-size: 11px; color: #8fb5ad; margin-top: 4px; }
.tenant {
  margin: 12px 14px 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  font-size: 12px;
}
.tenant strong { color: #fff; display: block; margin-bottom: 2px; }

.nav {
  padding: 8px 10px 12px;
  overflow: auto;
  flex: 1;
}
.nav-section { margin-top: 6px; }
.nav-section-hd {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  width: 100%; padding: 6px 10px; margin-bottom: 2px;
  border: 0; border-radius: 6px; background: transparent;
  color: #6f948c; font-size: 10px; letter-spacing: .06em;
  cursor: pointer; text-align: left;
  transition: background .15s ease, color .15s ease;
}
.nav-section-hd:hover { background: rgba(255,255,255,.05); color: #9ec4bc; }
.nav-section-title { font-weight: 600; flex: 1; min-width: 0; }
.nav-section-arrow {
  flex-shrink: 0; font-size: 10px; opacity: .75;
  transition: transform .2s ease;
}
.nav-section-arrow::before { content: "▾"; }
.nav-section.collapsed .nav-section-arrow { transform: rotate(-90deg); }
.nav-section-bd {
  overflow: hidden;
  transition: max-height .25s ease, opacity .18s ease;
}
.nav-section:not(.collapsed) .nav-section-bd { max-height: 1200px; opacity: 1; }
.nav-section.collapsed .nav-section-bd { max-height: 0; opacity: 0; pointer-events: none; }
.nav-group {
  margin-top: 12px;
  padding: 0 8px 4px;
  font-size: 10px;
  letter-spacing: .06em;
  color: #6f948c;
}
.nav-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  color: #b7d4ce;
  cursor: pointer;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: .15s ease;
  font-size: 12.5px;
  line-height: 1.25;
}
.feature-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 12px; padding: 10px 14px;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(15,118,110,.08), rgba(45,212,191,.06));
  border: 1px solid rgba(15,118,110,.18);
}
.feature-banner b { display: block; font-size: 13px; color: #0f766e; }
.feature-banner span { color: var(--text-2); font-size: 12px; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(45,212,191,.22), rgba(45,212,191,.08));
  color: #fff;
  box-shadow: inset 3px 0 0 #2dd4bf;
}
.nav-item .ico {
  width: 18px; text-align: center; opacity: .9; flex-shrink: 0;
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 60px;
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px;
  position: sticky; top: 0; z-index: 10;
}
.topbar h2 {
  font-family: Sora, "Noto Sans SC", sans-serif;
  font-size: 17px; font-weight: 650;
}
.topbar .sub { color: var(--text-2); font-size: 12px; margin-top: 2px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 999px;
  background: var(--bg-muted); border: 1px solid var(--line);
  color: var(--text-2); font-size: 12px;
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #99f6e4, #0f766e);
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 12px;
}

.content { padding: 18px 22px 28px; }

/* Cards & grids */
.grid { display: grid; gap: 14px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-12 { grid-template-columns: repeat(12, 1fr); }
@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .sidebar { display: none; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 0;
}
.card-hd h3 {
  font-size: 14px; font-weight: 650;
  font-family: Sora, "Noto Sans SC", sans-serif;
}
.card-bd { padding: 14px 16px 16px; }
.kpi {
  padding: 16px;
  position: relative;
  overflow: hidden;
}
.kpi::after {
  content: "";
  position: absolute; right: -20px; top: -20px;
  width: 90px; height: 90px; border-radius: 50%;
  background: radial-gradient(circle, rgba(20,184,166,.18), transparent 70%);
}
.kpi .label { color: var(--text-2); font-size: 12px; }
.kpi .value {
  font-family: Sora, sans-serif;
  font-size: 28px; font-weight: 700; margin-top: 8px; letter-spacing: -.02em;
}
.kpi .delta { margin-top: 8px; font-size: 12px; }
.kpi .delta.up { color: var(--ok); }
.kpi .delta.down { color: var(--danger); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: 9px;
  border: 1px solid transparent; cursor: pointer;
  transition: .15s ease; white-space: nowrap;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: #0d9488; }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--brand-2); color: var(--brand); }
.btn-soft { background: var(--brand-soft); color: var(--brand); }
.btn-danger { background: #fff1f2; color: var(--danger); border-color: #fecdd3; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 7px; }

.toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin-bottom: 14px;
}
.field {
  height: 34px; padding: 0 12px; border-radius: 9px;
  border: 1px solid var(--line); background: #fff; color: var(--text);
  min-width: 140px;
}
.search { min-width: 220px; }

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td {
  padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
th {
  font-size: 12px; color: var(--text-2); font-weight: 600;
  background: var(--bg-muted);
}
tr:hover td { background: #f8fbfa; }

.tag {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
}
.tag-ok { background: #d1fae5; color: #047857; }
.tag-warn { background: #fef3c7; color: #b45309; }
.tag-danger { background: #ffe4e6; color: #be123c; }
.tag-info { background: #e0f2fe; color: #0369a1; }
.tag-muted { background: #eef2f1; color: #64748b; }

.cn-emblem {
  width: 16px; height: 16px;
  display: inline-block; vertical-align: -3px; flex: none;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.25));
}
.cn-emblem-sm { width: 12px; height: 12px; vertical-align: -2px; }
.cn-emblem-lg { width: 22px; height: 22px; vertical-align: -5px; }
.party-cell {
  display: inline-flex; align-items: center; gap: 4px;
  color: #9b1c1c; font-weight: 700; white-space: nowrap;
}
.person-name { white-space: nowrap; }
.person-name .cn-emblem { margin-left: 4px; }
.profile-name {
  display: flex; align-items: center; gap: 8px;
  font-size: 18px; flex-wrap: wrap;
}
.staff-avatar { position: relative; overflow: visible; }
.staff-avatar .cn-emblem {
  position: absolute; right: -6px; bottom: -4px; margin: 0;
  width: 20px; height: 20px;
}

/* Map mock */
.map {
  position: relative;
  height: 460px;
  border-radius: 12px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(15,118,110,.08), transparent 40%),
    radial-gradient(circle at 30% 40%, rgba(45,212,191,.25), transparent 25%),
    radial-gradient(circle at 70% 60%, rgba(14,165,233,.18), transparent 28%),
    linear-gradient(135deg, #dbece7 0%, #c5ddd6 40%, #b7d0c8 100%);
  border: 1px solid var(--line);
}
.map-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(15,118,110,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15,118,110,.08) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: .7;
}
.map-road {
  position: absolute; background: rgba(255,255,255,.55);
  border-radius: 999px;
}
.map-wrap { position: relative; }
.map-wrap-tall .map-real { height: 540px; }
.map-real {
  height: 460px; border-radius: 12px; border: 1px solid var(--line);
  background: #d7e3dc; overflow: hidden; position: relative;
}
.leaflet-container { font-family: inherit; background: #d7e3dc; }
.leaflet-div-icon { background: none !important; border: none !important; }
.geo-pin {
  display: flex; flex-direction: column; align-items: center;
  transform: translate(-50%, -100%);
  width: max-content !important;
}
.geo-pin .label {
  background: rgba(12,47,44,.88); color: #fff;
  padding: 3px 8px; border-radius: 6px; font-size: 11px; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 4px;
}
.geo-pin .dot {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 4px 10px rgba(0,0,0,.2); margin-top: 4px;
}
.geo-pin.on .label { background: var(--brand); }
.geo-pin.on .dot { box-shadow: 0 0 0 4px rgba(15,118,110,.28); }
.fence-tip {
  background: rgba(255,255,255,.92) !important; border: 1px solid var(--line) !important;
  color: var(--text) !important; font-size: 11px; font-weight: 600;
  box-shadow: none !important; padding: 2px 6px !important;
}
.fence-tip.on { outline: 1px solid var(--brand); }
.map-wrap .map-legend, .map-wrap .panel-float { z-index: 1000; }
.map-svg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 1;
}
.fence-poly { fill-opacity: .1; stroke-width: .35; stroke-dasharray: 1.4 .8; }
.fence-poly.on { fill-opacity: .22; stroke-width: .7; stroke-dasharray: none; }
.track-line {
  fill: none; stroke: #0ea5e9; stroke-width: .75;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 2.2 1.1;
}
.track-line.play { animation: track-dash 1.1s linear infinite; }
@keyframes track-dash { to { stroke-dashoffset: -24; } }
.fence-label {
  position: absolute; z-index: 2; font-size: 10px; font-weight: 600;
  background: rgba(255,255,255,.88); padding: 2px 6px; border-radius: 4px;
  pointer-events: none; white-space: nowrap; border: 1px solid rgba(15,118,110,.2);
}
.fence-label.on { outline: 1px solid currentColor; }
.map-pin {
  position: absolute; transform: translate(-50%, -100%);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  cursor: pointer; z-index: 3;
}
.map-pin.on .dot { transform: scale(1.35); box-shadow: 0 0 0 4px rgba(15,118,110,.25); }
.map-pin.on .label { background: var(--brand); }
.panel-map { width: 300px; max-height: 500px; overflow: auto; }
.row-on td { background: #e6f7f3 !important; }
.map-pin .dot {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 4px 10px rgba(0,0,0,.2);
}
.map-pin .label {
  background: rgba(12,47,44,.88); color: #fff;
  padding: 3px 8px; border-radius: 6px; font-size: 11px;
  white-space: nowrap;
}
.map-legend {
  position: absolute; left: 12px; bottom: 12px; z-index: 4;
  background: rgba(255,255,255,.92); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; display: flex; gap: 12px;
  flex-wrap: wrap; max-width: 70%;
}
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }

.panel-float {
  position: absolute; right: 12px; top: 12px; width: 280px; z-index: 5;
  background: rgba(255,255,255,.95); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px; box-shadow: var(--shadow);
}
.panel-float h4 { font-size: 13px; margin-bottom: 8px; }
.panel-shift-form {
  width: min(320px, 42%);
  max-height: calc(100% - 24px);
  overflow: auto;
  top: 12px; right: 12px;
}
.panel-shift-form .form-row { margin-bottom: 8px; }
.panel-shift-form .form-row label {
  display: block; font-size: 12px; color: var(--text-2); margin-bottom: 4px;
}
.panel-shift-form .field { width: 100%; }
.shift-map-split .map-wrap-tall .map-real { height: 560px; }

/* 人员队伍：左列表 + 右详情，适配多队伍 */
.team-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1.2fr);
  gap: 14px;
  align-items: stretch;
}
@media (max-width: 1100px) {
  .team-layout { grid-template-columns: 1fr; }
}
.team-list-card .card-bd { padding: 0; }
.team-list-scroll {
  max-height: 420px;
  overflow: auto;
}
.team-row {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 12px 14px;
  cursor: pointer;
  color: inherit;
  transition: background .15s ease;
}
.team-row:last-child { border-bottom: 0; }
.team-row:hover { background: var(--bg-muted); }
.team-row.active {
  background: var(--brand-soft);
  box-shadow: inset 3px 0 0 var(--brand);
}
.team-row-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.team-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--text-2);
  font-size: 12px;
  margin-bottom: 2px;
}
.team-detail-grid .stat-row:last-child { border-bottom: 1px dashed var(--line); }
.team-detail-grid .stat-row:last-of-type { border-bottom: 0; }

.ops-cell {
  white-space: normal;
  min-width: 200px;
}
.ops-cell .btn { margin: 2px 2px 2px 0; }
.table-staff-online th,
.table-staff-online td { vertical-align: middle; }
/* 排班绘制类弹窗靠右抽屉，避免挡住地图操作区 */
.modal-mask.modal-dock-right {
  justify-content: flex-end;
  align-items: stretch;
  background: rgba(8, 24, 22, .28);
  padding: 0;
}
.modal-mask.modal-dock-right .modal {
  width: min(400px, 92vw);
  max-height: 100vh;
  height: 100%;
  border-radius: 16px 0 0 16px;
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-mask.modal-dock-right .modal-bd {
  flex: 1;
  overflow: auto;
}
.stat-row {
  display: flex; justify-content: space-between; padding: 7px 0;
  border-bottom: 1px dashed var(--line); color: var(--text-2);
}
.stat-row:last-child { border-bottom: 0; }
.stat-row b { color: var(--text); }

/* Charts */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 140px; padding-top: 10px; }
.bar {
  flex: 1; border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #2dd4bf, #0f766e);
  position: relative; min-width: 0;
}
.bar span {
  position: absolute; top: -18px; left: 50%; transform: translateX(-50%);
  font-size: 10px; color: var(--text-3);
}
.line-chart {
  height: 160px;
  background:
    linear-gradient(180deg, transparent 0 39px, rgba(213,227,221,.9) 40px) 0 0 / 100% 40px,
    linear-gradient(90deg, transparent, transparent);
  position: relative;
  border-radius: 8px;
}
.line-chart svg { width: 100%; height: 100%; }

.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tab {
  padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; cursor: pointer; color: var(--text-2);
}
.tab.active { background: var(--brand); color: #fff; border-color: var(--brand); }

.split { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; }
@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } }

.list-item {
  display: flex; gap: 10px; padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.list-item:last-child { border-bottom: 0; }
.list-item .badge {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center; flex-shrink: 0;
  background: var(--brand-soft); color: var(--brand); font-weight: 700;
}
.muted { color: var(--text-2); }
.tiny { font-size: 11px; color: var(--text-3); }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mb-12 { margin-bottom: 12px; }
.flex { display: flex; }
.between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }

/* Video / monitor */
.video-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.video {
  aspect-ratio: 16/10; border-radius: 10px; overflow: hidden;
  background: linear-gradient(160deg, #0f172a, #134e4a 60%, #042f2e);
  position: relative; color: #fff;
}
.video.video-offline {
  background: linear-gradient(160deg, #1e293b, #334155 70%, #475569);
  opacity: .92;
}
.video .hud {
  position: absolute; inset: 0; padding: 10px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.video .cam { font-size: 11px; opacity: .85; }
.video .live {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(225,29,72,.85); padding: 2px 8px; border-radius: 999px; font-size: 10px;
}
.pulse { width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* Progress ring text */
.progress {
  height: 8px; border-radius: 999px; background: #e5eeea; overflow: hidden;
}
.progress > i {
  display: block; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, #14b8a6, #0f766e);
}

/* Contract AI */
.risk {
  border: 1px solid #fecdd3; background: #fff1f2; border-radius: 10px;
  padding: 12px; margin-bottom: 10px;
}
.risk h5 { color: var(--danger); margin-bottom: 4px; }
.risk.medium { border-color: #fde68a; background: #fffbeb; }
.risk.medium h5 { color: var(--warn); }

/* Avatar scene */
.avatar-stage {
  height: 420px; border-radius: 14px; overflow: hidden; position: relative;
  background:
    radial-gradient(circle at 50% 20%, rgba(45,212,191,.35), transparent 40%),
    linear-gradient(180deg, #082f2b, #0c4a43 50%, #083533);
  color: #fff;
}
.avatar-figure {
  position: absolute; left: 8%; bottom: 40px; width: 180px; height: 260px;
  border-radius: 90px 90px 24px 24px;
  background:
    linear-gradient(180deg, #99f6e4 0 70px, #14b8a6 70px 160px, #0f766e 160px);
  box-shadow: 0 20px 50px rgba(0,0,0,.35);
}
.avatar-figure::before {
  content: "";
  position: absolute; left: 50%; top: 28px; transform: translateX(-50%);
  width: 56px; height: 56px; border-radius: 50%; background: #fce7d2;
}
.chat-bubble {
  position: absolute; left: 240px; top: 70px; right: 30px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(8px); border-radius: 16px; padding: 16px;
}
.chat-bubble .q { opacity: .75; font-size: 12px; margin-bottom: 8px; }
.chat-bubble .a { font-size: 15px; line-height: 1.7; }
.screen-panel {
  position: absolute; right: 24px; bottom: 24px; width: 280px;
  background: rgba(255,255,255,.95); color: var(--text);
  border-radius: 12px; padding: 12px; box-shadow: var(--shadow);
}

/* Mini program frame */
.phone {
  width: 320px; height: 640px; margin: 0 auto;
  border: 10px solid #111; border-radius: 34px;
  background: #fff; overflow: hidden; position: relative;
  box-shadow: 0 25px 60px rgba(0,0,0,.2);
}
.phone-bar {
  height: 52px; background: linear-gradient(90deg, #0f766e, #0d9488);
  color: #fff; display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 10px; font-weight: 600;
}
.phone-body { padding: 12px; height: calc(100% - 104px); overflow: auto; background: #f3f7f5; }
.phone-tab {
  position: absolute; left: 0; right: 0; bottom: 0; height: 52px;
  background: #fff; border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(4, 1fr);
}
.phone-tab span {
  display: grid; place-items: center; font-size: 11px; color: var(--text-3);
}
.phone-tab span.on { color: var(--brand); font-weight: 650; }

.mini-hd {
  display: grid; grid-template-columns: 28px 1fr 28px; align-items: center;
  margin: -4px -2px 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.mini-back {
  border: none; background: none; color: var(--brand); font-size: 22px; line-height: 1;
  cursor: pointer; padding: 0;
}
.mini-user-card {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: #fff; border-radius: 12px; border: 1px solid var(--line); margin-bottom: 8px;
}
.mini-avatar {
  width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, #0f766e, #0d9488);
  color: #fff; display: grid; place-items: center; font-weight: 700; flex-shrink: 0;
}
.mini-menu-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.mini-menu-item {
  border: 1px solid var(--line); background: #fff; border-radius: 12px;
  padding: 10px 6px; text-align: center; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.mini-menu-item .ico { font-size: 20px; line-height: 1.2; }
.mini-menu-item b { font-size: 11px; }
.mini-menu-item .tiny { font-size: 10px; color: var(--text-3); }
.mini-menu-item:hover { border-color: var(--brand-2); background: #f0fdfa; }
.mini-row {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px; margin-top: 6px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; cursor: pointer; text-align: left;
}
.mini-row.static { cursor: default; }
.mini-row:not(.static):hover { border-color: var(--brand-2); }
.mini-sect {
  font-size: 11px; color: var(--text-3); margin: 10px 0 4px; font-weight: 600;
}
.mini-segment { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.mini-seg {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 4px 10px; font-size: 11px; cursor: pointer;
}
.mini-seg.on { background: #ecfdf5; border-color: #0f766e; color: #0f766e; font-weight: 600; }
.mini-map { height: 160px; margin: 8px 0; border-radius: 10px; }
.mini-video { height: 100px; margin-top: 8px; border-radius: 10px; }
.mini-map-toolbar { display: flex; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
.mini-chip {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 3px 10px; font-size: 11px; cursor: pointer;
}
.mini-chip.on { background: #0f766e; color: #fff; border-color: #0f766e; }
.mini-tip {
  font-size: 11px; color: var(--text-3); padding: 6px 0 2px;
}
.mini-search { margin-bottom: 8px; font-size: 12px; padding: 8px 10px; }
.mini-legend { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 8px; }
.mini-camera-frame {
  height: 220px; border-radius: 12px; background: #111;
  position: relative; overflow: hidden; margin-top: 8px;
  background-image: linear-gradient(135deg, rgba(15,118,110,.25), rgba(0,0,0,.8)),
    repeating-linear-gradient(0deg, transparent, transparent 18px, rgba(255,255,255,.03) 18px, rgba(255,255,255,.03) 19px);
}
.mini-watermark {
  position: absolute; left: 8px; bottom: 8px; right: 8px;
  color: #fff; font-size: 10px; line-height: 1.5;
  text-shadow: 0 1px 2px rgba(0,0,0,.8);
  background: rgba(0,0,0,.35); padding: 6px 8px; border-radius: 6px;
}
.mini-camera-hint {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  color: rgba(255,255,255,.5); font-size: 12px;
}
.mini-feat-row {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border: none; border-bottom: 1px solid var(--line); background: none;
  cursor: pointer; text-align: left;
}
.mini-feat-row:last-child { border-bottom: none; }
.mini-feat-row.active b { color: var(--brand); }
.mini-feat-row:hover { background: #f8faf9; }

.mini-task-photo {
  margin-top: 10px; padding: 10px; border-radius: 10px;
  border: 1px dashed var(--line); background: #fff;
}
.mini-task-photo.done { border-style: solid; border-color: #99f6e4; background: #f0fdfa; }
.mini-task-photo-empty, .mini-task-photo-preview {
  min-height: 72px; border-radius: 8px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px; text-align: center;
  background: linear-gradient(135deg, rgba(15,118,110,.06), rgba(14,165,233,.04));
}
.mini-task-photo-preview { background: linear-gradient(135deg, #ecfdf5, #e0f2fe); }
.mini-task-photo-badge {
  font-size: 11px; font-weight: 650; padding: 2px 8px; border-radius: 999px;
  background: #0f766e; color: #fff;
}
.mini-task-photo-badge.muted { background: #94a3b8; }
.mini-task-photo-ico { font-size: 28px; line-height: 1; }
.mini-task-photo-wm {
  font-size: 9px; line-height: 1.4; color: #fff; margin-top: 4px;
  padding: 4px 6px; border-radius: 4px; background: rgba(0,0,0,.45);
  text-shadow: 0 1px 1px rgba(0,0,0,.5);
}

.empty-hint {
  padding: 10px 12px; border-radius: 10px;
  background: #ecfeff; border: 1px dashed #a5f3fc; color: #0e7490; font-size: 12px;
}

.photo-slot {
  height: 96px;
  border-radius: 10px;
  border: 1px dashed var(--line);
  background:
    linear-gradient(135deg, rgba(15,118,110,.08), rgba(14,165,233,.06)),
    repeating-linear-gradient(0deg, transparent, transparent 11px, rgba(15,118,110,.06) 11px, rgba(15,118,110,.06) 12px);
  display: grid;
  place-items: center;
  color: var(--text-3);
  font-size: 12px;
}

.span-8 { grid-column: span 8; }
.span-4 { grid-column: span 4; }
.span-7 { grid-column: span 7; }
.span-5 { grid-column: span 5; }
@media (max-width: 1100px) {
  .span-8, .span-4, .span-7, .span-5 { grid-column: span 12; }
}

.tab-panel[hidden] { display: none !important; }
.shift-cell {
  display: inline-block; min-width: 36px; text-align: center;
  padding: 3px 8px; border-radius: 6px; font-size: 12px; white-space: nowrap;
}
.shift-ok { background: #d9f5ef; color: #0f766e; }
.shift-info { background: #e0f2fe; color: #0369a1; }
.shift-warn { background: #fef3c7; color: #b45309; }
.shift-muted { background: #f1f5f4; color: #879992; }
.shift-danger { background: #ffe4e6; color: #be123c; }
.bind-flow {
  display: flex; flex-wrap: wrap; align-items: stretch; gap: 6px;
}
.bind-step {
  flex: 1 1 120px; min-width: 110px;
  padding: 10px 12px; border-radius: 10px;
  background: #f3f7f5; border: 1px solid var(--line);
}
.bind-step.on {
  background: rgba(15,118,110,.08); border-color: rgba(15,118,110,.28);
}
.bind-step b { display: block; font-size: 12.5px; margin-bottom: 4px; }
.bind-step span { font-size: 11px; color: var(--text-2); line-height: 1.35; }
.bind-arrow {
  display: grid; place-items: center; color: #0f766e; font-weight: 700; padding: 0 2px;
}
.fence-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 8px; border-radius: 999px; font-size: 12px;
  background: #e7f5f1; color: #0f766e; border: 1px solid #b7e0d4;
}
.fence-chip::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--fc, #0f766e);
}
.rb-poi-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 999px; font-size: 11.5px;
  background: color-mix(in srgb, var(--poi, #94a3b8) 12%, white);
  color: var(--poi, #64748b); border: 1px solid color-mix(in srgb, var(--poi, #94a3b8) 35%, white);
}
.rb-poi-chip::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--poi, #94a3b8);
}
.rb-poi-layout .map-wrap-tall { min-height: 420px; }
.rb-poi-type-bar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.rb-poi-type-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; cursor: pointer; font-size: 12px;
}
.rb-poi-type-btn.on, .rb-poi-type-btn:hover {
  border-color: #b7e0d4; background: var(--brand-soft);
}
.rb-poi-type-btn b { font-size: 12px; color: var(--text-2); }
.rb-poi-marker { background: none !important; border: none !important; }
.rb-poi-pin {
  width: 28px; height: 28px; border-radius: 50%;
  background: color-mix(in srgb, var(--poi, #94a3b8) 18%, white);
  border: 2px solid var(--poi, #64748b);
  display: grid; place-items: center;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .15);
  transition: transform .15s ease, box-shadow .15s ease;
}
.rb-poi-pin span { font-size: 11px; font-weight: 700; color: var(--poi, #64748b); line-height: 1; }
.rb-poi-marker.on .rb-poi-pin,
.rb-poi-marker:hover .rb-poi-pin {
  transform: scale(1.15);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--poi, #0f766e) 25%, transparent);
}
.rb-poi-mark-form .form-row { margin-bottom: 8px; }
.rb-poi-mark-form .form-row label { font-size: 11px; }
.rb-bind-layout .team-list-card { min-width: 240px; }
.rb-bind-checklist {
  display: grid; gap: 8px;
}
.rb-bind-check {
  display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: center;
  padding: 8px 10px; border-radius: 8px; background: var(--bg-muted); font-size: 12.5px;
}
.rb-bind-check i {
  width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; font-style: normal; background: #fff; border: 1px solid var(--line); color: var(--text-2);
}
.rb-bind-check.ok i { background: #e7f5f1; border-color: #b7e0d4; color: #0f766e; }
.rb-bind-check b { font-size: 12px; text-align: right; }
.rb-audit-timeline { display: grid; gap: 10px; }
.rb-audit-step {
  display: grid; grid-template-columns: 88px 1fr; gap: 10px; align-items: start;
  padding-bottom: 10px; border-bottom: 1px dashed var(--line);
}
.rb-audit-step:last-child { border-bottom: 0; padding-bottom: 0; }
.rb-audit-time { font-size: 11px; color: var(--text-2); }
.rb-audit-body b { display: block; font-size: 12.5px; margin-bottom: 2px; }
.rb-audit-body span { font-size: 12px; color: var(--text-2); }
.route-fence-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 6px 0; border-bottom: 1px dashed var(--line);
}
.route-fence-row:last-of-type { border-bottom: 0; }
.route-name { font-weight: 600; font-size: 13px; }
b.clickable { color: var(--brand); }
.map-pin.clickable:hover .label { background: var(--brand); }
.life-steps {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 0 16px 14px;
}
.life-steps span {
  font-size: 11px;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 6px;
  padding: 4px 8px;
}

.modal-mask {
  position: fixed; inset: 0; background: rgba(8, 24, 22, .45);
  display: none; align-items: center; justify-content: center;
  /* 需高于 Leaflet pane / 地图浮层（约 400–1000），否则处置弹窗会被地图挡住 */
  z-index: 5000; padding: 20px;
}
.modal-mask.show { display: flex; }
.modal {
  width: min(720px, 96vw); max-height: 86vh; overflow: auto;
  background: #fff; border-radius: 16px; box-shadow: 0 24px 60px rgba(0,0,0,.25);
  position: relative; z-index: 1;
}
.modal-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: #fff; z-index: 2;
}
.modal-hd h3 { font-size: 16px; font-family: Sora, "Noto Sans SC", sans-serif; }
.modal-bd { padding: 16px 18px 20px; }
.form-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px;
}
.form-grid .span-2 { grid-column: 1 / -1; }
.form-grid .field, .form-row .field { width: 100%; min-width: 0; }
.form-grid textarea.field, .form-row textarea.field { height: auto; min-height: 72px; padding: 8px 12px; }
.req { color: var(--danger); font-style: normal; }
.file-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.file-slot {
  border: 1px dashed var(--line); border-radius: 10px;
  padding: 12px; background: var(--bg-muted); cursor: pointer;
  display: flex; flex-direction: column; gap: 4px;
}
.file-slot:hover { border-color: var(--brand); }
.chk-line {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0; border-bottom: 1px dashed var(--line);
  color: var(--text);
}
.chk-line:last-of-type { border-bottom: 0; }
@media (max-width: 900px) {
  .form-grid, .file-grid { grid-template-columns: 1fr; }
}
.toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 5100;
  background: #0c2f2c; color: #fff; padding: 10px 14px; border-radius: 10px;
  display: none; font-size: 13px;
}

/* 车辆作业流程 */
.ops-strip {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin-bottom: 14px; padding: 10px 12px;
  background: linear-gradient(90deg, #0c2f2c, #164642);
  border-radius: var(--radius-sm); color: #e8f5f2;
}
.ops-strip-item {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06);
  color: #d8efe9; border-radius: 999px; padding: 4px 10px; cursor: pointer; font-size: 12px;
}
.ops-strip-item:hover { background: rgba(255,255,255,.14); }
.ops-strip-item.on { background: #14b8a6; border-color: #14b8a6; color: #042f2e; font-weight: 600; }
.ops-strip-item.focus:not(.on) { border-color: #ffc000; color: #ffe08a; }
.ops-strip .ops-no {
  width: 18px; height: 18px; border-radius: 50%;
  display: inline-grid; place-items: center;
  background: rgba(0,0,0,.25); font-size: 11px; font-weight: 700;
}
.ops-strip-item.on .ops-no { background: rgba(0,0,0,.18); }
.ops-arrow { opacity: .45; font-size: 12px; }
.ops-pager {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin-top: 14px; flex-wrap: wrap;
}
.ops-quick { display: flex; flex-direction: column; gap: 10px; }
.ops-quick .btn { justify-content: center; }

.ops-flow-board {
  background: linear-gradient(160deg, #0a2748 0%, #123a5c 45%, #0c2f4a 100%);
  border-radius: var(--radius); padding: 22px 20px 18px; color: #e8f1ff;
  box-shadow: var(--shadow);
}
.ops-flow-title {
  font-family: Sora, "Noto Sans SC", sans-serif;
  font-size: 20px; font-weight: 700; text-align: center; margin-bottom: 18px;
  letter-spacing: .08em;
}
.ops-flow-u { display: flex; flex-direction: column; gap: 14px; max-width: 980px; margin: 0 auto; }
.ops-flow-row { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.ops-flow-row.mid { justify-content: flex-end; padding-right: 4%; }
.ops-flow-row.bottom { flex-direction: row; }
.ops-flow-spacer { flex: 1; min-width: 40%; }
.ops-flow-box {
  --ops-c: #5b9bd5;
  width: min(200px, 28vw); min-height: 86px;
  border: 2px solid rgba(255,255,255,.35); border-radius: 12px;
  background: color-mix(in srgb, var(--ops-c) 88%, #fff 12%);
  color: #123; padding: 10px 12px; text-align: left; cursor: pointer;
  display: flex; flex-direction: column; gap: 2px;
  box-shadow: 0 8px 20px rgba(0,0,0,.22);
  transition: transform .15s ease, box-shadow .15s ease;
}
.ops-flow-box:hover { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(0,0,0,.28); }
.ops-flow-box.is-focus {
  background: #ffc000; border-color: #fff59d; color: #3b2a00;
  box-shadow: 0 0 0 3px rgba(255,192,0,.35), 0 12px 28px rgba(0,0,0,.3);
}
.ops-flow-box.is-on:not(.is-focus) { outline: 2px solid #7dd3fc; }
.ops-flow-box.is-end { opacity: .95; }
.ops-flow-no { font-size: 11px; font-weight: 700; opacity: .7; }
.ops-flow-name { font-size: 15px; font-weight: 700; line-height: 1.3; }
.ops-flow-desc { font-size: 11px; opacity: .78; line-height: 1.35; margin-top: 2px; }
.ops-flow-arr { color: #fff; font-size: 20px; font-weight: 700; opacity: .9; }
.ops-flow-hint { text-align: center; margin-top: 16px; font-size: 12px; color: #9ec0e6; }

.ops-gantt { display: flex; flex-direction: column; gap: 14px; padding: 8px 0; }
.ops-gantt-row {
  display: grid; grid-template-columns: 88px 1fr; align-items: center; gap: 10px;
}
.ops-gantt-row > span { font-size: 12px; color: var(--text-2); }
.ops-gantt-track {
  position: relative; height: 18px; border-radius: 999px; background: #e8efec;
}
.ops-gantt-track i {
  position: absolute; top: 1px; bottom: 1px; border-radius: 999px;
  background: linear-gradient(90deg, #0f766e, #14b8a6);
}
.ops-gantt-track i.pending { background: linear-gradient(90deg, #94a3b8, #cbd5e1); }
.ops-gantt-axis {
  display: flex; justify-content: space-between; margin-left: 98px;
  font-size: 11px; color: var(--text-3);
}
@media (max-width: 900px) {
  .ops-flow-row.mid { justify-content: center; padding-right: 0; }
  .ops-flow-spacer { display: none; }
  .ops-flow-box { width: min(160px, 42vw); min-height: 78px; }
}

.map-route-svg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 1;
}
.map .map-pin { z-index: 2; }
.rt-type-chip {
  display: inline-flex; align-items: center;
  padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
  color: #fff; background: var(--rtc, #5b9bd5);
}
.rt-vehicle-checks { max-height: 140px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; }
tr.row-on td { background: var(--brand-soft); }

.ss-score-pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 42px; padding: 1px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 700; color: #fff;
  background: #64748b;
}
.ss-score-pill.hi { background: #059669; }
.ss-score-pill.mid { background: #0284c7; }
.ss-score-pill.lo { background: #d97706; }
.ss-score-bars { display: flex; flex-direction: column; gap: 8px; }
.ss-score-row {
  display: grid; grid-template-columns: 36px 1fr 48px; gap: 8px; align-items: center;
  font-size: 12px; color: var(--text-2);
}
.ss-score-row b { text-align: right; color: var(--text); font-size: 11px; }
.ss-score-track {
  height: 8px; border-radius: 999px; background: #e8efec; overflow: hidden;
}
.ss-score-track i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #ed7d31, #f6b26b);
}

.wp-rule-chips {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.wp-rule-chip {
  display: inline-flex; align-items: center;
  padding: 4px 10px; border-radius: 999px; font-size: 12px;
  background: #eef2f0; color: var(--text-2); border: 1px solid var(--line);
}
.wp-rules-sections {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px;
}
@media (max-width: 1100px) {
  .wp-rules-sections { grid-template-columns: 1fr; }
}
.wp-rules-sec {
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg-muted); padding: 12px 14px;
}
.wp-rules-sec h4 {
  font-size: 13px; margin-bottom: 8px; color: var(--brand);
  font-family: Sora, "Noto Sans SC", sans-serif;
}
.work-rules-form .chk-line { align-items: flex-start; }
.modal .wp-rules-sections { grid-template-columns: 1fr; }
.modal .work-rules-form { max-height: min(70vh, 640px); overflow: auto; }
.toast.show { display: block; }
.phone-body .nav-card { cursor: pointer; }
.phone-body .nav-card:hover { border-color: var(--brand-2); }

/* 环卫车辆作业管理 */
.grid-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1200px) { .grid-5 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) { .grid-5 { grid-template-columns: repeat(2, 1fr); } }

.vehicle-mgmt-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 24px; border-radius: 16px;
  background: linear-gradient(135deg, #0f172a 0%, #134e4a 55%, #0f766e 100%);
  color: #fff; box-shadow: var(--shadow);
}
.vehicle-mgmt-hero-fleet { background: linear-gradient(135deg, #1e1b4b 0%, #4338ca 55%, #6366f1 100%); }
.vehicle-mgmt-hero-fleet .vehicle-mgmt-pill { color: #c7d2fe; }
.vehicle-mgmt-hero-ops .vehicle-mgmt-pill { color: #5eead4; }
.vehicle-mgmt-modules.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 960px) { .vehicle-mgmt-modules.grid-3 { grid-template-columns: 1fr; } }
.vehicle-mgmt-hero-main h2 { font-size: 22px; margin-bottom: 6px; font-family: Sora, "Noto Sans SC", sans-serif; }
.vehicle-mgmt-hero-main p { font-size: 13px; opacity: 0.88; margin: 0; }
.vehicle-mgmt-pill {
  flex-shrink: 0; padding: 8px 14px; border-radius: 999px;
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.25);
  font-weight: 700; font-size: 14px; color: #5eead4;
}
.vehicle-mgmt-modules .nav-card { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.vehicle-mgmt-modules .nav-card:hover { border-color: var(--brand-2); box-shadow: var(--shadow-sm); }
.vehicle-mod-ico { font-size: 22px; margin-bottom: 8px; display: block; }
.vehicle-type-grid { gap: 10px; }
.vehicle-type-card {
  display: flex; flex-direction: column; gap: 4px; align-items: flex-start;
  padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-muted);
}
.vehicle-type-icon { font-size: 20px; }
.vehicle-type-card b { font-size: 13px; }
.badge.ok { background: #d1fae5; color: #065f46; }

/* AI 智能体 */
.agent-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 1200;
  width: 52px; height: 52px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(135deg, #0f766e, #0284c7);
  color: #fff; font-weight: 800; font-size: 15px; letter-spacing: 0.02em;
  box-shadow: 0 8px 24px rgba(15, 118, 110, 0.35);
}
.agent-fab:hover { transform: translateY(-1px); }
.agent-panel-mask[hidden] { display: none !important; }
.agent-panel[hidden] { display: none !important; }
.agent-panel-mask {
  position: fixed; inset: 0; z-index: 1300; background: rgba(15, 23, 42, 0.35);
}
.agent-panel {
  position: fixed; right: 0; top: 0; bottom: 0; z-index: 1310;
  width: min(420px, 100vw); background: var(--bg); border-left: 1px solid var(--line);
  box-shadow: -8px 0 32px rgba(0,0,0,0.12);
  display: flex; flex-direction: column;
}
.agent-panel-hd {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--bg-muted);
}
.agent-panel-messages, .agent-messages {
  flex: 1; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px;
  min-height: 280px; max-height: calc(100vh - 180px);
}
.agent-layout { display: grid; grid-template-columns: 280px 1fr; gap: 16px; min-height: calc(100vh - 160px); }
@media (max-width: 960px) { .agent-layout { grid-template-columns: 1fr; } }
.agent-main { display: flex; flex-direction: column; min-height: 620px; }
.agent-main-hd { align-items: center; }
.agent-compose {
  display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--bg-muted);
}
.agent-compose-panel { padding: 12px; }
.agent-input { flex: 1; }
.agent-welcome { display: flex; gap: 12px; padding: 8px 0; }
.agent-welcome.compact .agent-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.agent-avatar {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  display: grid; place-items: center; font-weight: 800; font-size: 12px;
  background: linear-gradient(135deg, #0f766e, #0284c7); color: #fff;
}
.agent-avatar.sm { width: 28px; height: 28px; font-size: 10px; border-radius: 8px; }
.agent-msg { display: flex; gap: 8px; align-items: flex-start; }
.agent-msg.user { justify-content: flex-end; }
.agent-msg.user .agent-bubble { background: #ecfdf5; border-color: #99f6e4; }
.agent-bubble {
  max-width: 92%; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: #fff; line-height: 1.55;
}
.agent-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.agent-chip {
  border: 1px solid var(--line); background: var(--bg-muted); border-radius: 999px;
  padding: 6px 12px; font-size: 12px; cursor: pointer;
}
.agent-chip:hover { border-color: var(--brand-2); color: var(--brand); }
.agent-cards { display: grid; gap: 8px; margin-top: 10px; }
.agent-card {
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg-muted); overflow: hidden;
}
.agent-card-hd { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.agent-card-bd { padding: 8px 10px; }
.agent-card-ft { padding: 8px 10px; border-top: 1px solid var(--line); }
.agent-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.agent-cap-list { display: grid; gap: 10px; }
.agent-cap b { display: block; font-size: 13px; margin-bottom: 2px; }
.border-top { border-top: 1px solid var(--line); }
