:root {
  color-scheme: light;
  --ink: #18201c;
  --muted: #66716b;
  --paper: #f3f0e8;
  --paper-deep: #e8e3d7;
  --line: #c8c1b2;
  --pine: #335c50;
  --pine-dark: #203d35;
  --celadon: #86a69a;
  --mineral: #a25b42;
  --gold: #b98b44;
  --research: #75645b;
  --overview: #75645b;
  --white: #fffef9;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(rgba(51, 92, 80, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(51, 92, 80, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  letter-spacing: 0;
}

button, input, select { font: inherit; letter-spacing: 0; }

button, a, select { -webkit-tap-highlight-color: transparent; }

.layout-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 88px;
  display: grid;
  grid-template-columns: 170px minmax(320px, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 64px);
  color: #f7f3e9;
  background: rgba(24, 32, 28, 0.96);
  border-bottom: 1px solid rgba(185, 139, 68, 0.48);
  backdrop-filter: blur(14px);
}

.back-link {
  width: fit-content;
  color: #f7f3e9;
  text-decoration: none;
  border-bottom: 1px solid rgba(247, 243, 233, 0.5);
  padding: 7px 0;
  font-size: 14px;
}

.back-link:hover { color: #efd9a9; border-color: #efd9a9; }

.header-title p,
.section-heading p,
.records-heading p,
.hall-heading p {
  margin: 0 0 5px;
  color: inherit;
  font-size: 12px;
  line-height: 1.4;
}

.header-title p { color: #c9c7ba; }

.header-title {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.header-title > img {
  width: 42px;
  height: 56px;
  flex: 0 0 auto;
  border-radius: 6px;
  object-fit: cover;
}

.header-title > div { min-width: 0; }

.header-title h1 {
  margin: 0;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: clamp(24px, 2.4vw, 36px);
  font-weight: 500;
  line-height: 1.15;
}

.header-summary {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 1px;
  border: 1px solid rgba(247, 243, 233, 0.18);
  background: rgba(247, 243, 233, 0.18);
}

.header-summary span {
  min-width: 92px;
  padding: 10px 12px;
  text-align: center;
  background: rgba(24, 32, 28, 0.96);
  color: #c9c7ba;
  font-size: 11px;
}

.header-summary strong {
  display: block;
  color: #f7f3e9;
  font-size: 19px;
  line-height: 1.15;
}

main { padding: 36px clamp(16px, 4vw, 64px) 60px; }

.plan-section,
.hall-workbench,
.records-section {
  max-width: 1640px;
  margin: 0 auto 42px;
}

.section-heading,
.records-heading,
.hall-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 28px;
}

.section-heading h2,
.records-heading h2,
.hall-heading h2 {
  margin: 0;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: clamp(24px, 2.2vw, 34px);
  font-weight: 600;
  line-height: 1.2;
}

.section-heading p,
.records-heading p,
.hall-heading p { color: var(--muted); }

.legend { display: flex; flex-wrap: wrap; gap: 15px; color: var(--muted); font-size: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 18px; height: 9px; border: 1px solid rgba(24, 32, 28, 0.22); }
.legend-public { background: var(--pine); }
.legend-overview { background: var(--overview); }
.legend-corridor { background: var(--paper-deep); }

.plan-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 5px;
  margin: 16px 0 7px;
}

.plan-toolbar button {
  min-width: 36px;
  height: 32px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
}

.plan-toolbar button:hover { border-color: var(--pine); color: var(--pine); }
.plan-toolbar span { min-width: 48px; color: var(--muted); font-size: 12px; text-align: right; }

.plan-viewport {
  position: relative;
  width: 100%;
  height: 650px;
  overflow: auto;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 254, 249, 0.76);
  overscroll-behavior: contain;
}

.museum-plan {
  position: relative;
  width: 1510px;
  height: 620px;
  transform-origin: top left;
  transition: transform 180ms ease;
}

.plan-axis {
  position: absolute;
  left: 74px;
  top: 292px;
  width: 1326px;
  height: 39px;
  border: 1px solid #9d9586;
  background: var(--paper-deep);
}

.plan-axis::before {
  content: "入口";
  position: absolute;
  left: -38px;
  top: 8px;
  color: var(--mineral);
  font-weight: 700;
  font-size: 13px;
}

