:root {
  color-scheme: light;
  --paper: #f3efe5;
  --paper-deep: #e9e1d2;
  --ink: #18231f;
  --ink-soft: #52615a;
  --rule: #c8c0b2;
  --red: #a43c2d;
  --red-dark: #76281f;
  --green: #1d4b3e;
  --gold: #ba8a3b;
  --white: #fbfaf6;
  --shadow: 0 22px 60px rgba(40, 38, 31, 0.12);
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --serif: Iowan Old Style, "Songti SC", "STSong", "Noto Serif CJK SC", Georgia, serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  color: inherit;
  font: inherit;
}

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

a {
  color: inherit;
}

.page-shell {
  width: min(1420px, calc(100% - 80px));
  margin-inline: auto;
}

.masthead {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: 250px 1fr 170px;
  align-items: center;
  min-height: 76px;
  padding: 0 40px;
  border-bottom: 1px solid rgba(24, 35, 31, 0.22);
  background: rgba(243, 239, 229, 0.93);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: 20px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: 0.08em;
}

.brand small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 9px;
  letter-spacing: 0.26em;
}

.masthead nav {
  display: flex;
  justify-content: center;
  gap: clamp(16px, 2.3vw, 38px);
}

.masthead nav a {
  position: relative;
  color: #34423c;
  font-size: 13px;
  text-decoration: none;
}

.masthead nav a::after {
  position: absolute;
  right: 0;
  bottom: -11px;
  left: 0;
  height: 1px;
  background: var(--red);
  content: "";
  transform: scaleX(0);
  transition: transform 160ms ease;
}

.masthead nav a:hover::after,
.masthead nav a:focus-visible::after {
  transform: scaleX(1);
}

.edition {
  justify-self: end;
  padding: 8px 12px;
  border: 1px solid var(--rule);
  border-radius: 100px;
  color: var(--ink-soft);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 80px;
  min-height: 650px;
  padding-top: 106px;
  padding-bottom: 120px;
}

.hero::before {
  position: absolute;
  z-index: -1;
  top: 20px;
  right: 24%;
  width: 420px;
  height: 420px;
  border: 1px solid rgba(164, 60, 45, 0.16);
  border-radius: 50%;
  content: "";
}

.hero::after {
  position: absolute;
  z-index: -1;
  top: 88px;
  right: calc(24% + 66px);
  width: 286px;
  height: 286px;
  border: 1px solid rgba(164, 60, 45, 0.11);
  border-radius: 50%;
  content: "";
}

.eyebrow,
.section-number {
  margin: 0 0 18px;
  color: var(--red);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 850px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(54px, 6.8vw, 104px);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.hero h1 em {
  color: var(--red);
  font-weight: 400;
}

.hero-intro {
  max-width: 650px;
  margin: 38px 0 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.9;
}

.hero-actions {
  display: flex;
  gap: 32px;
  align-items: center;
  margin-top: 38px;
}

.primary-action {
  display: inline-flex;
  gap: 36px;
  align-items: center;
  padding: 14px 18px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--white);
  font-size: 12px;
  text-decoration: none;
  transition: background 150ms ease, color 150ms ease;
}

.primary-action:hover {
  background: transparent;
  color: var(--ink);
}

.text-action {
  color: var(--ink-soft);
  font-size: 12px;
  text-underline-offset: 5px;
}

.hero-note {
  align-self: center;
  padding: 32px;
  border-top: 3px solid var(--red);
  background: rgba(251, 250, 246, 0.68);
  box-shadow: var(--shadow);
  transform: rotate(1.2deg);
}

