/* ==========================================================================
   暗夜地球 / Night Earth — 中国国家一级博物馆
   Palette: deep indigo void, warm brass light, cool slate structure.
   ========================================================================== */

:root {
  --void: #05070d;
  --deep: #0a0f1b;
  --raise: #0e1422;
  --gold: #d9b46c;
  --gold-hi: #f2dda8;
  --brass: #8a6c3a;
  --ivory: #efe8da;
  --mist: #98a1b4;
  --dim: #5f6a82;
  --line: rgba(217, 180, 108, 0.15);
  --line-2: rgba(217, 180, 108, 0.32);
  --line-cool: rgba(150, 168, 205, 0.12);

  --serif: "Songti SC", "STSong", "Source Han Serif SC", "Noto Serif CJK SC",
    "Noto Serif SC", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC",
    "Noto Sans CJK SC", "Noto Sans SC", -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;

  --rail-h: 62px;
  --drawer-w: 442px;
  --ease: cubic-bezier(0.22, 0.61, 0.24, 1);
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  height: 100%;
  background: var(--void);
  color: var(--ivory);
  font-family: var(--sans);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  font-size: 14px;
  line-height: 1.6;
}

::selection { background: rgba(217, 180, 108, 0.26); }

:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 3px;
}

/* ---------- canvas ---------- */
#sky {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  transition: opacity 0.5s var(--ease);
  touch-action: none;
  cursor: grab;
}
#sky.is-hidden { opacity: 0; pointer-events: none; }
#sky.is-dragging { cursor: grabbing; }

/* ---------- shell ---------- */
#ui {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

.rail {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--rail-h);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 26px;
  pointer-events: auto;
  z-index: 4;
}
.rail::after {
  content: "";
  position: absolute;
  left: 26px;
  right: 26px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--line) 12%,
    var(--line) 88%,
    transparent
  );
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}
.brand-mark {
  width: 22px;
  height: 22px;
  flex: none;
  color: var(--gold);
  opacity: 0.9;
}
.brand-txt { display: flex; flex-direction: column; min-width: 0; }
.brand-name {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.15;
  letter-spacing: 0.16em;
  margin: 0;
  white-space: nowrap;
}
.brand-sub {
  font-size: 11px;
  color: var(--dim);
  letter-spacing: 0.06em;
  margin: 1px 0 0;
  white-space: nowrap;
}

.spacer { flex: 1 1 auto; }

/* view switch — three words, one gold underline */
.views {
  display: flex;
  align-items: center;
  gap: 26px;
}
.view-btn {
  appearance: none;
  background: none;
  border: 0;
  padding: 6px 0 7px;
  font: inherit;
  font-size: 13px;
  color: var(--mist);
  letter-spacing: 0.08em;
  cursor: pointer;
  position: relative;
  transition: color 0.22s var(--ease);
  white-space: nowrap;
}
.view-btn::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.34s var(--ease);
}
.view-btn:hover { color: var(--ivory); }
.view-btn[aria-selected="true"] { color: var(--gold-hi); }
.view-btn[aria-selected="true"]::after { transform: scaleX(1); }
.view-btn .count {
  color: var(--dim);
  font-size: 10px;
  margin-left: 5px;
  letter-spacing: 0.02em;
}

.lang-btn {
  appearance: none;
  background: none;
  border: 1px solid var(--line);
  color: var(--mist);
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.14em;
  padding: 6px 11px 5px;
  cursor: pointer;
  transition: color 0.22s var(--ease), border-color 0.22s var(--ease);
}
.lang-btn:hover { color: var(--gold-hi); border-color: var(--line-2); }

/* ---------- views ---------- */
/* All three views share one box under the rail; only the active one shows.
   They are taken out of flow so a wide timeline cannot stretch the page. */
.view {
  position: absolute;
  top: var(--rail-h);
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease), visibility 0.4s;
}
.view.is-active { opacity: 1; visibility: visible; }
.view > * { pointer-events: auto; }

