:root {
    --ink: #17221d;
    --muted: #5d6963;
    --paper: #f4f6f2;
    --surface: #ffffff;
    --line: #d9dfda;
    --forest: #176b52;
    --forest-soft: #e6f1eb;
    --amber: #a9670f;
    --amber-soft: #fff4dc;
    --blue: #275d89;
    --blue-soft: #e9f0f6;
    --red: #a44735;
    --code: #13211b;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
a { color: var(--forest); }
.shell { width: min(100% - 32px, 940px); margin-inline: auto; }
.site-nav { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); }
.site-nav .shell { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 18px; font-size: 13px; }
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; color: var(--muted); }
.crumbs a { text-decoration: none; }
.series-link { white-space: nowrap; text-decoration: none; font-weight: 650; }
.hero { background: #14241d; color: #fff; border-bottom: 6px solid #d2a345; }
.hero .shell { min-height: 340px; display: grid; grid-template-columns: minmax(0, 1fr) 230px; align-items: center; gap: 52px; padding-block: 54px; }
.eyebrow { color: #a4d4be; font-size: 13px; font-weight: 750; text-transform: uppercase; letter-spacing: 0; }
.hero h1 { margin: 12px 0 18px; font-size: clamp(36px, 7vw, 64px); line-height: 1.08; letter-spacing: 0; }
.hero p { margin: 0; color: #d2dfd8; font-size: 18px; line-height: 1.8; max-width: 690px; }
.hero-fact { border-left: 1px solid #547065; padding-left: 24px; }
.hero-fact strong { display: block; margin-bottom: 8px; color: #f0c66c; font-size: 36px; line-height: 1.1; }
.hero-fact span { color: #c6d4cd; font-size: 14px; line-height: 1.7; }
.toc { display: flex; gap: 8px; overflow-x: auto; padding: 16px 0; white-space: nowrap; scrollbar-width: thin; }
.toc a { border: 1px solid var(--line); border-radius: 4px; padding: 7px 10px; background: var(--surface); color: #3f5047; font-size: 13px; text-decoration: none; }
article { background: var(--surface); }
article section { border-top: 1px solid var(--line); padding: 52px 0; }
article section:first-child { border-top: 0; }
h2 { margin: 0 0 20px; scroll-margin-top: 72px; font-size: 29px; line-height: 1.35; letter-spacing: 0; }
h3 { margin: 28px 0 10px; font-size: 20px; line-height: 1.45; letter-spacing: 0; }
p, li { color: #35463d; line-height: 1.85; }
p { margin: 0 0 16px; }
ul, ol { padding-left: 22px; }
li { margin-bottom: 8px; }
.lead { color: #22362b; font-size: 19px; }
.callout { margin: 22px 0; border-left: 4px solid var(--forest); background: var(--forest-soft); padding: 17px 19px; }
.callout.warning { border-left-color: var(--amber); background: var(--amber-soft); }
.callout.blue { border-left-color: var(--blue); background: var(--blue-soft); }
.callout p:last-child { margin-bottom: 0; }
.formula { margin: 22px 0; border: 1px solid var(--line); background: #f8faf8; padding: 18px; overflow-x: auto; text-align: center; font-family: "SFMono-Regular", Consolas, monospace; line-height: 1.7; }
.flow { margin: 26px 0; border: 1px solid var(--line); background: #fbfcfa; }
.flow-scroll { overflow-x: auto; padding: 18px; }
.flow svg { display: block; width: 100%; min-width: 820px; height: auto; }
.flow figcaption { border-top: 1px solid var(--line); padding: 12px 15px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.table-wrap { margin: 22px 0; border: 1px solid var(--line); overflow-x: auto; }
table { width: 100%; min-width: 700px; border-collapse: collapse; font-size: 14px; }
th { background: #eef2ef; color: #24352c; text-align: left; }
th, td { border-bottom: 1px solid var(--line); padding: 12px 13px; vertical-align: top; line-height: 1.65; }
tr:last-child td { border-bottom: 0; }
.metric-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 22px 0; border: 1px solid var(--line); background: var(--line); }
.metric { background: #fff; padding: 17px; }
.metric strong { display: block; color: var(--forest); font-size: 24px; }
.metric span { display: block; margin-top: 5px; color: var(--muted); font-size: 13px; line-height: 1.55; }
code { font-family: "SFMono-Regular", Consolas, monospace; font-size: .92em; }
pre { margin: 22px 0; border-radius: 6px; background: var(--code); color: #dce9e2; padding: 20px; overflow-x: auto; font: 13px/1.75 "SFMono-Regular", Consolas, monospace; }
details { border-top: 1px solid var(--line); padding: 16px 0; }
summary { cursor: pointer; color: #22362b; font-weight: 650; }
details p { margin-top: 12px; }
.refs { padding-left: 20px; }
.refs li { margin-bottom: 12px; font-size: 14px; }
.refs a { overflow-wrap: anywhere; }
.related { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 22px; }
.related a { min-height: 86px; border: 1px solid var(--line); border-radius: 6px; padding: 14px; color: var(--ink); text-decoration: none; }
.related b { display: block; margin-bottom: 5px; color: var(--forest); }
.related span { color: var(--muted); font-size: 13px; line-height: 1.5; }
.page-footer { background: #14241d; color: #c7d5ce; padding: 30px 0; }
.page-footer .shell { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.page-footer a { color: #add8c5; }
@media (max-width: 720px) {
    .hero .shell { min-height: auto; grid-template-columns: 1fr; gap: 28px; padding-block: 42px; }
    .hero-fact { border-left: 0; border-top: 1px solid #547065; padding: 20px 0 0; }
    article section { padding: 42px 0; }
    h2 { font-size: 25px; }
    .metric-row, .related { grid-template-columns: 1fr; }
    .site-nav .shell { padding-block: 8px; }
}