.folio {
  color: var(--red);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.hero-note blockquote {
  margin: 28px 0;
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.75;
}

.note-rule {
  width: 50px;
  height: 1px;
  background: var(--red);
}

.hero-note p {
  margin: 20px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.8;
}

.hero-stats {
  position: absolute;
  bottom: 40px;
  left: 0;
  display: flex;
  width: min(800px, 70%);
  border-top: 1px solid var(--rule);
}

.hero-stats > div {
  flex: 1;
  padding: 20px 24px 0 0;
}

.hero-stats strong,
.hero-stats span {
  display: block;
}

.hero-stats strong {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 500;
}

.hero-stats span {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.history-section {
  padding: 100px 0 110px;
  background: var(--ink);
  color: var(--paper);
}

.section-heading {
  margin-bottom: 48px;
}

.section-heading h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(38px, 4vw, 62px);
  font-weight: 500;
  letter-spacing: -0.04em;
}

.section-heading > p:not(.section-number),
.split-heading > p {
  color: var(--ink-soft);
  font-family: var(--serif);
  line-height: 1.8;
}

.split-heading {
  display: grid;
  grid-template-columns: 1fr 480px;
  gap: 80px;
  align-items: end;
}

.split-heading > p {
  margin: 0 0 4px;
}

.history-section .split-heading > p {
  color: #abb6af;
}

.period-rail {
  border-top: 1px solid #53625c;
}

.period-item {
  display: grid;
  grid-template-columns: 82px minmax(270px, 0.9fr) minmax(320px, 1.3fr) 130px;
  gap: 26px;
  width: 100%;
  padding: 24px 8px;
  border: 0;
  border-bottom: 1px solid #3f4e48;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 150ms ease, padding 150ms ease;
}

.period-item:hover,
.period-item:focus-visible {
  padding-inline: 18px;
  background: #22342d;
  outline: none;
}

.period-index {
  color: var(--gold);
  font-family: var(--serif);
  font-size: 13px;
}

.period-item h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
}

.period-item p {
  margin: 0;
  color: #9daba5;
  font-size: 12px;
  line-height: 1.75;
}

.period-date {
  justify-self: end;
  color: #bec8c3;
  font-family: var(--serif);
  font-size: 12px;
  text-align: right;
}

.problem-section,
.model-section {
  padding-top: 110px;
  padding-bottom: 120px;
}

.problem-section .section-heading > p:not(.section-number) {
  max-width: 600px;
  margin-top: 20px;
}

.problem-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--rule);
  background: var(--rule);
}

.problem-card {
  position: relative;
  min-height: 230px;
  padding: 30px;
  border: 0;
  background: var(--paper);
  text-align: left;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.problem-card:hover,
.problem-card:focus-visible {
  background: var(--red);
  color: var(--white);
  outline: none;
}

.problem-card .card-type {
  color: var(--red);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.problem-card:hover .card-type,
.problem-card:focus-visible .card-type,
.problem-card:hover p,
.problem-card:focus-visible p {
  color: #f2d9d2;
}

.problem-card h3 {
  margin: 36px 0 14px;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 500;
}

.problem-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.7;
}

.problem-card .card-arrow {
  position: absolute;
  right: 24px;
  bottom: 24px;
  font-size: 20px;
}

.graph-section {
  padding: 104px 0 120px;
  background: var(--paper-deep);
}

.graph-heading {
  margin-bottom: 44px;
}

.graph-workbench {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 310px;
  min-height: 680px;
  border: 1px solid var(--rule);
  background: var(--white);
  box-shadow: var(--shadow);
}

.graph-controls,
.detail-panel {
  padding: 24px;
}

.graph-controls {
  border-right: 1px solid var(--rule);
  background: #eee9de;
}

.control-block {
  padding: 20px 0;
  border-bottom: 1px solid var(--rule);
}

.control-block:first-child {
  padding-top: 0;
}

.control-block > label,
.control-block > span,
.control-label-row > span {
  display: block;
  margin-bottom: 11px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.search-block {
  position: relative;
}

.search-field {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
  border-bottom: 1px solid var(--ink);
  background: rgba(255, 255, 255, 0.45);
}

.search-field input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 12px;
}

.search-results {
  position: absolute;
  z-index: 5;
  top: 72px;
  right: 0;
  left: 0;
  overflow: auto;
  max-height: 270px;
  border: 1px solid var(--rule);
  background: var(--white);
  box-shadow: 0 14px 35px rgba(20, 25, 22, 0.15);
}

.search-result {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid #e2ddd2;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.search-result:hover {
  background: #f1ede4;
}

.search-result strong,
.search-result small {
  display: block;
}

.search-result strong {
  font-family: var(--serif);
  font-size: 13px;
}

.search-result small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 9px;
}

.control-label-row {
  display: flex;
  justify-content: space-between;
  align-items: start;
}

.quiet-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--red);
  font-size: 9px;
  cursor: pointer;
}

.kind-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.kind-filter {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 6px 8px;
  border: 1px solid var(--rule);
  border-radius: 100px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 9px;
  cursor: pointer;
}