/* ---------- globe view ---------- */
.gv-scale {
  position: absolute;
  left: 26px;
  bottom: 30px;
  width: 128px;
  pointer-events: none;
  color: var(--dim);
}
.gv-scale-title {
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--mist);
  margin: 0 0 9px;
}
.gv-scale-axis {
  position: relative;
  height: 92px;
  border-left: 1px solid var(--line);
  margin-left: 3px;
}
.gv-scale-tick {
  position: absolute;
  left: -3px;
  width: 6px;
  height: 1px;
  background: var(--line-2);
}
.gv-scale-tick span {
  position: absolute;
  left: 11px;
  top: -8px;
  font-size: 10px;
  color: var(--dim);
  white-space: nowrap;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
}
.gv-scale-foot {
  margin: 10px 0 0;
  font-size: 10px;
  line-height: 1.5;
  color: var(--dim);
  letter-spacing: 0.02em;
}

.gv-tally {
  position: absolute;
  right: 26px;
  bottom: 30px;
  text-align: right;
  pointer-events: none;
  font-size: 11px;
  color: var(--dim);
  letter-spacing: 0.03em;
  line-height: 1.9;
  font-variant-numeric: tabular-nums;
}
.gv-tally b {
  color: var(--mist);
  font-weight: 400;
  font-size: 13px;
  font-feature-settings: "tnum";
}

.gv-hint {
  position: absolute;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--dim);
  letter-spacing: 0.1em;
  pointer-events: none;
  transition: opacity 0.6s var(--ease);
  white-space: nowrap;
}
.gv-hint.is-gone { opacity: 0; }

/* loading line */
.loader {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 132px;
  text-align: center;
  pointer-events: none;
  transition: opacity 0.6s var(--ease);
}
.loader.is-gone { opacity: 0; }
.loader-bar {
  height: 1px;
  background: var(--line-cool);
  overflow: hidden;
}
.loader-bar i {
  display: block;
  height: 100%;
  width: 40%;
  background: var(--gold);
  animation: slide 1.25s var(--ease) infinite;
}
@keyframes slide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(350%); }
}
.loader-txt {
  margin-top: 12px;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--dim);
}

/* tooltip */
#tip {
  position: fixed;
  z-index: 40;
  pointer-events: none;
  padding: 7px 11px 8px;
  background: rgba(8, 12, 21, 0.94);
  border: 1px solid var(--line-2);
  color: var(--ivory);
  font-size: 12px;
  line-height: 1.45;
  max-width: 260px;
  opacity: 0;
  transform: translate(-50%, -140%);
  transition: opacity 0.13s linear;
  backdrop-filter: blur(6px);
}
#tip.is-on { opacity: 1; }
#tip b { font-weight: 500; display: block; font-size: 12.5px; }
#tip i {
  font-style: normal;
  color: var(--gold);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
#tip i.none { color: var(--dim); }

/* ---------- treasure wall ---------- */
#view-wall {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.wall-bar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 26px 14px;
  flex: none;
}
.q-wrap {
  position: relative;
  flex: 1 1 auto;
  max-width: 420px;
}
.q-wrap svg {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--dim);
  pointer-events: none;
}
#q {
  width: 100%;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 7px 4px 8px 22px;
  color: var(--ivory);
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.03em;
  outline: none;
  transition: border-color 0.25s var(--ease);
}
#q::placeholder { color: var(--dim); }
#q:focus { border-color: var(--line-2); }
.wall-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--dim);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.wall {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 26px 60px;
  columns: 5;
  column-gap: 18px;
  overscroll-behavior: contain;
}
@media (max-width: 1680px) { .wall { columns: 4; } }
@media (max-width: 1280px) { .wall { columns: 4; } }
@media (max-width: 1080px) { .wall { columns: 3; } }
@media (max-width: 720px) { .wall { columns: 2; column-gap: 12px; padding: 4px 14px 80px; } }

.plate {
  break-inside: avoid;
  margin: 0 0 20px;
  display: block;
  width: 100%;
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.plate-img {
  position: relative;
  display: block;
  width: 100%;
  background: #090d16;
  overflow: hidden;
  border: 1px solid rgba(217, 180, 108, 0.1);
  transition: border-color 0.3s var(--ease);
}
.plate-img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.55s var(--ease), transform 0.7s var(--ease);
  transform: scale(1.012);
}
.plate-img img.is-loaded { opacity: 0.93; }
.plate:hover .plate-img { border-color: var(--line-2); }
.plate:hover .plate-img img.is-loaded { opacity: 1; transform: scale(1); }
/* An image that cannot load leaves a quiet plate in the same shape, so the
   wall keeps its masonry rhythm instead of collapsing to a line of text. */