.plan-axis::after {
  content: "出口";
  position: absolute;
  right: -38px;
  top: 8px;
  color: var(--mineral);
  font-weight: 700;
  font-size: 13px;
}

.axis-title {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: #665f54;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 18px;
  white-space: nowrap;
}

.axis-tick {
  position: absolute;
  top: 0;
  width: 1px;
  height: 100%;
  background: rgba(102, 95, 84, 0.38);
}

.axis-tick span {
  position: absolute;
  top: 46px;
  left: 0;
  transform: translateX(-50%);
  color: #81796b;
  font-size: 10px;
  white-space: nowrap;
}

.plan-hall {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  padding: 9px 10px;
  overflow: hidden;
  border: 1px solid rgba(24, 32, 28, 0.45);
  border-radius: 2px;
  background: var(--pine);
  color: #f7f3e9;
  text-align: left;
  box-shadow: 0 6px 18px rgba(24, 32, 28, 0.08);
  cursor: pointer;
  transition: filter 150ms ease, transform 150ms ease, outline-color 150ms ease;
}

.plan-hall.overview { background: var(--overview); }
.plan-hall:hover { filter: brightness(1.08); }
.plan-hall.active { outline: 3px solid var(--gold); outline-offset: 3px; transform: translateY(-2px); }
.plan-hall.bottom.active { transform: translateY(2px); }
.plan-hall strong { font-size: 15px; line-height: 1.25; }
.plan-hall small { display: block; margin-top: 2px; color: rgba(247, 243, 233, 0.72); font-size: 10px; }
.plan-hall em { font-style: normal; font-size: 11px; }

.hall-connector {
  position: absolute;
  width: 1px;
  background: #8d8577;
  pointer-events: none;
}

.plan-era {
  position: absolute;
  transform: translateX(-50%);
  color: #5b645f;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 13px;
  white-space: nowrap;
}

.plan-area-key {
  position: absolute;
  left: 74px;
  top: 555px;
  color: #746d61;
  font-size: 11px;
}

.plan-note { margin: 10px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }

.hall-workbench { border-top: 1px solid var(--ink); }

.hall-tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
}

.hall-tabs button {
  flex: 0 0 auto;
  min-width: 128px;
  padding: 13px 16px 12px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}

