:root {
  --paper: #f7f5ef;
  --paper-2: #efede6;
  --ink: #24231f;
  --muted: #6d6a61;
  --rule: #d8d3c7;
  --rule-strong: #aaa397;
  --blue: #536a76;
  --blue-light: #d8e0e2;
  --terra: #b04f32;
  --olive: #77775a;
  --white: #fffdf8;
  --shadow: 0 1px 0 rgba(36, 35, 31, 0.04);
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --serif: Georgia, "Times New Roman", "Songti SC", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.72;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: rgba(83, 106, 118, 0.08);
  padding: 0.06rem 0.22rem;
}

.page-shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  border-bottom: 1px solid var(--rule);
  padding: 56px 0 30px;
}

.kicker {
  color: var(--blue);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 22px;
}

h1,
h2,
h3 {
  letter-spacing: 0;
  line-height: 1.16;
  margin: 0;
}

h1 {
  max-width: 1040px;
  font-family: var(--serif);
  font-size: clamp(34px, 4.6vw, 58px);
  font-weight: 500;
  line-height: 1.08;
}

h1 span {
  display: block;
  white-space: nowrap;
}

.subtitle {
  max-width: 760px;
  color: #4f4c46;
  font-size: clamp(14px, 1.55vw, 18px);
  line-height: 1.48;
  margin: 20px 0 0;
}

.opening {
  max-width: 900px;
  margin: 28px 0 0;
  font-size: 17px;
  line-height: 1.75;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule);
  margin-top: 34px;
}

.metric {
  min-height: 92px;
  padding: 16px 18px 14px 0;
  border-right: 1px solid var(--rule);
}

.metric:last-child {
  border-right: 0;
}

.metric-value {
  display: block;
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1;
}

.metric-label {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
}

.disclaimer,
.fine-note {
  color: var(--muted);
  font-size: 13px;
}

.disclaimer {
  margin: 16px 0 0;
}

.report-layout {
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  column-gap: 52px;
}

.toc {
  position: sticky;
  top: 18px;
  align-self: start;
  padding-top: 40px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
}

.toc a {
  display: block;
  padding: 9px 0;
  color: var(--muted);
  border-bottom: 1px solid rgba(216, 211, 199, 0.65);
  text-decoration: none;
}

.toc a:hover,
.toc a:focus {
  color: var(--ink);
}

.toc-group {
  display: block;
  margin: 18px 0 2px;
  color: var(--terra);
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
}

.toc-group:first-child {
  margin-top: 0;
}

.toc-brand-mark {
  margin-top: 86px;
  padding: 12px 10px;
  background: #242a2b;
  border: 1px solid rgba(36, 35, 31, 0.28);
}

.toc-brand-mark img {
  display: block;
  width: 100%;
  height: auto;
}

.report {
  min-width: 0;
}

.section {
  position: relative;
  max-width: 960px;
  padding: 54px 0;
  border-bottom: 1px solid var(--rule);
}

.section.wide {
  max-width: 100%;
}

.part-divider {
  max-width: 960px;
  padding: 38px 0 18px;
  border-bottom: 1px solid var(--rule-strong);
}

.part-divider span {
  display: block;
  color: var(--terra);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 650;
  margin-bottom: 8px;
}

.part-divider strong {
  display: block;
  font-family: var(--serif);
  color: var(--terra);
  font-size: clamp(28px, 3vw, 34px);
  font-weight: 500;
  line-height: 1.15;
}

.part-divider p {
  color: var(--muted);
  font-size: 14px;
  margin: 12px 0 0;
}

.section-number {
  color: var(--terra);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 650;
  margin-bottom: 10px;
}

h2 {
  font-family: var(--serif);
  color: var(--ink);
  font-size: clamp(23px, 2.2vw, 28px);
  font-weight: 500;
  margin-bottom: 20px;
}

h3 {
  font-size: 15px;
  font-weight: 650;
  margin-bottom: 9px;
}

p {
  margin: 0 0 16px;
  max-width: 860px;
}

.section-lead {
  color: var(--muted);
}

.three-column,
.two-column,
.story-grid,
.example-grid,
.chart-grid,
.network-grid,
.network-notes,
.reflection-grid,
.reflection-stack {
  display: grid;
  gap: 18px;
}

.three-column {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 26px;
}

.two-column,
.split {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 34px;
}

.story-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 30px;
}

.story-grid > div:first-child {
  grid-column: span 2;
}

.note-block,
.story-grid > div,
.example-grid > div {
  border-top: 1px solid var(--rule-strong);
  padding-top: 13px;
}

.note-block p,
.story-grid p {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}