.plate-fail {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  font-size: 9.5px;
  line-height: 1.6;
  color: #46506a;
  letter-spacing: 0.08em;
  background:
    linear-gradient(135deg, rgba(217, 180, 108, 0.045), transparent 62%),
    repeating-linear-gradient(45deg, rgba(150, 168, 205, 0.035) 0 1px, transparent 1px 7px);
}
.plate-img.is-failed .plate-fail { display: flex; }
.plate-img.is-failed img { display: none; }

.plate-cap { padding: 9px 1px 0; }
.plate-name {
  display: block;
  font-family: var(--serif);
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ivory);
  letter-spacing: 0.01em;
}
.plate-museum {
  display: block;
  margin-top: 3px;
  font-size: 10.5px;
  color: var(--dim);
  letter-spacing: 0.03em;
  transition: color 0.25s var(--ease);
}
.plate:hover .plate-museum { color: var(--gold); }

.wall-empty {
  column-span: all;
  padding: 60px 4px;
  font-size: 12.5px;
  color: var(--dim);
  letter-spacing: 0.04em;
}

/* ---------- timeline ---------- */
#view-time { display: flex; flex-direction: column; }

.tl-jump {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 14px 26px 12px;
  flex: none;
  overflow-x: auto;
  scrollbar-width: none;
}
.tl-jump::-webkit-scrollbar { display: none; }
.tl-jump button {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 1px solid transparent;
  color: var(--dim);
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.06em;
  padding: 5px 8px 6px;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
  white-space: nowrap;
}
.tl-jump button:hover { color: var(--ivory); }
.tl-jump button.is-on { color: var(--gold-hi); border-bottom-color: var(--gold); }