.hall-tabs button strong { display: block; color: inherit; font-size: 14px; }
.hall-tabs button span { font-size: 10px; }
.hall-tabs button.active { background: var(--pine-dark); color: #f7f3e9; }

.hall-detail { padding: 26px 0 0; }
.hall-period { padding: 7px 11px; border: 1px solid var(--line); color: var(--pine); font-size: 12px; }

.hall-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  margin: 22px 0 28px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.metric { padding: 15px 16px; border-right: 1px solid var(--line); }
.metric:last-child { border-right: 0; }
.metric span { display: block; color: var(--muted); font-size: 10px; }
.metric strong { display: block; margin-top: 4px; font-size: 22px; font-weight: 600; }
.metric small { margin-left: 3px; color: var(--muted); font-size: 10px; }

.hall-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: clamp(30px, 6vw, 84px); }
.hall-grid h3, .category-line h3 { margin: 0 0 14px; font-size: 14px; font-weight: 700; }
.theme-units ol { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.theme-units li { display: grid; grid-template-columns: 32px 1fr auto; gap: 12px; align-items: center; min-height: 48px; border-bottom: 1px solid var(--line); }
.theme-units li span:first-child { color: var(--mineral); font-family: Georgia, serif; font-size: 18px; }
.theme-units li strong { font-size: 14px; font-weight: 500; }
.theme-units li em { color: var(--muted); font-style: normal; font-size: 11px; }
.theme-copy { display: grid; gap: 4px; padding: 10px 0; }
.theme-copy small { max-width: 720px; color: var(--muted); font-size: 11px; line-height: 1.55; }

.model-brief dl, .model-brief { margin: 0; }
.model-brief dl { border-top: 1px solid var(--line); }
.model-brief .brief-row { display: grid; grid-template-columns: 115px 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.model-brief dt { color: var(--muted); font-size: 11px; }
.model-brief dd { margin: 0; font-size: 13px; line-height: 1.45; }

.category-line { margin-top: 28px; }
#categoryChips { display: flex; flex-wrap: wrap; gap: 7px; }
.category-chip { padding: 6px 9px; border: 1px solid var(--line); background: rgba(255, 254, 249, 0.55); color: #4f5a54; font-size: 11px; }

.records-section { padding-top: 28px; border-top: 1px solid var(--ink); }
.records-tools { display: flex; gap: 10px; }
.records-tools label { display: grid; grid-template-columns: auto minmax(160px, 230px); align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.records-tools input, .records-tools select { height: 38px; border: 1px solid var(--line); border-radius: 0; background: var(--white); padding: 0 10px; color: var(--ink); }
.records-count { margin: 17px 0 7px; color: var(--muted); font-size: 11px; }
.records-count strong { color: var(--ink); font-size: 16px; }

.table-wrap { max-height: 600px; overflow: auto; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); background: rgba(255, 254, 249, 0.6); }
table { width: 100%; border-collapse: collapse; min-width: 980px; }
th, td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; font-size: 11px; line-height: 1.35; vertical-align: top; }
th { position: sticky; top: 0; z-index: 2; background: var(--pine-dark); color: #f7f3e9; font-weight: 500; }
td:nth-child(1) { color: var(--muted); width: 56px; }
td:nth-child(2) { min-width: 150px; font-weight: 700; }
td:nth-child(6) { min-width: 210px; }
tr:hover td { background: rgba(134, 166, 154, 0.12); }
.status-pill { display: inline-block; padding: 3px 6px; border: 1px solid #a8b8b1; color: var(--pine); white-space: nowrap; }
.status-pill.research { border-color: #b8aaa3; color: var(--research); }
.status-pill.extension { border-color: #b9975b; color: #8a642f; }
.status-pill.pending { border-color: #b7aea0; color: #796f61; }

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 22px clamp(16px, 4vw, 64px);
  border-top: 1px solid var(--line);
  background: var(--paper-deep);
  color: var(--muted);
  font-size: 10px;
}

@media (max-width: 980px) {
  .layout-header { grid-template-columns: auto 1fr; gap: 12px 18px; }
  .header-summary { grid-column: 1 / -1; width: 100%; }
  .header-summary span { width: 100%; min-width: 0; }
  .plan-viewport { height: 570px; }
  .hall-metrics { grid-template-columns: repeat(3, 1fr); }
  .metric:nth-child(3) { border-right: 0; }
  .metric:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .hall-grid { grid-template-columns: 1fr; }
  .records-heading { align-items: flex-start; flex-direction: column; }
  .records-tools { width: 100%; }
  .records-tools label { flex: 1; grid-template-columns: auto 1fr; }
}

@media (max-width: 620px) {
  .layout-header { position: relative; grid-template-columns: 1fr; padding: 15px 16px; }
  .back-link { order: 2; }
  .header-title { order: 1; }
  .header-summary { order: 3; }
  .header-title h1 { font-size: 25px; }
  main { padding-top: 24px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 12px; }
  .plan-viewport { height: 510px; }
  .hall-heading { align-items: flex-start; }
  .hall-metrics { grid-template-columns: repeat(2, 1fr); }
  .metric { border-bottom: 1px solid var(--line); }
  .metric:nth-child(2n) { border-right: 0; }
  .metric:nth-child(3) { border-right: 1px solid var(--line); }
  .metric:last-child { grid-column: 1 / -1; border-bottom: 0; }
  .records-tools { flex-direction: column; }
  .records-tools label { grid-template-columns: 42px 1fr; }
  footer { flex-direction: column; }
}

@media print {
  .layout-header { position: static; }
  .back-link, .plan-toolbar, .records-section { display: none; }
  body { background: #fff; }
  .plan-viewport { height: 620px; overflow: hidden; }
  .museum-plan { transform: scale(0.92) !important; }
}

.assembly-door { position:absolute; height:6px; background:#f3f0e8; border:1px solid #927447; z-index:3; }
.plan-lobby { position:absolute; display:grid; place-items:center; background:#e9e3d6; border:1px solid #9d9586; color:#574c3e; font-size:13px; text-decoration:none; }
.plan-axis::before { content:none; }
.plan-axis::after { content:"回程"; }
