:root {
  color-scheme: light;
  --ink: #242827;
  --body: #515754;
  --muted: #777e79;
  --accent: #a13b35;
  --line: #e2e6e3;
  --soft: #f6f8f7;
}

* { box-sizing: border-box; letter-spacing: 0; }
html { scroll-padding-top: 24px; scrollbar-gutter: stable; }
body {
  margin: 0;
  background: #fff;
  color: var(--body);
  font: 16px/1.85 "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
.document { max-width: 936px; margin: 0 auto; padding: 0 40px; }
p, h1, h2, h3, h4, figure { margin: 0; }
h1, h2, h3, h4, strong, dt, th { color: var(--ink); font-weight: 600; }
a { color: #3d6257; text-underline-offset: 4px; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid #3d6257; outline-offset: 5px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.document-header { position: relative; padding: 44px 0 48px; }
.document-header::before { position: absolute; top: 24px; left: 0; width: 36px; height: 2px; background: var(--accent); content: ""; }
.byline { font-size: 13px; color: var(--ink); }
.byline span { color: var(--muted); }
h1 { margin-top: 26px; font-size: 40px; line-height: 1.35; text-wrap: balance; }
.intro { margin-top: 18px; }
.overview { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line); }
.overview-label { margin-bottom: 10px; font-size: 12px; color: var(--muted); }
.outline { list-style: none; padding: 0; margin: 0; }
.outline li { display: grid; grid-template-columns: 36px 112px minmax(0, 1fr); padding: 4px 0; font-size: 14px; }
.outline li > span:last-child { color: var(--muted); }
.number { color: var(--accent); font: 13px/1.8 "SFMono-Regular", Consolas, monospace; font-variant-numeric: tabular-nums; }

.chapter { position: relative; padding: 46px 0 50px; border-top: 1px solid var(--line); }
.chapter::before { position: absolute; top: -1px; left: 0; width: 28px; height: 2px; background: var(--accent); opacity: .65; content: ""; }
.chapter-heading { margin-bottom: 26px; }
h2 { display: flex; align-items: baseline; gap: 16px; font-size: 27px; line-height: 1.5; }
h2 .number { flex: 0 0 24px; }
.chapter-lead { margin-top: 12px; color: var(--ink); font-size: 19px; line-height: 1.75; }
h3 { font-size: 17px; line-height: 1.7; }
.text-list { margin: 24px 0 0; }
.text-list > div { padding: 17px 0; border-bottom: 1px solid var(--line); }
.text-list > div:last-child { padding-bottom: 0; border-bottom: 0; }
dt { font-size: 16px; }
dd { margin: 4px 0 0; }
.prose-block + .prose-block { margin-top: 28px; padding-top: 26px; border-top: 1px solid var(--line); }
.prose-block > p { margin-top: 10px; }
.role { margin-left: 12px; color: var(--muted); font-size: 14px; font-weight: 400; }
.bullets { margin: 12px 0 0; padding-left: 22px; }
.bullets li { padding-left: 2px; margin: 5px 0; }
.bullets li::marker { color: #99a39d; font-size: 11px; }
.team-table { width: 100%; margin-top: 16px; border-collapse: collapse; table-layout: fixed; font-size: 14px; }
.team-table th, .team-table td { padding: 11px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.team-table thead { background: var(--soft); }
.team-table thead th { font-size: 12px; color: var(--muted); font-weight: 400; }
.team-table th:first-child { width: 100px; }
.team-table th:nth-child(2) { width: 142px; }

.case, .case-static { border-bottom: 1px solid var(--line); }
.case:first-child { border-top: 1px solid var(--line); }
.case > summary { position: relative; display: block; padding: 21px 32px 21px 0; list-style: none; cursor: pointer; }
.case > summary::-webkit-details-marker { display: none; }
.case > summary::after { position: absolute; right: 5px; top: 24px; content: "+"; color: var(--muted); font: 22px/1.2 monospace; }
.case[open] > summary::after { content: "−"; }
.case > summary:hover .case-title { color: var(--accent); }
.case-title { display: block; color: var(--ink); font-size: 17px; font-weight: 600; }
.case-description { display: block; margin-top: 4px; }
.case-content { padding-bottom: 24px; }
.media-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.media-grid:has(> figure:only-child) { grid-template-columns: 1fr; }
.image-link { display: block; aspect-ratio: 16 / 10; background: var(--soft); border: 1px solid var(--line); cursor: zoom-in; }
.image-link img { display: block; width: 100%; height: 100%; object-fit: contain; }
figcaption { padding-top: 8px; color: var(--muted); font-size: 12px; }
.case-static { padding: 21px 0; }
.case-static p { margin-top: 4px; }
.steps { list-style: none; counter-reset: step; padding: 0; margin: 24px 0 0; }
.steps > li { position: relative; counter-increment: step; padding: 17px 0 18px 35px; border-bottom: 1px solid var(--line); }
.steps > li::before { position: absolute; top: 21px; left: 0; content: counter(step, decimal-leading-zero); color: var(--muted); font: 12px/1.8 "SFMono-Regular", Consolas, monospace; }
.steps > li:first-child { border-top: 1px solid var(--line); }
.steps p { margin-top: 4px; }
.steps .annotation { margin-top: 9px; color: var(--muted); font-size: 12px; }
.prototype { margin-top: 14px; font-size: 13px; }
.prototype > summary { display: flex; align-items: center; gap: 8px; width: fit-content; min-height: 40px; padding: 4px 0; color: #3d6257; cursor: pointer; list-style: none; }
.prototype > summary::-webkit-details-marker { display: none; }
.prototype > summary::before { content: "+"; display: inline-block; width: 16px; text-align: center; font: 18px/1 monospace; }
.prototype[open] > summary::before { content: "−"; }
.prototype > summary:hover, .case-reference:hover { color: var(--accent); }
.prototype-content { margin-top: 10px; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.preview-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; min-height: 44px; padding: 8px 14px; background: var(--soft); border-bottom: 1px solid var(--line); font-size: 12px; }
.preview-toolbar > span { color: var(--muted); }
.preview-toolbar a { display: inline-flex; gap: 6px; align-items: center; text-decoration: none; }
.preview-toolbar a:hover { text-decoration: underline; }
.preview-surface { display: none; position: relative; height: 560px; background: #fff; }
.preview-surface.is-mounted { display: block; }
.preview-surface iframe { display: block; width: 100%; height: 100%; border: 0; }
.preview-status { position: absolute; top: 0; left: 0; right: 0; z-index: 1; padding: 12px 16px; background: var(--soft); color: var(--body); font-size: 13px; pointer-events: none; }
.preview-status[hidden] { display: none; }
.case-reference { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; margin-top: 14px; font-size: 13px; text-decoration: none; }
.case-reference:hover { text-decoration: underline; }
.conclusion { margin-top: 30px; color: var(--ink); font-weight: 600; }
.document-footer { padding: 20px 0 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }

/* Diagrams share the document's reading order and use selectable text. */
.diagram-caption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; padding: 4px 0 12px; font-size: 13px; color: var(--body); }
.ai-legend { color: #276456; font-size: 12px; }
.flow-lane { padding: 20px 0; border-top: 1px solid var(--line); }
.flow-lane:last-child { padding-bottom: 0; }
.flow-lane h4 { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 16px; font-size: 16px; }
.lane-index { color: var(--muted); font: 12px/1.8 "SFMono-Regular", Consolas, monospace; }
.lane-purpose { color: var(--muted); font-size: 12px; font-weight: 400; }
.node-flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.node-flow > li { position: relative; min-width: 0; padding: 12px; background: var(--soft); border-top: 2px solid #cdd5d0; }
.node-flow > li + li::before { content: "→"; position: absolute; top: 14px; left: -22px; width: 20px; text-align: center; color: #8a9590; font-size: 16px; }
.node-flow strong { display: block; font-size: 13px; line-height: 1.7; }
.node-flow p { margin-top: 6px; font-size: 12px; line-height: 1.8; }
.node-flow .ai-node { background: #f0f7f4; border-color: #468575; }
.ai-node strong { color: #276456; }
.flow-branches { margin: 20px 0 0 16px; padding-left: 18px; border-left: 1px solid #ccdcd4; }
.branch-row + .branch-row { margin-top: 16px; }
.branch-label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 12px; }
.two-nodes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three-nodes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.flow-takeaway { margin-top: 16px; font-size: 13px; color: #3d6257; }

.method-block { margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--line); }
.method-index { display: inline-block; margin-right: 12px; color: var(--accent); font: 12px/1.8 "SFMono-Regular", Consolas, monospace; }
.block-intro { margin: 8px 0 20px; font-size: 14px; }
.goal-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; padding: 16px 0; background: var(--soft); }
.goal-grid > div { padding: 0 20px; }
.goal-grid > div + div { border-left: 1px solid var(--line); }
.goal-grid dt { font-size: 15px; }
.goal-grid dd { font-size: 13px; }
.implementation-path { counter-reset: phase; padding: 0; margin: 0; list-style: none; }
.implementation-path > li { counter-increment: phase; display: grid; grid-template-columns: 28px 116px minmax(0, 1fr); gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.implementation-path > li::before { content: counter(phase, decimal-leading-zero); color: #3d6257; font: 12px/1.8 "SFMono-Regular", Consolas, monospace; }
.implementation-path h4 { font-size: 15px; }
.implementation-path ul { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 0; padding-left: 16px; font-size: 13px; }
.implementation-path ul li::marker { color: #a0aaa4; }
.maturity-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 2px solid #92aaa0; border-bottom: 1px solid var(--line); }
.maturity-level { min-width: 0; padding: 20px 16px; display: flex; flex-direction: column; }
.maturity-level + .maturity-level { border-left: 1px solid var(--line); }
.level-label { margin-bottom: 4px; font-size: 12px; color: #3d6257; }
.maturity-level h4 { font-size: 16px; }
.maturity-level dl { margin: 16px 0 20px; font-size: 13px; }
.maturity-level dl > div + div { margin-top: 12px; }
.maturity-level dt { color: var(--muted); font-size: 12px; font-weight: 400; }
.maturity-level dd { margin-top: 2px; }
.period { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; }
.period strong { display: block; font-size: 14px; }
.method-note { margin-top: 12px; color: var(--muted); font-size: 12px; }
.foundation-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 2px solid #b1b8b3; }
.foundation-grid article { min-width: 0; padding: 16px 12px 0; }
.foundation-grid article + article { border-left: 1px solid var(--line); }
.foundation-grid h4 { font-size: 15px; }
.foundation-grid ul { padding-left: 16px; margin: 12px 0 0; font-size: 12px; }
.foundation-grid li { margin: 6px 0; overflow-wrap: anywhere; }
.foundation-grid li::marker { color: #a0aaa4; }
.method-principles dl { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin: 18px 0 0; }
.method-principles dt { font-size: 13px; }
.method-principles dd { font-size: 12px; }

.image-dialog { width: min(1200px, calc(100% - 48px)); max-width: none; max-height: calc(100dvh - 48px); padding: 20px; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.image-dialog::backdrop { background: rgb(35 40 37 / 45%); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 16px; color: var(--body); font-size: 14px; }
.dialog-close { flex: 0 0 auto; min-height: 40px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 3px; background: #fff; color: var(--ink); }
.dialog-close:hover { background: var(--soft); }
.expanded-image { display: block; width: 100%; height: min(75dvh, 880px); object-fit: contain; }
body:has(.image-dialog[open]) { overflow: hidden; }

.reading-progress { position: fixed; inset: 0 0 auto; z-index: 10; height: 2px; background: #468575; transform: scaleX(0); transform-origin: left; pointer-events: none; }
.case-title, .node-flow > li, .image-link, .prototype > summary { transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease; }
.image-link { overflow: hidden; }
.image-link img { transition: transform 240ms ease; }
@media (hover: hover) {
  .image-link:hover { border-color: #92aaa0; }
  .image-link:hover img { transform: scale(1.015); }
  .node-flow > li:hover { background-color: #eef2ef; }
  .node-flow > .ai-node:hover { background-color: #e5f1eb; }
  .case > summary:hover::after { color: var(--accent); }
}
@keyframes section-arrive {
  from { opacity: .55; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes detail-arrive {
  from { opacity: .5; }
  to { opacity: 1; }
}
@media (prefers-reduced-motion: no-preference) {
  .chapter-heading.is-revealed, .method-block > h3.is-revealed { animation: section-arrive 420ms ease-out; }
  .case[open] > .case-content, .prototype[open] > .prototype-content { animation: detail-arrive 200ms ease-out; }
  .image-dialog[open] { animation: detail-arrive 160ms ease-out; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 600px) {
  .document { padding: 0 22px; }
  .document-header { padding: 26px 0 34px; }
  .document-header::before { top: 12px; width: 24px; }
  .byline { font-size: 11px; }
  h1 { font-size: 30px; margin-top: 24px; }
  .intro { font-size: 15px; margin-top: 14px; }
  .overview { margin-top: 24px; }
  .outline li { grid-template-columns: 28px 80px minmax(0, 1fr); padding: 6px 0; font-size: 12px; line-height: 1.65; }
  .outline .number { font-size: 11px; }
  .chapter { padding: 34px 0 38px; }
  .chapter-heading { margin-bottom: 22px; }
  h2 { font-size: 23px; gap: 8px; }
  .chapter-lead { font-size: 17px; }
  body { font-size: 15px; }
  .team-table { font-size: 12px; }
  .team-table th, .team-table td { padding: 10px 6px; }
  .team-table th:first-child { width: 70px; }
  .team-table th:nth-child(2) { width: 78px; }
  .media-grid { grid-template-columns: 1fr; gap: 16px; }
  .case-description { font-size: 14px; }
  .steps > li { padding-left: 28px; }
  .image-dialog { width: calc(100% - 24px); padding: 12px; }
  .expanded-image { height: 65dvh; }
  .node-flow { grid-template-columns: 1fr; gap: 22px; }
  .node-flow > li + li::before { content: "↓"; top: -25px; left: 14px; }
  .node-flow strong { font-size: 14px; }
  .flow-branches { margin-left: 8px; padding-left: 12px; }
  .goal-grid { grid-template-columns: 1fr; padding: 0 16px; }
  .goal-grid > div { padding: 12px 0; }
  .goal-grid > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .implementation-path > li { grid-template-columns: 24px minmax(0, 1fr); gap: 6px 10px; }
  .implementation-path ul { grid-column: 2; display: block; }
  .maturity-grid { grid-template-columns: 1fr; }
  .maturity-level { padding: 20px 0; }
  .maturity-level + .maturity-level { border-left: 0; border-top: 1px solid var(--line); }
  .maturity-level dl { margin-top: 12px; }
  .foundation-grid { grid-template-columns: 1fr; }
  .foundation-grid article { padding: 16px 0; }
  .foundation-grid article + article { border-left: 0; border-top: 1px solid var(--line); }
  .method-principles dl { grid-template-columns: 1fr; gap: 10px; }
  .method-principles dl > div { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 8px; }
  .method-principles dd { margin: 0; }
  .preview-surface { height: 480px; }
}

@media print {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reading-progress, .document-header::before { display: none; }
  .document { max-width: none; padding: 0; }
  .document-header { padding-top: 0; }
  .chapter { padding: 28px 0; }
  .chapter-heading { break-after: avoid; }
  .case, .prose-block, .steps > li, tr { break-inside: avoid; }
  .case::details-content, .prototype::details-content { content-visibility: visible; }
  .case:not([open]) > .case-content, .prototype:not([open]) > .prototype-content { display: block; }
  .preview-surface.is-mounted { display: none; }
  .preview-toolbar a::after { content: " (" attr(href) ")"; overflow-wrap: anywhere; }
  .preview-toolbar { display: block; }
  .preview-toolbar a { display: block; }
  .prototype > summary::before { display: none; }
  .case > summary::after { display: none; }
  .image-dialog { display: none; }
  #zhuanyu { break-inside: auto; }
  .flow-lane, .maturity-level, .foundation-grid article { break-inside: avoid; }
  .node-flow .ai-node { print-color-adjust: exact; }
}
