:root {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: #253a42;
  background: #f4f6f6;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, .result:focus-visible, .booth:focus-visible { outline: 3px solid #bd693e; outline-offset: 2px; }

.app { max-width: 1480px; margin: 0 auto; padding: 24px; }
.heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0 0 18px; }
.heading h1 { flex: 0 0 auto; margin: 0; line-height: 1.18; letter-spacing: .02em; }
.heading h1 span { display: block; white-space: nowrap; }
.heading h1 span:first-child { margin-bottom: 5px; color: #557078; font-size: 18px; font-weight: 600; letter-spacing: .08em; }
.heading h1 span:last-child { font-size: 28px; font-weight: 700; }
.guide-qr { display: flex; flex: 0 0 auto; align-items: center; gap: 10px; padding: 10px 12px; background: #fff; border: 1px solid #d9e2e3; border-radius: 10px; }
.guide-qr p { margin: 0; color: #375761; font-size: 14px; font-weight: 600; line-height: 1.55; text-align: right; }
.guide-qr p span { display: block; white-space: nowrap; }
.guide-qr img { display: block; width: 112px; height: auto; object-fit: contain; }
.search-section { margin-bottom: 16px; }
.search { display: flex; align-items: center; gap: 10px; max-width: 640px; height: 48px; padding: 0 15px; background: #fff; border: 1px solid #cfd9dc; border-radius: 8px; }
.search:focus-within { border-color: #427e90; box-shadow: 0 0 0 3px #427e9020; }
.search svg { width: 19px; height: 19px; fill: none; stroke: #647b82; stroke-width: 2; stroke-linecap: round; flex: 0 0 auto; }
.search input { flex: 1; width: 100%; border: 0; outline: 0; background: transparent; color: #253a42; font-size: 16px; }
.search input::placeholder { color: #73868c; opacity: 1; }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.map-panel, .results-panel { background: #fff; border: 1px solid #d9e2e3; border-radius: 9px; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; padding: 12px 17px; border-bottom: 1px solid #e8eeee; }
.panel-head h2 { margin: 0; font-size: 16px; font-weight: 650; letter-spacing: .01em; }
.map-tools { display: flex; align-items: center; gap: 5px; }
.map-tools button { min-width: 36px; height: 36px; padding: 0 9px; background: #fff; border: 1px solid #d5e0e2; border-radius: 5px; color: #375761; font-size: 19px; line-height: 1; }
.map-tools button:hover { background: #edf6f7; }
.map-tools .fit-map { margin-left: 4px; font-size: 13px; }
.map-tools output { min-width: 48px; font-size: 12px; font-variant-numeric: tabular-nums; text-align: center; color: #617880; }
.map-viewport { position: relative; height: min(70vh, 720px); min-height: 530px; overflow: hidden; background: #fff; touch-action: none; cursor: grab; }
.map-viewport.is-dragging { cursor: grabbing; }
#siteMap { display: block; width: 100%; height: 100%; }
.map-loading { position: absolute; inset: 0; display: grid; place-items: center; background: #fff; color: #6d8085; font-size: 14px; }
.map-loading[hidden] { display: none; }
.map-foot { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; min-height: 60px; padding: 8px 17px; border-top: 1px solid #e8eeee; font-size: 12px; color: #768a8e; }
.map-foot strong { max-width: 100%; color: #172327; font-size: 15px; font-weight: 700; line-height: 1.45; text-align: left; overflow-wrap: anywhere; }

.results-head { min-height: 60px; }
.results { max-height: min(70vh, 720px); overflow: auto; }
.result { display: block; width: 100%; padding: 14px 17px 13px; border: 0; border-bottom: 1px solid #edf0f0; background: #fff; text-align: left; color: inherit; }
.result:hover { background: #f6faf9; }
.result.is-selected { background: #fff6ef; box-shadow: inset 3px 0 0 #b85d32; }
.result-name { display: block; font-size: 15px; font-weight: 570; line-height: 1.45; }
.result-meta { display: block; margin-top: 5px; color: #71858b; font-size: 12px; line-height: 1.4; font-variant-numeric: tabular-nums; }
.empty { padding: 24px 17px; font-size: 14px; line-height: 1.6; color: #71858b; }

.map-ground { fill: #fff; }
.map-building { fill: #f9faf8; stroke: #9eaeb0; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.map-edge { fill: none; stroke: #b0bdbd; stroke-width: 2.4; stroke-linejoin: round; }
.map-passage { fill: #d8eff2; }
.map-amenity { fill: #344d51; font-size: 38px; font-weight: 650; letter-spacing: .04em; text-anchor: middle; dominant-baseline: middle; paint-order: stroke; stroke: #fff; stroke-width: 5px; stroke-linejoin: round; pointer-events: none; }
.map-parking { fill: #7f9293; font-size: 38px; font-weight: 500; letter-spacing: .08em; }
.map-sign { fill: #344d51; font-size: 24px; font-weight: 650; }
.map-exit { fill: #a45a49; font-size: 17px; font-weight: 550; }
.map-exit-arrow { fill: none; stroke: #a45a49; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.booth { cursor: pointer; }
.booth rect { fill: #f9f2ee; stroke: #d9c9c3; stroke-width: 1.7; transition: fill .18s, stroke .18s, stroke-width .18s; }
.booth text { fill: #8d6d67; font-size: 12px; font-weight: 560; text-anchor: middle; dominant-baseline: middle; pointer-events: none; font-variant-numeric: tabular-nums; }
.booth:hover rect { fill: #f1dbca; stroke: #ab6e4e; }
.booth.is-selected rect { fill: #b9532e; stroke: #7e361f; stroke-width: 3; }
.booth.is-selected text { fill: #fff; font-weight: 700; }
.booth.is-muted { opacity: .52; }
.booth.is-selected { opacity: 1; }
.booth.is-uncertain rect { stroke-dasharray: 2 2; }

@media (max-width: 850px) {
  .app { padding: 14px; }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .map-viewport { height: min(61vh, 600px); min-height: 420px; }
  .results { max-height: 360px; }
}

@media (max-width: 600px) {
  .app { padding: 14px 10px 24px; }
  .heading { gap: 4px; margin-bottom: 14px; padding: 0 2px; }
  .heading h1 span:first-child { margin-bottom: 4px; font-size: 14px; }
  .heading h1 span:last-child { font-size: 19px; }
  .guide-qr { gap: 5px; padding: 10px; border-radius: 8px; }
  .guide-qr p { font-size: 12px; line-height: 1.5; }
  .guide-qr img { width: 112px; height: auto; }
  .search-section { margin-bottom: 12px; }
  .workspace { display: flex; flex-direction: column; gap: 12px; }
  .map-panel, .results-panel { width: 100%; }
  .panel-head { min-height: 55px; padding: 9px 12px; }
  .map-tools { gap: 3px; }
  .map-tools button { min-width: 34px; height: 34px; padding: 0 7px; }
  .map-tools output { min-width: 40px; }
  .map-viewport { height: clamp(290px, 90vw, 420px); min-height: 0; }
  .map-foot { align-items: flex-start; padding: 10px 17px; font-size: 11px; }
  .map-foot strong { max-width: 100%; }
  .workspace.has-many .results-panel { order: -1; }
  .workspace.has-many .results { max-height: 230px; }
}