.tl-scroll {
  /* the year band is content-sized; the decade chart below takes the slack,
     so a year with one museum does not leave a column of dead space */
  flex: 0 0 auto;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-color: var(--brass) transparent;
}
.tl-scroll::-webkit-scrollbar { height: 7px; }
.tl-scroll::-webkit-scrollbar-thumb { background: #2a2418; }
.tl-scroll::-webkit-scrollbar-track { background: transparent; }

.tl-inner {
  display: flex;
  align-items: flex-start;
  padding: 6px 40vw 22px 26px;
  min-width: min-content;
  position: relative;
}

/* One column per founding year: the year, a one-line summary, then every
   museum that opened that year. The decade histogram at the foot of the view
   carries the density story, so the columns themselves stay quiet. */
.yr {
  flex: 0 0 auto;
  width: 154px;
  display: flex;
  flex-direction: column;
  align-self: stretch;
  padding: 0 12px 0 13px;
  border-left: 1px solid rgba(217, 180, 108, 0.1);
  position: relative;
  scroll-margin-left: 40px;
  background: linear-gradient(180deg, rgba(150, 168, 205, 0.03), transparent 132px);
}
.yr.is-first { border-left-color: var(--line); }
.yr:nth-child(10n + 1) { border-left-color: var(--line-2); }
.yr-head { flex: none; padding: 2px 0 8px; order: 0; }

.yr-summary {
  flex: none;
  order: 0;
  margin: 0 0 8px;
  font-size: 10px;
  line-height: 1.55;
  color: var(--dim);
  letter-spacing: 0.02em;
  min-height: 31px;
}
.yr:hover .yr-summary { color: var(--mist); }
.yr-num {
  display: block;
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.1;
  color: var(--ivory);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}
.yr-n {
  font-family: var(--sans);
  font-size: 9.5px;
  color: var(--dim);
  letter-spacing: 0.04em;
  margin-left: 7px;
  font-variant-numeric: tabular-nums;
}
.yr-world {
  display: inline-block;
  margin-top: 4px;
  font-size: 10px;
  color: var(--dim);
  text-decoration: none;
  letter-spacing: 0.02em;
  border-bottom: 1px solid transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.yr-world:hover { color: var(--gold-hi); border-bottom-color: var(--line-2); }

.yr-list {
  overflow-y: auto;
  overflow-x: hidden;
  flex: 0 1 auto;
  max-height: min(26vh, 212px);
  order: 1;
  padding: 0 0 4px;
  scrollbar-width: thin;
  scrollbar-color: #23283a transparent;
}
.yr-list::-webkit-scrollbar { width: 4px; }
.yr-list::-webkit-scrollbar-thumb { background: #232a3c; }

.node {
  display: flex;
  align-items: baseline;
  gap: 6px;
  width: 100%;
  background: none;
  border: 0;
  padding: 3px 2px 3px 0;
  margin: 0;
  text-align: left;
  color: var(--mist);
  font: inherit;
  font-size: 11.5px;
  line-height: 1.35;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: color 0.18s var(--ease);
}
.node::before {
  content: "";
  flex: none;
  width: 3px;
  height: 3px;
  margin-top: 6px;
  background: var(--brass);
  transition: background 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.node:hover,
.node:focus-visible { color: var(--ivory); }
.node:hover::before,
.node:focus-visible::before {
  background: var(--gold);
  box-shadow: 0 0 6px rgba(217, 180, 108, 0.7);
}
.node.is-current { color: var(--gold-hi); }

.tl-gap {
  flex: 0 0 74px;
  align-self: stretch;
  border-left: 1px solid var(--line-cool);
  color: var(--dim);
  font-size: 10px;
  letter-spacing: 0.06em;
  padding: 0 0 9px 8px;
  position: relative;
}
/* the axis runs through the gap too, drawn as a dashed stretch */
.tl-gap::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: repeating-linear-gradient(
    90deg,
    rgba(217, 180, 108, 0.22) 0 3px,
    transparent 3px 8px
  );
}
.tl-gap span {
  position: absolute;
  left: 9px;
  font-size: 9.5px;
  letter-spacing: 0.05em;
  color: #4a5468;
  font-variant-numeric: tabular-nums;
}

/* ---------- decade profile (foot of the timeline) ---------- */
.tl-profile {
  flex: 1 1 auto;
  min-height: 132px;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  padding: 14px 26px 24px;
  position: relative;
  border-top: 1px solid var(--line-cool);
  margin-top: 8px;
}
.tl-profile::before {
  content: "";
  position: absolute;
  left: 26px;
  right: 26px;
  bottom: 40px;
  height: 1px;
  background: var(--line);
}
.pf {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 0;
  cursor: pointer;
  color: var(--dim);
  font: inherit;
  position: relative;
  container-type: size;
}
/* the bar is a share of the plot area, which is the button minus its labels */
.pf-plot {
  flex: 1 1 auto;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 0;
}
.pf-bar {
  width: 100%;
  max-width: 64px;
  height: calc(var(--p, 0.06) * 100%);
  background: rgba(217, 180, 108, 0.3);
  border-top: 1px solid rgba(242, 221, 168, 0.5);
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
  margin-bottom: 6px;
}
.pf:hover .pf-bar { background: rgba(217, 180, 108, 0.6); }
.pf.is-on .pf-bar { background: rgba(217, 180, 108, 0.85); border-top-color: var(--gold-hi); }
.pf-n {
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
  color: #4d566c;
  line-height: 1.5;
}
.pf:hover .pf-n, .pf.is-on .pf-n { color: var(--gold); }
.pf-k {
  position: absolute;
  bottom: -2px;
  font-size: 9.5px;
  letter-spacing: 0.05em;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
  transform: translateY(100%);
  display: none;
}
@media (min-width: 861px) {
  .pf-k { display: block; }
  .tl-profile { padding-bottom: 26px; }
}

/* ---------- drawer ---------- */
#scrim {
  position: fixed;
  inset: 0;
  background: rgba(3, 5, 9, 0.55);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease), visibility 0.4s;
  z-index: 20;
}
#scrim.is-on { opacity: 1; visibility: visible; }

#drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: var(--drawer-w);
  height: 100%;
  visibility: hidden;
  background: linear-gradient(180deg, #0b101c 0%, #070a12 58%, #06080e 100%);
  border-left: 1px solid var(--line);
  transform: translateX(102%);
  transition: transform 0.46s var(--ease), visibility 0.46s;
  z-index: 30;
  display: flex;
  flex-direction: column;
  box-shadow: -30px 0 80px rgba(0, 0, 0, 0.55);
}
#drawer.is-on { transform: none; visibility: visible; }

.dw-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 30px;
  height: 30px;
  background: none;
  border: 1px solid transparent;
  color: var(--mist);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.dw-close:hover { color: var(--gold-hi); border-color: var(--line); }

.dw-body {
  overflow-y: auto;
  padding: 30px 30px 54px;
  scrollbar-width: thin;
  scrollbar-color: #232a3c transparent;
  overscroll-behavior: contain;
}
.dw-body::-webkit-scrollbar { width: 5px; }
.dw-body::-webkit-scrollbar-thumb { background: #232a3c; }

.dw-kicker {
  font-size: 10.5px;
  color: var(--gold);
  letter-spacing: 0.12em;
  margin: 0 0 8px;
}
.dw-title {
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1.28;
  letter-spacing: 0.02em;
  margin: 0 0 5px;
  color: var(--ivory);
  font-weight: 500;
}
.dw-en {
  font-size: 12px;
  color: var(--mist);
  letter-spacing: 0.03em;
  line-height: 1.45;
  margin: 0 0 4px;
}
.dw-place {
  font-size: 11.5px;
  color: var(--dim);
  letter-spacing: 0.05em;
  margin: 0 0 2px;
}

.dw-sec { margin-top: 26px; }
.dw-sec-h {
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--gold);
  margin: 0 0 11px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dw-sec-h .hint {
  color: var(--dim);
  letter-spacing: 0.04em;
  font-family: var(--sans);
  font-size: 10px;
}

/* stat block */
.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line-cool);
  border: 1px solid var(--line-cool);
}
.stat {
  background: #080c15;
  padding: 13px 14px 14px;
}
.stat-k {
  font-size: 10px;
  color: var(--dim);
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: 5px;
}
.stat-v {
  font-family: var(--serif);
  font-size: 23px;
  line-height: 1.1;
  color: var(--ivory);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  display: block;
}
.stat-v small {
  font-size: 11px;
  color: var(--mist);
  font-family: var(--sans);
  letter-spacing: 0.04em;
  margin-left: 5px;
}
.stat-v.is-none {
  color: var(--dim);
  font-size: 15px;
  font-family: var(--sans);
  letter-spacing: 0.04em;
}
.stat-note {
  display: block;
  margin-top: 6px;
  font-size: 10px;
  line-height: 1.55;
  color: var(--dim);
  letter-spacing: 0.02em;
}

