:root {
  --ink: #20221f;
  --muted: #6b6d68;
  --line: #dedfd9;
  --soft-line: #ecece7;
  --paper: #f7f7f4;
  --surface: #ffffff;
  --soft: #f1f2ee;
  --accent: #963c31;
  --accent-soft: #f5e9e6;
  --green: #3e6755;
  --green-soft: #e5eee8;
  --gold: #8b6b2e;
  --gold-soft: #f3eddd;
  --blue: #42657b;
  --blue-soft: #e5edf1;
  --shadow: 0 18px 50px rgba(31, 31, 26, 0.14);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { color-scheme: light; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

button, input, select { font: inherit; letter-spacing: 0; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.topbar {
  height: 76px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand { display: flex; align-items: center; gap: 13px; min-width: 0; }
.brand-logo {
  width: auto;
  height: 42px;
  display: block;
  flex: 0 0 auto;
  object-fit: contain;
}
.brand h1 {
  margin: 0;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 21px;
  line-height: 1.15;
}
.brand p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.data-note { color: var(--muted); font-size: 12px; }

.archive-nav { position: sticky; top: 76px; z-index: 19; padding: 0 28px; background: var(--surface); border-bottom: 1px solid var(--line); }
.archive-nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 1500px; margin: 0 auto; }
.archive-tabs { display: flex; align-items: stretch; gap: 6px; }
.archive-tab { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 18px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; }
.archive-tab svg { width: 16px; height: 16px; }
.archive-tab:hover { color: var(--ink); background: var(--paper); }
.archive-tab[aria-selected="true"] { border-bottom-color: var(--accent); color: var(--accent); }
.global-stele-toggle { min-height: 52px; margin-left: auto; font-size: 12px; }

.workspace {
  min-height: calc(100vh - 128px);
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
}
body[data-view="collection"] .workspace { display: block; }
body[data-view="collection"] .filters,
body[data-view="collection"] .mobile-filter-button { display: none; }

.filters {
  padding: 21px 18px 0;
  background: var(--surface);
  border-right: 1px solid var(--line);
  position: sticky;
  top: 128px;
  height: calc(100vh - 128px);
  overflow: auto;
}

.filter-heading { min-height: 49px; display: flex; align-items: flex-start; justify-content: space-between; margin: 0 4px 15px; }
.filter-heading strong { display: block; margin-top: 5px; font-family: "Noto Serif SC", serif; font-size: 18px; line-height: 1.25; }
.eyebrow { color: var(--accent); font-size: 10px; font-weight: 700; letter-spacing: 1.6px; }

.filter-section { padding: 16px 4px; border-top: 1px solid var(--soft-line); }
.search-section { padding-top: 15px; }
.search-field, .filter-grid > label, .bibliography-filter-section label { display: block; }
.search-field > span:first-child, .filter-grid > label > span, .bibliography-filter-section label > span, .sort-control > span {
  display: block;
  margin-bottom: 8px;
  color: #4f514d;
  font-size: 11px;
  font-weight: 600;
}
.bibliography-filter-section label > span { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bibliography-filter-section label small { color: var(--muted); font-size: 10px; font-weight: 400; }
.bibliography-filter-section select { font-size: 12px; }
.input-wrap { position: relative; display: block; }
.input-wrap svg { width: 16px; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #777a74; pointer-events: none; }
input[type="search"], select {
  width: 100%;
  height: 41px;
  border: 1px solid #d5d6d0;
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
input[type="search"] { padding: 0 36px; background: #fafaf8; }
input[type="search"]::-webkit-search-cancel-button { opacity: .45; }
select { padding: 0 32px 0 11px; }
input[type="search"]:hover, select:hover { border-color: #aeb0aa; background-color: #fff; }
input[type="search"]:focus, select:focus { border-color: #b77b72; box-shadow: 0 0 0 3px rgba(150, 60, 49, .08); }

.filter-grid { display: grid; gap: 14px; }
.toggle-group { display: grid; gap: 5px; }
.filter-section-title { margin-bottom: 5px; color: #4f514d; font-size: 11px; font-weight: 600; }
.check-row { min-height: 39px; padding: 0 8px; border-radius: 4px; display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 9px; cursor: pointer; color: #40423e; transition: background .15s ease; }
.check-row:hover { background: var(--soft); }
.check-row:has(input:checked) { background: var(--accent-soft); color: #66352e; }
.check-row input { position: absolute; opacity: 0; pointer-events: none; }
.check-box { width: 18px; height: 18px; border: 1px solid #bfc1bb; border-radius: 3px; display: grid; place-items: center; background: #fff; }
.check-box svg { width: 13px; opacity: 0; color: #fff; stroke-width: 3; }
.check-row input:checked + .check-box, .category-check input:checked + .check-box, .unit-check input:checked + .check-box { background: var(--accent); border-color: var(--accent); }
.check-row input:checked + .check-box svg, .category-check input:checked + .check-box svg, .unit-check input:checked + .check-box svg { opacity: 1; }
.check-row input:focus-visible + .check-box, .category-check input:focus-visible + .check-box, .unit-check input:focus-visible + .check-box { outline: 2px solid var(--accent); outline-offset: 2px; }
.check-label { min-width: 0; font-size: 12px; }
.toggle-count { color: #8a8c86; font-size: 10px; font-variant-numeric: tabular-nums; }
.check-row:has(input:checked) .toggle-count { color: #7b4a43; }
.category-fieldset, .unit-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.category-fieldset legend, .unit-fieldset legend { width: 100%; margin-bottom: 8px; padding: 0; color: #4f514d; font-size: 12px; font-weight: 600; }
.category-fieldset legend span, .unit-fieldset legend span { float: right; color: var(--muted); font-size: 10px; font-weight: 400; }
.category-checks, .unit-checks { max-height: 236px; padding: 3px; overflow: auto; border: 1px solid #dfe0da; border-radius: 5px; background: #fafaf8; display: grid; gap: 1px; scrollbar-width: thin; }
.unit-checks { max-height: 288px; }
.category-check, .unit-check { min-height: 33px; padding: 0 7px; border-radius: 3px; display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 8px; cursor: pointer; transition: background .15s ease; }
.category-check:hover, .unit-check:hover { background: #efefeb; }
.category-check:has(input:checked), .unit-check:has(input:checked) { background: var(--accent-soft); }
.category-check input, .unit-check input { position: absolute; opacity: 0; pointer-events: none; }
.category-name, .unit-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #40423e; font-size: 12px; }
.category-total, .unit-total { color: #949690; font-size: 10px; font-variant-numeric: tabular-nums; }

.filter-actions { margin: 0 -18px; padding: 13px 22px 18px; border-top: 1px solid var(--soft-line); background: #fff; }
.reset-button {
  width: 100%;
  min-height: 38px;
  border: 1px solid #d8c9c5;
  border-radius: 4px;
  padding: 0 12px;
  background: #fff;
  color: var(--accent);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  font-size: 12px;
}
.reset-button svg { width: 15px; }
.reset-button:hover { border-color: #bd8f87; background: var(--accent-soft); }

.results { min-width: 0; padding: 24px 28px 42px; max-width: 1500px; width: 100%; margin: 0 auto; }
.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 25px;
  background: rgba(255,255,255,.55);
}
.summary-item { padding: 15px 18px; border-right: 1px solid var(--line); }
.summary-item:last-child { border-right: 0; }
.summary-item strong { display: block; font-family: "Noto Serif SC", serif; font-size: 22px; line-height: 1; }
.summary-item span { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; }

.distribution-section { margin: 0 0 28px; padding: 0 0 22px; border-bottom: 1px solid var(--line); }
.distribution-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 6px; }
.distribution-heading h2 { margin: 5px 0 0; font-family: "Noto Serif SC", serif; font-size: 21px; line-height: 1.4; }
.distribution-hint { margin: 8px 0 16px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.distribution-heading-actions { display: flex; align-items: center; justify-content: flex-end; gap: 13px; flex-wrap: wrap; }
.distribution-meta { color: var(--muted); font-size: 12px; line-height: 1.7; font-variant-numeric: tabular-nums; text-align: right; }
.map-stele-toggle { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 0 2px; color: #50534e; font-size: 11px; cursor: pointer; user-select: none; white-space: nowrap; }
.map-stele-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.map-stele-toggle-ui { width: 30px; height: 17px; border-radius: 999px; background: #d8dad4; position: relative; flex: 0 0 auto; transition: background .15s ease; }
.map-stele-toggle-ui::after { content: ""; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.18); transition: transform .15s ease; }
.map-stele-toggle input:checked + .map-stele-toggle-ui { background: var(--accent); }
.map-stele-toggle input:checked + .map-stele-toggle-ui::after { transform: translateX(13px); }
.map-stele-toggle input:focus-visible + .map-stele-toggle-ui { outline: 2px solid var(--accent); outline-offset: 2px; }
.map-back-button, .map-clear-button { min-height: 32px; padding: 0 9px; border: 1px solid #d3d5cf; border-radius: 4px; background: #fff; color: #50534e; display: inline-flex; align-items: center; gap: 6px; font-size: 11px; white-space: nowrap; }
.map-back-button:hover, .map-clear-button:hover { border-color: #9fa39c; background: var(--soft); }
.map-back-button svg, .map-clear-button svg { width: 14px; height: 14px; }
.map-back-button[hidden], .map-clear-button[hidden], .distribution-legend [hidden] { display: none; }
.distribution-map-wrap { width: 100%; max-width: 920px; margin-inline: auto; min-width: 0; background: var(--surface); border: 1px solid var(--soft-line); border-radius: 8px; overflow: hidden; }
.distribution-map { display: block; width: 100%; height: auto; min-height: 0; }
.distribution-map-wrap.has-unit-labels { overflow-x: auto; overscroll-behavior-x: contain; }
.has-unit-labels .distribution-map { min-width: 840px; }
.unit-callout { cursor: pointer; }
.unit-callout .institution-leader { stroke-width: .75px; opacity: .5; }
.unit-callout:hover .institution-leader, .unit-callout:focus-visible .institution-leader, .unit-callout.is-selected .institution-leader { stroke: var(--accent); stroke-width: 1.5px; opacity: 1; }
.unit-callout:hover .institution-label, .unit-callout:focus-visible .institution-label, .unit-callout.is-selected .institution-label { fill: var(--accent); text-decoration: underline; }
.unit-callout:focus-visible { outline: none; }
.institution-marker { cursor: pointer; }
.institution-marker:focus-visible { outline: none; }
.institution-label { font-size: 12px; fill: #805035; paint-order: stroke; stroke: #fff; stroke-width: 4px; stroke-linejoin: round; }
.institution-leader { fill: none; stroke: #b68c73; stroke-width: 1px; pointer-events: none; }
.institution-marker:hover .institution-label, .institution-marker:focus-visible .institution-label { fill: var(--accent); text-decoration: underline; font-weight: 600; }
.institution-marker:focus-visible .institution-point { stroke: var(--accent); stroke-width: 2px; }
.province-land { fill: #eceee9; }
.province-outline { fill: none; stroke: #91978f; stroke-width: .7px; vector-effect: non-scaling-stroke; pointer-events: none; }
.county-shape, .province-shape { stroke: #fff; stroke-width: .65px; vector-effect: non-scaling-stroke; cursor: pointer; outline: none; transition: filter .15s ease; }
.county-shape.is-empty, .province-shape.is-empty { fill: #eceee9; }
.province-shape.is-empty { stroke: #b8beb7; }
.county-shape.map-level-1, .province-shape.map-level-1 { fill: #dfeaf0; }
.county-shape.map-level-2, .province-shape.map-level-2 { fill: #c9dde8; }
.county-shape.map-level-5, .province-shape.map-level-5 { fill: #a8c9da; }
.county-shape.map-level-10, .province-shape.map-level-10 { fill: #82b0c8; }
.county-shape.map-level-25, .province-shape.map-level-25 { fill: #5e93b0; }
.county-shape.map-level-50, .province-shape.map-level-50 { fill: #386f8e; }
.province-shape, .scs-islands[role="button"] { transform-box: fill-box; transform-origin: center; outline: none; transition: transform .15s ease, filter .15s ease; }
.province-shape:hover, .province-shape:focus-visible,
.scs-islands[role="button"]:hover, .scs-islands[role="button"]:focus-visible { transform: scale(1.012); filter: brightness(1.08) saturate(1.12); }
.county-shape:hover, .county-shape:focus-visible { filter: brightness(1.08) saturate(1.12); }
.county-shape.is-selected { fill: #82b0c8; filter: saturate(1.3); }
.county-shape.is-selected:hover, .county-shape.is-selected:focus-visible { filter: brightness(1.08) saturate(1.3); }
@media (prefers-reduced-motion: reduce) {
  .province-shape, .county-shape, .scs-islands[role="button"] { transition: none; }
}
.scs-inset { pointer-events: none; }
.scs-inset-frame { fill: #eef3f1; stroke: #7d857e; stroke-width: 1px; }
.scs-inset-label { fill: #4f554f; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; }
.scs-inset .scs-islands {
  pointer-events: auto;
  stroke: #4d6570;
  stroke-width: 1.15px;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
}
.scs-inset .scs-islands.scs-inset-land,
.scs-inset .scs-islands.is-empty {
  fill: #b7c4be;
  stroke: #7d8a84;
  pointer-events: none;
  cursor: default;
}
.institution-point { fill: #c8753d; stroke: #fff; stroke-width: 1.5px; vector-effect: non-scaling-stroke; cursor: pointer; }
.institution-point.is-zero { fill: #fff; stroke: #c8753d; stroke-width: 2px; }
.institution-point.is-approximate { fill: #fff; stroke: #c8753d; stroke-width: 1.5px; }
.institution-point.is-collection { fill: #fff; stroke: #2f6f6a; stroke-width: 2px; }
.institution-marker.is-selected .institution-point { stroke: var(--accent); stroke-width: 3px; }
.institution-marker.is-selected .institution-label { fill: var(--accent); font-weight: 600; }
.unit-callout.is-collection .institution-label { fill: #2f6f6a; }
.unit-callout.is-collection .institution-leader { stroke: #6f9793; }
.map-unit-row.is-collection .map-unit-count { color: #2f6f6a; }
.map-units { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.map-units[hidden] { display: none; }
.map-units summary { cursor: pointer; font-size: 13px; line-height: 1.7; color: var(--ink); }
.map-unit-note { font-size: 12px; color: var(--muted); line-height: 1.6; }
.map-unit-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 6px 14px; }
.map-unit-row { display: flex; width: 100%; min-height: 54px; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid transparent; border-bottom-color: var(--soft-line); padding: 9px; background: transparent; text-align: left; color: var(--ink); }
.map-unit-row > span:first-child { min-width: 0; }
.map-unit-row strong { display: block; font-size: 12px; font-weight: 500; overflow-wrap: anywhere; }
.map-unit-row small { display: block; margin-top: 4px; font-size: 11px; line-height: 1.5; color: var(--muted); overflow-wrap: anywhere; }
.map-unit-count { white-space: nowrap; font-size: 12px; font-variant-numeric: tabular-nums; }
.map-unit-row:hover { background: var(--soft); }
.map-unit-row[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.distribution-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 15px; margin-top: 16px; color: var(--muted); font-size: 12px; }
.distribution-legend strong { font-size: 12px; font-weight: 500; color: var(--ink); }
.distribution-legend span { display: inline-flex; align-items: center; gap: 5px; }
.distribution-legend i { display: inline-block; width: 12px; height: 12px; }
.distribution-legend .map-level-0 { background: #eceee9; }
.distribution-legend .map-level-1 { background: #dfeaf0; }
.distribution-legend .map-level-2 { background: #c9dde8; }
.distribution-legend .map-level-5 { background: #a8c9da; }
.distribution-legend .map-level-10 { background: #82b0c8; }
.distribution-legend .map-level-25 { background: #5e93b0; }
.distribution-legend .map-level-50 { background: #386f8e; }
.distribution-legend .map-institution { width: 8px; height: 8px; border-radius: 50%; background: #c8753d; }
.distribution-legend .map-county-unit { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid #c8753d; margin-left: 8px; background: #fff; }
.distribution-legend .map-collection { width: 8px; height: 8px; border-radius: 50%; border: 2px solid #2f6f6a; margin-left: 8px; background: #fff; box-sizing: border-box; }
.distribution-selection { min-height: 22px; margin-top: 14px; color: #454843; font-size: 12px; line-height: 1.7; }
.distribution-source { margin-top: 7px; color: var(--muted); font-size: 11px; line-height: 1.65; }

.collection-section { padding: 0 0 22px; }
.collection-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 6px; flex-wrap: wrap; }
.collection-heading h2 { margin: 5px 0 0; font-family: "Noto Serif SC", serif; font-size: 21px; line-height: 1.4; }
.collection-heading-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.collection-search { flex: 1 1 240px; max-width: 360px; }
.collection-search input { width: 100%; height: 34px; padding: 0 11px; border: 1px solid #d3d5cf; border-radius: 4px; background: #fff; font-size: 12px; }
.collection-search input:focus { border-color: #b77b72; outline: none; box-shadow: 0 0 0 3px rgba(150, 60, 49, .08); }
#collectionKindFilter { width: 170px; height: 34px; padding: 0 28px 0 10px; border: 1px solid #d3d5cf; border-radius: 4px; background: #fff; font-size: 12px; }
.collection-meta { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.collection-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 20px; margin: 10px 0 5px; }
.collection-legend-item { display: inline-flex; align-items: center; gap: 7px; color: #4e504b; font-size: 12px; line-height: 1.5; }
.collection-legend-swatch { display: inline-block; width: 14px; height: 14px; flex: 0 0 auto; border-radius: 2px; }
.collection-legend-swatch.is-stele { background: #eef7f1; border: 1px solid #a8cfb5; }
.collection-legend-swatch.is-other { background: #fbf3ea; border: 1px solid #dec19d; }
.collection-hint { margin: 0 0 14px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.collection-table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--soft-line); border-radius: 8px; background: var(--surface); }
.collection-table { width: 100%; min-width: 980px; border-collapse: collapse; table-layout: fixed; }
.collection-table th { height: 40px; padding: 0 10px; position: sticky; top: 0; z-index: 2; background: #eeefeb; border-bottom: 1px solid #cfd0ca; color: #545651; font-size: 11px; font-weight: 600; text-align: left; white-space: nowrap; }
.collection-table td { padding: 10px; border-bottom: 1px solid var(--soft-line); color: #4e504b; font-size: 12px; line-height: 1.5; vertical-align: top; }
.collection-table tbody tr:last-child td { border-bottom: 0; }
.collection-table tbody tr:hover { background: #fafaf7; }
.collection-table th:nth-child(1), .collection-table td:nth-child(1) { width: 44px; }
.collection-table th:nth-child(2), .collection-table td:nth-child(2) { width: 14%; }
.collection-table th:nth-child(3), .collection-table td:nth-child(3) { width: 11%; }
.collection-table th:nth-child(4), .collection-table td:nth-child(4) { width: 11%; }
.collection-table th:nth-child(5), .collection-table td:nth-child(5) { width: 72px; text-align: right; font-variant-numeric: tabular-nums; }
.collection-table th:nth-child(6), .collection-table td:nth-child(6) { width: 18%; }
.collection-table th:nth-child(7), .collection-table td:nth-child(7) { width: 64px; text-align: right; font-variant-numeric: tabular-nums; }
.collection-table th:nth-child(8), .collection-table td:nth-child(8) { width: 12%; }
.collection-table th:nth-child(9), .collection-table td:nth-child(9) { width: 16%; }
.collection-table { min-width: 1180px; }
.collection-table tbody tr.is-stele-unit { background: #eef7f1; }
.collection-table tbody tr.is-stele-unit:hover { background: #e3f1e8; }
.collection-table tbody tr.is-other-unit { background: #fbf3ea; }
.collection-table tbody tr.is-other-unit:hover { background: #f6eadc; }
.collection-qty { font-variant-numeric: tabular-nums; font-weight: 600; color: #3d4a42; }
#collectionSiteFilter { width: 190px; height: 34px; padding: 0 28px 0 10px; border: 1px solid #d3d5cf; border-radius: 4px; background: #fff; font-size: 12px; }
.collection-section .collection-heading-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; }
.collection-meta { margin-left: auto; }
.collection-name { font-weight: 500; color: var(--ink); }
.collection-kind { display: inline-block; padding: 2px 6px; border-radius: 3px; background: #f1f2ee; color: #5b5e58; font-size: 11px; }
.collection-kind.is-stele { background: #eaf6ef; color: #2f6a45; }
.collection-kind.is-museum { background: #eaf4fb; color: #2c5d7c; }
.collection-kind.is-other { background: #e8f3f1; color: #2f6f6a; }
.collection-kind.is-han { background: #fff5e8; color: #8a5a28; }
.collection-kind.is-rubbing { background: #f4eef8; color: #6a457f; }
.collection-sources { display: grid; gap: 4px; }
.collection-sources a, .map-unit-sources a { color: #2b6cb0; text-decoration: none; font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
.collection-sources a:hover, .map-unit-sources a:hover { text-decoration: underline; }
.map-unit-sources { display: grid; gap: 3px; margin-top: 5px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.map-tooltip { position: fixed; z-index: 80; max-width: min(350px, calc(100vw - 24px)); max-height: 50vh; overflow: hidden; white-space: pre-line; padding: 8px 10px; border: 1px solid #d5d6d0; border-radius: 4px; background: #fff; box-shadow: 0 8px 24px rgba(31, 31, 26, .16); color: var(--ink); font-size: 11px; line-height: 1.5; pointer-events: none; }

.results-toolbar { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.result-count { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.result-count strong { font-family: "Noto Serif SC", serif; font-size: 23px; }
.result-count > span:not(.filter-summary) { color: #595b56; }
.filter-summary { margin-left: 9px; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toolbar-controls { display: flex; align-items: center; gap: 14px; }
.export-button {
  min-height: 34px;
  border: 1px solid #d8c9c5;
  border-radius: 4px;
  padding: 0 11px;
  background: #fff;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  white-space: nowrap;
}
.export-button svg { width: 15px; flex: 0 0 auto; }
.export-button:hover:not(:disabled) { border-color: #bd8f87; background: var(--accent-soft); }
.export-button:disabled { opacity: .45; cursor: default; }
.sort-control { display: flex; align-items: center; gap: 8px; }
.sort-control > span { margin: 0; white-space: nowrap; }
.sort-control select { width: 190px; height: 34px; font-size: 12px; }
.active-filters { min-height: 36px; display: flex; gap: 7px; flex-wrap: wrap; align-items: center; margin: 6px 0 8px; }
.active-filters:empty { min-height: 16px; margin-top: 0; }
.filter-chip { border: 1px solid #d5c7c3; border-radius: 3px; background: var(--accent-soft); color: #66352e; padding: 5px 7px; display: inline-flex; align-items: center; gap: 5px; font-size: 11px; }
.filter-chip svg { width: 12px; }

.table-wrap { width: 100%; overflow: auto; border: 1px solid var(--line); background: var(--surface); }
.data-table { width: 100%; min-width: 930px; border-collapse: collapse; table-layout: fixed; }
.data-table th { height: 41px; padding: 0 9px; position: sticky; top: 0; z-index: 5; background: #eeefeb; border-bottom: 1px solid #cfd0ca; color: #545651; font-size: 11px; font-weight: 600; text-align: left; white-space: nowrap; }
.data-table th:nth-child(1) { width: 58px; }
.data-table th:nth-child(2) { width: 26%; }
.data-table th:nth-child(3) { width: 15%; }
.data-table th:nth-child(4) { width: 7%; }
.data-table th:nth-child(5) { width: 8%; }
.data-table th:nth-child(6) { width: 24%; }
.data-table th:nth-child(7) { width: 30px; }
.data-table td { height: 56px; padding: 9px; border-bottom: 1px solid var(--soft-line); color: #4e504b; font-size: 12px; line-height: 1.45; vertical-align: middle; overflow: hidden; text-overflow: ellipsis; }
.data-table tbody tr { cursor: pointer; transition: background .15s ease; }
.data-table tbody tr:hover { background: #fafaf7; }
.data-table tbody tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.id-cell { color: #92948f !important; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px !important; font-variant-numeric: tabular-nums; }
.name-cell strong { display: block; overflow: hidden; color: var(--ink); font-family: "Noto Serif SC", serif; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.name-cell span { display: block; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.location-cell, .unit-cell { white-space: normal; }
.unit-cell span { display: block; }
.unit-cell small { display: block; margin-top: 3px; color: var(--accent); font-size: 10px; white-space: nowrap; }
.museum-name-button { max-width: 100%; padding: 0; border: 0; background: transparent; color: #67413a; display: inline-flex; align-items: center; gap: 5px; text-align: left; }
.museum-name-button:hover span { text-decoration: underline; }
.museum-name-button svg { width: 13px; flex: 0 0 auto; }
.museum-name-button span { overflow: hidden; text-overflow: ellipsis; }
.muted-cell { color: #969891; font-size: 11px; }
.action-cell { padding-left: 0 !important; padding-right: 5px !important; color: #a2a49e !important; }
.action-cell svg { width: 16px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.status { max-width: 100%; padding: 3px 6px; border-radius: 3px; font-size: 10px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status.green { color: var(--green); background: var(--green-soft); }
.status.gold { color: var(--gold); background: var(--gold-soft); }
.status.blue { color: var(--blue); background: var(--blue-soft); }
.status.gray { color: #666862; background: #e9e9e5; }

.empty-state { min-height: 360px; border-top: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); }
.empty-state[hidden] { display: none; }
.empty-state svg { width: 36px; height: 36px; margin-bottom: 15px; stroke-width: 1.3; }
.empty-state strong { color: var(--ink); margin-bottom: 7px; }
.empty-state span { font-size: 12px; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 46px; margin-top: 20px; }
.pagination button { min-width: 33px; height: 33px; border: 1px solid transparent; border-radius: 3px; background: transparent; color: #555752; }
.pagination button:hover:not(:disabled) { background: #fff; border-color: var(--line); }
.pagination button.active { color: #fff; background: var(--accent); }
.pagination button:disabled { opacity: .35; cursor: default; }
.pagination svg { width: 15px; vertical-align: middle; }
.page-ellipsis { color: #999b95; padding: 0 3px; }

.icon-button { width: 36px; height: 36px; border: 0; border-radius: 3px; display: grid; place-items: center; background: transparent; color: #50524e; }
.icon-button:hover { background: var(--soft); }
.icon-button svg { width: 18px; }
.mobile-filter-button, .close-filters { display: none; }

.scrim { position: fixed; inset: 0; z-index: 39; background: rgba(25, 25, 22, .34); opacity: 0; pointer-events: none; transition: opacity .22s ease; }
.detail-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 40;
  width: min(470px, 94vw);
  height: 100vh;
  background: var(--surface);
  box-shadow: var(--shadow);
  transform: translateX(103%);
  transition: transform .24s ease;
}
.detail-drawer.open { transform: translateX(0); }
.scrim.open { opacity: 1; pointer-events: auto; }
.detail-head { height: 67px; padding: 0 20px 0 24px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.detail-head > div { display: flex; align-items: center; gap: 10px; }
#detailId { color: var(--muted); font-size: 11px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.detail-scroll { height: calc(100vh - 67px); overflow: auto; padding: 24px; }
.detail-title { margin: 0; font-family: "Noto Serif SC", serif; font-size: 26px; line-height: 1.35; }
.detail-location { margin: 8px 0 20px; color: var(--muted); }
.detail-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 26px; }
.detail-section { padding: 18px 0; border-top: 1px solid var(--soft-line); }
.detail-section h3 { margin: 0 0 13px; font-size: 13px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.detail-field.full { grid-column: 1 / -1; }
.detail-field span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 10px; }
.detail-field p { margin: 0; line-height: 1.6; word-break: break-word; }
.detail-field a, .source-link { color: var(--accent); text-decoration: none; }
.detail-field a:hover, .source-link:hover { text-decoration: underline; }
.detail-museum-link { width: 100%; padding: 2px 0; border: 0; background: transparent; color: var(--accent); display: grid; grid-template-columns: 17px minmax(0, 1fr) 16px; align-items: center; gap: 7px; text-align: left; }
.detail-museum-link:hover strong { text-decoration: underline; }
.detail-museum-link svg { width: 15px; }
.source-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 12px; }
.source-link svg { width: 14px; }
.museum-links { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.museum-empty { margin: 14px 0 0; color: var(--muted); font-size: 12px; }
.detail-section h3 span { float: right; color: var(--muted); font-size: 11px; font-weight: 400; }
.name-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.name-cell .name-line strong { min-width: 0; }
.name-cell .image-available { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 4px; margin: 0; color: var(--accent); font-size: 10px; white-space: nowrap; }
.image-available svg { width: 12px; height: 12px; }
.name-cell .bibliography-available { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 4px; margin: 0; color: #526a59; font-size: 10px; white-space: nowrap; }
.bibliography-available svg { width: 12px; height: 12px; }
.name-cell .bibliography-available.confirmed { color: #25623d; }
.name-cell .bibliography-available.likely { color: #8a5a28; }
.name-cell .bibliography-available.candidate { color: #686b65; }
.rubbing-section { padding-top: 18px; }
.rubbing-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.rubbing-gallery.single { grid-template-columns: minmax(0, 1fr); }
.rubbing-figure { min-width: 0; margin: 0; }
.rubbing-image-link { position: relative; display: block; height: 220px; overflow: hidden; background: #efefec; border: 1px solid var(--soft-line); }
.rubbing-gallery.single .rubbing-image-link { height: min(52vh, 380px); }
.rubbing-image-link:hover { border-color: var(--accent); }
.rubbing-image-link img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; }
.rubbing-figure figcaption { margin-top: 6px; color: var(--muted); font-size: 11px; }
.object-image-section .rubbing-figure figcaption { color: var(--ink); }
.object-image-section .rubbing-note + .rubbing-note { margin-top: 5px; }
.rubbing-note { margin: 13px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.rubbing-sources { display: flex; flex-direction: column; align-items: flex-start; }
.rubbing-sources .source-link { margin-top: 8px; line-height: 1.45; }
.bibliography-list { border-top: 1px solid var(--soft-line); }
.bibliography-item { padding: 14px 2px; border-bottom: 1px solid var(--soft-line); }
.bibliography-item-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.bibliography-item-head > div { min-width: 0; }
.bibliography-item-head strong { display: block; margin-top: 4px; font-family: "Noto Serif SC", serif; font-size: 13px; line-height: 1.55; }
.bibliography-id { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }
.bibliography-status { flex: 0 0 auto; padding: 3px 6px; border-radius: 3px; font-size: 10px; white-space: nowrap; }
.bibliography-status.confirmed { background: var(--green-soft); color: var(--green); }
.bibliography-status.likely { background: var(--gold-soft); color: var(--gold); }
.bibliography-status.candidate { background: #e9e9e5; color: #666862; }
.bibliography-meta, .bibliography-evidence, .bibliography-citation, .bibliography-location { margin: 7px 0 0; line-height: 1.6; overflow-wrap: anywhere; }
.bibliography-meta, .bibliography-location { color: var(--muted); font-size: 10px; }
.bibliography-evidence { color: #464943; font-size: 11px; }
.bibliography-citation { color: #5a5d57; font-size: 11px; }
.bibliography-contents { display: flex; flex-wrap: wrap; gap: 5px 10px; margin-top: 8px; }
.bibliography-contents span { color: #65716a; font-size: 10px; }
.bibliography-source-link { margin-top: 8px; }
.museum-object-list { border-top: 1px solid var(--soft-line); }
.museum-object { width: 100%; min-height: 52px; padding: 9px 2px; border: 0; border-bottom: 1px solid var(--soft-line); background: transparent; color: var(--ink); display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left; }
.museum-object:hover { background: #fafaf7; }
.museum-object > span { min-width: 0; }
.museum-object strong { display: block; overflow: hidden; font-family: "Noto Serif SC", serif; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.museum-object small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.museum-object svg { width: 15px; flex: 0 0 auto; color: #a2a49e; }

@media (max-width: 820px) {
  .topbar { height: 68px; padding: 0 16px; }
  .archive-nav { top: 68px; padding: 0 12px; }
  .archive-nav-inner { flex-wrap: wrap; gap: 0; }
  .archive-tabs { width: 100%; }
  .archive-tab { min-height: 48px; padding: 0 14px; }
  .global-stele-toggle { width: 100%; min-height: 40px; margin-left: 0; padding: 0 14px; border-top: 1px solid var(--soft-line); }
  .brand p, .data-note { display: none; }
  .brand h1 { font-size: 19px; }
  .seal { width: 38px; height: 38px; font-size: 21px; }
  .mobile-filter-button, .close-filters { display: grid; }
  .workspace { display: block; min-height: calc(100vh - 156px); }
  .filters { position: fixed; inset: 0 auto 0 0; z-index: 50; width: min(320px, 90vw); height: 100vh; transform: translateX(-103%); transition: transform .22s ease; }
  .filters.open { transform: translateX(0); }
  .results { padding: 18px 16px 36px; }
  .summary-strip { grid-template-columns: repeat(2, 1fr); margin-bottom: 18px; }
  .summary-item:nth-child(2) { border-right: 0; }
  .summary-item:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .summary-item { padding: 12px 14px; }
  .summary-item strong { font-size: 19px; }
  .distribution-section { margin-bottom: 22px; }
  .distribution-map { min-height: 0; }
  body.filter-open .scrim { z-index: 49; opacity: 1; pointer-events: auto; }
}

@media (max-width: 520px) {
  .collection-search { flex-basis: 100%; max-width: none; }
  #collectionSiteFilter, #collectionKindFilter { width: calc(50% - 5px); min-width: 0; }
  .collection-meta { margin-left: 0; }
  .distribution-heading { display: block; }
  .distribution-heading h2 { font-size: 19px; }
  .distribution-heading-actions { margin-top: 7px; justify-content: flex-start; flex-wrap: wrap; }
  .distribution-meta { text-align: left; }
  .distribution-map { min-height: 0; }
  .map-back-button, .map-clear-button { min-height: 40px; }
  .distribution-legend { gap: 6px 11px; }
  .results-toolbar { align-items: flex-start; }
  .toolbar-controls { gap: 8px; }
  .export-button { width: 34px; padding: 0; justify-content: center; }
  .export-button span { display: none; }
  .sort-control > span { display: none; }
  .sort-control select { width: 156px; }
  .filter-summary { display: none; }
  .detail-scroll { padding: 19px; }
  .detail-title { font-size: 22px; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-field.full { grid-column: auto; }
  .rubbing-image-link { height: 180px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
