/* ============================================================
   信标部署管理中心 · 设计体系
   参考：暗色侧栏 + 琥珀色主色 + 浅灰工作区（圆角卡片）
   ============================================================ */
:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --side: #17181d;
  --side-2: #1f2127;
  --side-line: #2a2c34;
  --ink: #1f2329;
  --ink-2: #6b7280;
  --ink-3: #9ca3af;
  --line: #e5e7eb;
  --line-2: #eef0f2;
  --brand: #f7b500;
  --brand-deep: #e5a800;
  --brand-ink: #231b00;
  --brand-soft: #fdf3d7;
  --blue: #2563eb;
  --blue-soft: #e7f0fe;
  --green: #16a34a;
  --green-soft: #e6f4ea;
  --red: #dc2626;
  --red-soft: #fdecec;
  --amber: #d97706;
  --amber-soft: #fdf0dd;
  --gray-soft: #eef0f2;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(17, 24, 39, .05), 0 8px 24px rgba(17, 24, 39, .06);
  --font: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "Cascadia Mono", Consolas, "Courier New", monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
::selection { background: rgba(247, 181, 0, .35); }

/* ================= 布局 ================= */
.layout { display: flex; min-height: 100vh; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { flex: 1; padding: 20px 24px 32px; min-width: 0; }

/* ================= 侧栏 ================= */
.sidebar {
  width: 224px; flex: none;
  background: var(--side);
  color: #d7dae0;
  display: flex; flex-direction: column;
  padding: 16px 14px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 6px 18px; }
.brand-badge {
  width: 34px; height: 34px; flex: none; border-radius: 9px;
  background: radial-gradient(circle at 50% 50%, rgba(247,181,0,.28) 0 38%, transparent 40%),
              radial-gradient(circle at 50% 50%, rgba(247,181,0,.16) 0 62%, transparent 64%),
              var(--side-2);
  position: relative;
  border: 1px solid var(--side-line);
}
.brand-badge::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--brand); box-shadow: 0 0 12px rgba(247, 181, 0, .8);
}
.brand-badge.big { width: 42px; height: 42px; border-radius: 11px; }
.brand-text { line-height: 1.25; }
.brand-text b { display: block; color: #fff; font-size: 15px; letter-spacing: .5px; }
.brand-text span { font-size: 10px; letter-spacing: 2.5px; color: #8b8f99; }
.menu-group {
  font-size: 11px; color: #6d717c; letter-spacing: 2px;
  padding: 10px 10px 6px;
}
.menu { display: flex; flex-direction: column; gap: 2px; }
.menu a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 9px;
  color: #c3c7cf; font-size: 13.5px;
  transition: background .15s, color .15s;
}
.menu a:hover { background: var(--side-2); color: #fff; }
.menu a.active { background: var(--brand); color: var(--brand-ink); font-weight: 600; }
.menu a .mi { display: inline-flex; width: 16px; height: 16px; }
.menu a .mi svg { width: 16px; height: 16px; }
.sidebar-foot {
  margin-top: auto; padding: 12px 10px 2px;
  font-size: 11px; color: #6d717c;
  border-top: 1px solid var(--side-line);
}

/* ================= 顶栏 ================= */
.topbar {
  height: 58px; background: var(--card);
  border-bottom: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; gap: 16px;
  position: sticky; top: 0; z-index: 30;
}
.page-title { font-size: 19px; font-weight: 700; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.proj-picker {
  display: flex; align-items: center; gap: 8px;
  background: var(--gray-soft); border-radius: 9px; padding: 5px 10px;
}
.pp-label { font-size: 12px; color: var(--ink-2); }
.proj-picker select {
  border: none; background: transparent; font-size: 13px; font-weight: 600;
  color: var(--ink); outline: none; max-width: 220px; cursor: pointer;
}
.user-chip {
  position: relative; display: flex; align-items: center; gap: 8px;
  cursor: pointer; padding: 4px 6px; border-radius: 9px;
}
.user-chip:hover { background: var(--gray-soft); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--side); color: var(--brand);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}
.user-name { font-weight: 600; font-size: 13px; }
.role-tag {
  font-size: 11px; background: var(--brand-soft); color: #946c00;
  border-radius: 5px; padding: 2px 6px;
}
.user-drop {
  display: none; position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow);
  min-width: 140px; overflow: hidden; z-index: 50;
}
.user-chip.open .user-drop { display: block; }
.ud-item {
  display: block; width: 100%; text-align: left;
  padding: 10px 14px; border: none; background: none;
  font-size: 13px; cursor: pointer; color: var(--ink);
}
.ud-item:hover { background: var(--gray-soft); }
.ud-item.danger { color: var(--red); }

/* ================= 按钮 ================= */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--card);
  color: var(--ink); border-radius: 9px;
  padding: 7px 14px; font-size: 13px; cursor: pointer;
  transition: filter .12s, background .12s, border-color .12s;
  white-space: nowrap; line-height: 1.4;
}
.btn:hover { background: var(--gray-soft); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 600; }
.btn.primary:hover { background: var(--brand-deep); border-color: var(--brand-deep); filter: none; }
.btn.danger { color: var(--red); border-color: #f3c2c2; }
.btn.danger:hover { background: var(--red-soft); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--gray-soft); }
.btn.sm { padding: 4px 10px; font-size: 12px; border-radius: 7px; }
.btn.block { width: 100%; justify-content: center; padding: 10px; font-size: 14px; }
.btn svg { width: 15px; height: 15px; }