/* star pieces */
.piece {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 14px;
  padding: 13px 0;
  border-top: 1px solid var(--line-cool);
}
.piece:first-of-type { border-top: 0; padding-top: 2px; }
.piece-img {
  width: 92px;
  height: 92px;
  background: #090d16;
  border: 1px solid rgba(217, 180, 108, 0.13);
  overflow: hidden;
  position: relative;
}
/* In the detail card the whole object should be visible, never cropped. */
.piece-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  opacity: 0;
  transition: opacity 0.5s var(--ease);
}
.piece-img img.is-failed { display: none; }
.piece-img img.is-loaded { opacity: 0.95; }
.piece-img .ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: #3c465c;
  letter-spacing: 0.1em;
  text-align: center;
  padding: 6px;
}
.piece-img img.is-loaded + .ph { display: none; }
.piece-name {
  font-family: var(--serif);
  font-size: 14.5px;
  line-height: 1.4;
  color: var(--ivory);
  margin: 0 0 5px;
  letter-spacing: 0.01em;
}
.piece-desc {
  font-size: 11.5px;
  line-height: 1.72;
  color: var(--mist);
  margin: 0;
  letter-spacing: 0.01em;
}
.piece-lic {
  margin-top: 7px;
  font-size: 9.5px;
  color: var(--dim);
  letter-spacing: 0.04em;
  line-height: 1.5;
}

