:root {
  color-scheme: light;
  --paper:#f3efe5; --sheet:#fbf9f2; --ink:#222821; --muted:#5b6156;
  --rule:#d5cfc0; --rule-strong:#a8a598; --water:#d6e2e1;
  --accent:#a34420; --accent-fill:#bd552b; --accent-soft:#f4e5d7;
  --blue:#315e6a; --sans:"PingFang SC","Microsoft YaHei","Noto Sans CJK SC",system-ui,sans-serif;
  --serif:"Songti SC","Noto Serif CJK SC","SimSun",serif;
  --number:ui-monospace,"Cascadia Mono",Consolas,monospace;
  font-family:var(--sans); background:var(--paper); color:var(--ink);
}
* {box-sizing:border-box}
body {margin:0}
button,input,select {font:inherit;color:inherit}
button {cursor:pointer}
a {color:inherit}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,[tabindex]:focus-visible {outline:2px solid var(--accent);outline-offset:3px}
button:disabled {cursor:default;opacity:.4}
h1,h2,h3,p,dl,dd {margin:0}
.sr,.skip:not(:focus) {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.skip:focus {position:fixed;z-index:10;background:var(--sheet);padding:12px}
.top {height:68px;display:flex;align-items:center;justify-content:space-between;padding:0 max(26px,calc((100vw - 1520px)/2 + 30px));border-bottom:1px solid var(--rule-strong);background:var(--sheet);gap:20px}
.brand {display:flex;align-items:center;gap:10px;text-decoration:none;font-size:17px;font-weight:800;line-height:1.25;white-space:nowrap}
.brand small {display:block;font:12px Georgia,serif;color:var(--muted);margin-top:2px}
.top nav {display:flex;gap:25px;align-items:stretch;height:100%;font-size:14px}
.top nav a,.top nav button {display:flex;align-items:center;text-decoration:none;border:0;border-bottom:2px solid transparent;background:none;padding:0 2px;color:var(--muted);white-space:nowrap}
.top nav .current {border-color:var(--accent);color:var(--ink);font-weight:700}
.top nav a:hover,.top nav button:hover,footer button:hover {color:var(--accent)}
.edition {color:var(--muted);font-size:13px;white-space:nowrap}
main {max-width:1520px;margin:auto;padding:0 30px}
.intro {display:flex;align-items:end;justify-content:space-between;gap:20px;padding:32px 0 24px}
h1 {font-size:clamp(28px,3.4vw,49px);font-weight:850;letter-spacing:-.045em;line-height:1.16}
.intro p {color:var(--muted);font-size:15px;margin-top:10px}
.stats {display:flex;align-items:end;flex-shrink:0}
.stats div {display:flex;flex-direction:column-reverse;gap:5px;border-left:1px solid var(--rule-strong);padding:0 17px}
.stats div:last-child {padding-right:0}
.stats dt {font-size:12px;color:var(--muted)}
.stats dd {font:31px/1 var(--number);font-variant-numeric:tabular-nums}
.workspace {display:grid;grid-template-columns:205px minmax(0,1fr) 302px;align-items:stretch;gap:14px}
.paper {background:var(--sheet);border:1px solid var(--rule);min-width:0}
.directory,.archive {min-height:0;position:relative;display:flex;flex-direction:column;border-top:2px solid var(--ink)}
.directory-head {padding:15px 13px 12px;border-bottom:1px solid var(--rule)}
h2 {font-size:16px;line-height:1.35}
.directory h2 small {color:var(--muted);font:12px var(--number);margin-left:5px}
.search {display:flex;gap:7px;align-items:center;margin-top:10px;padding:0 8px;border:1px solid var(--rule-strong);background:#fffdf8;color:var(--muted)}
.search input {min-width:0;width:100%;height:36px;border:0;background:none;font-size:13px}
.search:focus-within {outline:2px solid var(--accent);outline-offset:2px}
.search input:focus {outline:none}
.building-list {overflow:auto;scrollbar-width:thin;position:absolute;inset:97px 0 0}
.building {width:100%;display:grid;grid-template-columns:26px 1fr;gap:8px;text-align:left;padding:11px 10px 10px;border:0;border-bottom:1px solid var(--rule);border-left:3px solid transparent;background:none;min-height:58px}
.building:hover {background:#f0ece1}
.building[aria-pressed="true"] {border-left-color:var(--accent);background:var(--accent-soft)}
.building .num {font:12px/1.5 var(--number);color:var(--muted);padding-top:1px}
.building strong {display:block;font-size:13px;line-height:1.4}
.building small {display:block;font-size:11px;color:var(--muted);margin-top:4px;line-height:1.45}
.building .building-state {color:var(--accent)}
.center {display:grid;gap:14px;min-width:0}
.map-head,.map-foot {display:flex;gap:10px;align-items:center;justify-content:space-between;padding:10px 13px}
.map-head {min-height:47px;border-bottom:1px solid var(--rule)}
.map-head small {font-size:11px;font-weight:400;color:var(--muted);border-left:1px solid var(--rule);padding-left:9px;margin-left:5px}
.map-head > span,.map-foot {font-size:11px;color:var(--muted)}
.map-view {position:relative;width:100%;aspect-ratio:2.25;min-height:315px;overflow:hidden;background:var(--water)}
#map {width:100%;height:100%;display:block;cursor:grab;touch-action:pan-y}
#map.dragging {cursor:grabbing;touch-action:none}
.land {fill:#eee9d8;stroke:#9da89b;stroke-width:1.2}
.city {fill:#e3e1d5;stroke:#a5aca3;stroke-width:1}
.island-park {fill:#d3dbc0;stroke:#bac5a9;stroke-width:.7}
.base-building {fill:#cfc7b5;stroke:#ada591;stroke-width:.7}
.main-road {fill:none;stroke:#fbf8e9;stroke-width:5;stroke-linecap:round;stroke-linejoin:round}
.small-road {fill:none;stroke:#f8f4e6;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.bridge-road {fill:none;stroke:#f9f3df;stroke-width:5;stroke-linecap:round}
.map-label {fill:#42493d;font:700 19px var(--sans);paint-order:stroke;stroke:#f3eddb;stroke-width:4px;stroke-linejoin:round;pointer-events:none}
.map-label.water {font:23px var(--serif);letter-spacing:.16em;fill:#365c65;stroke:var(--water);stroke-width:4px}
.heritage-shape {fill:#9caa8d;stroke:#67785d;stroke-width:1;pointer-events:none}
.heritage-shape.bridge {fill:none;stroke-width:5}
.heritage-shape.selected {fill:#d5a385;stroke:var(--accent);stroke-width:2}
.heritage-shape.bridge.selected {fill:none}
.pin {cursor:pointer;outline:none}
.pin .hit {fill:transparent}
.pin .mark {fill:#26372e;stroke:#fff9eb;stroke-width:1.8}
.pin .pin-number {fill:#fffaf0;font:700 14px var(--number);text-anchor:middle;dominant-baseline:central;pointer-events:none}
.pin.inferred .mark {fill:#fcf6e8;stroke:#6f422a;stroke-width:1.7;stroke-dasharray:2.5 1.4}
.pin.inferred .pin-number {fill:#663b27}
.pin.quiet .mark {fill:#59665a;stroke:#eee9d8}
.pin.quiet.inferred .mark {fill:#fcf6e8;stroke:#6f422a}
.pin.active .mark {stroke:#fff9eb;fill:var(--accent-fill);stroke-width:2.4}
.pin.active .pin-number {fill:white}
.pin:hover .mark,.pin:focus-visible .mark,.pin.event .mark {stroke:#a34420;stroke-width:3}
.pin.active:focus-visible .mark,.pin.active:hover .mark {stroke:#33241d}
.pin-leader {stroke:#736e5e;stroke-width:1;pointer-events:none}
.map-zoom {position:absolute;right:9px;top:9px;display:grid;border:1px solid var(--rule-strong);background:var(--sheet);box-shadow:0 2px 7px #25251c18}
.map-zoom button {background:none;border:0;border-bottom:1px solid var(--rule);width:35px;height:33px;font:21px var(--number)}
.map-zoom button:last-child {border-bottom:0}
.map-zoom button:hover {background:var(--accent-soft)}
.north {position:absolute;left:12px;top:9px;display:grid;justify-items:center;font-size:11px;font-weight:700;gap:2px;pointer-events:none}
.attribution {position:absolute;right:4px;bottom:3px;background:#fbf9f2e8;padding:2px 4px;color:#364f53;font:10px/1.1 system-ui,sans-serif}
.map-foot {justify-content:start;gap:14px;min-height:37px;border-top:1px solid var(--rule);flex-wrap:wrap}
.map-foot span {display:inline-flex;gap:5px;align-items:center}
.dot {width:9px;height:9px;border-radius:50%;display:inline-block}
.dot.solid {background:#26372e}
.dot.dashed {border:1px dashed #6f422a;background:#fcf6e8}
.timeline {padding:14px 15px 10px;border-top:2px solid var(--ink)}
.timeline-top {display:flex;justify-content:space-between;gap:9px;align-items:center}
.timeline-top p {font-size:11px;line-height:1.5;color:var(--muted);margin-top:4px}
.year-field select {padding:7px 26px 7px 9px;background:#fffdf7;border:1px solid var(--rule-strong);font-size:13px;max-width:100%}
.time-axis {height:47px;position:relative;margin:8px 4px 0}
.axis-line {height:1px;background:var(--rule-strong);position:absolute;inset:13px 0 auto}
.axis-events {position:absolute;inset:0 0 auto;height:28px}
.year-tick {position:absolute;transform:translateX(-50%);padding:0;width:14px;height:27px;border:0;background:transparent}
.year-tick::after {content:"";position:absolute;left:50%;top:13px;transform:translate(-50%,-50%);width:5px;height:5px;border-radius:50%;background:var(--ink)}
.year-tick:hover::after,.year-tick[aria-pressed="true"]::after {width:11px;height:11px;background:var(--accent-fill);box-shadow:0 0 0 2px var(--sheet)}
.year-tick[aria-pressed="true"] {z-index:2}
.axis-labels {position:absolute;inset:auto 0 0;display:flex;justify-content:space-between;font:11px var(--number);color:var(--muted);pointer-events:none}
.archive-tabs {display:grid;grid-template-columns:1fr 1fr;border-bottom:1px solid var(--rule);min-height:43px}
.archive-tabs button {border:0;border-bottom:2px solid transparent;background:none;font-size:13px;color:var(--muted)}
.archive-tabs button[aria-pressed="true"] {border-color:var(--accent);color:var(--ink);background:#f0ece1;font-weight:700}
.archive-content {overflow:auto;scrollbar-width:thin;position:absolute;inset:43px 0 0;padding:15px}
.record-kicker {font-size:11px;color:var(--muted);display:flex;align-items:center;gap:6px;margin-bottom:8px;line-height:1.45}
.record-kicker .record-id {font:11px var(--number)}
.archive-title {font-size:22px;line-height:1.3;letter-spacing:-.02em}
.record-address,.scope-note,.empty {font-size:13px;color:var(--muted);line-height:1.6;margin-top:6px}
.archive-meta {margin:14px 0;border-top:1px solid var(--rule-strong)}
.archive-meta div {display:grid;grid-template-columns:62px 1fr;gap:8px;border-bottom:1px solid var(--rule);padding:7px 0;font-size:12px;line-height:1.45}
.archive-meta dt {color:var(--muted)}
.section-label {margin-top:17px;padding:9px 0 5px;border-top:2px solid var(--ink);display:flex;align-items:center;justify-content:space-between;gap:7px;font-size:14px}
.section-label small {font:11px var(--number);color:var(--muted)}
.event {padding:10px 0;border-bottom:1px solid var(--rule)}
.event time {display:block;color:var(--accent);font:700 12px var(--number);margin-bottom:5px}
.event h3 {font-size:14px;line-height:1.45}
.event p {font-size:12px;line-height:1.65;margin-top:4px;color:#444a41}
.event .event-notes {font-size:11px;color:var(--muted)}
.event-actions {display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-top:6px}
.text-btn {padding:1px 0;background:none;border:0;border-bottom:1px solid var(--rule-strong);font-size:12px;color:var(--blue);text-align:left;line-height:1.5}
.text-btn:hover {color:var(--accent);border-color:var(--accent)}
.empty {padding:9px 0}
.source-cta {margin-top:12px}
.status-pill {font-size:11px;padding:2px 5px;border:1px solid var(--rule-strong);color:#495546;white-space:nowrap}
.status-pill.inferred,.status-pill.unlocated {border-style:dashed;color:var(--accent)}
footer {display:flex;justify-content:space-between;gap:10px;color:var(--muted);border-top:1px solid var(--rule);font-size:12px;margin-top:18px;padding:12px 0 20px}
footer button {padding:0;border:0;background:none;color:var(--blue);text-align:left}
dialog {color:var(--ink);background:var(--sheet);border:1px solid var(--rule-strong);border-top:3px solid var(--ink);padding:0;width:min(630px,calc(100vw - 28px));max-height:85dvh}
dialog::backdrop {background:#24292285}
.dialog-head {display:flex;align-items:center;justify-content:space-between;padding:12px 17px;border-bottom:1px solid var(--rule);position:sticky;top:0;background:var(--sheet)}
.close {width:34px;height:34px;border:1px solid var(--rule);background:none;font-size:22px;line-height:1}
.source-body {padding:0 17px 14px}
.source-entry {padding:13px 0;border-bottom:1px solid var(--rule)}
.source-entry h3 {font-size:15px;line-height:1.5}
.source-entry p {font-size:12px;color:var(--muted);line-height:1.65;margin-top:5px;overflow-wrap:anywhere}
.source-entry a {display:inline-block;color:var(--blue);font-size:13px;margin-top:6px}
@media (min-width:931px) {
  .map-label {font-size:max(19px,calc(13 * var(--map-unit,1px)))}
  .map-label.water {font-size:max(23px,calc(15 * var(--map-unit,1px)))}
  .pin .pin-number {font-size:max(14px,calc(11 * var(--map-unit,1px)))}
  .pin .hit {r:max(17px,calc(12 * var(--map-unit,1px)))}
  .pin .mark {r:max(12.5px,calc(9 * var(--map-unit,1px)))}
  .year-tick {width:min(24px,2.4%)}
  .archive-title:focus-visible {outline-offset:2px}
  .record-address,.scope-note,.empty {font-size:14px}
  .archive-meta div {font-size:13px}
  .event h3,.source-entry h3 {font-size:16px}
  .event p,.source-entry p {font-size:15px;line-height:1.7}
  .event .event-notes,.text-btn {font-size:13px}
}
@media (min-width:1450px) {.workspace {grid-template-columns:225px minmax(0,1fr) 325px}}
@media (max-width:1120px) {
  main {padding:0 20px}
  .workspace {grid-template-columns:176px minmax(0,1fr) 263px;gap:10px}
  .center {gap:10px}
}
@media (max-width:930px) {
  .workspace {grid-template-columns:205px minmax(0,1fr)}
  .directory {grid-row:span 2}
  .archive {min-height:0}
  .archive-content {position:static;max-height:480px}
}
@media (max-width:620px) {
  .top {padding:0 12px;height:58px;gap:9px}
  .brand {gap:6px;font-size:14px}
  .brand svg {width:28px;height:28px}
  .brand small {font-size:10px}
  .top nav {gap:12px;font-size:12px}
  .edition {display:none}
  main {padding:0 11px}
  .intro {display:block;padding:20px 0 14px}
  .intro p {font-size:13px;margin-top:6px}
  .stats {margin-top:15px}
  .stats div {padding:0 12px}
  .stats div:first-child {padding-left:0;border-left:0}
  .stats dd {font-size:21px}
  .stats dt {font-size:10px}
  .workspace {display:flex;flex-direction:column}
  .center {order:-2}
  .archive {order:-1}
  .map-view {min-height:185px}
  .map-label,.map-label.water {font-size:25px}
  .pin .pin-number {font-size:17px}
  .pin .mark {r:14px}
  .map-head,.map-foot {padding:8px}
  .map-foot {gap:7px}
  .map-zoom {grid-auto-flow:column;top:6px;right:6px}
  .map-zoom button {width:30px;height:29px;border-bottom:0;border-right:1px solid var(--rule)}
  .map-zoom button:last-child {border-right:0}
  .archive-content {max-height:none}
  .building-list {position:static;max-height:390px}
  footer {font-size:11px}
}
@media (prefers-reduced-motion:reduce) {* {scroll-behavior:auto!important}}