/* ================= 表单 ================= */
.f-label { display: block; font-size: 12.5px; color: var(--ink-2); margin: 12px 0 5px; }
.f-input, .f-select, .f-textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 9px;
  padding: 8px 11px; font-size: 13.5px; font-family: inherit;
  background: var(--card); color: var(--ink); outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.f-input:focus, .f-select:focus, .f-textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(247, 181, 0, .18);
}
.f-textarea { min-height: 120px; resize: vertical; font-family: var(--mono); font-size: 12.5px; }
.f-row { display: flex; gap: 12px; }
.f-row > * { flex: 1; }
.f-hint { font-size: 12px; color: var(--ink-3); margin-top: 5px; line-height: 1.6; }
.f-check { display: flex; align-items: center; gap: 7px; font-size: 13px; margin-top: 10px; cursor: pointer; }
.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.toolbar .f-select, .toolbar .f-input { width: auto; }
.toolbar .f-input { min-width: 210px; }
.toolbar .grow { flex: 1; }
.toolbar .count { font-size: 12.5px; color: var(--ink-2); }

/* ================= 卡片 ================= */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 20px;
}
.card + .card { margin-top: 16px; }
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.card-title .sub { font-size: 12px; color: var(--ink-3); font-weight: 400; margin-left: 4px; }
.grid { display: grid; gap: 16px; }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1100px) { .grid.cols-4 { grid-template-columns: repeat(2, 1fr); } .grid.cols-3 { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .grid.cols-4, .grid.cols-2 { grid-template-columns: 1fr; } }

/* 统计卡 */
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat .s-label { font-size: 12.5px; color: var(--ink-2); }
.stat .s-value { font-size: 26px; font-weight: 800; line-height: 1.1; }
.stat .s-value small { font-size: 13px; color: var(--ink-3); font-weight: 400; margin-left: 3px; }
.stat .s-extra { font-size: 12px; color: var(--ink-2); display: flex; gap: 10px; }
.bar-track { height: 6px; border-radius: 4px; background: var(--gray-soft); overflow: hidden; margin-top: 4px; }
.bar-fill { height: 100%; border-radius: 4px; background: var(--brand); transition: width .3s; }
.bar-fill.green { background: var(--green); }
.bar-fill.red { background: var(--red); }
.bar-fill.blue { background: var(--blue); }
.bar-fill.gray { background: var(--ink-3); }

/* ================= 表格 ================= */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; font-weight: 600; color: var(--ink-2);
  font-size: 12.5px; padding: 9px 10px; background: #fafafb;
  border-bottom: 1px solid var(--line-2); white-space: nowrap;
}
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tbody tr:hover { background: #fafbfc; }
.tbl tbody tr.selected { background: var(--brand-soft); }
.tbl .mono { font-family: var(--mono); font-size: 12px; }
.tbl .dim { color: var(--ink-3); }
.tbl .actions { display: flex; gap: 6px; white-space: nowrap; }
.tbl .link { color: var(--blue); cursor: pointer; }
.tbl .link:hover { text-decoration: underline; }
.empty { text-align: center; color: var(--ink-3); padding: 36px 0; font-size: 13px; }

/* 徽标 */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; border-radius: 6px; padding: 2.5px 8px; white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-online { background: var(--green-soft); color: var(--green); }
.st-offline { background: var(--gray-soft); color: var(--ink-2); }
.st-maintenance { background: var(--amber-soft); color: var(--amber); }
.st-planned { background: var(--blue-soft); color: var(--blue); }
.tag { display: inline-block; background: var(--gray-soft); color: var(--ink-2); border-radius: 5px; padding: 2px 7px; font-size: 12px; }
.tag.type { background: var(--blue-soft); color: var(--blue); }

/* 分页 */
.pager { display: flex; align-items: center; gap: 10px; justify-content: flex-end; padding-top: 14px; font-size: 12.5px; color: var(--ink-2); }
.pager .btn { padding: 4px 10px; font-size: 12px; }

/* ================= 标签页 ================= */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; background: var(--card); padding: 6px; border-radius: 10px; box-shadow: var(--shadow); width: fit-content; }
.tabs button {
  border: none; background: transparent; padding: 7px 14px; font-size: 13px;
  border-radius: 7px; cursor: pointer; color: var(--ink-2);
}
.tabs button:hover { color: var(--ink); }
.tabs button.active { background: var(--brand); color: var(--brand-ink); font-weight: 600; }

