:root {
  --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  --serif: "Songti SC", "Noto Serif CJK SC", "Noto Serif SC", "SimSun", serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", "PingFang SC", "Microsoft YaHei", monospace;
  --ink: #173d38;
  --muted: #51695f;
  --paper: #fffefa;
  --canvas: #f2f4ed;
  --bg: var(--canvas);
  --line: #cdd7cf;
  --rule: var(--line);
  --green: #1e6958;
  --green-deep: #174d43;
  --ui-chrome: #f8f9f4;
  --ui-display: clamp(32px, 3.6vw, 52px);
  --ui-section: clamp(23px, 2.25vw, 32px);
  --ui-panel: clamp(18px, 1.55vw, 22px);
  --ui-lead: clamp(16px, 1.35vw, 19px);
  --ui-card: 17px;
  --ui-text: 15px;
  --ui-control: 13px;
  --ui-note: 12px;
  --ui-code: 11px;
  --ui-heading: 600;
  --ui-medium: 600;
  --ui-weight: 400;
}

body { background-color: var(--canvas); color: var(--ink); font: var(--ui-weight) var(--ui-text)/1.7 var(--sans); }
button, input, select, textarea { font-family: var(--sans); }
:is(a, button, input, textarea, select, summary):focus-visible {
  outline: 2px solid #287458;
  outline-offset: 2px;
}

.masthead, body > .mast, body > .top {
  background: var(--ui-chrome);
  color: var(--ink);
  box-shadow: inset 0 -1px var(--rule);
}
.masthead .brand strong, .mast .brand, .top .brand {
  font: var(--ui-heading) 16px/1.35 var(--sans);
  letter-spacing: .02em;
}
.mast .brand-mark i { border-color: var(--green); }
.mast .mast-center, .head .tag, .head .nav button, .masthead .nav-links a { color: var(--muted); }
.mast .mast-center b { color: var(--ink); }
.mast .divider, .head .tag { border-color: var(--rule); }
.mast .ghost-action { color: var(--green-deep); border-color: #b5c7bb; }
.head .nav button.on { background: var(--green-deep); color: white; }
.masthead .nav-links a, .masthead .nav-cta, .head .nav button,
.mast .ghost-action, .mast .manage-entry, .hero-actions .button, .scenario button {
  font: var(--ui-medium) var(--ui-control)/1.45 var(--sans);
  letter-spacing: 0;
}

.hero h1, .heading h1, .admin-head h1, .focus-intro h1, .detail-main h1 {
  font: var(--ui-heading) var(--ui-display)/1.2 var(--serif);
  letter-spacing: -.025em;
}
.dimension-aside h1 { font: var(--ui-heading) var(--ui-section)/1.25 var(--serif); letter-spacing: -.02em; }
.section-head h2, .route-intro h2, .thesis h2, .method > header h2,
.roadmap-title h2, .section-title h2 {
  font: var(--ui-heading) var(--ui-section)/1.32 var(--serif);
  letter-spacing: -.015em;
}
.map-label, .module h3, .route-step h3, .market-reading h3,
.bar h2, .detail h2, .case-head h2, .edit-head h2, .detailbody h2, #readerBody h2 {
  font: var(--ui-heading) var(--ui-panel)/1.4 var(--serif);
  letter-spacing: 0;
}
.orbit-node h3, .layerhead h3, .opportunity-column header h3, .dimension-card h3,
.evolution-step h3, .gate-panel h2, .detail-main .detail-block h2, .stage-button strong,
.detailbody h3, #readerBody h3 {
  font: var(--ui-heading) var(--ui-card)/1.45 var(--sans);
  letter-spacing: 0;
}
.hero .lead, .hero-copy > p, .hero > div:first-child > p:not([class]), .heading > div > p {
  font: var(--ui-weight) var(--ui-lead)/1.65 var(--sans);
  letter-spacing: 0;
}
.premise, .thesis-copy, .module h3 + p, .route-step p, .route-intro h2 + p, .market-reading p,
.detail .desc, .bench p, .opportunity-intro, .case-head p, .case-detail .case-block p,
.detail-lead, .detail-block p, .detailbody .lead, #readerBody, .reading-table table {
  font: var(--ui-weight) var(--ui-text)/1.75 var(--sans);
}
.orbit-node p, .card-tail, .detail-side h2, .dimension-card p, .method > header p, .roadmap-title p,
.evolution-step p, .layerhead p, .opportunity-column header p, .case small, .journey p,
.gate p, .metric, .markettable, .matrix, .goal, .detailbody details, .form-field :is(input, textarea, select) {
  font-size: var(--ui-control);
  line-height: 1.6;
}
.product b, .case b, .matrix-cell b, .dimension-button b, .journey b,
.form-title h3, .layerrow b, .feature-row b, .gate h3, .case-block h3 {
  font: var(--ui-medium) var(--ui-control)/1.45 var(--sans);
}
.eyebrow, .module-code, .period, .stage-button .stage-code, .layerhead span,
.opportunity-column header span, .step-index, .milestone span {
  font: var(--ui-medium) var(--ui-code)/1.5 var(--mono);
  letter-spacing: .06em;
}
.case-caption, .crumb, .crumbs, .foot, .bar small, .summary .label, .summary small,
.state p, .journey span, .source p, .source a, .refs a, .controls label, .money span,
.resultgrid span, .panelbar, .matrix-cell span, .gate-panel > p, .section-title p,
.milestone p, .action span, .dimension-button small, .detail-side dl {
  font-size: var(--ui-note);
  line-height: 1.5;
}
.routes button, .phases button, .feature-jump select, .controls :is(input, select),
.editor-stages button, .tree-node b, .child-row b, .record-item b, .product-links button {
  font-family: var(--sans);
  font-size: var(--ui-control);
}
.counts b, .summary b, .money b, .resultgrid b, .chart b, .markettable .num, .metric td:not(:first-child),
.mini-code, .stage-time, .hero-metrics b, .gate-item b, .formula, .product small, #refcode {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
.summary .state b { font-family: var(--sans); }
.counts b, .summary > div:not(.state) b, .money b, .result .main b, .hero-metrics b {
  font-size: clamp(21px, 1.9vw, 28px);
  line-height: 1.25;
  letter-spacing: -.035em;
}
.viewport, #atlas { line-height: 1.5; }
body > a[href="../index.html"] {
  font: var(--ui-medium) var(--ui-control)/1.45 var(--sans) !important;
  background-color: var(--green-deep) !important;
}

@media (max-width: 760px) {
  :root { --ui-display: 32px; --ui-section: 24px; --ui-panel: 19px; --ui-card: 16px; }
  .masthead .brand strong, .mast .brand, .top .brand { font-size: 14px; }
  .heading > div > p { font-size: var(--ui-control); }
  .head .nav button, .mast .manage-entry { font-size: var(--ui-note); }
}
