:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --border: #e6eaf0;
  --text: #1e2733;
  --muted: #7a8595;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #eaf1ff;
  --danger: #dc2626;
  --ok: #0f9d58;
  --warn: #b45309;
  --sidebar: #111827;
  --sidebar-sub: #9ca3af;
  --shadow: 0 2px 12px rgba(16, 24, 40, 0.05);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif; }
.hidden { display: none !important; }
button { font: inherit; cursor: pointer; }
input, select { font: inherit; border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px; background: #fff; color: var(--text); outline: none; }
input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }

/* ============ 登录 ============ */
.login-page { position: fixed; inset: 0; display: grid; place-items: center; z-index: 50; overflow: hidden; }
.login-bg { position: absolute; inset: 0; background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 45%, #3b82f6 100%); }
.login-bg::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 20% 20%, rgba(255,255,255,.12), transparent 40%), radial-gradient(circle at 80% 80%, rgba(255,255,255,.1), transparent 35%); }
.login-box { position: relative; width: min(420px, calc(100vw - 32px)); background: #fff; border-radius: 18px; padding: 40px 36px 30px; box-shadow: 0 24px 70px rgba(0,0,0,.25); }
.login-brand { text-align: center; margin-bottom: 30px; }
.login-logo { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 18px; background: linear-gradient(135deg, #2563eb, #3b82f6); color: #fff; font-size: 36px; line-height: 64px; box-shadow: 0 10px 24px rgba(37,99,235,.3); }
.login-brand h1 { margin: 0; font-size: 22px; }
.login-brand p { margin: 6px 0 0; color: var(--muted); font-size: 12px; letter-spacing: .4px; }
.form-label { display: block; margin: 16px 0 8px; font-size: 13px; font-weight: 600; color: #4b5563; }
.input-wrap { position: relative; }
.input-wrap input { width: 100%; height: 46px; padding-left: 42px; }
.input-icon { position: absolute; left: 14px; top: 12px; font-size: 15px; opacity: .6; }
.login-error { min-height: 20px; margin-top: 10px; color: var(--danger); font-size: 12px; }
.login-submit { width: 100%; height: 46px; border: 0; border-radius: 10px; background: var(--primary); color: #fff; font-size: 15px; font-weight: 600; letter-spacing: 4px; }
.login-submit:hover { background: var(--primary-dark); }
.login-submit:disabled { opacity: .6; cursor: wait; }
.login-foot { margin-top: 20px; text-align: center; color: #9ca3af; font-size: 11px; }

/* ============ 布局 ============ */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 232px; flex-shrink: 0; background: var(--sidebar); color: #e5e7eb; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side-brand { display: flex; align-items: center; gap: 12px; padding: 22px 20px; border-bottom: 1px solid rgba(255,255,255,.07); }
.side-logo { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg, #2563eb, #3b82f6); color: #fff; font-size: 22px; line-height: 38px; text-align: center; flex-shrink: 0; }
.side-title { font-size: 14px; font-weight: 600; }
.side-sub { font-size: 11px; color: var(--sidebar-sub); }
.side-nav { flex: 1; padding: 12px 12px; overflow-y: auto; }
.nav-group { padding: 16px 12px 6px; font-size: 11px; color: #6b7280; letter-spacing: 1px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; font-size: 13px; color: #cbd5e1; cursor: pointer; margin-bottom: 2px; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; font-weight: 600; }
.nav-ico { width: 18px; text-align: center; font-size: 15px; }
.side-foot { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.07); font-size: 11px; color: var(--sidebar-sub); }
.side-status { display: flex; align-items: center; gap: 8px; }
.side-status .dot { width: 7px; height: 7px; border-radius: 50%; background: #f59e0b; }
.side-status .dot.ok { background: #22c55e; }
.side-version { margin-top: 6px; opacity: .6; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 64px; background: #fff; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 28px; position: sticky; top: 0; z-index: 10; }
.crumb { font-size: 14px; font-weight: 600; }
.top-actions { display: flex; align-items: center; gap: 16px; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--primary-light); color: var(--primary); font-size: 14px; font-weight: 700; display: grid; place-items: center; }
.user-meta { display: flex; flex-direction: column; line-height: 1.3; }
.user-name { font-size: 13px; font-weight: 600; }
.user-role { font-size: 11px; color: var(--muted); }
.btn-ghost { border: 1px solid var(--border); background: #fff; color: #4b5563; border-radius: 8px; padding: 7px 14px; font-size: 12px; }
.btn-ghost:hover { border-color: #b9c4d2; }
.btn-primary { border: 0; background: var(--primary); color: #fff; border-radius: 8px; padding: 9px 16px; font-size: 13px; font-weight: 600; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { opacity: .6; cursor: wait; }
.btn-danger { border: 0; background: #fff1f0; color: var(--danger); border-radius: 6px; padding: 5px 10px; font-size: 12px; }
.wide { width: 100%; }

.content { padding: 24px 28px 60px; flex: 1; }
.view { max-width: 1400px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; gap: 16px; }
.page-head h2 { margin: 0 0 4px; font-size: 19px; }
.page-head p { margin: 0; color: var(--muted); font-size: 12px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.card.pad { padding: 22px; }
.card-title { margin: 0 0 18px; font-size: 15px; }
.card-head { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h3 { margin: 0; font-size: 14px; }

/* 工作台 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 14px; }
.stat-ico { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; font-size: 20px; }
.stat-num { font-size: 26px; font-weight: 700; line-height: 1.1; }
.stat-label { color: var(--muted); font-size: 12px; margin-top: 2px; }
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.dash-types { padding: 8px 20px 18px; }
.dash-type-row { display: flex; align-items: center; padding: 12px 0; border-bottom: 1px solid #f1f3f6; }
.dash-type-row:last-child { border-bottom: 0; }
.dash-type-dot { width: 10px; height: 10px; border-radius: 50%; margin-right: 12px; }
.dash-type-name { flex: 1; font-size: 13px; }
.dash-type-count { color: var(--muted); font-size: 12px; margin-right: 14px; }
.quick-actions { padding: 16px 20px 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quick-item { text-align: left; border: 1px solid var(--border); background: #fafbfc; border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 2px; }
.quick-item:hover { border-color: var(--primary); background: var(--primary-light); }
.quick-item span { font-size: 20px; color: var(--primary); }
.quick-item b { font-size: 13px; margin-top: 4px; }
.quick-item small { color: var(--muted); font-size: 11px; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 16px; text-align: left; border-bottom: 1px solid var(--border); font-size: 12.5px; white-space: nowrap; }
th { background: #f8fafc; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
.right { text-align: right; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11px; background: #f1f3f6; color: var(--muted); }
.badge.dispatch { background: #e7f5ee; color: var(--ok); }
.badge.closed { background: #f3f4f6; color: #6b7280; }
.badge.pending { background: #fef3e2; color: var(--warn); }
.badge.verified { background: #e7f5ee; color: var(--ok); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; vertical-align: -1px; }

/* 导入 */
.two-col { display: grid; grid-template-columns: minmax(300px, 420px) 1fr; gap: 18px; }
.file-drop { border: 2px dashed #cbd5e1; border-radius: 10px; padding: 28px 16px; text-align: center; color: var(--muted); font-size: 13px; cursor: pointer; background: #fafbfc; }
.file-drop:hover, .file-drop.drag { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.file-drop-icon { font-size: 30px; color: var(--primary); margin-bottom: 8px; }
.radio-row { display: flex; gap: 20px; margin: 6px 0 20px; font-size: 13px; }
.radio-row label { display: flex; align-items: center; gap: 6px; }
.result-box { min-height: 150px; background: #f8fafc; border-radius: 8px; padding: 14px; font: 12px/1.7 Consolas, monospace; white-space: pre-wrap; word-break: break-all; }
.hint-box { margin-top: 16px; padding: 14px; background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; font-size: 12px; color: #92400e; }
.hint-box p { margin: 4px 0; }

/* 筛选/分页 */
.filter-bar { display: flex; gap: 10px; padding: 16px; flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.filter-bar input { min-width: 180px; }
.pager { display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: var(--muted); font-size: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 16px; }

/* 弹窗 */
.modal { position: fixed; inset: 0; background: rgba(15,23,42,.5); display: grid; place-items: center; z-index: 40; padding: 20px; }
.modal-box { width: min(460px, 100%); max-height: 90vh; overflow: auto; background: #fff; border-radius: 14px; padding: 22px; box-shadow: 0 24px 70px rgba(0,0,0,.2); }
.modal-box.wide { width: min(760px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-close { border: 0; background: none; font-size: 22px; color: var(--muted); line-height: 1; }
.form-row { display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: 12px; margin-bottom: 12px; }
.form-row label { color: var(--muted); font-size: 13px; }
.form-row .check { display: flex; align-items: center; gap: 6px; color: var(--text); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; margin-bottom: 16px; }
.kv div { background: #f8fafc; border-radius: 8px; padding: 8px 10px; font-size: 12px; }
.kv b { display: block; color: var(--muted); font-weight: 400; }
.toast { position: fixed; left: 50%; bottom: 36px; transform: translateX(-50%); background: #1f2937; color: #fff; padding: 10px 18px; border-radius: 8px; z-index: 60; font-size: 13px; }
@media (max-width: 900px) { .dash-grid, .two-col { grid-template-columns: 1fr; } .sidebar { width: 68px; } .side-title, .side-sub, .nav-group, .nav-item { font-size: 0; } .nav-ico { font-size: 16px; } .form-grid { grid-template-columns: 1fr; } }

/* ============ 类型级数据管理 ============ */
.btn-primary.sm { padding: 5px 12px; font-size: 12px; border-radius: 6px; }
.btn-primary.sm:hover { background: var(--primary-dark); }
.back-btn { margin-bottom: 10px; padding: 4px 10px; font-size: 12px; }
.head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.switch-check { display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font-size: 13px; cursor: pointer; user-select: none; }
.switch-check input { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.switch-check:hover { border-color: var(--primary); }
.photo-tip { padding: 16px 20px; margin-top: 4px; font-size: 12px; color: #4b5563; border-left: 3px solid #cbd5e1; }
.photo-tip.on { border-left-color: var(--primary); background: #f7faff; }
.photo-tip b { font-size: 13px; color: var(--text); }
.photo-tip p { margin: 6px 0 0; }
.date-range { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.date-range input { min-width: 132px; padding: 7px 10px; }
.pager-total { margin-left: auto; }
.muted { color: #9aa4b2; }
.thumb-row { display: inline-flex; align-items: center; gap: 4px; }
.thumb { width: 34px; height: 34px; border-radius: 6px; overflow: hidden; border: 1px solid var(--border); display: inline-block; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-more { font-size: 11px; color: var(--muted); }
.photo-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.photo-item { width: 104px; height: 78px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); display: block; }
.photo-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-empty { font-size: 12px; color: #9aa4b2; }
.badge.photo { background: #e0f2fe; color: #0284c7; }

/* ============ 类型弹窗：整体布局 ============ */
.modal-box.lg {
  width: min(1080px, 100%);
  padding: 0;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow: hidden;
}
.modal-box.lg .modal-head {
  padding: 18px 24px 16px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.mh-main h3 { margin: 0; font-size: 17px; }
.mh-sub { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.modal-box.lg .modal-body {
  padding: 0 24px 20px;
  overflow-y: auto;
  flex: 1;
  background: #f7f9fc;
}
.modal-box.lg .modal-actions {
  margin-top: 0;
  padding: 13px 24px;
  border-top: 1px solid var(--border);
  background: #fff;
  justify-content: space-between;
  align-items: center;
}
.ma-btns { display: flex; gap: 10px; }
.ma-summary { font-size: 12px; color: var(--muted); }

/* 基本信息：独立卡片 + 4 列网格 */
.form-sect {
  margin-top: 16px;
  padding: 16px 20px 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.sect-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sect-head .sect-title { margin: 0 0 12px; }
.sect-hint { font-size: 11.5px; color: #94a3b8; }
.sect-title { margin: 0 0 10px; font-size: 13px; font-weight: 700; color: #334155; }
.sect-title em, .form-label em { color: var(--danger); font-style: normal; }

.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 16px; }
.form-sect .form-grid { margin-bottom: 0; }
.fg-item { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fg-item .form-label { margin: 0; }
.fg-item input, .fg-item select { width: 100%; }
.fg-hint { font-size: 11px; color: #9aa4b2; line-height: 1.4; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }

/* 图标选择 */
.icon-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.icon-chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); background: #fff; border-radius: 8px;
  padding: 6px 10px; font-size: 11.5px; color: #4b5563; cursor: pointer;
}
.icon-chip .ico { width: 14px; text-align: center; color: #94a3b8; font-size: 13px; }
.icon-chip:hover { border-color: #b9c4d2; }
.icon-chip.on { border-color: var(--primary); background: var(--primary-light); color: var(--primary); font-weight: 600; }
.icon-chip.on .ico { color: var(--primary); }

/* 颜色选择 */
.color-picker { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.swatches { display: flex; gap: 6px; }
.sw {
  width: 24px; height: 24px; padding: 0; border-radius: 7px;
  border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); cursor: pointer;
}
.sw.on { border-color: #1e2733; }
.color-picker input[type="color"] { width: 34px; height: 28px; padding: 2px; border-radius: 8px; cursor: pointer; }
.color-picker .hex { width: 96px; padding: 6px 9px; font: 12px/1.4 Consolas, monospace; text-transform: lowercase; }

/* 两个开关卡片 */
.check-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.check-card {
  display: flex; align-items: flex-start; gap: 10px;
  border: 1px solid var(--border); border-radius: 10px;
  padding: 11px 14px; background: #fafbfd; cursor: pointer;
}
.check-card:hover { border-color: #b9c4d2; }
.check-card input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--primary); cursor: pointer; flex-shrink: 0; }
.check-card b { display: block; font-size: 13px; font-weight: 600; }
.check-card small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 1px; }
.check-card:has(input:checked) { border-color: var(--primary); background: var(--primary-light); }

/* ============ 字段设计 ============ */
.field-design { margin-top: 16px; padding: 16px 18px 14px; background: #fff; border: 1px solid var(--border); border-radius: 12px; }
.field-design .sect-title { margin-top: 0; margin-bottom: 0; }
.fd-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.fd-sub { margin: 5px 0 0; font-size: 12px; color: var(--muted); }
.fd-actions { display: flex; gap: 8px; flex-shrink: 0; }
.fd-tip { margin-top: 12px; padding: 10px 12px; border-radius: 8px; font-size: 12px; line-height: 1.7; background: #eef2f7; color: #475569; }
.fd-tip.warn { background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; }
.fd-tip.ok { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.fd-tip ul { margin: 6px 0 0; padding-left: 18px; }
.fd-empty {
  display: block; width: 100%; margin-top: 12px; padding: 24px 18px; text-align: center;
  font-size: 12.5px; color: #7a8595; border: 1.5px dashed #cbd5e1; border-radius: 10px;
  background: #fbfcfe; cursor: pointer;
}
.fd-empty:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.fd-table { margin-top: 12px; background: #fff; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.fd-table th { font-size: 11px; padding: 9px 8px; background: #f8fafc; }
.fd-table th.center, .fd-table td.center { text-align: center; }
.fd-table td { padding: 6px 8px; vertical-align: middle; }
.fd-table tr:hover td { background: #fbfcfe; }
.fd-table .idx { text-align: center; color: #94a3b8; font-size: 11px; }
.fd-input { width: 100%; padding: 6px 9px; font-size: 12px; border-radius: 6px; }
.fd-input.soft { color: #b0b8c4; }
.fd-input.soft:not(:placeholder-shown) { color: var(--text); }
.fd-input.soft:focus { color: var(--text); }
.fd-table .ops { display: flex; gap: 4px; justify-content: flex-end; }
.icon-btn {
  width: 26px; height: 26px; padding: 0; border: 1px solid var(--border); background: #fff;
  border-radius: 6px; color: #64748b; font-size: 12px; line-height: 1; display: grid; place-items: center;
}
.icon-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.icon-btn.danger:hover:not(:disabled) { border-color: var(--danger); color: var(--danger); background: #fff1f0; }
.icon-btn:disabled { opacity: .32; cursor: not-allowed; }
.fd-note { margin: 10px 0 0; font-size: 11px; color: #94a3b8; }
.field-count { display: inline-block; padding: 2px 8px; border-radius: 10px; background: var(--primary-light); color: var(--primary); font-size: 12px; cursor: help; }
input.readonly { background: #f1f5f9; color: var(--muted); cursor: not-allowed; }
.btn-danger.sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }

@media (max-width: 1080px) {
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-4 { grid-column: span 2; }
}
@media (max-width: 720px) {
  .form-grid, .check-cards { grid-template-columns: 1fr; }
  .span-2, .span-4 { grid-column: span 1; }
  .modal-box.lg .modal-body { padding: 0 14px 16px; }
}

/* ==================== 一张图 ==================== */
#view-map { max-width: none; }

.map-shell {
  display: flex;
  gap: 0;
  height: calc(100vh - 148px);
  min-height: 520px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* 左侧：筛选 + 图层 */
.map-panel {
  width: 268px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: #fbfcfe;
}
.map-panel-head { padding: 16px 16px 12px; border-bottom: 1px solid var(--border); }
.map-panel-head h3 { margin: 0 0 3px; font-size: 15px; }
.map-panel-head p { margin: 0; font-size: 12px; color: var(--muted); }

.map-filters { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.map-filters input { width: 100%; }
.map-filter-row { display: flex; gap: 8px; margin-top: 8px; }
.map-filter-row select { flex: 1; min-width: 0; padding: 7px 9px; font-size: 12px; }

.map-layer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px 6px; font-size: 12px; color: var(--muted); font-weight: 600;
}
.map-layer-tools { display: flex; gap: 10px; font-weight: 400; }
.map-layer-tools a { color: var(--primary); text-decoration: none; font-size: 12px; }
.map-layer-tools a:hover { text-decoration: underline; }

.map-layers { flex: 1; overflow-y: auto; padding: 0 8px 8px; }
.map-layer {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px; border-radius: 8px; cursor: pointer; font-size: 13px;
}
.map-layer:hover { background: #eef3fb; }
.map-layer input { flex: none; width: 14px; height: 14px; margin: 0; }
.map-layer-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.map-layer-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-layer-count { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.map-layer-empty { padding: 14px; font-size: 12px; color: var(--muted); }

.map-panel-foot {
  display: flex; gap: 8px; padding: 10px 14px;
  border-top: 1px solid var(--border); background: #fff;
}
.map-panel-foot .btn-ghost { flex: 1; }

/* 右侧：地图 */
.map-stage { position: relative; flex: 1; min-width: 0; background: #eef1f5; }
.map-canvas { position: absolute; inset: 0; }
.map-canvas.dimmed { opacity: .25; filter: grayscale(1); }

.map-status {
  position: absolute; left: 50%; top: 14px; transform: translateX(-50%);
  padding: 7px 14px; border-radius: 20px; background: rgba(17,24,39,.82);
  color: #fff; font-size: 12px; z-index: 30; pointer-events: none;
}

.map-legend {
  position: absolute; right: 14px; top: 14px; z-index: 20;
  background: rgba(255,255,255,.94); border: 1px solid var(--border);
  border-radius: 10px; padding: 9px 11px; box-shadow: var(--shadow);
  max-height: 60%; overflow-y: auto;
}
.map-legend-row { display: flex; align-items: center; gap: 7px; font-size: 12px; color: #34404f; line-height: 1.9; }
.map-legend-row i { width: 8px; height: 8px; border-radius: 50%; flex: none; }

/* 未配置 Key 时的引导层 */
.map-setup {
  position: absolute; inset: 0; z-index: 40;
  display: grid; place-items: center; padding: 24px;
  background: rgba(244,246,250,.92);
}
.map-setup-card {
  width: 100%; max-width: 520px; background: #fff;
  border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 12px 36px rgba(16,24,40,.12); padding: 24px 26px;
}
.map-setup-card h3 { margin: 0 0 8px; font-size: 16px; }
.map-setup-card p { margin: 0 0 12px; font-size: 13px; color: #4b5563; line-height: 1.7; }
.map-setup-card ol { margin: 0 0 16px; padding-left: 20px; font-size: 13px; color: #4b5563; line-height: 1.9; }
.map-setup-card ol a { color: var(--primary); }
.map-setup-field { display: block; margin-bottom: 12px; font-size: 12px; color: var(--muted); }
.map-setup-field input { display: block; width: 100%; margin-top: 5px; }
.map-setup-actions { display: flex; align-items: center; gap: 12px; }
.map-setup-msg { font-size: 12px; color: var(--danger); }

/* 点位信息窗：自绘卡片，固定在地图左上角（那一片没有图例/工具条/比例尺） */
.map-pop-card {
  position: absolute; left: 14px; top: 14px; z-index: 30;
  width: 272px; padding: 12px 14px 10px;
  background: #fff; border-radius: 10px;
  box-shadow: 0 8px 26px rgba(16, 24, 40, .18);
}
.map-pop-card.hidden { display: none; }
.map-pop-close {
  position: absolute; right: 6px; top: 5px; width: 22px; height: 22px;
  border: 0; background: transparent; border-radius: 6px;
  color: #8b95a3; font-size: 16px; line-height: 1; cursor: pointer;
}
.map-pop-close:hover { background: #f1f3f6; color: #1e2733; }
.map-pop { font-size: 13px; color: #1e2733; line-height: 1.6; }
.map-pop-title { font-weight: 600; font-size: 14px; margin-bottom: 5px; padding-right: 22px; }
.map-pop-row { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.map-pop-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.map-pop-addr { color: #5b6675; font-size: 12px; }
.map-pop-meta { color: var(--muted); font-size: 12px; }
.map-pop-state {
  margin-left: auto; padding: 1px 7px; border-radius: 9px;
  background: #fff3e0; color: #b45309; font-size: 11px;
}
.map-pop-state.ok { background: #e7f5ee; color: #0f9d58; }
.map-pop-links { display: flex; gap: 12px; margin-top: 8px; padding-top: 8px; border-top: 1px solid #eef0f3; }
.map-pop-links a { color: var(--primary); font-size: 12px; text-decoration: none; }
.map-pop-links a:hover { text-decoration: underline; }

@media (max-width: 980px) {
  .map-panel { width: 220px; }
  .map-shell { height: calc(100vh - 160px); }
}