/* ================= 弹窗 ================= */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 18, 24, .45);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 6vh 16px; z-index: 100; overflow: auto;
}
.modal {
  background: var(--card); border-radius: 14px; box-shadow: var(--shadow);
  width: 520px; max-width: 100%; animation: pop .16s ease;
}
.modal.wide { width: 780px; }
.modal.narrow { width: 420px; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 12px; border-bottom: 1px solid var(--line-2);
}
.modal-head h3 { font-size: 15.5px; }
.modal-close { border: none; background: none; cursor: pointer; color: var(--ink-3); font-size: 20px; line-height: 1; padding: 4px; }
.modal-close:hover { color: var(--ink); }
.modal-body { padding: 6px 20px 18px; max-height: 70vh; overflow: auto; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 12px 20px 16px; border-top: 1px solid var(--line-2);
}

/* ================= Toast ================= */
#toastRoot { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: #23252b; color: #fff; font-size: 13px;
  padding: 10px 18px; border-radius: 10px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 8px;
  animation: pop .18s ease;
}
.toast.success { background: #14532d; }
.toast.error { background: #7f1d1d; }
.toast.warn { background: #713f12; }

/* ================= 地图视图 ================= */
.map-page { display: flex; gap: 14px; height: calc(100vh - 58px - 52px); min-height: 480px; }
.map-stage {
  flex: 1; min-width: 0; position: relative;
  background: #eceff3; border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.map-banner {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  z-index: 20; background: rgba(23, 24, 29, .82); color: #ffd54d;
  font-size: 12px; padding: 6px 14px; border-radius: 999px; pointer-events: none;
}
.map-floorbar {
  position: absolute; top: 12px; left: 12px; z-index: 20;
  display: flex; gap: 4px; background: rgba(255,255,255,.92);
  padding: 4px; border-radius: 10px; box-shadow: var(--shadow);
}
.map-floorbar button {
  border: none; background: transparent; padding: 5px 12px; font-size: 12.5px;
  border-radius: 7px; cursor: pointer; color: var(--ink-2);
}
.map-floorbar button.active { background: var(--brand); color: var(--brand-ink); font-weight: 600; }
.map-toggles {
  position: absolute; top: 12px; right: 12px; z-index: 20;
  background: rgba(255,255,255,.94); border-radius: 10px; box-shadow: var(--shadow);
  padding: 8px 12px; display: flex; flex-direction: column; gap: 5px; font-size: 12.5px;
}
.map-toggles label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.map-legend {
  position: absolute; bottom: 12px; right: 12px; z-index: 20;
  background: rgba(255,255,255,.94); border-radius: 10px; box-shadow: var(--shadow);
  padding: 8px 12px; font-size: 12px; display: flex; flex-direction: column; gap: 4px;
}
.map-legend .lg { display: flex; align-items: center; gap: 6px; color: var(--ink-2); }
.map-legend .lg i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.map-statusbar {
  position: absolute; bottom: 12px; left: 12px; z-index: 20;
  background: rgba(23,24,29,.78); color: #e5e7eb; font-size: 12px;
  border-radius: 8px; padding: 5px 10px; display: flex; gap: 12px;
}
.map-nav {
  position: absolute; bottom: 46px; left: 12px; z-index: 21;
  width: 300px; background: rgba(255,255,255,.97); border-radius: 12px;
  box-shadow: var(--shadow); padding: 12px 14px;
}
.map-nav h4 { font-size: 13.5px; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.map-nav .f-select { font-size: 12.5px; padding: 6px 9px; }
.map-nav .nrow { display: flex; gap: 8px; margin-top: 8px; }
.map-nav .steps { max-height: 180px; overflow: auto; margin-top: 10px; font-size: 12.5px; }
.map-nav .step { display: flex; gap: 8px; padding: 4px 0; border-bottom: 1px dashed var(--line-2); color: var(--ink-2); }
.map-nav .step b { color: var(--ink); font-weight: 600; }
.map-nav .step .fl { flex: none; }
.map-side {
  width: 312px; flex: none; background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden;
}
.map-side .ms-head { padding: 14px 16px 8px; display: flex; align-items: center; justify-content: space-between; }
.map-side .ms-head h3 { font-size: 14.5px; }
.map-side .ms-head .count { font-size: 12px; color: var(--ink-3); }
.map-side .ms-search { padding: 0 12px 10px; }
.map-side .ms-search .f-input { padding: 7px 10px; font-size: 12.5px; }
.map-side .ms-list { flex: 1; overflow: auto; padding: 0 8px 10px; }
.ms-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: 9px; cursor: pointer;
}
.ms-item:hover { background: var(--gray-soft); }
.ms-item.active { background: var(--blue-soft); }
.ms-item .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.ms-item .t { flex: 1; min-width: 0; }
.ms-item .t b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-item .t span { font-size: 11.5px; color: var(--ink-3); }
.ms-item .q { font-size: 11px; color: var(--ink-3); font-family: var(--mono); }
.map-popup {
  position: absolute; z-index: 40; width: 250px;
  background: var(--card); border-radius: 12px; box-shadow: var(--shadow);
  padding: 12px 14px; animation: pop .15s ease;
}
.map-popup h4 { font-size: 14px; margin-bottom: 6px; padding-right: 18px; }
.map-popup .x { position: absolute; right: 10px; top: 8px; border: none; background: none; cursor: pointer; color: var(--ink-3); font-size: 16px; }
.map-popup .kv { font-size: 12px; color: var(--ink-2); display: flex; gap: 6px; padding: 1.5px 0; }
.map-popup .kv b { color: var(--ink); font-weight: 500; }
.map-popup .acts { display: flex; gap: 8px; margin-top: 9px; }

/* 示意底图（MockMap） */
.mockmap { position: absolute; inset: 0; cursor: default; }
.mockmap svg { width: 100%; height: 100%; display: block; }
.mm-zone-label { font-size: 11px; fill: #8a8f98; font-family: var(--font); }
.mm-grid { stroke: #1f2329; stroke-opacity: .05; }
.mm-mk { cursor: pointer; }
.mm-mk text { font-size: 10.5px; fill: #374151; font-family: var(--font); paint-order: stroke; stroke: rgba(255,255,255,.9); stroke-width: 3px; }
.mm-mk.hidden-label text { display: none; }
.mm-mk.focus circle.core, .mm-mk.focus rect.core { stroke-width: 3; }
@keyframes mm-pulse { 0% { stroke-opacity: .9; r: 8; } 100% { stroke-opacity: 0; r: 18; } }
.mm-pulse { animation: mm-pulse 1.1s ease-out 2; fill: none; stroke: var(--blue); stroke-width: 2.5; }
/* 路径：参考蜂鸟导航样式（绿线 + 白衬 + 深绿方向箭头 + 起/终徽标） */
.mm-route { fill: none; stroke: #16a34a; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.mm-route-case { fill: none; stroke: rgba(255,255,255,.95); stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; }
.mm-route-dim { fill: none; stroke: #16a34a; stroke-opacity: .3; stroke-width: 3.5; stroke-dasharray: 5 5; }
.mm-route-badge text { font-family: var(--font); }
.mm-dot { fill: var(--brand); stroke: #fff; stroke-width: 2; }

/* ================= 登录页 ================= */
.login-body {
  background: radial-gradient(1200px 600px at 20% -10%, #2a2c35 0%, transparent 60%),
              radial-gradient(900px 500px at 110% 110%, #2a2415 0%, transparent 55%),
              #141519;
  min-height: 100vh;
}
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.login-card {
  width: 400px; max-width: 100%;
  background: #1d1f26; border: 1px solid #2b2e37;
  border-radius: 18px; padding: 34px 34px 24px;
  color: #d7dae0; box-shadow: 0 24px 70px rgba(0, 0, 0, .45);
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.login-title { color: #fff; font-size: 18px; font-weight: 700; letter-spacing: .5px; }
.login-sub { font-size: 10px; letter-spacing: 3px; color: #8b8f99; margin-top: 3px; }
.login-mode {
  display: inline-block; font-size: 12px; color: #ffd54d;
  background: rgba(247, 181, 0, .12); border: 1px solid rgba(247, 181, 0, .3);
  padding: 4px 10px; border-radius: 999px; margin: 12px 0 4px;
}
.login-card .f-label { color: #9aa0ab; }
.login-card .f-input {
  background: #16181d; border-color: #2e313b; color: #f3f4f6;
}
.login-card .f-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(247, 181, 0, .18); }
.login-err { color: #ff8f8f; font-size: 12.5px; min-height: 18px; margin-top: 10px; }
.login-card .btn.primary { margin-top: 8px; }
.login-foot { text-align: center; font-size: 11.5px; color: #6d717c; margin-top: 18px; }

/* ================= 日志 ================= */
.kv-json { font-family: var(--mono); font-size: 12px; background: #fafafb; border-radius: 8px; padding: 8px 10px; white-space: pre-wrap; word-break: break-all; }
.log-detail { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 设置页两栏 */
.settings-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.set-section { margin-bottom: 10px; }
.set-hint { font-size: 12.5px; color: var(--ink-2); line-height: 1.8; background: var(--brand-soft); border-radius: 9px; padding: 10px 14px; margin-bottom: 14px; }
.set-hint code { font-family: var(--mono); background: rgba(0,0,0,.05); border-radius: 4px; padding: 0 4px; }

/* 自检结果 */
.st-line { display: flex; align-items: flex-start; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line-2); font-size: 13px; }
.st-line .ok { color: var(--green); flex: none; }
.st-line .fail { color: var(--red); flex: none; }
.st-line .detail { color: var(--red); font-size: 12px; }
.st-line .ms { margin-left: auto; color: var(--ink-3); font-size: 11.5px; flex: none; }

/* 滚动条 */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #d3d6dc; border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #b9bdc5; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ================= 移动端适配（P2-12，2026-11-18） =================
   现场场景：工人带手机查信标/看地图/比对结果。≤768px 平板竖屏起步，
   ≤480px 手机全量适配。要点：侧栏转顶部横条、地图占满宽、点位列表下沉、
   触控目标 ≥40px、表格横向滚动、弹窗不溢出。 */
@media (max-width: 768px) {
  .layout { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: static;
    flex-direction: row; align-items: center; gap: 4px;
    padding: 8px 10px; overflow-x: auto; overflow-y: hidden;
  }
  .sidebar .brand { padding: 0 8px 0 0; flex: none; }
  .sidebar .brand-text span { display: none; }          /* 副标题藏起省宽度 */
  .sidebar .brand-text b { font-size: 13px; white-space: nowrap; }
  .sidebar .menu-group { display: none; }
  .sidebar nav.menu { display: flex; flex-direction: row; gap: 2px; }
  .sidebar nav.menu a {
    padding: 9px 11px; font-size: 12.5px; white-space: nowrap;
    border-radius: 9px; flex: none;
  }
  .sidebar nav.menu a .mi { margin-right: 4px; }
  .sidebar-foot { display: none; }

  .topbar { height: 52px; padding: 0 12px; gap: 10px; }
  .page-title { font-size: 16.5px; }
  .content { padding: 12px 12px 28px; }

  /* 触控目标 ≥40px */
  .btn { padding: 9px 14px; min-height: 40px; }
  .f-input, .f-select, input.f-input { min-height: 40px; }

  /* 地图页：地图占满宽在上，规划面板/点位列表下沉在下 */
  .map-page { flex-direction: column; height: auto; min-height: 0; }
  .map-stage { flex: none; height: 54vh; min-height: 340px; }
  .map-side { width: 100%; max-height: 42vh; }
  /* 规划面板已由 JS 移出地图（断点双向归位），这里只改排版 */
  .map-nav {
    position: static; width: auto; max-height: none; overflow: visible;
    margin: 0; background: var(--card);
  }
  .map-floorbar { max-width: calc(100% - 24px); overflow-x: auto; top: 8px; }
  .map-toggles { padding: 6px 8px; top: 8px; max-width: 46%; }
  .map-toggles label { font-size: 11.5px; gap: 3px; }
  .map-toggles .btn { padding: 4px 7px; min-height: 0; font-size: 11px; border-radius: 7px; }
  .map-legend { display: none; }                        /* 手机上让位给地图 */

  /* 弹窗不溢出 */
  .modal { max-width: 94vw; }
  .modal-body { max-height: 72vh; }

  /* 卡片/表格 */
  .card { padding: 14px 14px; }
  .tbl th, .tbl td { padding: 10px 8px; }
}

@media (max-width: 480px) {
  .sidebar .brand-text b { max-width: 96px; overflow: hidden; text-overflow: ellipsis; }
  .sidebar nav.menu a { padding: 9px 9px; font-size: 12px; }
  .topbar { flex-wrap: wrap; height: auto; padding: 8px 12px; row-gap: 6px; }
  .page-title { font-size: 15.5px; }
  .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr 1fr; }
  .map-stage { height: 48vh; }
}