.kind-filter::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--kind-color, #777);
  content: "";
}

.kind-filter[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--white);
}

.control-block select {
  width: 100%;
  padding: 9px;
  border: 1px solid var(--rule);
  border-radius: 0;
  background: var(--white);
  font-size: 11px;
}

.legend-block p {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 9px 0;
  color: var(--ink-soft);
  font-size: 9px;
}

.line-sample {
  display: inline-block;
  width: 23px;
  height: 0;
  border-top: 1px solid var(--ink);
}

.line-sample.disputed {
  border-top-style: dashed;
  border-color: var(--red);
}

.node-sample {
  display: inline-block;
  width: 9px;
  height: 9px;
  border: 2px solid var(--red);
  border-radius: 50%;
}

.graph-canvas-card {
  min-width: 0;
  background-color: #f7f4ed;
  background-image: radial-gradient(#c7c0b2 0.6px, transparent 0.6px);
  background-size: 17px 17px;
}

.canvas-toolbar {
  display: flex;
  position: relative;
  z-index: 2;
  justify-content: space-between;
  align-items: center;
  height: 57px;
  padding: 0 20px;
  border-bottom: 1px solid var(--rule);
  background: rgba(247, 244, 237, 0.92);
  color: var(--ink-soft);
  font-size: 10px;
}

.canvas-toolbar strong {
  color: var(--ink);
  font-weight: 600;
}

.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--red);
}

.graph-canvas {
  position: relative;
  min-height: 622px;
}

#graphSvg {
  display: block;
  width: 100%;
  height: 622px;
}

.graph-edge-visible {
  stroke: #758079;
  stroke-width: 1.1;
}

.graph-edge-visible.disputed {
  stroke: var(--red);
  stroke-dasharray: 5 5;
}

.graph-edge-hit {
  stroke: transparent;
  stroke-width: 14;
  cursor: pointer;
}

.graph-edge-group:hover .graph-edge-visible,
.graph-edge-group:focus .graph-edge-visible {
  stroke: var(--red-dark);
  stroke-width: 2;
}

.edge-label {
  fill: #56635d;
  font-family: var(--sans);
  font-size: 8px;
  paint-order: stroke;
  stroke: #f7f4ed;
  stroke-width: 4px;
  stroke-linejoin: round;
  text-anchor: middle;
}

.node-group {
  cursor: pointer;
  outline: none;
}

.node-shape {
  fill: #fbfaf6;
  stroke: var(--node-color);
  stroke-width: 1.4;
  filter: drop-shadow(0 5px 6px rgba(20, 30, 26, 0.08));
}

.node-group.center .node-shape,
.node-group:hover .node-shape,
.node-group:focus .node-shape {
  fill: var(--ink);
  stroke-width: 2.5;
}

.node-title {
  fill: var(--ink);
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 600;
  text-anchor: middle;
  pointer-events: none;
}

.node-kind {
  fill: var(--node-color);
  font-family: var(--sans);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-anchor: middle;
  pointer-events: none;
}

.node-group.center .node-title,
.node-group:hover .node-title,
.node-group:focus .node-title {
  fill: var(--white);
}

.node-group.center .node-kind,
.node-group:hover .node-kind,
.node-group:focus .node-kind {
  fill: #d9cbb8;
}

.graph-empty {
  position: absolute;
  top: 45%;
  right: 20%;
  left: 20%;
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  text-align: center;
}

.detail-panel {
  overflow: auto;
  max-height: 680px;
  border-left: 1px solid var(--rule);
  background: var(--white);
}

.detail-placeholder {
  margin: 60px 4px;
  color: #879088;
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.8;
}

.detail-kicker {
  display: flex;
  justify-content: space-between;
  color: var(--red);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.detail-panel h3 {
  margin: 22px 0 12px;
  font-family: var(--serif);
  font-size: 29px;
  font-weight: 500;
  line-height: 1.2;
}

.detail-portrait {
  margin: 20px 0 24px;
}

.detail-portrait img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid var(--rule);
  background: var(--paper);
  object-fit: cover;
}

.detail-portrait figcaption {
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.55;
}

.detail-aliases,
.detail-temporal {
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.6;
}

.detail-summary {
  margin: 24px 0;
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.75;
}

.detail-section {
  padding-top: 20px;
  border-top: 1px solid var(--rule);
}

