:root{
  --bg:#eef2f8; --card:#fff; --line:#e0e6ef; --ink:#16202f; --muted:#6b7a90;
  --accent:#14539a; --accent-soft:#e9f1fb; --shadow:0 1px 2px rgba(22,40,80,.05),0 8px 24px -18px rgba(22,40,80,.35);
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;background:var(--bg);color:var(--ink);
  font:14px/1.5 "Segoe UI","Microsoft YaHei",system-ui,-apple-system,sans-serif;
  -webkit-font-smoothing:antialiased;
}
.layout{display:flex;gap:14px;height:100vh;padding:14px}

/* 左侧窗口 */
.panel{flex:0 0 330px;width:330px;display:flex;flex-direction:column;gap:12px;overflow-y:auto;padding-right:2px}
.brand{padding:2px 4px 0}
.brand h1{margin:0;font-size:19px;letter-spacing:.2px}
.brand p{margin:3px 0 0;color:var(--muted);font-size:12px}
.card{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:14px;box-shadow:var(--shadow)}
.card h2{margin:0 0 12px;font-size:13.5px;font-weight:600;display:flex;align-items:center;gap:8px}
.idx{width:18px;height:18px;border-radius:50%;background:var(--accent);color:#fff;font-size:11px;display:grid;place-items:center;flex:0 0 auto}

.drop{display:flex;flex-direction:column;gap:7px;align-items:center;justify-content:center;text-align:center;
  border:2px dashed #9ed3bd;border-radius:12px;background:#effaf4;padding:18px 12px;cursor:pointer;transition:.18s}
.drop:hover,.drop.over{border-color:#0f7d5f;background:#e2f6ec;transform:translateY(-1px)}
.drop-icon{width:36px;height:36px;border-radius:50%;background:#0f7d5f;color:#fff;display:grid;place-items:center;
  font-size:20px;font-weight:700;line-height:1;box-shadow:0 5px 12px -5px rgba(15,125,95,.9)}
.drop strong{font-size:22px;font-weight:800;color:#0b6b52;letter-spacing:1.5px;line-height:1.2}
.drop-sub{font-size:12px;color:#5b8a7a}
.btn{width:100%;margin-top:10px;padding:8px 10px;border-radius:9px;border:1px solid transparent;font:inherit;font-size:13px;cursor:pointer;transition:.18s}
.btn.ghost{background:#f4f7fc;border-color:var(--line);color:#33425a}
.btn.ghost:hover{background:var(--accent-soft);border-color:#bfd3ea;color:var(--accent)}
.fileinfo{margin:10px 0 0;font-size:11.5px;color:var(--muted);word-break:break-all;line-height:1.45}

/* 下拉多选 */
.select{position:relative}
.select-btn{width:100%;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:9px 12px;
  background:#f7f9fc;border:1px solid var(--line);border-radius:9px;font:inherit;font-size:13px;color:#2a3a52;cursor:pointer;text-align:left}
.select-btn:hover{border-color:#bfd3ea;background:var(--accent-soft)}
.select-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.caret{color:var(--muted);font-size:11px}
.select-pop{position:absolute;z-index:20;top:calc(100% + 6px);left:0;right:0;background:#fff;border:1px solid var(--line);
  border-radius:10px;box-shadow:0 12px 30px -12px rgba(22,40,80,.35);padding:10px}
.select-pop input[type=search]{width:100%;padding:8px 10px;border:1px solid var(--line);border-radius:8px;font:inherit;font-size:12.5px;outline:none}
.select-pop input[type=search]:focus{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
.pop-actions{display:flex;align-items:center;gap:10px;margin:8px 2px 6px}
.link{background:none;border:0;padding:0;color:var(--accent);font:inherit;font-size:12px;cursor:pointer}
.link:hover{text-decoration:underline}
.pop-count{margin-left:auto;font-size:11.5px;color:var(--muted)}
.sku-list{list-style:none;margin:0;padding:0;max-height:260px;overflow-y:auto}
.sku-list li{border-radius:7px}
.sku-list li:hover{background:#f5f8fd}
.sku-list label{display:flex;align-items:center;gap:8px;padding:6px 7px;cursor:pointer;font-size:12.5px}
.sku-list input{accent-color:var(--accent);width:14px;height:14px;flex:0 0 auto}
.sku-name{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:Consolas,"Courier New",monospace;font-size:12px}
.sku-badge{font-size:11px;color:var(--muted);background:#f1f4f9;border-radius:20px;padding:1px 7px;flex:0 0 auto}
.sku-empty{padding:10px 6px;font-size:12px;color:var(--muted);text-align:center}

/* 统计 */
.stats{margin:0;display:flex;flex-direction:column;gap:9px}
.stat{display:flex;align-items:center;justify-content:space-between;gap:10px;background:#f7f9fc;border:1px solid var(--line);border-radius:10px;padding:12px 14px}
.stat dt{display:flex;align-items:center;gap:8px;font-size:16px;font-weight:700;color:#1c2836;letter-spacing:.2px}
.stat dt .n{width:20px;height:20px;border-radius:50%;background:#e3edf9;color:var(--accent);font-size:11.5px;font-weight:700;display:grid;place-items:center;flex:0 0 auto}
.stat dd{margin:0;font-size:23px;font-weight:800;font-variant-numeric:tabular-nums;color:var(--accent);letter-spacing:.3px}
.stat:nth-child(3) dd{color:#0d7a5f}
.stat-extra{margin:10px 2px 0;font-size:11.5px;color:var(--muted);line-height:1.5}

/* 右侧窗口 */
.map-panel{flex:1;min-width:0;display:flex;flex-direction:column;background:var(--card);border:1px solid var(--line);
  border-radius:14px;box-shadow:var(--shadow);padding:14px 16px;overflow:hidden}
.map-head{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap;padding-bottom:8px}
.map-head h2{margin:0;font-size:15px}
.map-head p{margin:0;font-size:12px;color:var(--muted)}
.map-stage{position:relative;flex:1;min-height:0;display:grid;place-items:center}
.map-head{padding-bottom:10px}
#map{width:100%;height:100%;max-height:100%;display:block;user-select:none;touch-action:none;
  border:1.5px dashed #b9cbe2;border-radius:12px;background:#fafcff}

/* 地图右下角的清空按钮 */
.clear-btn{position:absolute;right:20px;bottom:16px;z-index:4;padding:8px 16px;border-radius:9px;
  border:1.5px solid #f0a9a4;background:#fff;color:#d92d20;font:inherit;font-size:14px;font-weight:800;
  letter-spacing:.5px;cursor:pointer;transition:.16s;box-shadow:0 4px 12px -8px rgba(217,45,32,.9)}
.clear-btn:hover{background:#fef2f2;border-color:#d92d20;box-shadow:0 6px 16px -8px rgba(217,45,32,.95)}
.clear-btn:active{transform:translateY(1px)}
.state{stroke:#fff;stroke-width:1;cursor:pointer;transition:fill .2s ease,stroke-width .12s}
.state:hover{stroke:#7fa6d4;stroke-width:1.6}
.state:focus{outline:none}
.state:focus-visible{outline:2.5px solid var(--accent);outline-offset:2px}
.state.selected{stroke:#7a3d00;stroke-width:2.6;filter:drop-shadow(0 0 3px rgba(246,166,9,.9))}
.marquee{fill:rgba(20,83,154,.10);stroke:var(--accent);stroke-width:1;stroke-dasharray:5 3;pointer-events:none}
.marquee[hidden]{display:none}
.label text{pointer-events:none;text-anchor:middle;dominant-baseline:central;paint-order:stroke;stroke:#fff;stroke-width:2.4px;stroke-linejoin:round}
.label .abbr{font-family:"Segoe UI",Arial,sans-serif;font-weight:700;fill:#16202f;letter-spacing:.2px}
.label .zh{font-family:"Microsoft YaHei","PingFang SC",sans-serif;fill:#3d4c63}
.leader{stroke:#93a7c0;stroke-width:.8;pointer-events:none}
.tooltip{position:absolute;left:0;top:0;z-index:6;pointer-events:none;background:rgba(15,24,38,.95);color:#fff;
  border-radius:9px;padding:9px 11px;font-size:12px;line-height:1.55;white-space:nowrap;box-shadow:0 10px 24px -12px rgba(0,0,0,.6)}
.tooltip b{font-size:13px}
.tooltip .tt-row{color:#c3d2e6}
.tooltip .tt-num{color:#7fc4ff;font-weight:650}
.legend{display:flex;align-items:center;gap:16px;flex-wrap:wrap;padding-top:10px;margin-top:6px;border-top:1px solid var(--line);font-size:11.5px;color:var(--muted)}
.legend .ticks{display:flex;align-items:center;gap:6px}
.legend .sw{width:22px;height:11px;border-radius:3px;border:1px solid rgba(255,255,255,.7)}
.legend .grp{display:flex;align-items:center;gap:5px}
.empty{position:absolute;inset:auto;padding:10px 16px;background:#fff;border:1px dashed #c3d2e6;border-radius:10px;
  color:var(--muted);font-size:12.5px}
.empty[hidden]{display:none}
@media (max-width:900px){.layout{flex-direction:column;height:auto}.panel{width:100%;flex:1 1 auto}.map-stage{min-height:420px}}