.flow-diagram,
.evidence-ladder {
  background: var(--white);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow);
  padding: 18px;
}

.flow-diagram {
  display: grid;
  gap: 9px;
  font-family: var(--mono);
  font-size: 12px;
  align-content: start;
}

.flow-diagram div,
.flow-diagram strong {
  border-bottom: 1px solid var(--rule);
  padding: 7px 0;
}

.flow-rule {
  display: block;
  height: 28px;
  border-left: 1px solid var(--terra);
  margin-left: 8px;
}

.evidence-ladder {
  display: grid;
  gap: 0;
}

.ladder-row,
.ladder-result {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
}

.ladder-row:first-child {
  padding-top: 0;
}

.ladder-row span,
.ladder-result span {
  color: var(--terra);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
}

.ladder-row strong,
.ladder-result strong {
  display: block;
  line-height: 1.25;
}

.ladder-row em,
.ladder-result em {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
}

.ladder-result {
  margin-top: 10px;
  padding: 12px 0 0;
  border-bottom: 0;
  border-top: 1px solid var(--rule-strong);
}

.timeline {
  border-left: 1px solid var(--rule-strong);
  margin-left: 5px;
}

.timeline div {
  position: relative;
  padding: 0 0 24px 24px;
}

.timeline div::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 4px;
  width: 9px;
  height: 9px;
  background: var(--paper);
  border: 1px solid var(--terra);
}

.timeline span,
.timeline em {
  display: block;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-style: normal;
}

.timeline strong {
  display: block;
  margin: 3px 0 3px;
}

.timeline p {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 14px;
}

.rule-table {
  border-top: 1px solid var(--rule-strong);
}

.rule-table div {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 20px;
  border-bottom: 1px solid var(--rule);
  padding: 14px 0;
}

.rule-table span {
  color: var(--muted);
}

.chart-grid {
  grid-template-columns: minmax(0, 1.28fr) minmax(0, 0.95fr);
  margin-top: 22px;
}

