:root { --ink: #172f29; --muted: #4c645a; --line: #c8d4c9; --paper: #f9faf4; --accent: #1c5646; --amber: #84542d; }
body { background: #eef1e8; font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", sans-serif; }
header { background: #f5f7ee; color: var(--ink); border-bottom: 1px solid var(--line); }
.brand p { color: var(--muted); }
.brand-icon { display: block; flex: none; }
.province-nav a { border-color: var(--line); color: #365249; }
.skip { position: absolute; top: -6rem; left: 1rem; z-index: 5; }
.skip:focus { top: 1rem; background: white; padding: .5rem; }
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.query-filters { margin: 14px 28px 0; }
.query-filters summary { cursor: pointer; font-size: 12px; color: var(--muted); }
#filter-count { margin-left: 7px; }
.query-filters .filters { margin: 7px 0 13px; }
.query-filters select { max-width: 220px; }
.primary { background: var(--accent); color: white; border-color: var(--accent); }
.primary:hover { background: #19564d; color: white; }
.query-disclaimer { margin: 0 28px 12px; padding: 0; max-width: none; }
.query-disclaimer p { margin: 5px 0; }
.country-nav { display: flex; flex-wrap: wrap; gap: 7px; padding: 3px 18px 14px; }
.country-nav a { padding: 3px 8px; border: 1px solid var(--line); border-radius: 4px; background: #f4f6f2; text-decoration: none; font-size: 12px; }
.country-nav a[aria-current] { background: var(--accent); border-color: var(--accent); color: white; }
.country-nav span { font-variant-numeric: tabular-nums; }
.control-options:not([hidden]) { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 12px; padding: 5px 18px 10px; }
.control-options label { display: flex; align-items: center; gap: 5px; min-height: 30px; font-weight: 600; }
#control-match { margin-block: 16px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 6px; }
#mine-map { display: block; width: 100%; height: 480px; touch-action: none; cursor: grab; }
#mine-map.dragging { cursor: grabbing; }
#mine-map :focus-visible { outline: 2px solid #a56e27; outline-offset: 2px; }
.province-shape { fill: #d8e6d8; fill-opacity: .55; stroke: #6e9690; stroke-width: 1; vector-effect: non-scaling-stroke; cursor: pointer; }
.province-shape:hover, .province-shape.selected { fill: #9bc2ac; stroke: #1c7061; stroke-width: 2; }
.province-shape.record-province { stroke: #a56e27; stroke-width: 2.3; }
.mine-dot { stroke: #fff; stroke-width: 1.5; vector-effect: non-scaling-stroke; cursor: pointer; }
.mine-dot.source, .mine-dot.approximate { fill: #176f65; }
.mine-dot.occurrence { fill: #32689a; }
.mine-dot.administrative { fill: #a56e27; }
.mine-dot.reference { fill: #7554a3; }
.mine-dot.mixed { fill: #516880; }
.map-marker text { pointer-events: none; fill: #fff; font-weight: 650; text-anchor: middle; dominant-baseline: central; }
.map-label { pointer-events: none; paint-order: stroke; stroke: #fff; stroke-linejoin: round; fill: #315853; }
.city-dot { fill: #78958c; }
.selection-halo, .selection-ring { fill: none; vector-effect: non-scaling-stroke; pointer-events: none; }
.selection-halo { stroke: #fff; stroke-width: 7; }
.selection-ring { stroke: #ad4937; stroke-width: 3; }
.selected-geometry { fill: #e4977140; stroke: #ad4937; stroke-width: 2.5; vector-effect: non-scaling-stroke; pointer-events: none; }
.map-options label { display: block; }
.map-card { position: absolute; right: 12px; top: 72px; width: min(320px, calc(100% - 24px)); max-height: calc(100% - 88px); overflow: auto; overscroll-behavior: contain; background: var(--paper); border: 1px solid var(--line); border-top: 3px solid var(--amber); border-radius: 7px; box-shadow: 0 8px 24px #233e5a25; padding: 14px; font-size: 12px; }
.map-card h3 { margin: 8px 28px 8px 0; overflow-wrap: anywhere; }
.map-card .close-card { position: absolute; right: 5px; top: 5px; }
.map-card dt, .map-card .card-kind { color: var(--muted); }
.map-card dd { margin: 0 0 6px; overflow-wrap: anywhere; }
.map-card .card-actions { margin-top: 10px; }
.map-card .primary { display: inline-block; border-radius: 5px; padding: 5px 8px; }
#map-error { position: absolute; inset: auto 12px 10px; background: #fcf5e5; padding: 8px; color: #75511f; }
#map-status { padding: 0 18px; margin: 5px 0 10px; }
.legend-dot { display: inline-block; width: 9px; height: 9px; margin-right: 4px; border-radius: 50%; background: #176f65; }
.legend-dot.occurrence { background: #32689a; }
.legend-dot.administrative { background: #a56e27; }
.legend-dot.reference { background: #7554a3; }
.control-shape { fill-opacity: .48; stroke: white; stroke-width: .5; vector-effect: non-scaling-stroke; cursor: pointer; }
.control-shape.active { fill-opacity: .8; stroke: #243d67; stroke-width: 3; }
#control-legend { padding: 10px 18px; border-top: 1px solid var(--line); }
#control-legend > div { display: flex; flex-wrap: wrap; gap: 6px; }
#control-legend i { display: inline-block; width: 12px; height: 12px; margin-right: 4px; }
#results { max-height: none; overflow: hidden; scroll-margin-top: 12px; }
.results-list { max-height: 507px; overflow: auto; }
.results-list table, .results-list tbody, .results-list tr { display: block; }
.results-list thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.results-list tr { padding: 11px 18px; border-block-start: 1px solid var(--line); }
.results-list td { display: inline; border: 0; padding: 0 8px 0 0; white-space: normal; overflow-wrap: anywhere; color: var(--muted); }
.results-list td:first-child { display: block; padding-right: 0; }
.record-name { font-size: 13px; font-weight: 600; }
.row-id { display: block; margin: 2px 0; }
.record-action { display: block !important; margin-top: 5px; }
.record-action button { font-size: 12px; padding: 4px 8px; }
.location-badge { color: var(--accent); }
.location-badge.unlocated { color: #94641f; }
.pager a[aria-disabled] { color: var(--muted); }
.detail-layout { grid-template-columns: minmax(0, 1fr); margin-top: 20px; }
.detail-body { padding: 14px 22px 24px; overflow-wrap: anywhere; }
.detail-body dt { color: var(--muted); }
.detail-body dd { margin: 0; }
@media (max-width: 760px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .province-nav { flex-wrap: wrap; min-width: 0; max-width: 100%; }
  .query-filters, .query-disclaimer { margin-inline: 12px; }
  .query-filters .search { flex-basis: 100%; min-width: 0; }
  .query-filters select { max-width: min(60vw, 220px); }
  main { grid-template-columns: minmax(0, 1fr); }
  #mine-map { height: 360px; }
  .map-card { top: auto; bottom: 18px; max-height: 57%; }
  .results-list { max-height: 440px; }
}