/* visiting */
.dl { margin: 0; }
.dl-row {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line-cool);
}
.dl-row:last-child { border-bottom: 0; }
.dl-k {
  font-size: 10.5px;
  color: var(--dim);
  letter-spacing: 0.05em;
  padding-top: 2px;
}
.dl-v {
  font-size: 12px;
  line-height: 1.68;
  color: var(--ivory);
  letter-spacing: 0.01em;
  word-break: break-word;
}
.dl-v.muted { color: var(--mist); }
.dl-v.tiny { font-size: 11px; color: var(--mist); }

.hours {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  width: 100%;
}
.hours i {
  font-style: normal;
  font-size: 10.5px;
  color: var(--dim);
  width: 34px;
  flex: none;
  letter-spacing: 0.04em;
}
.hours span {
  font-size: 11.5px;
  color: var(--ivory);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}
.hours em {
  font-style: normal;
  color: var(--dim);
}
.hour-row {
  flex: 0 0 100%;
  display: flex;
  align-items: baseline;
  padding: 2px 0;
}

.price {
  font-family: var(--serif);
  font-size: 20px;
  color: var(--gold-hi);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}
.price small {
  font-size: 10.5px;
  color: var(--dim);
  font-family: var(--sans);
  letter-spacing: 0.05em;
  margin-left: 6px;
}
.conc {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}
.conc li {
  font-size: 11px;
  line-height: 1.65;
  color: var(--mist);
  display: flex;
  gap: 8px;
}
.conc li b {
  font-weight: 400;
  color: var(--ivory);
  flex: none;
  min-width: 54px;
}
.conc li span.p { color: var(--gold); font-variant-numeric: tabular-nums; flex: none; }

.dw-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid var(--line-2);
  padding-bottom: 2px;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
  word-break: break-all;
}
.dw-link:hover { color: var(--gold-hi); border-color: var(--gold); }

.dw-foot {
  margin-top: 30px;
  padding-top: 14px;
  border-top: 1px solid var(--line-cool);
  font-size: 10px;
  color: #47506a;
  line-height: 1.75;
  letter-spacing: 0.03em;
}

.dw-sec .prose {
  font-size: 11.5px;
  line-height: 1.78;
  color: var(--mist);
  margin: 0;
  letter-spacing: 0.01em;
}

/* ---------- footer note (global) ---------- */
.foot-note {
  position: fixed;
  left: 26px;
  bottom: 7px;
  z-index: 5;
  font-size: 9.5px;
  color: #3d465c;
  letter-spacing: 0.04em;
  pointer-events: none;
}

/* ---------- mobile ---------- */
@media (max-width: 860px) {
  :root { --rail-h: 56px; }
  .rail { padding: 0 14px; gap: 12px; }
  .rail::after { left: 14px; right: 14px; }
  .brand-sub { display: none; }
  .views { gap: 14px; }
  .view-btn { font-size: 12px; letter-spacing: 0.04em; }
  .view-btn .count { display: none; }
  .gv-scale { display: none; }
  .gv-tally { right: 14px; bottom: 74px; font-size: 10px; }
  .gv-hint { bottom: 16px; font-size: 10px; letter-spacing: 0.04em; }
  .wall-bar { padding: 12px 14px 10px; gap: 12px; }
  .q-wrap { max-width: none; }
  .foot-note { display: none; }

  #drawer {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 86dvh;
    border-left: 0;
    border-top: 1px solid var(--line-2);
    border-radius: 14px 14px 0 0;
    transform: translateY(101%);
    box-shadow: 0 -30px 80px rgba(0, 0, 0, 0.6);
  }
  #drawer.is-on { transform: none; }
  #drawer::before {
    content: "";
    position: absolute;
    top: 7px;
    left: 50%;
    transform: translateX(-50%);
    width: 34px;
    height: 3px;
    border-radius: 2px;
    background: #2b3346;
  }
  .dw-body { padding: 26px 18px 60px; }
  .dw-title { font-size: 22px; }
  .tl-jump { padding: 10px 14px 9px; }
  .tl-inner { padding: 2px 70vw 18px 14px; }
  .yr { width: 132px; }
  .yr-list { max-height: 30vh; }
  .tl-profile { min-height: 120px; padding: 10px 14px 18px; }
  .tl-profile::before { left: 14px; right: 14px; bottom: 29px; }
  .pf-bar { max-width: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.05ms !important;
  }
}