.analysis-chart-grid {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

.analysis-chart-grid.two-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.analysis-chart-grid.one-up {
  grid-template-columns: 1fr;
}

.viz-section figure {
  min-width: 0;
}

.echart {
  width: 100%;
}

.chart-md {
  min-height: 360px;
}

.chart-table5 {
  min-height: 410px;
}

.chart-lg {
  min-height: 440px;
}

.chart-world-map {
  min-height: 470px;
}

.chart-xl {
  min-height: 560px;
}

.chart-network {
  min-height: 760px;
}

.chart-wide {
  min-height: 460px;
}

.chart-wide-matrix {
  min-height: 390px;
}

.chart-subregion-matrix {
  min-height: 760px;
}

.chart-china-matrix {
  min-height: 760px;
}

.chart-china-chrono {
  min-height: 780px;
}

.chart-china-typology {
  min-height: 820px;
}

.chart-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.matrix-wide-grid {
  gap: 24px;
}

.analysis-note {
  background: var(--white);
  border: 1px solid var(--rule);
  padding: 16px;
}

.analysis-note a {
  color: var(--blue);
}

.network-grid {
  grid-template-columns: 1fr;
  margin-top: 24px;
}

figure {
  margin: 0;
  background: var(--white);
  border: 1px solid var(--rule);
  padding: 16px;
}

figcaption {
  font-family: var(--mono);
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.chart {
  min-height: 340px;
}

.chart svg,
.calibration-grid svg,
.network-chart svg,
.matrix-chart svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.network-chart,
.matrix-chart {
  min-height: 420px;
}

.axis-label,
.chart-label {
  fill: var(--muted);
  font-family: var(--sans);
  font-size: 11px;
}

.chart-label-code {
  font-size: 13px;
  fill: #514d45;
}

.chart-value {
  fill: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
}

.bar-final {
  fill: var(--blue);
}

.bar-table {
  fill: var(--blue-light);
}

.diff-positive {
  fill: var(--terra);
}

.diff-negative {
  fill: var(--blue);
}

.zero-line,
.grid-line {
  stroke: var(--rule);
  stroke-width: 1;
}

.network-edge {
  fill: none;
  stroke: rgba(83, 106, 118, 0.2);
  stroke-width: 0.9;
}

.network-node-type {
  fill: var(--terra);
  fill-opacity: 0.78;
  stroke: var(--white);
  stroke-width: 1;
}

.network-node-property {
  fill: var(--blue);
  fill-opacity: 0.82;
  stroke: var(--white);
  stroke-width: 1;
}

.network-label {
  fill: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 650;
}

.network-property-label {
  fill: var(--ink);
  font-family: var(--sans);
  font-size: 11px;
}

.network-property-meta {
  fill: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.matrix-code {
  fill: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}

.matrix-theme-label {
  fill: var(--ink);
  font-family: var(--sans);
  font-size: 12px;
}

.matrix-row-line {
  stroke: rgba(216, 211, 199, 0.75);
  stroke-width: 1;
}

.matrix-dot {
  fill: var(--blue);
  fill-opacity: 0.78;
  stroke: var(--white);
  stroke-width: 0.8;
}

.matrix-value {
  fill: var(--white);
  font-family: var(--mono);
  font-size: 9px;
  pointer-events: none;
}

.network-notes {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.network-notes div {
  border-top: 1px solid var(--rule-strong);
  padding-top: 12px;
}

.network-notes strong,
.network-notes span {
  display: block;
}

.network-notes span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
}

.tier-legend {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0 18px;
}

.tier-legend div {
  border-top: 1px solid var(--rule-strong);
  padding-top: 10px;
}

.tier-legend strong,
.tier-legend span {
  display: block;
}

.tier-legend strong {
  font-family: var(--mono);
  font-size: 12px;
}

.tier-legend span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 5px;
}

.theme-rule-table-wrap {
  max-height: 680px;
  overflow: auto;
}

.theme-rule-table {
  min-width: 980px;
}

.theme-rule-table th {
  position: sticky;
  top: 0;
  background: var(--paper);
  z-index: 1;
}

.theme-rule-table td:nth-child(2),
.theme-rule-table td:nth-child(3),
.theme-rule-table td:nth-child(5) {
  font-family: var(--mono);
}

.theme-rule-name {
  display: block;
  font-weight: 650;
}

.theme-rule-path {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.star-rating {
  display: block;
  color: var(--terra);
  letter-spacing: 0.04em;
}

.theme-rule-risk,
.theme-rule-fit {
  color: var(--muted);
  font-size: 11px;
}

.reflection-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 24px;
}

.reflection-grid > div {
  border-top: 1px solid var(--rule-strong);
  padding-top: 13px;
}

.reflection-grid p {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}

.reflection-stack {
  gap: 30px;
  margin-top: 28px;
}

.reflection-topic {
  border-top: 1px solid var(--rule-strong);
  padding-top: 16px;
}

.reflection-topic h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.reflection-topic p {
  color: var(--muted);
  font-size: 14px;
  max-width: 940px;
}

.case-feature-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 18px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.case-feature-board div {
  min-height: 116px;
  padding: 13px 12px 12px;
  border-right: 1px solid var(--rule);
}

.case-feature-board div:last-child {
  border-right: 0;
}

.case-feature-board strong,
.case-feature-board span,
.case-feature-board em {
  display: block;
}

.case-feature-board strong {
  font-size: 12px;
  line-height: 1.35;
}

.case-feature-board span {
  margin-top: 12px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
}

.case-feature-board em {
  margin-top: 8px;
  color: var(--terra);
  font-family: var(--mono);
  font-size: 11px;
  font-style: normal;
  line-height: 1.35;
}

.case-table {
  margin-top: 16px;
  border-top: 1px solid var(--rule);
}

.case-table th,
.case-table td {
  vertical-align: top;
}

.vault-summary {
  margin-top: 38px;
  border-top: 1px solid var(--rule-strong);
  padding-top: 18px;
}

.vault-summary > h3 {
  font-size: 18px;
}

.vault-summary > p {
  color: var(--muted);
  font-size: 14px;
  max-width: 900px;
}

.vault-stat-grid,
.vault-architecture,
.vault-preview-grid {
  display: grid;
  gap: 14px;
}

.vault-stat-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 20px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.vault-stat-grid div {
  min-height: 82px;
  padding: 14px 12px 12px 0;
  border-right: 1px solid var(--rule);
}

.vault-stat-grid div:last-child {
  border-right: 0;
}

.vault-stat-grid strong,
.vault-stat-grid span {
  display: block;
}

.vault-stat-grid strong {
  font-family: var(--serif);
  font-size: 30px;
  line-height: 1;
}

.vault-stat-grid span {
  margin-top: 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.35;
  text-transform: uppercase;
}

.vault-architecture {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 18px;
}

.vault-architecture div {
  border-top: 1px solid var(--rule-strong);
  padding-top: 12px;
}

.vault-architecture strong,
.vault-architecture span {
  display: block;
}

.vault-architecture strong {
  font-family: var(--mono);
  font-size: 12px;
}

.vault-architecture span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.vault-preview-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  margin-top: 24px;
}

.vault-preview-figure {
  padding: 14px;
}

.obsidian-page-preview,
.obsidian-graph-preview {
  width: 100%;
  min-height: 300px;
  border: 1px solid var(--rule);
  background: #fbfaf6;
}

.obsidian-page-preview {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
  padding: 16px;
  font-family: var(--mono);
}

.preview-topline {
  border-bottom: 1px solid var(--rule-strong);
  padding-bottom: 10px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}

.preview-yaml {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.38;
}

.preview-yaml span,
.preview-yaml em,
.preview-block span {
  display: block;
}

.preview-yaml em {
  color: var(--blue);
  font-style: normal;
  padding-left: 14px;
}

.preview-block {
  border-top: 1px solid var(--rule);
  padding-top: 12px;
}

.preview-block strong {
  display: block;
  font-size: 12px;
}

.preview-block span {
  margin-top: 6px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13px;
}

.obsidian-graph-preview {
  display: block;
}

.obsidian-graph-preview line {
  stroke: rgba(83, 106, 118, 0.32);
  stroke-width: 1;
}

.obsidian-graph-preview circle {
  stroke: var(--white);
  stroke-width: 1.5;
}

.graph-node-property {
  fill: var(--blue);
}

.graph-node-type {
  fill: var(--terra);
  fill-opacity: 0.82;
}

.graph-node-theme {
  fill: var(--olive);
  fill-opacity: 0.82;
}

.graph-node-cr {
  fill: #8c7d6a;
  fill-opacity: 0.82;
}

.obsidian-graph-preview text {
  fill: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  pointer-events: none;
}

.table-wrap {
  margin-top: 22px;
  overflow-x: auto;
  border-top: 1px solid var(--rule-strong);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 10px 9px;
  border-bottom: 1px solid var(--rule);
}

th {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
}

td:nth-child(1),
td:nth-child(3),
td:nth-child(4),
td:nth-child(5) {
  font-family: var(--mono);
}

.calibration-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.calibration-item {
  border: 1px solid var(--rule);
  background: var(--white);
  padding: 12px;
}

.calibration-item h3 {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.35;
  min-height: 34px;
}

.calibration-item p {
  color: var(--muted);
  font-size: 12px;
  margin: 8px 0 0;
}

.example-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 24px;
}

