:root {
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  color: #1d3028;
  background: #f8f8f0;
  font-synthesis: none;
  --green: #244c3d;
  --quiet: #56685d;
  --line: #dce1d5;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; color: inherit; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid #428671; outline-offset: 3px; }
button[disabled] { cursor: default; opacity: .5; }
[hidden] { display: none !important; }
.symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
svg:not(.symbols) { display: inline-block; width: 20px; height: 20px; vertical-align: middle; }
svg:has(use) { fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }

.masthead {
  height: 73px; padding: 0 clamp(18px, 3.1vw, 50px); display: flex;
  align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line);
}
.identity { display: flex; align-items: center; gap: 12px; }
.brand-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--green); color: #f6faef; }
.eyebrow { margin: 0; color: #557262; font-size: 10px; font-weight: 750; letter-spacing: .17em; }
.school { margin: 3px 0 0; font-size: 15px; font-weight: 750; letter-spacing: .08em; }
.quiet { border: 0; border-radius: 8px; background: transparent; padding: 7px 9px; }
.quiet:hover { background: #e8ede2; }
.source-button { color: var(--green); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.source-button svg { width: 17px; height: 17px; }

.atlas { position: relative; display: grid; grid-template-columns: minmax(284px, 338px) minmax(0, 1fr); min-height: calc(100svh - 73px); }
.sidebar {
  display: flex; flex-direction: column; min-height: 0; padding: 36px 24px 18px clamp(20px, 3.1vw, 50px);
  border-right: 1px solid var(--line); height: calc(100svh - 73px);
}
.kicker { display: flex; gap: 7px; align-items: center; }
.kicker span, .map-badge > span:first-child { width: 7px; height: 7px; border-radius: 50%; background: #7c9b62; }
h1 { margin: 14px 0 13px; font-size: clamp(38px, 3.5vw, 53px); font-weight: 850; line-height: 1.11; letter-spacing: -.075em; }
h1 span { display: block; margin-top: 9px; font-size: .50em; font-weight: 660; letter-spacing: .01em; color: #345d4b; }
.intro-copy { font-size: 13px; line-height: 1.7; margin: 0; color: var(--quiet); max-width: 240px; }
.places { display: flex; flex-direction: column; margin-top: 28px; min-height: 0; flex: 1; }
.list-heading { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.list-heading h2 { font-size: 15px; margin: 0; }
.list-heading span { font-size: 11px; color: var(--quiet); font-variant-numeric: tabular-nums; }
.search { display: flex; align-items: center; gap: 7px; border-radius: 8px; border: 1px solid #d8e0d3; background: #fffef9; padding: 0 10px; min-height: 39px; }
.search:focus-within { border-color: #6b9c84; box-shadow: 0 0 0 2px #dfebe1; }
.search svg { color: #667d6e; width: 17px; height: 17px; flex: none; }
.search input { width: 100%; border: 0; outline: 0; background: transparent; color: inherit; padding: 8px 0; font-size: 13px; }
.search input:focus-visible { outline: none; }
.filters { display: flex; flex-wrap: wrap; gap: 5px; margin: 11px 0 10px; }
.filter { border: 1px solid #dce4d8; border-radius: 99px; background: transparent; padding: 4px 8px; color: #405649; font-size: 11px; line-height: 1.25; }
.filter:hover { background: #eaf0e4; }
.filter[aria-pressed="true"] { color: #fffdf5; background: var(--green); border-color: var(--green); }
.place-list { margin: 0; padding: 0 2px 0 0; min-height: 0; overflow: auto; scrollbar-width: thin; list-style: none; }
.place-row { width: 100%; display: grid; grid-template-columns: 10px minmax(0, 1fr) 17px; align-items: center; gap: 10px; text-align: left; background: transparent; padding: 9px 8px; border: 1px solid transparent; border-bottom-color: #e5e8de; border-radius: 5px; }
.place-row:hover, .place-row[aria-pressed="true"] { background: #eaf0e4; border-color: #dce7d9; }
.place-row:focus-visible { outline-offset: -2px; }
.place-row svg { width: 16px; height: 16px; color: #6d8373; }
.place-row strong { font-size: 13px; font-weight: 690; }
.place-row small { display: block; margin-top: 2px; font-size: 10px; color: var(--quiet); }
.category-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--category); }
.empty { margin: 10px 2px; font-size: 13px; color: var(--quiet); }
.address { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--quiet); margin: 14px 0 0; }
.address svg { width: 15px; height: 15px; flex: none; }

.map { position: relative; min-width: 0; min-height: 590px; overflow: hidden; isolation: isolate; background: #e1e9d9; }
.map-mount, .markers { position: absolute; inset: 0; }
.map-mount { background: radial-gradient(ellipse at 50% 45%, #f4f5e9 9%, #e6ebdb 62%, #dce7d8 100%); }
.map.night .map-mount { background: radial-gradient(ellipse at 50% 42%, #26364c, #141f32 68%, #101827); }
.map.night .map-badge > span:first-child { background: #cc9450; }
.map-mount canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.map-mount canvas:active { cursor: grabbing; }
.map-mount .fallback { width: 100%; height: 100%; display: block; touch-action: none; }
.markers { pointer-events: none; overflow: hidden; }
.marker {
  position: absolute; top: 0; left: 0; display: flex; align-items: center; gap: 5px; color: #18342a;
  background: #fffff6f2; border: 1px solid #c9d7c9; border-radius: 6px; padding: 4px 7px;
  white-space: nowrap; font-size: 11px; font-weight: 700; box-shadow: 0 2px 7px #203d3123;
  pointer-events: auto; will-change: transform;
}
.marker::after { position: absolute; left: calc(50% - 3px); top: 100%; content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--category); box-shadow: 0 0 0 1px #fffff5; }
.marker:hover, .marker[aria-pressed="true"] { z-index: 1; background: var(--green); border-color: var(--green); color: white; }
.marker .category-dot { width: 6px; height: 6px; }
.map-head { position: absolute; inset: 19px 21px auto; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; pointer-events: none; }
.map-badge, .control, .map-foot span, .compass { background: #fdfef4f2; border: 1px solid #d1ddce; box-shadow: 0 2px 9px #344e3610; }
.map-badge { display: flex; align-items: center; gap: 7px; border-radius: 99px; padding: 8px 12px; color: var(--green); font-size: 12px; font-weight: 700; white-space: nowrap; }
.map-controls, .zoom-controls { display: flex; gap: 5px; }
.control { display: grid; place-items: center; border-radius: 8px; pointer-events: auto; color: var(--green); }
.control:hover, .control[aria-pressed="true"] { background: #e8f0e4; }
.control svg { width: 18px; height: 18px; }
.control.square { width: 38px; height: 38px; }
.control.mode { display: flex; gap: 7px; align-items: center; white-space: nowrap; padding: 0 10px; font-size: 12px; }
.ground-control, .lighting-control { min-height: 38px; }
.lighting-control[aria-pressed="true"] { background: #f1dfb5; border-color: #d8bf89; color: #5a421d; }
.tour {
  position: absolute; left: 21px; top: 68px; width: min(255px, calc(100% - 84px));
  padding: 9px 10px; background: #fdfef5ed; border: 1px solid #d1ddce;
  border-radius: 9px; box-shadow: 0 3px 11px #25382b1a;
}
.tour-stops { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px; margin: 6px 0; }
.tour-stops button { border: 1px solid #d6dfd1; background: #f5f7ec; border-radius: 6px; padding: 4px 1px; font-size: 11px; }
.tour-stops button[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #fffdf5; }
.tour-range { display: grid; grid-template-columns: auto 1fr 31px; align-items: center; gap: 5px; color: #3c594a; font-size: 10px; }
.tour-range input { width: 100%; margin: 0; min-width: 0; accent-color: #315e4d; }
.tour-range output { text-align: right; font-variant-numeric: tabular-nums; }
.zoom-controls { position: absolute; right: 21px; bottom: 60px; flex-direction: column; }
.compass { position: absolute; top: 72px; right: 21px; width: 46px; height: 56px; border-radius: 23px; display: grid; justify-items: center; align-content: center; gap: 1px; color: var(--green); font-size: 10px; font-weight: 700; pointer-events: none; }
.compass svg { width: 26px; height: 26px; }
.map-foot { position: absolute; inset: auto 21px 17px; display: flex; flex-wrap: wrap; gap: 4px; justify-content: space-between; pointer-events: none; }
.map-foot span { padding: 5px 9px; border-radius: 7px; color: #435f50; font-size: 10px; }

.detail {
  position: absolute; grid-column: 2; grid-row: 1; z-index: 2;
  bottom: 60px; left: 21px; width: min(340px, calc(100% - 85px)); padding: 16px;
  max-height: calc(100% - 117px); overflow: auto; scrollbar-width: thin;
  border-radius: 12px; background: #fffef5fa; border: 1px solid #d6e3d3; box-shadow: 0 9px 22px #1d372626;
}
.icon-only { display: grid; place-items: center; padding: 4px; width: 31px; height: 31px; }
.detail .icon-only, dialog .icon-only { position: absolute; right: 10px; top: 10px; }
.detail h2 { margin: 6px 26px 7px 0; font-size: 19px; }
.detail p:not(.eyebrow) { margin: 0 0 8px; font-size: 12px; line-height: 1.6; color: #4d6153; }
.detail a, dialog a { color: #275e4b; font-size: 12px; }
.detail a svg { width: 15px; height: 15px; }
.height-metrics { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px; margin: 11px 0 9px; }
.height-metrics div { background: #edf0e4; border-radius: 7px; padding: 7px 6px; }
.height-metrics dt, .height-metrics small { display: block; color: #4b6254; font-size: 10px; }
.height-metrics dd { margin: 3px 0 2px; color: #253f34; font-size: 13px; font-weight: 750; }
.levels { margin-bottom: 8px; border-block: 1px solid #e2e8dc; font-size: 12px; }
.levels summary { padding: 7px 2px; cursor: pointer; font-weight: 690; }
.levels summary span { color: #596b5e; margin-left: 3px; font-weight: 400; font-size: 10px; }
.floor-list { display: grid; gap: 3px; max-height: 140px; overflow: auto; margin: 0 0 6px; padding: 0; list-style: none; scrollbar-width: thin; }
.floor-list li { display: grid; grid-template-columns: 27px 1fr auto; gap: 5px; align-items: baseline; padding: 4px; background: #f0f2e9; color: #475e53; }
.floor-list b { color: #224c3e; font-weight: 690; }
.floor-uses-list { display: grid; gap: 5px; list-style: none; padding: 0; margin: 0 0 8px; }
.floor-uses-list li { display: grid; grid-template-columns: 27px 1fr; gap: 6px; padding: 5px; background: #eef1e7; font-size: 11px; line-height: 1.55; color: #475e53; }
.floor-uses-list strong { color: #224c3e; }
.detail p.height-note { font-size: 11px; }
.detail-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.detail-actions button { padding: 4px 8px; background: #e6eee2; color: #275e4b; font-size: 12px; }
dialog { width: min(460px, calc(100vw - 32px)); border-radius: 15px; border: 1px solid #d1ddce; color: inherit; background: #fffef5; padding: 26px; }
dialog::backdrop { background: #182f2694; }
dialog h2 { margin: 8px 0 12px; }
dialog p:not(.eyebrow), dialog ul { line-height: 1.75; font-size: 14px; }
dialog ul { padding-left: 19px; margin-bottom: 0; }
dialog p.terrain-credit { margin-bottom: 0; color: #4f6458; font-size: 10px; }
noscript { position: fixed; bottom: 1rem; left: 1rem; background: #fffef5; padding: 1rem; }

@media (max-width: 780px) {
  .masthead { height: 62px; }
  .atlas { grid-template-columns: 1fr; }
  .sidebar { display: contents; }
  .intro { padding: 20px 19px 16px; }
  .intro h1 { margin: 7px 0; font-size: 34px; letter-spacing: -.06em; }
  .intro h1 span { display: inline; margin: 0 0 0 8px; font-size: .51em; }
  .intro-copy { max-width: none; font-size: 12px; }
  .map { grid-row: 2; height: min(55svh, 520px); min-height: 340px; border-block: 1px solid var(--line); }
  .places { grid-row: 4; margin: 0; padding: 18px 19px; }
  .place-list { max-height: 300px; }
  .address { grid-row: 5; margin: 0 19px 16px; }
  .map-head { inset: 10px 10px auto; }
  .map-controls :is(.ground-control, .lighting-control) { width: 38px; justify-content: center; padding: 0; }
  :is(.ground-control, .lighting-control) span { display: none; }
  .tour { left: 10px; top: auto; bottom: 42px; }
  .compass { top: 55px; right: 10px; }
  .zoom-controls { bottom: 51px; right: 10px; }
  .map-foot { inset: auto 10px 10px; }
  .detail { position: relative; grid-column: 1; grid-row: 3; inset: auto; width: auto; max-height: none; padding: 14px; margin: 12px 19px 0; }
  .detail h2 { font-size: 16px; }
  .marker { padding: 3px 5px; font-size: 10px; }
}
@media (max-width: 365px) {
  .masthead .identity { gap: 7px; min-width: 0; }
  .masthead .brand-icon { width: 32px; height: 32px; flex: none; }
  .masthead .eyebrow { font-size: 8px; letter-spacing: .06em; }
  .masthead .school { font-size: 12px; letter-spacing: .02em; }
  .masthead-actions { flex-shrink: 0; }
  .masthead .source-button { white-space: nowrap; }
  .map-controls { gap: 3px; }
  .map-controls .control { width: 34px; min-width: 34px; height: 34px; min-height: 34px; padding: 0; justify-content: center; }
  #view-mode span { display: none; }
}