.detail-section + .detail-section {
  margin-top: 20px;
}

.detail-section h4 {
  margin: 0 0 12px;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.relation-link {
  display: block;
  width: 100%;
  padding: 9px 0;
  border: 0;
  border-bottom: 1px dotted var(--rule);
  background: transparent;
  font-family: var(--serif);
  font-size: 12px;
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
}

.relation-link:hover {
  color: var(--red);
}

.relation-link small {
  display: block;
  margin-top: 2px;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 8px;
}

.assertion-path {
  display: grid;
  gap: 8px;
  margin: 22px 0;
  padding: 16px;
  border-left: 2px solid var(--red);
  background: #f2eee5;
  font-family: var(--serif);
  font-size: 14px;
}

.assertion-path strong {
  color: var(--red);
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.status-chip {
  padding: 5px 7px;
  border: 1px solid var(--rule);
  border-radius: 100px;
  color: var(--ink-soft);
  font-size: 8px;
}

.status-chip.disputed,
.status-chip.hypothesis {
  border-color: #d9a196;
  color: var(--red);
}

.scope-note {
  margin: 0 0 22px;
  padding: 12px;
  border: 1px solid #e0c8ad;
  background: #fff7e8;
  color: #6a5441;
  font-size: 10px;
  line-height: 1.65;
}

.evidence-item {
  padding: 12px 0;
  border-bottom: 1px dotted var(--rule);
}

.evidence-item strong,
.evidence-item span,
.evidence-item p {
  display: block;
}

.evidence-item strong {
  font-family: var(--serif);
  font-size: 12px;
}

.evidence-item span {
  margin-top: 5px;
  color: var(--red);
  font-size: 9px;
}

.evidence-item p {
  margin: 7px 0 0;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.6;
}

.model-flow {
  display: grid;
  grid-template-columns: 1fr 45px 1fr 45px 1fr;
  align-items: center;
}

.model-flow article {
  min-height: 260px;
  padding: 32px;
  border: 1px solid var(--rule);
  background: rgba(255, 255, 255, 0.25);
}

.model-flow article > span {
  color: var(--red);
  font-family: var(--serif);
  font-size: 13px;
}

.model-flow h3 {
  margin: 38px 0 14px;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 500;
}

.model-flow p {
  min-height: 55px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.7;
}

.model-flow code {
  display: inline-block;
  margin-top: 12px;
  color: var(--red);
  font-size: 10px;
}

.model-flow .accent-card {
  border-color: var(--red);
  background: var(--red);
  color: var(--white);
}

.model-flow .accent-card > span,
.model-flow .accent-card code {
  color: #ffd1c7;
}

.model-flow .accent-card p {
  color: #f3d5ce;
}

.flow-arrow {
  color: var(--red);
  font-size: 24px;
  text-align: center;
}

.learning-section {
  padding: 78px 0;
  background: var(--red);
  color: var(--white);
}

.learning-inner {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 70px;
  align-items: center;
}

.learning-section .section-number {
  color: #f2c1b6;
}

.learning-section h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 40px;
  font-weight: 500;
}

.learning-section p {
  color: #f3d6d0;
  font-family: var(--serif);
  line-height: 1.8;
}

.learning-section a {
  white-space: nowrap;
  font-size: 11px;
  text-underline-offset: 6px;
}

.footer {
  display: flex;
  justify-content: space-between;
  padding-top: 28px;
  padding-bottom: 28px;
  color: var(--ink-soft);
  font-size: 9px;
  letter-spacing: 0.1em;
}

@media (max-width: 1120px) {
  .masthead {
    grid-template-columns: 220px 1fr;
  }

  .masthead nav {
    justify-content: end;
  }

  .edition {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr 270px;
    gap: 40px;
  }

  .graph-workbench {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .detail-panel {
    grid-column: 1 / -1;
    min-height: 260px;
    max-height: none;
    border-top: 1px solid var(--rule);
    border-left: 0;
  }
}

@media (max-width: 820px) {
  .page-shell {
    width: min(100% - 36px, 680px);
  }

  .masthead {
    position: static;
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 18px;
  }

  .masthead nav {
    justify-content: start;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .masthead nav a {
    white-space: nowrap;
  }

  .hero {
    display: block;
    min-height: 0;
    padding: 72px 0 170px;
  }

  .hero-note {
    width: min(100%, 420px);
    margin-top: 60px;
  }

  .hero-stats {
    bottom: 35px;
    width: 100%;
  }

  .split-heading {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .period-item {
    grid-template-columns: 45px 1fr;
  }

  .period-item p,
  .period-date {
    grid-column: 2;
    justify-self: start;
    text-align: left;
  }

  .problem-list {
    grid-template-columns: 1fr;
  }

  .graph-workbench {
    grid-template-columns: 1fr;
  }

  .graph-controls {
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }

  .graph-canvas {
    overflow-x: auto;
  }

  #graphSvg {
    min-width: 680px;
  }

  .model-flow {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .flow-arrow {
    transform: rotate(90deg);
  }

  .learning-inner {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

@media (max-width: 520px) {
  .hero h1 {
    font-size: 48px;
  }

  .hero-actions {
    align-items: start;
    flex-direction: column;
  }

  .hero-stats > div {
    padding-right: 8px;
  }

  .hero-stats strong {
    font-size: 23px;
  }

  .hero-stats span {
    font-size: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}

[hidden] {
  display: none !important;
}

body.route-active #top > section:not(#corpusRoute) {
  display: none;
}

body.route-active #top {
  min-height: calc(100vh - 132px);
}

.corpus-route {
  padding-top: 54px;
  padding-bottom: 100px;
}

.route-loading,
.empty-state {
  padding: 64px 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 18px;
  text-align: center;
}

.breadcrumbs {
  display: flex;
  gap: 9px;
  align-items: center;
  margin-bottom: 52px;
  color: var(--ink-soft);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.breadcrumbs a {
  text-underline-offset: 4px;
}

.breadcrumbs span[aria-hidden="true"] {
  color: var(--rule);
}

.corpus-page-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 80px;
  align-items: end;
  margin-bottom: 54px;
  padding-bottom: 42px;
  border-bottom: 1px solid var(--ink);
}

.corpus-page-header h1,
.reader-header h1,
.route-error h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(46px, 5.4vw, 78px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.corpus-page-header > div > p:last-child {
  max-width: 760px;
  margin: 24px 0 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.8;
}

.corpus-page-header dl {
  display: flex;
  gap: 34px;
  margin: 0;
}

.corpus-page-header dl div {
  min-width: 88px;
  padding-left: 14px;
  border-left: 1px solid var(--red);
}

.corpus-page-header dt,
.edition-counts dt,
.metadata-list dt {
  color: var(--ink-soft);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.corpus-page-header dd {
  margin: 7px 0 0;
  font-family: var(--serif);
  font-size: 18px;
}

.corpus-filters {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 220px 240px auto;
  gap: 14px;
  align-items: end;
  padding: 22px;
  border: 1px solid var(--rule);
  background: rgba(251, 250, 246, 0.65);
}

.corpus-filters label,
.fulltext-form label {
  display: grid;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.corpus-filters input,
.corpus-filters select,
.fulltext-form input {
  width: 100%;
  height: 43px;
  padding: 0 12px;
  border: 1px solid var(--rule);
  border-radius: 0;
  outline: none;
  background: var(--white);
  font-size: 12px;
}

.corpus-filters input:focus,
.corpus-filters select:focus,
.fulltext-form input:focus {
  border-color: var(--red);
}

.corpus-filters button,
.fulltext-form button,
.reader-source button {
  min-height: 43px;
  padding: 0 18px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--white);
  cursor: pointer;
}

.catalog-result-line {
  display: flex;
  justify-content: space-between;
  margin-top: 26px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-soft);
  font-size: 11px;
}

.catalog-result-line strong {
  color: var(--red);
}

.catalog-result-line a,
.card-actions a {
  text-underline-offset: 4px;
}

.work-card {
  display: grid;
  grid-template-columns: 50px minmax(240px, 0.7fr) minmax(0, 1.3fr);
  gap: 34px;
  padding: 42px 0;
  border-bottom: 1px solid var(--rule);
}

.work-index {
  color: var(--red);
  font-family: var(--serif);
  font-size: 12px;
}

.work-card h2 {
  margin: 0 0 14px;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 500;
}

.work-card h2 a,
.edition-card h3 a {
  text-decoration: none;
}

.work-card h2 a:hover,
.edition-card h3 a:hover {
  color: var(--red);
}

.work-card > div > p {
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.75;
}

.work-versions,
.edition-grid {
  display: grid;
  gap: 16px;
}

.edition-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.edition-card {
  padding: 24px;
  border: 1px solid var(--rule);
  background: rgba(251, 250, 246, 0.72);
}

.edition-card-topline,
.result-context {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--red);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.edition-card h3 {
  margin: 18px 0 10px;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
}

.edition-card > p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.65;
}

.edition-counts {
  display: flex;
  gap: 32px;
  margin: 20px 0;
}

.edition-counts dd {
  margin: 4px 0 0;
  font-family: var(--serif);
  font-size: 16px;
}

.card-actions {
  display: flex;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  font-size: 10px;
}

.card-actions a:last-child {
  color: var(--red);
}

.edition-profile {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.65fr);
  gap: 80px;
}

.edition-profile h2 {
  margin: 0 0 30px;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 500;
}

.metadata-list {
  margin: 0;
  border-top: 1px solid var(--rule);
}

.metadata-list div {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
}

.metadata-list dd {
  margin: 0;
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.65;
}

.primary-route-actions {
  display: flex;
  gap: 30px;
  align-items: center;
  margin-top: 36px;
}

.toc-preview,
.reader-toc,
.reader-source {
  padding: 26px;
  border: 1px solid var(--rule);
  background: rgba(251, 250, 246, 0.6);
}

.toc-preview ol,
.reader-toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc-preview li,
.reader-toc li {
  padding: 9px 0 9px calc(var(--toc-depth, 0) * 13px);
  border-bottom: 1px dotted var(--rule);
  font-family: var(--serif);
  font-size: 12px;
  line-height: 1.45;
}

.toc-preview a,
.reader-toc a {
  text-decoration: none;
}

.toc-preview a:hover,
.reader-toc a:hover {
  color: var(--red);
}

.muted-note {
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.6;
}

.reader-header {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  align-items: end;
  margin-bottom: 34px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--ink);
}

.reader-header h1 {
  font-size: clamp(38px, 4.4vw, 62px);
}

.reader-progress {
  display: flex;
  gap: 8px;
  align-items: baseline;
  color: var(--ink-soft);
}

.reader-progress strong {
  color: var(--red);
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
}

.reader-progress span {
  font-size: 9px;
  letter-spacing: 0.08em;
}

.reader-layout {
  display: grid;
  grid-template-columns: 220px minmax(440px, 1fr) 250px;
  gap: 24px;
  align-items: start;
}

.reader-toc,
.reader-source {
  position: sticky;
  top: 100px;
  overflow: auto;
  max-height: calc(100vh - 124px);
  padding: 18px;
}

.reader-aside-label {
  margin: 0 0 16px;
  color: var(--red);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.reader-toc li {
  font-size: 10px;
}

.reader-text {
  min-width: 0;
  padding: 16px clamp(24px, 4vw, 64px) 38px;
  border: 1px solid var(--rule);
  background: var(--white);
  box-shadow: var(--shadow);
}

.text-segment {
  position: relative;
  padding: 36px 0;
  border-bottom: 1px solid #e5dfd4;
}

.text-segment.focal::before {
  position: absolute;
  top: 30px;
  bottom: 30px;
  left: -22px;
  width: 3px;
  background: var(--red);
  content: "";
}

.segment-meta {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 8px;
  letter-spacing: 0.06em;
}

.segment-meta a {
  color: var(--red);
  text-decoration: none;
}

.text-segment > p {
  margin: 20px 0;
  font-family: var(--serif);
  font-size: clamp(17px, 1.5vw, 21px);
  line-height: 1.95;
}

.anchor-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.anchor-chip {
  display: inline-flex;
  gap: 6px;
  max-width: 100%;
  padding: 5px 7px;
  border: 1px solid #ddd4c6;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 8px;
  overflow-wrap: anywhere;
}

.anchor-chip strong {
  color: var(--red);
  text-transform: uppercase;
}

.reader-pagination {
  display: flex;
  justify-content: space-between;
  padding-top: 32px;
  font-size: 10px;
}

.reader-pagination a {
  text-underline-offset: 5px;
}

.reader-source > strong,
.reader-source > p {
  overflow-wrap: anywhere;
}

.reader-source > strong {
  color: var(--red);
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.6;
}

.reader-source > p {
  color: var(--ink-soft);
  font-size: 8px;
  line-height: 1.5;
}

.reader-source button {
  width: 100%;
  min-height: 36px;
  margin: 10px 0 22px;
  font-size: 9px;
}

.source-note {
  padding: 16px 0;
  border-top: 1px solid var(--rule);
}

.source-note span {
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.source-note p,
.source-note a {
  font-family: var(--serif);
  font-size: 10px;
  line-height: 1.65;
}

.source-note a {
  color: var(--red);
  text-underline-offset: 4px;
}

.fulltext-form {
  max-width: 880px;
  margin: 0 auto 46px;
}

.fulltext-form > div {
  display: grid;
  grid-template-columns: 1fr auto;
  margin-top: 9px;
}

.fulltext-form input {
  height: 56px;
  border-color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
}

.fulltext-form button {
  min-width: 100px;
  min-height: 56px;
}

.fulltext-results {
  max-width: 1000px;
  margin: 0 auto;
}

.search-summary {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ink);
  color: var(--ink-soft);
  font-size: 10px;
}

.fulltext-result {
  padding: 30px 0;
  border-bottom: 1px solid var(--rule);
}

.result-context {
  justify-content: start;
}

.result-context span + span::before {
  margin-right: 12px;
  color: var(--rule);
  content: "/";
}

.fulltext-result > p {
  margin: 16px 0;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.85;
}

.fulltext-result footer {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  align-items: end;
}

.fulltext-result code {
  color: var(--ink-soft);
  font-size: 9px;
  overflow-wrap: anywhere;
}

.fulltext-result footer a {
  flex: 0 0 auto;
  color: var(--red);
  font-size: 10px;
  text-underline-offset: 4px;
}

.route-error {
  max-width: 760px;
  padding: 80px 0 160px;
}

.route-error p:not(.section-number) {
  margin: 24px 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 17px;
}

.route-error a {
  color: var(--red);
  text-underline-offset: 5px;
}

@media (max-width: 1120px) {
  .corpus-filters {
    grid-template-columns: 1fr 180px 210px;
  }

  .corpus-filters button {
    grid-column: 1 / -1;
  }

  .reader-layout {
    grid-template-columns: 190px minmax(0, 1fr);
  }

  .reader-source {
    position: static;
    grid-column: 1 / -1;
    max-height: none;
  }
}

@media (max-width: 820px) {
  .corpus-route {
    padding-top: 34px;
  }

  .corpus-page-header,
  .edition-profile {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .corpus-page-header dl {
    flex-wrap: wrap;
  }

  .corpus-filters,
  .work-card,
  .edition-grid,
  .reader-layout {
    grid-template-columns: 1fr;
  }

  .corpus-filters button {
    grid-column: auto;
  }

  .work-card {
    gap: 20px;
  }

  .reader-header {
    align-items: start;
    flex-direction: column;
  }

  .reader-toc,
  .reader-source {
    position: static;
    max-height: 320px;
  }

  .reader-source {
    grid-column: auto;
    max-height: none;
  }
}

@media (max-width: 520px) {
  .corpus-page-header h1,
  .route-error h1 {
    font-size: 42px;
  }

  .corpus-page-header dl,
  .primary-route-actions,
  .fulltext-result footer {
    align-items: start;
    flex-direction: column;
  }

  .metadata-list div {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .reader-text {
    padding-inline: 24px;
  }

  .fulltext-form > div {
    grid-template-columns: 1fr;
  }
}

/* 关系图谱独立页 */
.graph-section {
  display: none;
}

.graph-entry {
  padding: 96px 0 8px;
}

.graph-entry .primary-action {
  display: inline-flex;
  margin-top: 4px;
}

body.graph-route #top > section:not(#graph) {
  display: none;
}

body.graph-route .graph-section {
  display: block;
  padding: 56px 0 72px;
}

body.graph-route .graph-canvas {
  min-height: calc(100vh - 320px);
}

body.graph-route #graphSvg {
  height: calc(100vh - 320px);
  min-height: 640px;
}

body.graph-route .detail-panel {
  max-height: none;
  overflow: visible;
}

body.graph-route .graph-controls,
body.graph-route .graph-canvas-card {
  position: sticky;
  top: 84px;
  align-self: start;
}
