:root {
  --bg:#f8f6ef; --panel:#fffdf8; --ink:#173f36; --muted:#697873; --line:#dce3de;
  --green:#173f36; --green-2:#23695a; --green-soft:#eaf3ee; --orange:#c66a2b;
  --map:#e8f0f0; --danger:#a73b33; --shadow:0 18px 48px rgba(25,54,46,.16);
  --sans:"PingFang SC","Hiragino Sans GB","Microsoft YaHei",system-ui,sans-serif;
  --serif:"Songti SC","STSong","Noto Serif CJK SC",serif;
}
* { box-sizing:border-box; }
[hidden] { display:none !important; }
html,body { width:100%; height:100%; margin:0; overflow:hidden; background:var(--bg); color:var(--ink); font-family:var(--sans); }
button,input,select { font:inherit; }
button { min-height:44px; border:1px solid var(--line); border-radius:10px; padding:8px 12px; background:#fff; color:var(--ink); cursor:pointer; }
button:hover { border-color:#91aaa1; background:#f8fbf9; }
button:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible,a:focus-visible { outline:3px solid rgba(198,106,43,.55); outline-offset:2px; }
.skip-link { position:fixed; z-index:5000; left:16px; top:-60px; padding:10px 16px; border-radius:8px; background:#fff; color:var(--ink); }
.skip-link:focus { top:10px; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.app-shell { height:100dvh; display:flex; flex-direction:column; }
.topbar { z-index:1000; flex:0 0 60px; display:grid; grid-template-columns:276px minmax(420px,1fr) 118px; align-items:center; gap:18px; padding:0 18px; border-bottom:1px solid var(--line); background:rgba(255,253,248,.97); backdrop-filter:blur(14px); }
.brand { display:flex; align-items:center; gap:10px; color:var(--ink); text-decoration:none; min-width:0; }
.brand-mark { display:grid; place-items:center; width:34px; height:34px; border-radius:10px; background:var(--green); color:white; font-size:22px; }
.brand span:last-child { display:grid; min-width:0; }
.brand strong { font-size:17px; letter-spacing:.01em; }
.brand small { overflow:hidden; color:var(--muted); font-size:11px; text-overflow:ellipsis; white-space:nowrap; }
.mode-tabs { justify-self:center; display:grid; grid-template-columns:repeat(3,minmax(120px,170px)); gap:6px; padding:4px; border:1px solid var(--line); border-radius:13px; background:#f4f3ed; }
.mode-tabs button { min-height:42px; display:flex; align-items:center; justify-content:center; gap:7px; border:0; background:transparent; font-weight:720; }
.mode-tabs button[aria-current="page"] { background:var(--green); color:white; box-shadow:0 4px 12px rgba(23,63,54,.18); }
.compare-button { justify-self:end; border-color:#9eb8ae; font-weight:750; }
.compare-button span { display:inline-grid; place-items:center; min-width:22px; height:22px; margin-left:5px; border-radius:999px; background:var(--green); color:white; font-size:12px; }
.scope-banner { z-index:900; min-height:54px; display:flex; align-items:center; justify-content:space-between; gap:14px; padding:8px 18px; border-bottom:1px solid #c8dad1; background:#edf5ef; }
.scope-banner > div:first-child { display:flex; align-items:baseline; gap:10px; min-width:0; }
.scope-banner span { color:var(--muted); font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.scope-actions { display:flex; gap:8px; flex:0 0 auto; }
.scope-actions button { min-height:36px; padding:5px 10px; font-size:13px; }
.workspace { min-height:0; flex:1; display:grid; grid-template-columns:336px minmax(360px,1fr) 396px; }
.control-panel,.result-panel { min-width:0; overflow:auto; background:var(--panel); }
.control-panel { border-right:1px solid var(--line); padding:20px 18px 28px; }
.result-panel { display:flex; flex-direction:column; border-left:1px solid var(--line); }
.panel-loading,.empty-state { padding:28px 18px; color:var(--muted); line-height:1.6; text-align:center; }
.map-stage { position:relative; min-width:0; min-height:0; background:var(--map); }
#map { position:absolute; inset:0; background:var(--map); }
.map-status { position:absolute; z-index:650; top:14px; left:50%; max-width:min(440px,80%); transform:translateX(-50%); padding:8px 12px; border:1px solid rgba(87,112,104,.2); border-radius:999px; background:rgba(255,253,248,.94); box-shadow:0 5px 16px rgba(35,65,57,.1); color:var(--muted); font-size:12px; text-align:center; pointer-events:none; }
.map-status:empty { display:none; }
.legend { position:absolute; z-index:650; left:14px; bottom:18px; width:190px; padding:10px 12px; border:1px solid var(--line); border-radius:12px; background:rgba(255,253,248,.95); box-shadow:0 8px 22px rgba(32,60,52,.12); }
.legend-title { margin-bottom:7px; font-size:12px; font-weight:800; }
.legend-ramp { height:9px; border-radius:999px; background:linear-gradient(90deg,#d73027,#f46d43,#fee08b,#d9ef8b,#66bd63,#1a9850); }
.legend-labels { display:flex; justify-content:space-between; margin-top:4px; color:var(--muted); font-size:10px; }
.mobile-sheet-toggle,.mobile-mode-tabs { display:none; }
.eyebrow { color:var(--green-2); font-size:11px; font-weight:850; letter-spacing:.08em; text-transform:uppercase; }
.panel-head h1,.result-heading h2,.compare-drawer h2 { margin:4px 0 0; font:750 26px/1.15 var(--serif); letter-spacing:-.02em; }
.panel-head p { margin:9px 0 15px; color:var(--muted); font-size:13px; line-height:1.6; }
.panel-section { margin-top:18px; padding-top:16px; border-top:1px solid var(--line); }
.panel-section:first-of-type { margin-top:12px; }
.section-title { display:flex; align-items:center; justify-content:space-between; gap:10px; margin:0 0 10px; }
.section-title h2,.section-title h3 { margin:0; font-size:14px; }
.section-title span { color:var(--muted); font-size:11px; }
.field { display:grid; gap:6px; margin:10px 0; }
.field > span,.field-label { font-size:12px; font-weight:700; }
.field input[type="search"],.field input[type="date"],.field input[type="number"],.field select { width:100%; min-height:44px; border:1px solid var(--line); border-radius:10px; padding:8px 10px; background:white; color:var(--ink); }
.button-row,.preset-row { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.preset-row button { min-height:40px; padding:6px 8px; font-size:12px; }
.primary { border-color:var(--green) !important; background:var(--green) !important; color:white !important; font-weight:750; }
.secondary-active { border-color:#7aa696; background:var(--green-soft); color:var(--green); font-weight:750; }
.weight-list { display:grid; gap:2px; }
.weight-row { display:grid; grid-template-columns:94px minmax(80px,1fr) 58px; align-items:center; gap:8px; min-height:42px; }
.weight-row label { overflow:hidden; font-size:12px; text-overflow:ellipsis; white-space:nowrap; }
.weight-row input[type="range"] { width:100%; accent-color:var(--green-2); }
.weight-row output { text-align:right; font-size:12px; font-variant-numeric:tabular-nums; }
.weight-total { margin-top:8px; color:var(--muted); font-size:11px; }
.weight-total.is-invalid { color:var(--danger); font-weight:700; }
details.advanced,details.filter-group { margin-top:12px; border:1px solid var(--line); border-radius:12px; background:#fff; }
details.advanced summary,details.filter-group summary { min-height:44px; display:flex; align-items:center; justify-content:space-between; padding:8px 11px; cursor:pointer; font-size:13px; font-weight:750; }
.details-body { padding:0 11px 12px; }
.filter-group { overflow:hidden; }
.filter-group summary small { margin-left:auto; color:var(--muted); font-weight:500; }
.filter-row { padding:10px 0; border-top:1px solid #edf0ed; }
.filter-row-head { display:flex; align-items:flex-start; gap:8px; }
.filter-row-head input { width:18px; height:18px; accent-color:var(--green); }
.filter-row-head label { flex:1; font-size:12px; line-height:1.4; }
.filter-row-head small { color:var(--muted); }
.filter-bounds { display:grid; grid-template-columns:1fr 1fr; gap:7px; margin:8px 0 0 26px; }
.filter-bounds label { display:grid; gap:3px; color:var(--muted); font-size:10px; }
.filter-bounds input { min-width:0; width:100%; height:38px; border:1px solid var(--line); border-radius:8px; padding:5px 7px; }
.sticky-apply { position:sticky; bottom:-28px; margin:18px -18px -28px; padding:12px 18px calc(12px + env(safe-area-inset-bottom)); border-top:1px solid var(--line); background:rgba(255,253,248,.96); backdrop-filter:blur(10px); }
.sticky-apply button { width:100%; }
.inline-status { min-height:20px; margin-top:8px; color:var(--muted); font-size:11px; line-height:1.45; }
.result-heading { flex:0 0 auto; display:flex; justify-content:space-between; align-items:flex-end; gap:12px; padding:18px 16px 12px; }
.result-heading h2 { font-size:22px; }
.result-count { color:var(--muted); font-size:12px; }
.result-search { flex:0 0 auto; padding:0 14px 12px; }
.result-search input { width:100%; min-height:42px; border:1px solid var(--line); border-radius:10px; padding:8px 11px; background:#fff; }
.result-list { min-height:0; overflow:auto; padding:0 10px 24px; }
.result-card { display:grid; grid-template-columns:38px minmax(0,1fr) auto; gap:9px; align-items:center; margin:5px 0; padding:10px 8px; border:1px solid transparent; border-bottom-color:var(--line); border-radius:10px; cursor:pointer; }
.result-card:hover,.result-card.is-selected { border-color:#b7cec5; background:#f2f7f3; }
.rank { color:var(--orange); font:750 18px/1 var(--serif); text-align:center; }
.result-name { min-width:0; }
.result-name strong { display:block; overflow:hidden; font-size:13px; text-overflow:ellipsis; white-space:nowrap; }
.result-name small { display:block; margin-top:3px; overflow:hidden; color:var(--muted); font-size:10px; text-overflow:ellipsis; white-space:nowrap; }
.result-score { text-align:right; }
.result-score strong { display:block; font-size:15px; }
.result-score small { color:var(--muted); font-size:9px; }
.result-actions { grid-column:2 / 4; display:flex; justify-content:flex-end; gap:6px; }
.result-actions button { min-height:34px; padding:4px 8px; font-size:11px; }
.result-metrics { grid-column:2 / 4; display:grid; grid-template-columns:repeat(3,1fr); gap:5px; color:var(--muted); font-size:9px; }
.result-metrics span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.drawer-backdrop { position:fixed; z-index:1990; inset:0; background:rgba(19,39,34,.32); }
.compare-drawer { position:fixed; z-index:2000; top:0; right:0; width:min(720px,94vw); height:100dvh; display:flex; flex-direction:column; background:var(--panel); box-shadow:var(--shadow); }
.compare-drawer > header { display:flex; justify-content:space-between; align-items:center; padding:18px; border-bottom:1px solid var(--line); }
.compare-drawer > header button { width:44px; padding:0; font-size:26px; }
.compare-toolbar { display:flex; justify-content:space-between; align-items:center; padding:10px 18px; border-bottom:1px solid var(--line); color:var(--muted); font-size:12px; }
.compare-content { min-height:0; overflow:auto; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; padding:14px; }
.compare-card { position:relative; padding:14px; border:1px solid var(--line); border-radius:14px; background:#fff; }
.compare-card h3 { margin:0 32px 3px 0; font-size:15px; }
.compare-card > small { color:var(--muted); }
.compare-card .remove { position:absolute; top:8px; right:8px; min-height:34px; padding:4px 7px; font-size:11px; }
.metric-grid { display:grid; grid-template-columns:1fr 1fr; gap:7px; margin-top:12px; }
.metric-grid div { padding:7px; border-radius:8px; background:#f4f6f3; }
.metric-grid dt { color:var(--muted); font-size:9px; }
.metric-grid dd { margin:3px 0 0; font-size:13px; font-weight:750; }
.error-box { margin:10px 0; padding:10px; border:1px solid #e2b8b2; border-radius:10px; background:#fff3f0; color:#8b332c; font-size:12px; line-height:1.5; }

@media (max-width:1536px) {
  .workspace { grid-template-columns:310px minmax(320px,1fr) 350px; }
  .topbar { grid-template-columns:240px minmax(390px,1fr) 100px; padding-inline:14px; }
  .mode-tabs { grid-template-columns:repeat(3,minmax(112px,148px)); }
}
@media (max-width:1000px) {
  .workspace { grid-template-columns:300px minmax(320px,1fr); }
  .result-panel { position:fixed; z-index:850; top:60px; right:0; bottom:0; width:360px; box-shadow:-12px 0 34px rgba(30,58,50,.12); transform:translateX(calc(100% - 42px)); transition:transform .18s ease; }
  .result-panel:hover,.result-panel:focus-within { transform:translateX(0); }
  .topbar { grid-template-columns:210px minmax(350px,1fr) 92px; gap:8px; }
}
@media (max-width:900px) {
  html,body { overflow:hidden; }
  .topbar { flex:0 0 56px; grid-template-columns:minmax(0,1fr) auto; padding:0 10px; }
  .brand small,.mode-tabs { display:none; }
  .brand-mark { width:32px; height:32px; }
  .compare-button { min-height:40px; }
  .scope-banner { min-height:58px; align-items:flex-start; padding:7px 10px; }
  .scope-banner > div:first-child { display:grid; gap:1px; }
  .scope-banner span { max-width:46vw; }
  .scope-actions button { min-height:40px; }
  .workspace { position:relative; display:block; }
  .map-stage { position:absolute; inset:0 0 58px; }
  .control-panel,.result-panel { position:absolute; z-index:800; top:auto; left:8px; right:8px; bottom:66px; width:auto; height:min(48dvh,440px); border:1px solid var(--line); border-radius:18px 18px 12px 12px; background:rgba(255,253,248,.98); box-shadow:var(--shadow); transform:none; transition:height .18s ease,transform .18s ease; }
  .control-panel { padding:16px 14px 24px; }
  .result-panel { display:none; }
  body[data-mobile-panel="results"] .control-panel { display:none; }
  body[data-mobile-panel="results"] .result-panel { display:flex; }
  body.sheet-collapsed .control-panel,body.sheet-collapsed .result-panel { transform:translateY(calc(100% - 54px)); overflow:hidden; }
  .mobile-sheet-toggle { display:block; position:absolute; z-index:900; right:12px; bottom:calc(58px + min(48dvh,440px) + 10px); min-height:36px; padding:4px 9px; border-radius:999px; font-size:11px; transition:bottom .18s ease; }
  body.sheet-collapsed .mobile-sheet-toggle { bottom:122px; }
  .legend { left:10px; bottom:72px; width:148px; padding:8px 9px; }
  .map-status { top:10px; }
  .mobile-mode-tabs { z-index:1000; flex:0 0 calc(58px + env(safe-area-inset-bottom)); display:grid; grid-template-columns:repeat(3,1fr); gap:5px; padding:5px 8px calc(5px + env(safe-area-inset-bottom)); border-top:1px solid var(--line); background:var(--panel); }
  .mobile-mode-tabs button { min-height:44px; padding:5px; border:0; background:transparent; font-size:12px; }
  .mobile-mode-tabs button[aria-current="page"] { border-radius:10px; background:var(--green); color:#fff; }
  .sticky-apply { bottom:-24px; margin-bottom:-24px; }
  .compare-drawer { top:auto; bottom:0; width:100%; height:min(82dvh,720px); border-radius:20px 20px 0 0; }
  .compare-content { grid-template-columns:1fr; }
}
@media (max-width:600px) {
  .scope-actions { gap:4px; }
  .scope-actions button { padding-inline:7px; font-size:11px; }
  .result-card { grid-template-columns:34px minmax(0,1fr) auto; }
}
@media (max-width:360px) {
  .brand strong { font-size:15px; }
  .scope-banner span { display:none; }
  .control-panel,.result-panel { left:5px; right:5px; }
  .filter-bounds { grid-template-columns:1fr; }
}
@media (min-width:2200px) {
  .workspace { grid-template-columns:390px minmax(600px,1fr) 460px; }
  .control-panel { padding-inline:24px; }
  .result-card { padding-block:13px; }
}
@media (min-width:3200px) {
  .workspace { grid-template-columns:460px minmax(900px,1fr) 560px; }
  .topbar { grid-template-columns:360px 1fr 160px; }
}
@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after { scroll-behavior:auto !important; transition-duration:.01ms !important; animation-duration:.01ms !important; animation-iteration-count:1 !important; }
}
