:root {
  color-scheme: light;
  --page: #f7f9f6;
  --surface: #fff;
  --ink: #132823;
  --muted: #4e625b;
  --green: #087157;
  --green-dark: #075540;
  --line: #d9e5dc;
  --tint: #e8f4eb;
  --dark: #102c26;
  --dark-line: #396559;
  --radius: 1rem;
  --header-height: 4.25rem;
  --shell: 76rem;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--header-height) + 1.3rem); }
body { margin: 0; background: var(--page); color: var(--ink); font: 1rem/1.65 var(--sans); }
body:has(dialog[open]) { overflow: hidden; }
[hidden] { display: none !important; }
a { color: var(--green-dark); text-underline-offset: .2em; }
a:hover { color: var(--green); }
button, input, select { font: inherit; }
button { cursor: pointer; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #147767; outline-offset: 4px; }
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { line-height: 1.25; text-wrap: pretty; }
h2 { font-size: clamp(1.65rem, 3vw, 2.35rem); letter-spacing: -.035em; }
code, pre, kbd { font-family: var(--mono); }
img { max-width: 100%; }
.skip-link { position: fixed; z-index: 20; top: .5rem; left: .75rem; transform: translateY(-150%); padding: .65rem 1rem; border-radius: .5rem; background: var(--ink); color: white; }
.skip-link:focus { transform: none; color: white; }
.button { display: inline-flex; gap: .55rem; align-items: center; justify-content: center; min-height: 2.75rem; padding: .55rem 1rem; border: 1px solid transparent; border-radius: .625rem; font-size: .95rem; font-weight: 720; line-height: 1.35; text-decoration: none; white-space: nowrap; }
.button.primary { background: var(--green-dark); color: #fff; }
.button.primary:hover { background: #103e34; color: #fff; }
.button.secondary { background: var(--surface); border-color: #cadad0; color: var(--ink); }
.button.secondary:hover { background: var(--tint); border-color: #a8c5b4; color: var(--green-dark); }
.button[aria-pressed="true"] { background: var(--tint); border-color: #9bc5ae; color: var(--green-dark); }

.header { position: sticky; z-index: 5; top: 0; height: var(--header-height); border-bottom: 1px solid var(--line); background: #fbfdfa; }
.header-inner, .footer-inner { width: min(var(--shell), calc(100% - 4rem)); margin-inline: auto; }
.header-inner { display: flex; height: 100%; gap: 1.5rem; align-items: center; }
.brand { display: inline-flex; gap: .65rem; align-items: center; color: var(--ink); font-weight: 760; line-height: 1.25; text-decoration: none; }
.brand img { flex: none; display: block; }
.brand-title { font-size: 1.16rem; font-weight: 820; white-space: nowrap; }
.brand-title span { margin-left: .15rem; font-size: .91rem; font-weight: 650; }
.header-nav { display: flex; gap: clamp(1rem, 3vw, 2.35rem); align-items: center; margin-inline: auto; }
.header-nav a { padding-block: .5rem; color: var(--muted); font-size: .93rem; font-weight: 670; text-decoration: none; }
.header-nav a:hover { color: var(--green); text-decoration: underline; }
.header-actions { display: flex; gap: .5rem; align-items: center; margin-left: auto; }
.search-trigger { min-width: 7.1rem; justify-content: flex-start; }
.search-trigger kbd { margin-left: auto; padding: .075rem .35rem; border: 1px solid var(--line); border-radius: .25rem; color: var(--muted); font-size: .8rem; }
.search-icon { position: relative; width: .8rem; height: .8rem; margin-right: .15rem; border: 1.6px solid currentColor; border-radius: 50%; }
.search-icon::after { position: absolute; right: -.28rem; bottom: -.11rem; width: .35rem; height: 1.6px; transform: rotate(45deg); background: currentColor; content: ""; }
.header .menu-toggle { display: none; }

.home-main { width: min(var(--shell), calc(100% - 4rem)); margin-inline: auto; }
.hero { display: grid; grid-template-columns: .94fr 1.06fr; align-items: stretch; min-height: 31.75rem; margin-top: 1.85rem; border: 1px solid #d5e4d9; border-radius: 1.5rem; overflow: hidden; background: #edf5ed; }
.hero-copy { display: flex; flex-direction: column; justify-content: center; padding: clamp(1.75rem, 3.7vw, 3.85rem); background: radial-gradient(ellipse at 0 100%, #dceee0 0, transparent 65%); }
.eyebrow { display: flex; align-items: center; gap: .6rem; color: var(--green-dark); font: 720 .875rem/1.35 var(--sans); letter-spacing: .075em; }
.eyebrow-mark { width: .54rem; height: .54rem; border-radius: 2px; background: #2d8869; transform: rotate(45deg); }
.hero h1 { margin-block: 1.1rem 1.05rem; }
.hero-name { display: block; font-size: clamp(4.35rem, 8.2vw, 7.9rem); font-weight: 850; line-height: .86; letter-spacing: -.085em; }
.hero-name span { margin-left: .065em; color: #208060; }
.hero-title { display: block; margin-top: .6rem; font-size: clamp(1.75rem, 3.25vw, 3.18rem); font-weight: 820; letter-spacing: -.04em; }
.hero-description { max-width: 25rem; color: #36554b; font-size: 1.02rem; line-height: 1.85; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1.35rem; }
.hero-actions .button { min-height: 3rem; padding-inline: 1.2rem; }
.hero-meta { display: flex; flex-wrap: wrap; gap: .55rem 1rem; align-items: center; margin-top: 1.45rem; font-size: .86rem; }
.hero-meta a { color: #275b4b; }
.hero-proof { display: inline-flex; gap: .4rem; align-items: center; text-decoration: none; }
.hero-proof:hover { text-decoration: underline; }
.hero-proof > span:first-child { display: grid; place-items: center; width: 1.2rem; height: 1.2rem; border-radius: 50%; background: #cde5d5; color: var(--green-dark); font-size: .76rem; font-weight: 800; }

.hero-visual {
  display: grid;
  align-items: center;
  padding: clamp(1.25rem, 3.1vw, 3rem);
  background-color: #103329;
  background-image: radial-gradient(ellipse at 85% 12%, #215c47 0, transparent 62%), radial-gradient(#47836b 1px, transparent 1px);
  background-size: auto, 20px 20px;
  color: #f1fbf5;
}
.case-explorer { width: 100%; min-width: 0; overflow: hidden; border: 1px solid #4b7868; border-radius: 1rem; background: #112d27; box-shadow: 0 18px 45px #071e19a8; }
.case-header { display: flex; align-items: center; gap: .65rem; padding: .9rem 1.05rem; border-bottom: 1px solid #33594c; background: #173b32; }
.case-emblem { display: grid; place-items: center; flex: none; width: 2.35rem; height: 2.35rem; border: 1px solid #579983; border-radius: .55rem; background: #275c4b; color: #c3f8da; font-size: 1.3rem; }
.case-header strong, .case-header div span { display: block; }
.case-header strong { font-size: 1.02rem; }
.case-header div span { color: #b1cfc3; font-size: .8rem; }
.case-label { margin-left: auto; color: #cfebdc; font-size: .75rem; white-space: nowrap; }
.case-body { padding: 1.25rem 1rem 1.05rem; background-image: radial-gradient(#456b5d 1px, transparent 1px); background-size: 16px 16px; }
.case-event { position: relative; display: flex; align-items: center; gap: .55rem; width: fit-content; min-width: min(100%, 14.75rem); margin-inline: auto; padding: .65rem .8rem; border: 1px solid #79b49b; border-radius: .65rem; background: #235548; }
.case-event::after { position: absolute; bottom: -.85rem; left: 50%; height: .85rem; border-left: 1px solid #81ad9d; content: ""; }
.case-event span:not(.case-node-symbol) { display: block; color: #c5e8d8; font: 680 .69rem/1.32 var(--mono); letter-spacing: .08em; }
.case-event strong { display: block; font-size: .94rem; }
.case-node-symbol { font-size: 1.2rem; color: #c4f2d9; }
.case-event > code { margin-left: auto; padding: .12rem .32rem; border: 1px solid #82b49f; border-radius: .3rem; color: #effcf4; font-size: .7rem; }
.case-nodes { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .48rem; margin-top: 1.65rem; }
.case-nodes::before { position: absolute; top: -.82rem; left: 16.5%; right: 16.5%; border-top: 1px solid #81ad9d; content: ""; }
.case-nodes > div { position: relative; min-width: 0; padding: .5rem .3rem; border: 1px solid #4d7568; border-radius: .55rem; background: #193c32; text-align: center; }
.case-nodes > div::before { position: absolute; top: -.86rem; left: 50%; height: .84rem; border-left: 1px solid #81ad9d; content: ""; }
.case-nodes small { display: block; color: #afd9c8; font: 660 .675rem/1.35 var(--mono); letter-spacing: .04em; }
.case-nodes code { display: block; font-size: clamp(.65rem, 1.1vw, .88rem); white-space: nowrap; }
.case-controls { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .25rem; padding: .55rem .8rem; border-block: 1px solid #33594c; background: #17382f; }
.case-controls button { min-height: 2.5rem; padding: .25rem .15rem; border: 1px solid transparent; border-radius: .45rem; background: transparent; color: #d5eee3; font: 650 .82rem/1.3 var(--sans); }
.case-controls button:hover, .case-controls button[aria-pressed="true"] { border-color: #679888; background: #295f50; color: #fff; }
.case-controls button:focus-visible { outline-color: #afffcd; outline-offset: 1px; }
.case-details { min-height: 5.25rem; padding: .65rem 1.05rem .75rem; color: #d2eae1; font-size: .9rem; }
.case-details strong { color: #aef2ca; }
.case-details code { color: #fff; font-size: .92em; overflow-wrap: anywhere; }

.home-section { margin-top: clamp(2.65rem, 5vw, 4.7rem); }
.section-heading { margin-bottom: 1.2rem; }
.section-heading p { margin-top: .44rem; color: var(--muted); }
.task-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .9rem; }
.task-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 12.2rem;
  padding: 1.15rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.task-card:hover { transform: translateY(-3px); border-color: #a6c8b4; box-shadow: 0 8px 23px #14362910; color: var(--ink); }
.task-icon { display: grid; place-items: center; min-width: 2.45rem; height: 2.3rem; margin-bottom: .85rem; padding-inline: .3rem; border-radius: .55rem; font: 750 1.2rem/1 var(--mono); }
.task-icon.mint { background: #dbf1e1; color: #146344; }
.task-icon.blue { background: #e0eff5; color: #1e6278; }
.task-icon.yellow { background: #f7efd7; color: #705418; }
.task-icon.violet { background: #eee9f9; color: #5d4684; }
.task-card h3 { font-size: 1.13rem; }
.task-card p { margin-block: .42rem .65rem; color: var(--muted); font-size: .94rem; }
.task-link { margin-top: auto; color: var(--green-dark); font-size: .875rem; font-weight: 740; text-decoration: underline; text-underline-offset: .24em; }

.evidence-panel { display: grid; grid-template-columns: .82fr 1.18fr; gap: clamp(1.2rem, 3vw, 3rem); align-items: center; padding: clamp(1.35rem, 3vw, 2.5rem); border: 1px solid #d5e5d9; border-radius: 1.35rem; background: #eaf4ec; }
.evidence-copy h2 { margin-top: .55rem; }
.evidence-copy > p:not(.eyebrow) { margin-block: .6rem 1.2rem; color: var(--muted); }
.evidence-panel .evidence-terminal { margin: 0; }
.evidence-terminal code > span { display: block; overflow-wrap: anywhere; white-space: pre-wrap; }
.evidence-terminal b { color: #a5edc7; }

.learning-summary { display: flex; flex-wrap: wrap; gap: .7rem 1.25rem; justify-content: space-between; align-items: center; padding: .9rem 1.1rem; margin-bottom: 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.learning-summary > div { display: flex; flex-wrap: wrap; gap: .25rem 1rem; align-items: center; }
.learning-summary [data-learning-count] { color: var(--muted); font-size: .875rem; }
progress { height: .35rem; overflow: hidden; border: 0; border-radius: 1rem; background: #dce8e0; appearance: none; }
progress::-webkit-progress-bar { background: #dce8e0; }
progress::-webkit-progress-value { background: var(--green); }
progress::-moz-progress-bar { background: var(--green); }
.learning-summary progress { width: min(11rem, 42vw); }
.learning-storage-note { flex: 0 0 100%; color: #7c4c25; font-size: .875rem; }
.route-nav { display: flex; gap: .55rem; flex-wrap: wrap; margin-block: 1.05rem; }
.route-nav a { padding: .42rem .75rem; border: 1px solid var(--line); border-radius: 2rem; background: var(--surface); color: var(--green-dark); font-size: .875rem; font-weight: 680; text-decoration: none; }
.route-nav a:hover { border-color: #a9c7b5; background: var(--tint); }
.route-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 1.05rem; }
.route-group { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.route-group h3 { padding: .86rem 1rem; background: #edf5ee; font-size: 1rem; }
.route-group ul { margin: 0; padding: 0; list-style: none; }
.route-group li { border-top: 1px solid var(--line); }
.route-row { display: grid; grid-template-columns: .5rem 1fr auto; gap: .65rem; align-items: baseline; padding: .8rem 1rem; color: var(--ink); text-decoration: none; }
.route-row:hover { background: #f1f8f2; }
.route-row:focus-visible { outline-offset: -4px; }
.route-row strong { display: block; }
.route-row p { margin-top: .1rem; color: var(--muted); font-size: .875rem; }
.route-marker { width: .4rem; height: .4rem; margin-top: .52rem; align-self: start; border-radius: 2px; background: #4f976c; }
.route-status { color: var(--green-dark); font-size: .82rem; white-space: nowrap; }

.about-sectools { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .9fr); align-items: center; gap: clamp(1rem, 4vw, 3.5rem); padding: clamp(1.3rem, 4vw, 2.65rem); border: 1px solid #d4e4d8; border-radius: 1.35rem; background: #eaf4ec; }
.about-brand { display: flex; align-items: center; gap: .65rem; }
.about-brand img { flex: none; }
.about-copy p { max-width: 31rem; margin-block: .7rem 1.05rem; color: #36574a; }
.about-links { display: grid; gap: .5rem; }
.about-links a { display: grid; gap: .1rem; padding: .62rem .85rem; border: 1px solid #d8e6db; border-radius: .62rem; background: #fdfefd; color: var(--green-dark); text-decoration: none; }
.about-links a:hover { border-color: #a1c1ac; background: #f2f8f3; }
.about-links span { color: var(--muted); font-size: .88rem; }

.reading-shell { display: grid; grid-template-columns: minmax(11rem, 13.25rem) minmax(0, 1fr) minmax(9.5rem, 12rem); gap: clamp(1.2rem, 2.8vw, 2.65rem); width: min(83rem, calc(100% - 4rem)); margin-inline: auto; }
.sidebar, .toc-sidebar { position: sticky; top: var(--header-height); max-height: calc(100dvh - var(--header-height)); overflow: auto; scrollbar-width: thin; align-self: start; padding-block: 1.65rem; }
.sidebar { border-right: 1px solid var(--line); padding-right: 1rem; }
.sidebar-group + .sidebar-group { margin-top: 1.1rem; }
.sidebar-group p, .toc-sidebar nav p { margin: 0 0 .35rem; color: var(--muted); font-size: .83rem; font-weight: 760; }
.sidebar-group > a { display: flex; justify-content: space-between; gap: .35rem; align-items: baseline; padding: .38rem .5rem; border-radius: .4rem; color: var(--muted); font-size: .885rem; line-height: 1.45; text-decoration: none; }
.sidebar-group > a:hover, .sidebar-group > a[aria-current="page"] { background: #e4f1e8; color: var(--green-dark); }
.sidebar-group > a[aria-current="page"] { font-weight: 770; box-shadow: inset 2px 0 #348664; }
.sidebar-check { color: var(--green-dark); font-weight: 730; }
.sidebar-source { display: block; margin-top: 1.3rem; font-size: .88rem; }
.mobile-chapters, .mobile-toc { display: none; }
.chapter-main { min-width: 0; }
.chapter-hero { padding: 2.4rem 0 1.5rem; border-bottom: 1px solid var(--line); }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; color: var(--muted); font-size: .875rem; }
.breadcrumbs a { text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.chapter-hero h1 { margin-top: .95rem; font-size: clamp(2rem, 4vw, 3.3rem); font-weight: 825; line-height: 1.15; letter-spacing: -.04em; overflow-wrap: anywhere; }
.chapter-description { margin-top: .85rem; color: var(--muted); font-size: 1.075rem; line-height: 1.72; }
.chapter-meta { display: flex; align-items: baseline; flex-wrap: wrap; gap: .45rem 1rem; margin-top: .9rem; color: var(--muted); font-size: .875rem; }
.chapter-outcome { margin-top: 1.35rem; padding: .9rem 1.1rem; border-left: 3px solid #69a783; border-radius: .25rem .8rem .8rem .25rem; background: var(--tint); }
.chapter-outcome p { margin-top: .18rem; color: #37574a; }
.toc-sidebar { padding-top: 2.4rem; }
.chapter-toc > a { display: block; padding: .35rem .5rem; border-left: 2px solid var(--line); color: var(--muted); font-size: .85rem; line-height: 1.45; text-decoration: none; overflow-wrap: anywhere; }
.chapter-toc > a:hover, .chapter-toc > a[aria-current="location"] { border-left-color: #318269; color: var(--green-dark); }
.chapter-toc > a[aria-current="location"] { background: #e8f2e9; font-weight: 720; }
.reading-progress { display: grid; grid-template-columns: 1fr auto; gap: .3rem .5rem; margin-top: 1.15rem; padding: .65rem; border: 1px solid var(--line); border-radius: .5rem; background: var(--surface); color: var(--muted); font-size: .82rem; }
.reading-progress progress { grid-column: span 2; width: 100%; }

article { padding-top: .05rem; font-size: 1.04rem; line-height: 1.86; overflow-wrap: anywhere; }
article > section { padding-block: 1.9rem 1.65rem; }
article > section + section { border-top: 1px solid var(--line); }
article h2 { margin-bottom: .8rem; font-size: clamp(1.52rem, 3vw, 2rem); }
article h3 { margin-bottom: .3rem; font-size: 1.2rem; }
article p + p { margin-top: .85rem; }
article ul, article ol { padding-left: 1.5rem; margin: .8rem 0; }
article li + li { margin-top: .36rem; }
article :not(pre) > code { padding: .07rem .25rem; border: 1px solid #dbe7df; border-radius: .28rem; background: #ecf2ee; color: #124b3d; font-size: .89em; }
article blockquote { margin: 1.1rem 0; padding: .65rem .95rem; border-left: 3px solid #74a98d; background: #edf5ef; color: #245242; font-weight: 620; }
.section-kicker, .article-meta, .caption { color: var(--muted); font-size: .875rem; }
.section-kicker { margin-bottom: .35rem; color: var(--green-dark); font-weight: 720; }
.article-meta { display: flex; flex-wrap: wrap; gap: .35rem .9rem; margin-bottom: .65rem; }
.caption { margin-block: .45rem; }
.note, .release-note, .sharing-lab, .inline-promo { margin-block: 1.05rem; padding: .85rem 1rem; border: 1px solid #d8e7db; border-radius: .74rem; background: #ecf5ee; }
.note strong, .sharing-lab label { color: var(--green-dark); }
.note p, .release-note p, .inline-promo p { margin-top: .25rem; }
.inline-promo { display: flex; gap: .65rem; }
.promo-icon { color: var(--green-dark); }
.steps { list-style-position: outside; }
.steps > li { padding: .4rem 0; }
.steps > li::marker { color: var(--green-dark); font-weight: 760; }
.compare, .question-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; margin: 1rem 0; }
.compare > div, .question-list > div, .glossary > div { padding: .75rem .9rem; border: 1px solid var(--line); border-radius: .65rem; background: var(--surface); }
.question-list span, .glossary dt { font-weight: 740; }
.glossary { display: grid; gap: .55rem; }
.glossary dt span { padding-left: .35rem; color: var(--muted); font-size: .85rem; }
.glossary dd { margin: .15rem 0 0; }
.source-link { margin-left: .4rem; font-size: .9em; }
.table-wrap { overflow: auto; max-width: 100%; margin-block: .9rem; border: 1px solid var(--line); border-radius: .65rem; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
th, td { min-width: 7rem; padding: .55rem .7rem; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
thead th { border-top: 0; background: #edf5ee; }
.reference-list { padding: 0; list-style: none; }
article .reference-list { padding-left: 0; }
.reference-list > li { padding: .9rem 0; border-bottom: 1px solid var(--line); }
.reference-list > li:last-child { border-bottom: 0; }
.reference-list p { margin-block: .1rem .25rem; color: var(--muted); }
.sharing-lab label { display: block; font-weight: 740; }
.sharing-lab select { width: min(100%, 24rem); margin: .4rem 0 .65rem; padding: .55rem; border: 1px solid #9ab9a8; border-radius: .45rem; background: var(--surface); color: var(--ink); }
.sharing-result { min-height: 3.6rem; }

.terminal { max-width: 100%; min-width: 0; margin-block: 1rem; overflow: hidden; border: 1px solid #28493f; border-radius: .7rem; background: #112c26; color: #e4f5ed; }
.terminal-title, .terminal-label { display: flex; gap: .45rem .7rem; flex-wrap: wrap; justify-content: space-between; align-items: center; padding: .55rem .75rem; border-bottom: 1px solid #39574e; background: #1a3931; color: #d2e9dc; font-size: .845rem; font-weight: 650; line-height: 1.4; }
.terminal pre { width: 100%; margin: 0; padding: .8rem .9rem; overflow: auto; font-size: .88rem; line-height: 1.65; }
.terminal[data-output] pre { max-height: 25rem; }
.terminal pre:focus-visible { outline-color: #a0ebbf; outline-offset: -3px; }
.copy-code { padding: .21rem .55rem; border: 1px solid #5b8273; border-radius: .4rem; background: #263f38; color: #effaf5; font-size: .8rem; }
.copy-code:hover { background: #395b50; }
.copy-code:focus-visible { outline-color: #a0ebbf; }

.graph-demo { margin: .9rem 0; overflow: hidden; border: 1px solid var(--line); border-radius: .7rem; background: #edf5ed; }
.graph-toolbar { display: flex; justify-content: space-between; gap: .5rem; padding: .5rem .75rem; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .82rem; }
.graph-canvas { position: relative; height: 12.4rem; background-image: radial-gradient(#aac8b6 1px, transparent 1px); background-size: 14px 14px; }
.graph-canvas svg { position: absolute; width: 100%; height: 100%; fill: none; stroke: #87a594; stroke-width: 1.5; }
.graph-node { position: absolute; display: flex; align-items: center; gap: .35rem; width: max-content; max-width: 31%; padding: .35rem .5rem; transform: translateX(-50%); border: 1px solid #b8ccbe; border-radius: .55rem; background: var(--surface); color: var(--green-dark); font-size: .91rem; line-height: 1.4; text-align: left; }
.graph-node small { display: block; color: var(--muted); font-size: .72rem; }
.graph-node.report { top: 9%; left: 50%; max-width: 80%; }
.graph-node.actor { top: 68%; left: 16.5%; }
.graph-node.malware { top: 68%; left: 50%; }
.graph-node.domain { top: 68%; left: 83.5%; }
.graph-node:hover, .graph-node.selected { border-color: #308369; background: #dcf2e3; }
.edge-label { position: absolute; top: 46%; padding: .05rem .25rem; transform: translateX(-50%); border-radius: .25rem; background: #edf5ed; color: var(--muted); font-size: .76rem; }
.edge-a { left: 33%; }
.edge-b { left: 50%; }
.edge-c { left: 67%; }
.graph-detail { padding: .65rem .9rem; border-top: 1px solid var(--line); background: var(--surface); }
.graph-detail p { margin-top: .15rem; color: var(--muted); font-size: .96rem; }

.chapter-completion { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .6rem 1rem; padding: .85rem 1rem; margin-top: .5rem; border: 1px solid var(--line); border-radius: .7rem; background: #edf5ef; }
.chapter-completion p { color: var(--muted); font-size: .875rem; }
.chapter-completion .learning-storage-note { color: #7c4c25; }
.chapter-pagination { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; margin-block: 1rem 0; }
.chapter-pagination a { padding: .72rem .85rem; border: 1px solid var(--line); border-radius: .65rem; background: var(--surface); color: var(--ink); text-decoration: none; }
.chapter-pagination a:last-child { text-align: right; }
.chapter-pagination a:hover { background: #e9f4eb; }
.chapter-pagination small { display: block; color: var(--muted); font-size: .82rem; }

.site-footer { margin-top: clamp(3rem, 6vw, 5.25rem); border-top: 1px solid #d3e1d6; background: #eaf1e9; }
.footer-inner { display: flex; justify-content: space-between; gap: 1.65rem; flex-wrap: wrap; padding-block: 2.1rem; }
.maintenance p { margin-top: .35rem; color: var(--muted); font-size: .88rem; }
.footer-version { font-weight: 680; }
.footer-links { display: grid; grid-template-columns: repeat(2, max-content); gap: .35rem 1.3rem; align-content: start; }
.footer-links a { font-size: .875rem; }

#search-dialog { width: min(42rem, calc(100% - 1.5rem)); max-height: min(38rem, calc(100dvh - 2rem)); padding: 1.15rem; border: 1px solid #a0b9a9; border-radius: 1rem; background: var(--surface); color: var(--ink); box-shadow: 0 20px 80px #0c2b2350; }
#search-dialog::backdrop { background: #112e27aa; }
.search-heading { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .55rem; }
.search-heading h2 { font-size: 1.35rem; }
#close-search { min-width: 2.65rem; padding: .25rem; }
#search-dialog label { display: block; margin-bottom: .2rem; color: var(--muted); font-size: .89rem; }
#search-input { width: 100%; padding: .62rem .7rem; border: 1px solid #9eb6a8; border-radius: .45rem; background: #f7fbf8; color: var(--ink); }
.search-suggestions { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .6rem; }
.search-suggestions button { padding: .3rem .65rem; border: 1px solid var(--line); border-radius: 1rem; background: #edf6ef; color: var(--green-dark); font-size: .83rem; }
.search-suggestions button:hover { border-color: #9ebca9; }
#search-status { margin-top: .8rem; color: var(--muted); font-size: .875rem; }
#search-results { margin: .4rem 0 0; padding: 0; list-style: none; }
#search-results a { display: grid; padding: .55rem .5rem; border-top: 1px solid var(--line); color: var(--ink); line-height: 1.45; text-decoration: none; }
#search-results a:hover, #search-results a:focus-visible { background: #edf6ef; }
#search-results small, #search-results .search-excerpt { color: var(--muted); font-size: .84rem; }
#search-results strong { overflow-wrap: anywhere; }
#search-results .search-excerpt { margin-top: .15rem; overflow-wrap: anywhere; }

@media (max-width: 70rem) {
  .reading-shell { grid-template-columns: minmax(10rem, 12.1rem) minmax(0, 1fr); max-width: 63rem; }
  .toc-sidebar { display: none; }
  .mobile-toc { display: block; margin-top: 1rem; padding: .55rem .75rem; border: 1px solid var(--line); border-radius: .55rem; background: var(--surface); }
  .mobile-toc summary { cursor: pointer; font-size: .93rem; font-weight: 730; }
  .mobile-toc nav { margin-top: .45rem; }
}

@media (max-width: 53rem) {
  .home-main, .header-inner, .footer-inner, .reading-shell { width: calc(100% - 2rem); }
  .header-nav { gap: .75rem; }
  .hero { min-height: 0; }
  .hero-copy { padding: 1.5rem 1.25rem 1.8rem; }
  .hero-visual { padding: 1rem; }
  .case-header { padding: .65rem .7rem; }
  .case-body { padding-inline: .55rem; }
  .case-details { min-height: 6rem; padding-inline: .7rem; }
  .task-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
  .task-card { min-height: 10rem; }
}

@media (max-width: 45rem) {
  :root { --header-height: 3.75rem; }
  .header-nav, .sidebar { display: none; }
  .header .menu-toggle:not([hidden]) { display: inline-flex; }
  .search-trigger { min-width: 0; }
  .search-trigger kbd { display: none; }
  .mobile-chapters { position: fixed; inset: var(--header-height) 0 auto; z-index: 4; display: block; max-height: calc(100dvh - var(--header-height)); overflow: auto; overscroll-behavior: contain; padding: .95rem 1rem; border-bottom: 1px solid var(--line); background: #fbfdfa; box-shadow: 0 10px 30px #102b2140; }
  .mobile-chapters .sidebar-group > a { min-height: 2.75rem; align-items: center; font-size: .96rem; }
  .reading-shell { display: block; max-width: 40rem; }
  .chapter-hero { padding-top: 1.35rem; }
  .hero { grid-template-columns: 1fr; margin-top: .85rem; border-radius: 1rem; }
  .hero-copy { padding: 1.45rem; }
  .hero-title { font-size: clamp(1.64rem, 6vw, 2.6rem); }
  .hero-name { font-size: clamp(4rem, 14.5vw, 6rem); }
  .hero-visual { padding: .95rem; }
  .case-explorer { max-width: 31rem; margin-inline: auto; }
  .case-nodes code { font-size: clamp(.65rem, 2.7vw, .84rem); }
  .case-details { min-height: 4.85rem; }
  .evidence-panel, .route-groups, .about-sectools { grid-template-columns: 1fr; }
}

@media (max-width: 28rem) {
  .home-main, .header-inner, .footer-inner, .reading-shell { width: calc(100% - 1.25rem); }
  .header-inner { gap: .5rem; }
  .header-actions { gap: .35rem; }
  .header-actions .button { padding-inline: .65rem; min-height: 2.5rem; font-size: .875rem; }
  .brand { gap: .42rem; }
  .brand img { width: 1.9rem; height: 1.9rem; }
  .brand-title { font-size: .98rem; }
  .brand-title span { font-size: .8rem; }
  .hero-copy { padding: 1.2rem; }
  .hero-meta { margin-top: .95rem; }
  .hero-visual { padding: .65rem; }
  .case-controls { padding-inline: .35rem; }
  .case-controls button { font-size: .77rem; }
  .task-card { padding: .9rem .75rem; }
  .task-card h3 { font-size: 1rem; }
  .task-card p { font-size: .9rem; }
  .compare, .question-list { grid-template-columns: 1fr; }
  .graph-node { font-size: .75rem; }
  .graph-node small { font-size: .65rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

@media (forced-colors: active) {
  .case-controls button[aria-pressed="true"], .graph-node.selected, .sidebar a[aria-current="page"] { outline: 2px solid Highlight; outline-offset: -2px; }
  .case-nodes::before, .case-nodes > div::before, .case-event::after { border-color: GrayText; }
}

.evidence-actions { display: flex; gap: .55rem .95rem; flex-wrap: wrap; align-items: center; }
.evidence-actions > a:not(.button) { font-size: .9rem; font-weight: 680; }
.ui-figure { margin: 1.1rem 0; overflow: hidden; border: 1px solid var(--line); border-radius: .75rem; background: var(--surface); }
.ui-figure > a { display: block; }
.ui-figure > a:focus-visible { outline-offset: -4px; }
.ui-figure img { display: block; width: 100%; height: auto; }
.ui-figure.login-figure { max-width: 36.25rem; }
.ui-figure figcaption { padding: .7rem .85rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .89rem; line-height: 1.55; }
.ui-figure figcaption strong { color: var(--ink); }
.ui-figure figcaption span { display: block; margin-top: .2rem; font-size: .83rem; }

.language-switch { font-size: .875rem; }
.policy-main { width: min(47rem, calc(100% - 2rem)); margin: 2.5rem auto 0; }
.policy-main h1 { margin-top: .45rem; font-size: clamp(2rem, 5vw, 3rem); }
.policy-main article { margin-top: .7rem; border-top: 1px solid var(--line); }
.policy-main article > section { padding-block: 1.4rem; }
.maintenance .site-credit { font-size: .85rem; }

@media (max-width: 53rem) {
  .header-inner { column-gap: .75rem; }
  .header-nav { font-size: .875rem; }
  .header-nav a { font-size: inherit; }
  .search-trigger { min-width: 0; }
  .search-trigger kbd { display: none; }
}
@media (max-width: 30rem) {
  .header-inner:has(.menu-toggle) .brand-title span { display: none; }
  .header-actions .button { padding-inline: .48rem; }
  .header-actions .search-icon { display: none; }
  .footer-links { width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem 1rem; }
}
