:root {
  --ink: #1e2a2e;
  --muted: #5c6a6d;
  --line: #dfe3de;
  --paper: #e4e7e1;
  --panel: #fff;
  --primary: #0f5b57;
  --primary-dark: #0c3f3c;
  --accent: #c46d2b;
  --danger: #b4463f;
  --topbar: #12302e;
  --topbar-2: #0c2523;
  --shadow: 0 18px 44px rgba(20, 40, 38, 0.12);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--ink);
  font-family: "Helvetica Neue", "PingFang SC", "Microsoft YaHei", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper);
  font-variant-numeric: tabular-nums;
}
button, input, select, textarea { font: inherit; }
button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 11px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  white-space: nowrap;
}
button:hover { border-color: #98a7b7; }
button:disabled { opacity: .55; cursor: wait; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
  outline: none;
}
input, select { height: 34px; padding: 0 9px; }
textarea { min-height: 84px; max-height: 150px; padding: 9px; line-height: 1.45; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(18,106,124,.12); }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
.protocol-guard { display: none; }
.file-mode .workspace { display: none; }
.file-mode .protocol-guard {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background: var(--paper);
}
.protocol-guard > div {
  width: min(560px,100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  background: #fff;
  box-shadow: var(--shadow);
}
.protocol-guard h1 { margin: 5px 0 12px; font-size: 25px; }
.protocol-guard p { color: var(--muted); line-height: 1.65; }
.protocol-guard > div > p:first-child { color: var(--accent); font-size: 12px; font-weight: 850; }
.protocol-guard code { display: block; margin-top: 14px; padding: 12px; color: var(--primary-dark); background: #eef7f7; overflow-wrap: anywhere; }

.workspace { display: grid; grid-template-rows: auto auto minmax(0,1fr); height: 100vh; min-height: 680px; background: #f4f5f2; }
.topbar {
  display: grid;
  grid-template-columns: auto minmax(0,1fr);
  gap: 18px;
  align-items: center;
  border-bottom: 1px solid #0c2523;
  padding: 10px 18px;
  background: var(--topbar);
  color: #eef2ee;
  z-index: 3;
}
.brand {
  display: grid;
  align-content: center;
  min-width: 188px;
  padding-right: 18px;
  border-right: 1px solid rgba(255,255,255,.14);
}
.brand p, .panel-head p, .export-panel header p { margin-bottom: 2px; color: var(--accent); font-size: 11px; font-weight: 850; text-transform: uppercase; }
.topbar .brand p { color: #8fb7b0; letter-spacing: .06em; }
.brand h1 { font-size: 18px; line-height: 1.1; white-space: nowrap; }
.top-controls { display: grid; grid-template-columns: 120px minmax(180px,1fr) 94px 96px 104px 116px; gap: 9px; align-items: end; }
.top-controls > button {
  min-width: 0;
  height: 38px;
  padding: 0 14px;
  white-space: nowrap;
  line-height: 1;
  font-size: 13px;
  font-weight: 820;
}
#newProject { border-color: rgba(255,255,255,.24); color: #eef2ee; background: transparent; }
#newProject:hover { border-color: #7fd8c9; color: #7fd8c9; background: rgba(127,216,201,.08); }
.field { display: grid; gap: 5px; color: #3d4656; font-size: 12px; font-weight: 760; }
.topbar .field { color: #7fa9a2; }
.topbar select,
.topbar input {
  color: #eef2ee;
  border-color: rgba(255,255,255,.16);
  background: var(--topbar-2);
}
.topbar select:disabled {
  color: #b9cbc7;
  opacity: 1;
}
.scheme-status {
  display: grid;
  grid-template-columns: auto auto minmax(100px,1fr);
  gap: 7px;
  align-items: center;
  min-height: 34px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 7px;
  padding: 0 8px;
  background: var(--topbar-2);
}
.scheme-status span { color: #7fa9a2; font-size: 11px; font-weight: 760; }
.scheme-status strong, .code { color: var(--primary); font-weight: 900; }
.topbar .scheme-status strong { color: #f0c76a; }
.scheme-status input { height: 29px; border: 0; padding: 0 3px; box-shadow: none; }
.scheme-popover {
  position: relative;
  color: var(--ink);
}
.scheme-popover summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 7px;
  color: #eef2ee;
  background: rgba(255,255,255,.05);
  font-size: 13px;
  font-weight: 820;
  list-style: none;
  cursor: pointer;
}
.scheme-popover summary::-webkit-details-marker { display: none; }
.scheme-popover summary strong {
  display: inline-grid;
  place-items: center;
  min-width: 21px;
  height: 21px;
  border-radius: 11px;
  color: #0c3f3c;
  background: #dff4ef;
  font-size: 11px;
}
.scheme-popover[open] summary { border-color: #7fd8c9; color: #7fd8c9; background: rgba(127,216,201,.08); }
.scheme-popover-panel {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  z-index: 8;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 28px));
  max-height: calc(100vh - 118px);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8faf7;
  box-shadow: 0 24px 60px rgba(20,40,38,.24);
}
.scheme-popover-panel .field { color: #3d4656; }
.scheme-popover-panel input,
.scheme-popover-panel select {
  color: var(--ink);
  border-color: var(--line);
  background: #fff;
}
.scheme-popover-panel .scheme-list { max-height: 420px; }
.primary, .ghost { border-color: transparent; color: #fff; font-weight: 820; }
.primary { background: linear-gradient(135deg, #1c9c8e, var(--primary)); }
.primary:hover { background: var(--primary-dark); }
.ghost { background: var(--accent); }
.danger-text { color: var(--danger); }
.danger-button { border-color: var(--danger); color: #fff; background: var(--danger); }

.channel-bar {
  display: grid;
  grid-template-columns: 150px minmax(0,1fr);
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 7px 14px;
  background: #eef1ec;
}
.channel-label { display: flex; gap: 7px; align-items: baseline; }
.channel-label span { font-size: 13px; font-weight: 850; }
.channel-label small { color: var(--muted); font-size: 11px; }
.channel-controls { display: flex; gap: 10px; align-items: center; min-width: 0; overflow-x: auto; scrollbar-width: thin; scrollbar-color: #aab7c5 transparent; }
.channel-group { display: flex; gap: 7px; align-items: center; min-width: max-content; }
.main-channels { flex: 1 1 auto; }
.exception-channels { flex: 0 0 auto; position: relative; min-width: 218px; padding-left: 14px; }
.exception-channels::before { content: ""; position: absolute; left: 0; top: 3px; bottom: 3px; width: 1px; background: #cfd8d3; }
.insight-channel { position: relative; flex: 0 0 auto; padding-left: 14px; }
.insight-channel::before { content: ""; position: absolute; left: 0; top: 3px; bottom: 3px; width: 1px; background: #cfd8d3; }
.exception-label { flex: 0 0 auto; color: #9a4d19; font-size: 10px; font-weight: 850; letter-spacing: .04em; white-space: nowrap; }
.insight-channel .exception-label { color: #287c78; }
.insight-channel-button { display: flex; gap: 7px; align-items: center; min-width: 134px; height: 36px; border-color: #b9d4d1; color: #37645f; background: #f8fcfb; font-size: 12px; font-weight: 800; }
.insight-channel-button.active { border-color: #287c78; color: #fff; background: #287c78; }
.insight-channel-icon { display: grid; place-items: center; width: 21px; height: 21px; border: 2px solid currentColor; border-radius: 50%; font-size: 12px; }
.insight-channel-button b { min-width: 20px; border-radius: 10px; padding: 2px 5px; color: #287c78; background: #e4f2f0; font-size: 10px; }
.insight-channel-button.active b { color: #194e4a; background: #fff; }
.channel-control { display: grid; grid-template-columns: minmax(0,1fr) 32px; flex: 0 0 160px; min-width: 160px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; box-shadow: 0 1px 2px rgba(20,40,38,.04); }
.channel-led-mobile-route { flex-basis: 190px; min-width: 190px; }
.exception-channels .channel-control { flex-basis: 204px; min-width: 204px; }
.exception-channels .channel-name { overflow: visible; text-overflow: clip; }
.channel-control.active { border-color: var(--channel); box-shadow: inset 3px 0 var(--channel), 0 4px 14px -10px var(--channel); }
.channel-control button { min-width: 0; min-height: 34px; border: 0; border-radius: 0; padding: 0 8px; }
.channel-tab { display: flex; align-items: center; gap: 6px; overflow: hidden; color: var(--muted); font-size: 13px; font-weight: 780; white-space: nowrap; text-overflow: ellipsis; }
.channel-control.active .channel-tab { color: var(--channel); }
.channel-icon { display: inline-grid; place-items: center; flex: 0 0 22px; width: 22px; height: 22px; border-radius: 6px; color: #fff; background: var(--channel); }
.channel-icon svg { width: 15px; height: 15px; }
.channel-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.channel-count { display: inline-grid; place-items: center; flex: 0 0 auto; min-width: 20px; height: 20px; border-radius: 10px; color: var(--channel); background: color-mix(in srgb,var(--channel) 12%,white); font-size: 11px; }
.visibility { border-left: 1px solid var(--line) !important; color: #9aa6b5; }
.visibility.shown { color: var(--channel); }
.eye-mark {
  display: inline-block;
  width: 11px;
  height: 11px;
  overflow: hidden;
  color: transparent;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: transparent;
}
.visibility.shown .eye-mark { background: currentColor; box-shadow: 0 0 0 4px color-mix(in srgb,var(--channel) 14%,transparent); }

.layout { display: grid; grid-template-columns: minmax(620px,1fr) 360px; gap: 10px; min-height: 0; padding: 10px; }
.editor-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.editor-panel { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #aab7c5 transparent; }
.resource-editor-body { display: contents; }
.led-route-panel { display: grid; align-content: start; gap: 12px; min-height: 0; }
.led-route-panel[hidden] { display: none; }
.route-planner-intro { display: grid; gap: 3px; border: 1px solid #ead7c5; border-radius: 7px; padding: 10px 11px; color: #754018; background: #fff8f1; }
.route-planner-intro strong { font-size: 13px; }
.route-planner-intro small, .led-route-panel .field small { color: var(--muted); font-size: 10px; font-weight: 500; }
.route-draw-actions { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 7px; }
.route-draft-status { display: grid; gap: 3px; border: 1px solid #d9e2df; border-radius: 7px; padding: 10px 11px; background: #f7faf9; }
.route-draft-status strong { font-size: 13px; }
.route-draft-status small { color: var(--muted); font-size: 10px; line-height: 1.45; }
.route-draft-status.drawing { border-color: #d7ad88; color: #754018; background: #fff8f1; }
.route-generate { width: 100%; }
.led-route-panel textarea { min-height: 90px; resize: vertical; }
.panel-head, .section-title, .field-row { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.panel-head h2 { font-size: 17px; }
.task-status { min-height: 20px; color: var(--muted); font-size: 11px; line-height: 1.45; }
#addItems[aria-busy="true"] { color: #fff; background: #627975; cursor: progress; }
.batch-report { display: grid; flex: 0 0 auto; gap: 6px; border: 1px solid #d8e3df; border-radius: 7px; padding: 8px; background: #f5f8f7; }
.batch-report-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.batch-report-head strong { color: var(--ink); font-size: 11px; }
.batch-report-head span { color: var(--muted); font-size: 10px; }
.batch-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 4px; }
.batch-metrics span { display: grid; gap: 1px; border-right: 1px solid #dce5e2; color: var(--muted); font-size: 9px; text-align: center; }
.batch-metrics span:last-child { border-right: 0; }
.batch-metrics b { color: var(--primary-dark); font-size: 14px; }
.batch-report > p, .batch-report details p { color: var(--muted); font-size: 10px; line-height: 1.45; overflow-wrap: anywhere; }
.batch-report details { border-top: 1px solid #e1e8e5; padding-top: 5px; }
.batch-report details summary { color: #8a4b12; font-size: 10px; font-weight: 780; cursor: pointer; }
.batch-report .batch-warning summary { color: var(--danger); }
.count, .status { display: inline-grid; place-items: center; min-width: 30px; height: 28px; border-radius: 14px; color: var(--primary-dark); background: #e7f3ef; font-size: 12px; font-weight: 850; }
.status { min-width: 52px; padding: 0 9px; }
.status.dirty { color: #9a4d19; background: #fff0e4; }
.status.warning { color: #b42318; background: #fee4e2; }
.search-box { display: grid; grid-template-columns: minmax(0,1fr) 58px; gap: 6px; }
.scheme-list { display: grid; align-content: start; gap: 8px; min-height: 0; overflow: auto; padding-right: 3px; scrollbar-width: thin; scrollbar-color: #aab7c5 transparent; }
.scheme-card { border: 1px solid var(--line); border-radius: 7px; padding: 10px; background: #fff; }
.scheme-card h3 { margin: 3px 0 4px; overflow-wrap: anywhere; font-size: 14px; }
.scheme-card p, .library-empty, .empty-state { color: var(--muted); font-size: 12px; line-height: 1.45; }
.card-actions { display: grid; grid-template-columns: repeat(3,1fr); gap: 5px; margin-top: 8px; }
.card-actions button { min-height: 30px; padding: 0 5px; font-size: 12px; }
.library-empty, .empty-state { border: 1px dashed #b9c5d2; border-radius: 7px; padding: 18px 12px; text-align: center; }

.map-stage { position: relative; min-height: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #dfe8e9; box-shadow: var(--shadow); }
#map { position: relative; width: 100%; height: 100%; min-height: 430px; }
#map.is-picking,
#map.is-drawing-fence,
#map.is-drawing-route { cursor: crosshair; }
#map.is-picking::after {
  content: "点击地图放置人工点位";
  position: absolute;
  left: 50%;
  top: 56px;
  z-index: 20;
  transform: translateX(-50%);
  border-radius: 999px;
  padding: 8px 13px;
  color: #fff;
  background: rgba(18,48,46,.92);
  font-size: 12px;
  font-weight: 800;
  pointer-events: none;
  box-shadow: 0 8px 22px rgba(20,40,38,.18);
}
#map.is-drawing-fence::after {
  content: attr(data-draw-hint);
  position: absolute;
  left: 50%;
  top: 56px;
  z-index: 20;
  transform: translateX(-50%);
  border-radius: 999px;
  padding: 8px 13px;
  color: #fff;
  background: rgba(154,77,11,.94);
  font-size: 12px;
  font-weight: 800;
  pointer-events: none;
  box-shadow: 0 8px 22px rgba(80,45,10,.22);
}
#map.is-drawing-route::after {
  content: attr(data-route-hint);
  position: absolute;
  left: 50%;
  top: 56px;
  z-index: 20;
  transform: translateX(-50%);
  border-radius: 999px;
  padding: 8px 13px;
  color: #fff;
  background: rgba(117,64,24,.94);
  font-size: 12px;
  font-weight: 800;
  pointer-events: none;
  box-shadow: 0 8px 22px rgba(20,40,38,.18);
}
.map-route-control-marker.draft { border-style: dashed; background: #d8843f; }
.map-load-error {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  height: 100%;
  min-height: 430px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
  background: #eef3f3;
}
.map-load-error h2 { color: var(--ink); font-size: 20px; }
.map-load-error p { max-width: 360px; font-size: 13px; line-height: 1.6; }
.map-toolbar { position: absolute; top: 10px; right: 10px; display: flex; max-width: calc(100% - 20px); gap: 5px; justify-content: flex-end; flex-wrap: wrap; z-index: 2; }
.map-toolbar button { color: var(--muted); background: rgba(255,255,255,.95); font-weight: 760; box-shadow: 0 4px 14px rgba(31,41,55,.12); backdrop-filter: blur(5px); }
.map-toolbar button.active { border-color: var(--primary); color: #fff; background: var(--primary); }
.map-route-control-marker { display: grid; place-items: center; width: 30px; height: 30px; border: 3px solid #fff; border-radius: 50%; color: #fff; background: #a85b21; box-shadow: 0 3px 10px rgba(77,42,17,.3); }
.map-route-control-marker b { font-size: 11px; line-height: 1; }
#drawFence.active { border-color: #d97706; background: #d97706; }
#drawFence b { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 3px; border-radius: 9px; color: #9a4d0b; background: #fff1d6; font-size: 10px; }
#drawFence.active b { color: #d97706; background: #fff; }
.base-layer-toggle {
  display: flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255,255,255,.95);
  box-shadow: 0 4px 14px rgba(31,41,55,.12);
}
.base-layer-toggle button {
  min-height: 34px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.base-layer-toggle button + button { border-left: 1px solid var(--line); }
.map-summary { position: absolute; right: 64px; bottom: 12px; left: auto; display: flex; width: min(560px,calc(100% - 78px)); border: 1px solid rgba(255,255,255,.22); border-radius: 8px; color: #cfe0da; background: rgba(18,48,46,.92); box-shadow: 0 8px 24px rgba(20,40,38,.2); backdrop-filter: blur(8px); pointer-events: none; }
.map-summary div { display: flex; flex: 1 1 0; gap: 5px; align-items: baseline; justify-content: center; min-width: 0; padding: 6px 9px; border-right: 1px solid rgba(223,227,222,.45); }
.map-summary div:last-child { border-right: 0; }
.map-summary strong { color: #fff; font-size: 16px; }
.map-summary span { overflow: hidden; color: #8fb7b0; font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }

.button-grid { display: grid; grid-template-columns: 1fr 88px; gap: 7px; }
.field-row { min-height: 34px; font-size: 12px; font-weight: 760; }
.range-wrap { flex: 1; }
input[type="range"] { height: 26px; padding: 0; accent-color: var(--primary); box-shadow: none; }
.radius-row { display: grid; grid-template-columns: auto minmax(80px,1fr) 72px auto; gap: 7px; align-items: center; }
.radius-number { min-width: 0; height: 30px; padding: 4px 7px; text-align: right; }
.radius-row button { min-height: 30px; padding: 0 7px; font-size: 11px; white-space: nowrap; }
.section-title h3 { font-size: 14px; }
.section-actions { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.section-actions button { min-height: 29px; padding: 0 7px; font-size: 11px; }
.tag-cloud { display: flex; align-content: flex-start; align-items: flex-start; flex: 1 1 auto; gap: 6px; flex-wrap: wrap; min-height: 84px; overflow: auto; padding: 2px 3px 3px 0; scrollbar-width: auto; scrollbar-color: #9eacba #eef2f5; }
.resource-tag { display: inline-flex; gap: 6px; align-items: center; min-height: 30px; max-width: 100%; padding: 0 9px 0 7px; overflow: hidden; border-color: color-mix(in srgb,var(--tag) 28%,var(--line)); color: #243237; background: color-mix(in srgb,var(--tag) 7%,white); font-size: 12px; font-weight: 730; white-space: nowrap; text-overflow: ellipsis; }
.resource-tag span { display: inline-grid; place-items: center; flex: 0 0 auto; width: 19px; height: 19px; border-radius: 5px; color: #fff; background: var(--tag); }
.resource-tag svg { width: 13px; height: 13px; }
.pending-box { display: flex; flex: 0 0 auto; flex-direction: column; min-height: 0; border: 1px solid #ecccae; border-radius: 7px; background: #fff9f2; overflow: hidden; }
.pending-box[open] { flex: 0 0 auto; min-height: 0; max-height: none; }
.pending-box summary { padding: 8px 10px; color: #9a4d19; font-size: 12px; font-weight: 800; cursor: pointer; }
.pending-box[open] #pendingList { display: block; max-height: min(42vh, 360px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #d2a77c transparent; }
.pending-group { border-top: 1px solid #f1d9c3; }
.pending-group-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 10px 4px; }
.pending-group-head strong { color: #73390f; font-size: 12px; }
.pending-group-head button { min-height: 27px; font-size: 11px; }
.pending-summary { margin: 0 10px 5px; border-radius: 6px; padding: 6px 8px; color: #8a4b12; background: #fff0de; font-size: 11px; line-height: 1.45; }
.pending-item { border-top: 1px solid #f1d9c3; padding: 9px 10px; }
.pending-item strong, .pending-item p, .pending-item small { display: block; margin-bottom: 4px; font-size: 11px; }
.pending-item p, .pending-item small { color: var(--muted); }
.pending-item .pending-timeout-note { color: #9a4d19; }
.pending-item div { display: flex; gap: 5px; }
.pending-item > div:last-child { flex-wrap: wrap; }
.pending-item button { min-height: 27px; font-size: 11px; }
.pending-item .candidate-list { display: grid; gap: 4px; margin: 7px 0; }
.candidate-list button { height: auto; min-height: 30px; padding: 5px 7px; overflow-wrap: anywhere; text-align: left; }
.detail-card { flex: 0 0 auto; max-height: 112px; overflow: auto; border-top: 1px solid var(--line); padding-top: 9px; }
.detail-card h3 { margin-bottom: 4px; font-size: 13px; }
.detail-card p { color: var(--muted); font-size: 11px; line-height: 1.5; }
.assist-tools { display: grid; gap: 7px; border: 1px solid #d8e8e3; border-radius: 7px; padding: 8px; color: var(--primary-dark); background: #f4faf8; }
.assist-tools > div:first-child { display: grid; gap: 2px; }
.assist-tools strong { font-size: 11px; }
.assist-tools small { color: var(--muted); font-size: 10px; line-height: 1.35; }
.assist-tool-actions { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px; }
.assist-tools button { min-height: 30px; padding: 0 9px; font-size: 11px; }
.item-modal.community-assist-modal { display: grid; grid-template-rows: auto auto minmax(0,1fr); width: min(600px,calc(100vw - 32px)); height: min(580px,calc(100vh - 40px)); max-height: calc(100vh - 40px); gap: 8px; padding: 16px; overflow: hidden; }
.resource-list-modal { display: grid; grid-template-rows: auto auto minmax(0,1fr); width: min(760px,calc(100vw - 32px)); height: min(620px,calc(100vh - 40px)); max-height: calc(100vh - 40px); overflow: hidden; }
.resource-list-modal header p { margin-bottom: 2px; color: var(--accent); font-size: 10px; font-weight: 850; }
.resource-list-head { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.resource-list-head .modal-meta { min-width: 0; }
.resource-list-cloud { align-content: flex-start; min-height: 0; overflow-y: auto; border-top: 1px solid var(--line); padding-top: 12px; }
.community-assist-modal header { padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.community-assist-modal header p { color: var(--accent); font-size: 10px; font-weight: 850; }
.community-assist-modal header h2 { margin-top: 2px; font-size: 20px; }
.community-assist-modal .modal-meta { overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.4; white-space: nowrap; text-overflow: ellipsis; }
.community-assist-body { min-height: 0; overflow: hidden; }
.assist-result { display: flex; flex-direction: column; gap: 10px; height: 100%; min-width: 0; min-height: 0; }
.assist-empty, .assist-loading { border: 0; border-radius: 7px; padding: 18px; color: var(--muted); background: #f5f7f6; font-size: 12px; line-height: 1.55; }
.assist-empty strong { display: block; margin-bottom: 3px; color: var(--ink); }
.assist-empty button { margin-top: 8px; }
.assist-summary { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.assist-summary strong { font-size: 13px; }
.assist-summary span { color: var(--muted); font-size: 10px; }
.assist-selection-tools { display: flex; gap: 8px; align-items: center; justify-content: space-between; border-radius: 7px; padding: 7px 9px; background: #edf5f2; }
.assist-selection-tools label { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 10px; }
.assist-selection-tools input { width: 15px; height: 15px; }
.assist-selection-tools button { min-height: 28px; padding: 0 10px; font-size: 10px; }
.assist-stop { display: grid; gap: 4px; border: 1px solid #c9e2dc; border-radius: 7px; padding: 10px; background: #f2faf8; }
.assist-stop strong { color: var(--primary-dark); font-size: 14px; }
.assist-stop > span { display: block; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.35; white-space: nowrap; text-overflow: ellipsis; }
.assist-stop-list { display: grid; flex: 1 1 auto; align-content: start; gap: 2px; min-height: 0; overflow-y: auto; margin: 0; padding: 0 5px 0 0; list-style: none; scrollbar-width: thin; scrollbar-color: #bdc7c5 transparent; }
.assist-stop-list li { display: grid; grid-template-columns: 42px minmax(0,1fr); align-items: stretch; border-bottom: 1px solid #edf0ed; background: #fff; }
.assist-stop-list li.selected { border-radius: 6px; border-bottom-color: transparent; background: #fff4e8; box-shadow: inset 3px 0 #c46d2b; }
.assist-stop-check { display: grid; place-items: center; align-content: center; gap: 2px; border-right: 1px solid #edf0ed; color: var(--muted); font-size: 8px; cursor: pointer; }
.assist-stop-check input { width: 15px; height: 15px; }
.assist-stop-list li > button { display: grid; grid-template-columns: 22px minmax(0,1fr) auto; gap: 8px; align-items: center; width: 100%; min-height: 46px; border: 0; border-radius: 0; padding: 7px 8px; background: transparent; text-align: left; }
.assist-stop-list li > button:hover { background: #f6f8f7; }
.assist-stop-index { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: #fff; background: #b86627; font-size: 10px; font-weight: 800; }
.assist-stop-copy { display: grid; min-width: 0; gap: 2px; }
.assist-stop-list strong { overflow: hidden; color: var(--ink); font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.assist-stop-list small { overflow: hidden; color: var(--muted); font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.assist-stop-list em { border-radius: 99px; padding: 3px 6px; color: var(--primary); background: #e8f5f1; font-size: 9px; font-style: normal; font-weight: 800; white-space: nowrap; }
.assist-stop-list.compact { max-height: 214px; }
.assist-distance { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 5px 8px; align-items: baseline; margin-top: 5px; }
.assist-distance b { color: var(--muted); font-size: 10px; font-weight: 700; }
.assist-distance em { color: var(--primary); font-size: 13px; font-style: normal; font-weight: 850; }
.assist-success { align-self: center; color: var(--primary); font-size: 11px; font-weight: 760; }
.assist-error { color: var(--danger); font-size: 11px; }
.assist-actions { display: flex; flex: 0 0 auto; gap: 7px; align-items: center; justify-content: flex-end; margin-top: auto; border-top: 1px solid var(--line); padding-top: 10px; }
.assist-actions button { min-height: 32px; padding: 0 12px; font-size: 11px; }
.assist-delete-community { order: -1; margin-right: auto; border-color: transparent; color: var(--danger); background: transparent; }
.assist-delete-community:hover { border-color: #e6c4c1; background: #fff7f6; }
.assist-calculate, .assist-add { min-width: 112px; }

.map-bus-suggestion-marker { position: relative; display: grid; place-items: center; width: 32px; height: 32px; border: 2px dashed #b86627; border-radius: 50%; background: rgba(255,247,235,.96); box-shadow: 0 3px 10px rgba(113,65,24,.24); color: #b86627; }
.map-bus-suggestion-marker span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #fff; }
.map-bus-suggestion-marker svg { width: 16px; height: 16px; }
.map-bus-suggestion-marker b { position: absolute; right: -5px; top: -6px; min-width: 16px; height: 16px; border: 2px solid #fff; border-radius: 99px; padding: 0 3px; background: #b86627; color: #fff; font-size: 10px; line-height: 12px; text-align: center; }
.map-poi-insight-marker { display: grid; place-items: center; width: 28px; height: 28px; border: 2px solid #fff; border-radius: 50% 50% 50% 7px; color: #fff; background: var(--poi); box-shadow: 0 4px 12px rgba(25,45,44,.28); transform: rotate(-45deg); }
.map-poi-insight-marker span { font-size: 11px; font-weight: 900; transform: rotate(45deg); }
.poi-map-list { position: absolute; z-index: 91; left: 12px; top: 58px; display: grid; grid-template-rows: auto minmax(0,1fr); width: 300px; max-height: calc(100% - 132px); border: 1px solid rgba(31,67,66,.22); border-radius: 7px; background: rgba(255,255,255,.96); box-shadow: 0 12px 28px rgba(27,48,47,.18); backdrop-filter: blur(8px); }
.poi-map-list[hidden] { display: none; }
.poi-map-list header { display: flex; gap: 8px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 9px 10px; }
.poi-map-list header > div { display: grid; gap: 1px; min-width: 0; }
.poi-map-list header strong { font-size: 12px; }
.poi-map-list header small { color: var(--muted); font-size: 9px; }
.poi-map-list header button { min-height: 26px; padding: 0 8px; font-size: 9px; }
.poi-map-list-body { min-height: 0; overflow: auto; padding: 6px; scrollbar-gutter: stable; }
.poi-map-list-group + .poi-map-list-group { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 7px; }
.poi-map-list-group-head { position: sticky; z-index: 1; top: -6px; display: flex; align-items: center; justify-content: space-between; padding: 5px 6px; color: var(--poi); background: rgba(255,255,255,.97); font-size: 9px; }
.poi-map-list-group-head strong { font-size: 10px; }
.poi-map-list-group-head span { min-width: 20px; border-radius: 99px; padding: 2px 5px; color: #fff; background: var(--poi); text-align: center; }
.poi-map-list-selection { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 3px 4px; border-radius: 6px; padding: 6px 7px; color: var(--muted); background: #edf5f2; font-size: 9px; }
.poi-map-list-selection label { display: flex; align-items: center; gap: 5px; cursor: pointer; }
.poi-map-list-selection input { width: 14px; height: 14px; }
.poi-map-list-row { display: grid; grid-template-columns: 42px minmax(0,1fr); border-bottom: 1px solid #edf0ee; }
.poi-map-list-row.selected { border-radius: 5px; background: color-mix(in srgb,var(--poi) 8%,white); box-shadow: inset 3px 0 var(--poi); }
.poi-map-list-row.added { background: #f7f8f7; }
.poi-map-list-row:not(:has(.poi-map-list-check)) { grid-template-columns: minmax(0,1fr); }
.poi-map-list-check { display: grid; place-items: center; align-content: center; gap: 1px; border-right: 1px solid #edf0ee; color: var(--muted); font-size: 8px; cursor: pointer; }
.poi-map-list-check input { width: 14px; height: 14px; }
.poi-map-list-check:has(input:disabled) { color: var(--primary); cursor: default; }
.poi-map-list-item { display: grid; grid-template-columns: 24px minmax(0,1fr); gap: 7px; align-items: center; width: 100%; min-height: 42px; border: 0; border-bottom: 1px solid #edf0ee; border-radius: 0; padding: 6px 5px; background: transparent; text-align: left; }
.poi-map-list-item:hover { background: color-mix(in srgb,var(--poi) 7%,white); }
.poi-map-list-item > span { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 5px; color: #fff; background: var(--poi); font-size: 9px; font-weight: 900; }
.poi-map-list-item > div { display: grid; min-width: 0; gap: 2px; }
.poi-map-list-item strong, .poi-map-list-item small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.poi-map-list-item strong { color: var(--ink); font-size: 10px; }
.poi-map-list-item small { color: var(--muted); font-size: 8px; }
.poi-map-list-bulk-action { position: sticky; bottom: -6px; padding: 7px 4px 3px; background: rgba(255,255,255,.97); }
.poi-map-list-bulk-action button { width: 100%; min-height: 31px; font-size: 10px; }
.poi-map-list-empty, .poi-map-list-limit { padding: 12px 8px; color: var(--muted); font-size: 9px; line-height: 1.5; text-align: center; }
.poi-map-list-limit { display: flex; align-items: center; justify-content: center; gap: 8px; }
.poi-map-list-limit button { border: 1px solid #b9cec8; border-radius: 999px; padding: 3px 8px; color: #176b5c; background: #f4faf8; font: inherit; cursor: pointer; }
.poi-map-list.collapsed { width: 154px; grid-template-rows: auto; }
.poi-map-list.collapsed .poi-map-list-body { display: none; }
.map-context-menu { position: absolute; z-index: 120; display: grid; gap: 7px; width: 220px; border: 1px solid #d9c5aa; border-radius: 7px; padding: 9px; background: #fffdf9; box-shadow: 0 14px 34px rgba(42,34,24,.24); }
.map-context-menu strong { overflow: hidden; color: var(--ink); font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.map-context-menu button { min-height: 30px; font-size: 11px; }

.map-fence-label { display: grid; gap: 1px; width: 128px; min-height: 44px; border: 1px solid rgba(217,119,6,.72); border-radius: 7px; padding: 5px 8px; color: #6f3a08; background: rgba(255,252,245,.95); box-shadow: 0 6px 18px rgba(78,45,12,.2); text-align: left; white-space: normal; }
.map-fence-label strong,
.map-fence-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-fence-label strong { font-size: 11px; }
.map-fence-label span { color: #9a5b1c; font-size: 9px; }

.modal-dialog, .export-dialog { border: 0; border-radius: 8px; padding: 0; box-shadow: 0 28px 80px rgba(25,35,45,.28); }
.modal-dialog::backdrop, .export-dialog::backdrop { background: rgba(21,29,38,.48); }
.item-modal, .confirm-modal { display: grid; gap: 14px; width: min(430px,calc(100vw - 32px)); padding: 18px; }
.item-modal header, .export-panel header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.item-modal h2, .confirm-modal h2, .export-panel h2 { font-size: 18px; }
.icon-button { width: 34px; padding: 0; font-size: 21px; }
.modal-meta { color: var(--muted); font-size: 12px; line-height: 1.5; }
.modal-meta:has(.item-route-list) { display: grid; gap: 7px; border-top: 1px solid var(--line); padding-top: 11px; }
.item-meta-label { color: var(--ink); font-size: 11px; font-weight: 850; }
.item-route-list { display: flex; flex-wrap: wrap; gap: 6px; }
.item-route-list > span { border: 1px solid #c9ddda; border-radius: 5px; padding: 4px 7px; color: #285d58; background: #f2f8f7; font-size: 11px; line-height: 1.25; }
.item-coordinate { color: var(--muted); font-size: 10px; }
.fence-modal header p { margin-bottom: 2px; color: #b45e0b; font-size: 10px; font-weight: 850; }
.fence-modal .modal-meta { border-radius: 7px; padding: 9px 10px; color: #7a4b1a; background: #fff6e6; }
.poi-insight-panel { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.insight-area-card { display: grid; gap: 9px; border: 1px solid #c8dcd9; border-radius: 7px; padding: 10px; background: #f3f9f8; }
.insight-area-card > div:first-child { display: grid; gap: 3px; }
.insight-area-card strong { font-size: 13px; }
.insight-area-card small, .insight-section-head small { color: var(--muted); font-size: 10px; line-height: 1.4; }
.insight-area-actions { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px; }
.insight-area-actions button { min-height: 30px; font-size: 11px; }
.insight-section-head { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.insight-section-head > div { display: grid; gap: 2px; }
.insight-section-head strong { font-size: 12px; }
.insight-section-head button { min-height: 28px; font-size: 10px; }
.poi-category-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
.poi-category-item { display: grid; grid-template-columns: 16px 26px minmax(0,1fr); gap: 7px; align-items: center; min-width: 0; border: 1px solid var(--line); border-radius: 7px; padding: 7px; background: #fff; cursor: pointer; }
.poi-category-item.selected { border-color: color-mix(in srgb,var(--poi) 58%,white); background: color-mix(in srgb,var(--poi) 7%,white); }
.poi-category-item input { width: 15px; height: 15px; }
.poi-category-symbol { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; color: #fff; background: var(--poi); font-size: 10px; font-weight: 900; }
.poi-category-copy { display: grid; min-width: 0; gap: 1px; }
.poi-category-copy strong { overflow: hidden; font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
.poi-category-copy small { color: var(--muted); font-size: 9px; }
.insight-search { width: 100%; min-height: 34px; }
.poi-insight-detail { display: grid; gap: 6px; margin-top: auto; border-top: 1px solid var(--line); padding-top: 10px; }
.poi-insight-detail > strong { font-size: 12px; }
.poi-insight-detail p { color: var(--muted); font-size: 10px; line-height: 1.45; overflow-wrap: anywhere; }
.poi-insight-detail button { margin-top: 2px; min-height: 31px; font-size: 11px; }
.poi-detail-head { display: flex; gap: 8px; align-items: center; }
.poi-detail-head > span { display: grid; place-items: center; flex: 0 0 28px; width: 28px; height: 28px; border-radius: 7px; color: #fff; background: var(--poi); font-size: 11px; font-weight: 900; }
.poi-detail-head > div { display: grid; min-width: 0; gap: 1px; }
.poi-detail-head small { color: var(--muted); font-size: 9px; }
.poi-detail-head strong { overflow: hidden; font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; }
.export-dialog { width: min(1500px,calc(100vw - 30px)); max-height: calc(100vh - 30px); background: #f4f5f2; }
.export-panel { display: grid; grid-template-rows: auto auto auto minmax(0,1fr) auto; gap: 12px; width: 100%; max-height: calc(100vh - 30px); padding: 18px; }
.export-options { display: flex; gap: 7px; flex-wrap: wrap; }
.export-options label { display: flex; gap: 6px; align-items: center; border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; font-size: 12px; font-weight: 740; }
.export-options input { width: 16px; height: 16px; }
.export-options span { width: 8px; height: 8px; border-radius: 50%; background: var(--swatch); }
.export-options strong { color: var(--muted); }
.export-status { min-height: 32px; border-radius: 7px; padding: 8px 10px; color: var(--muted); background: #f3f6f8; font-size: 12px; }
.export-previews { display: grid; grid-template-columns: minmax(0,1fr); gap: 16px; min-height: 0; overflow: auto; }
.export-preview { display: grid; gap: 8px; align-content: start; }
.export-preview img { display: block; width: 100%; border: 1px solid var(--line); border-radius: 8px; background: #f3f6f8; box-shadow: 0 10px 30px rgba(20,40,38,.1); }

.amap-marker-label { border: 0 !important; border-radius: 13px !important; padding: 3px 7px !important; color: #fff !important; background: var(--primary) !important; font-weight: 800; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.map-media-marker {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #fff;
  border: 3px solid #fff;
  border-radius: 12px;
  background: var(--marker);
  box-shadow: 0 8px 20px rgba(20,40,38,.22);
}
.map-media-marker::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 14px;
  height: 14px;
  border-right: 3px solid #fff;
  border-bottom: 3px solid #fff;
  background: var(--marker);
  transform: translateX(-50%) rotate(45deg);
}
.map-media-marker.no-coverage {
  border-radius: 50%;
  box-shadow: 0 0 0 7px rgba(212,56,47,.16), 0 8px 20px rgba(120,30,24,.24);
}
.map-media-marker.no-coverage::after { display: none; }
.map-media-marker.no-coverage .map-marker-icon svg { width: 24px; height: 24px; }
.map-marker-icon { position: relative; z-index: 1; display: grid; place-items: center; }
.map-marker-icon svg { width: 20px; height: 20px; }
.map-marker-number {
  position: absolute;
  right: -9px;
  bottom: -9px;
  z-index: 2;
  display: grid;
  place-items: center;
  min-width: 21px;
  height: 21px;
  padding: 0 5px;
  border: 2px solid #fff;
  border-radius: 12px;
  color: var(--marker);
  background: #fff;
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 3px 9px rgba(20,40,38,.18);
}

@media (max-width: 1160px) {
  .workspace { height: auto; min-height: 100vh; }
  .topbar { grid-template-columns: 1fr; gap: 9px; }
  .top-controls { grid-template-columns: 120px minmax(260px,1fr) 104px 104px 112px; }
  .channel-bar { grid-template-columns: 1fr; }
  .layout { grid-template-columns: minmax(0,1fr) minmax(300px,36vw); grid-template-rows: minmax(570px,70vh); }
  .map-stage, .editor-panel { min-width: 0; }
  .editor-panel { min-height: 0; }
}

@media (max-width: 560px) {
  .workspace { display: block; }
  .topbar { position: static; padding: 12px; }
  .brand h1 { font-size: 22px; }
  .top-controls { grid-template-columns: 1fr 1fr; }
  .scheme-status { grid-column: 1 / -1; order: 2; }
  .compact-field { grid-column: 1 / -1; }
  .channel-bar { padding: 10px 12px; }
  .channel-label small { display: none; }
  .channel-controls { display: flex; overflow-x: auto; }
  .channel-control { flex: 0 0 160px; min-width: 160px; }
  .exception-channels .channel-control { flex-basis: 204px; min-width: 204px; }
  .layout { display: flex; flex-direction: column; padding: 8px; }
  .scheme-popover { order: 2; min-height: 0; }
  .map-stage { order: 1; height: 58vh; min-height: 480px; }
  .poi-map-list { left: 8px; top: 54px; width: min(250px,calc(100% - 76px)); max-height: 210px; }
  .editor-panel { order: 3; min-height: 470px; }
  .map-summary { right: 54px; width: calc(100% - 66px); }
  .map-summary div { padding-right: 5px; padding-left: 5px; }
  .map-summary strong { font-size: 14px; }
  .export-previews { grid-template-columns: 1fr; }
}