.example-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 24px;
}

.download-link {
  display: block;
  border: 1px solid var(--rule-strong);
  background: transparent;
  padding: 10px 12px;
  border-radius: 3px;
  text-decoration: none;
  font-size: 13px;
}

.download-link:hover,
.download-link:focus {
  background: var(--white);
  border-color: var(--ink);
}

.future-list {
  margin: 0;
  padding-left: 18px;
  max-width: 780px;
}

.future-list li {
  margin-bottom: 8px;
}

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 28px 0 46px;
  color: var(--muted);
  font-size: 13px;
}

.site-footer .page-shell {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

@media (max-width: 900px) {
  .page-shell {
    width: min(100% - 28px, 1120px);
  }

  .metric-strip,
  .three-column,
  .story-grid,
  .example-grid,
  .download-grid,
  .calibration-grid,
  .chart-grid,
  .analysis-chart-grid.two-up,
  .analysis-chart-grid.one-up,
  .network-grid,
  .network-notes,
  .tier-legend,
  .reflection-grid,
  .reflection-stack,
  .case-feature-board,
  .vault-stat-grid,
  .vault-architecture,
  .vault-preview-grid,
  .split,
  .two-column {
    grid-template-columns: 1fr;
  }

  .vault-stat-grid div,
  .vault-architecture div {
    border-right: 0;
  }

  .vault-stat-grid div {
    min-height: auto;
    border-bottom: 1px solid var(--rule);
    padding-right: 0;
  }

  .vault-stat-grid div:last-child {
    border-bottom: 0;
  }

  .case-feature-board div {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }

  .case-feature-board div:last-child {
    border-bottom: 0;
  }

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

  .metric:last-child {
    border-bottom: 0;
  }

  .report-layout {
    display: block;
  }

  h1 span {
    white-space: normal;
  }

  .toc {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 18px;
    padding: 18px 0 4px;
    border-bottom: 1px solid var(--rule);
  }

  .toc-brand-mark {
    display: none;
  }

  .section {
    padding: 42px 0;
  }

  .rule-table div {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .chart {
    min-height: 280px;
  }

  .story-grid > div:first-child {
    grid-column: auto;
  }
}

@media (max-width: 520px) {
  body {
    font-size: 14px;
  }

  .site-header {
    padding-top: 34px;
  }

  .toc {
    grid-template-columns: 1fr;
  }

  th,
  td {
    padding: 8px 7px;
  }
}
