:root {
  --ink: #173042;
  --muted: #5b6f7b;
  --paper: #f7f5ef;
  --surface: #ffffff;
  --line: #d7e0e3;
  --navy: #11394b;
  --accent: #3f7ea3;
  --accent-soft: #eaf3f8;
  --warm: #c77a28;
  --warm-soft: #fff4e6;
  --green: #367b62;
  --green-soft: #eaf5ef;
  --violet: #6d5b8c;
  --violet-soft: #f2edf8;
  --shadow: 0 18px 48px rgba(20, 48, 63, 0.08);
  --radius: 22px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 104px;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(17, 57, 75, 0.025) 1px, transparent 1px),
    var(--paper);
  background-size: 100% 32px;
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  line-height: 1.82;
  -webkit-font-smoothing: antialiased;
}

body[data-field="digital"] { --accent: #b06b12; --accent-soft: #fff1dd; }
body[data-field="network"] { --accent: #2d719d; --accent-soft: #e8f3fb; }
body[data-field="statistics"] { --accent: #327a62; --accent-soft: #e7f4ed; }
body[data-field="programming"] { --accent: #6f5b91; --accent-soft: #f1ecf8; }

a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }

.skip-link {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 100;
  padding: 10px 16px;
  color: #fff;
  background: var(--navy);
  border-radius: 0 0 10px 10px;
}
.skip-link:focus { top: 0; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgb(16 47 53 / 10%);
  background: rgb(245 243 237 / 94%);
  backdrop-filter: blur(14px);
  transform: translateY(0);
  transition: transform .24s ease, box-shadow .24s ease;
  will-change: transform;
}
.site-header.is-header-hidden { transform: translateY(calc(-100% - 2px)); }

.header-inner {
  width: min(1180px, calc(100% - 40px));
  min-height: 86px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #102f35;
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #f5f3ed;
  background: #102f35;
  border-radius: 50% 50% 48% 52% / 56% 48% 52% 44%;
  font-family: Georgia, serif;
  font-size: 1.45rem;
  font-style: italic;
}

.brand strong, .brand small { display: block; line-height: 1.25; }
.brand strong { font-family: Georgia, "Yu Mincho", serif; font-size: 1.02rem; letter-spacing: .02em; }
.brand small { margin-top: 3px; color: #36565b; font-size: .63rem; font-weight: 700; letter-spacing: .13em; }

.global-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
}
.global-nav a {
  position: relative;
  padding: 8px 0;
  color: #36565b;
  font-size: .78rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.global-nav a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 2px;
  left: 0;
  height: 2px;
  background: #e96f51;
  transform: scaleX(0);
  transition: transform .2s ease;
}
.global-nav a:hover::after, .global-nav a[aria-current="page"]::after { transform: scaleX(1); }
.global-nav a[aria-current="page"] { color: #102f35; }

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

.course-hero {
  position: relative;
  margin: 42px 0 20px;
  padding: clamp(32px, 5vw, 70px);
  overflow: hidden;
  color: #fff;
  background: var(--navy);
  border-radius: 30px;
  box-shadow: var(--shadow);
}
.course-hero::after {
  content: "";
  position: absolute;
  right: -120px;
  top: -150px;
  width: 440px;
  height: 440px;
  border: 80px solid color-mix(in srgb, var(--accent) 75%, white 25%);
  border-radius: 50%;
  opacity: 0.42;
}
.hero-kicker {
  position: relative;
  z-index: 1;
  margin: 0 0 12px;
  color: #b9d3de;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
}
.course-hero h1 {
  position: relative;
  z-index: 1;
  max-width: 980px;
  margin: 0;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1.18;
  letter-spacing: -0.035em;
}
.hero-lead {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 20px 0 0;
  color: #dce9ee;
  font-size: clamp(16px, 2vw, 20px);
}
.hero-meta {
  position: relative;
  z-index: 1;
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.hero-meta-label {
  align-self: center;
  margin-right: 2px;
  color: #b9d3de;
  font-size: 12px;
  letter-spacing: 0.08em;
}
.hero-meta span {
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: #eaf3f6;
  background: rgba(255, 255, 255, 0.07);
  font-size: 13px;
}

.lecture-learning-guide {
  margin: 0 0 20px;
  padding: clamp(20px, 3vw, 30px);
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--line));
  border-radius: 18px;
  background: color-mix(in srgb, var(--accent-soft) 62%, white);
  box-shadow: 0 10px 28px rgba(20, 48, 63, .06);
}
.lecture-learning-guide__heading p { margin: 0 0 3px; color: var(--accent); font-size: 10px; font-weight: 900; letter-spacing: .15em; }
.lecture-learning-guide__heading h2 { margin: 0; font-size: clamp(19px, 2.4vw, 26px); line-height: 1.45; }
.lecture-learning-guide__choices { margin-top: 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.lecture-learning-choice {
  min-height: 72px;
  padding: 14px 16px;
  display: grid;
  align-content: center;
  gap: 3px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  text-decoration: none;
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.lecture-learning-choice:hover { border-color: var(--accent); box-shadow: 0 8px 20px rgba(20, 48, 63, .07); transform: translateY(-1px); }
.lecture-learning-choice strong { font-size: 14px; }
.lecture-learning-choice span { color: var(--muted); font-size: 11px; }
.lecture-learning-choice:focus-visible, .lecture-keyword-index summary:focus-visible, .lecture-keyword-index a:focus-visible, .keyword-reading-tools a:focus-visible, .keyword-reading-tools button:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 38%, white); outline-offset: 3px; }
.lecture-keyword-index { margin-top: 12px; background: rgb(255 255 255 / 72%); border: 1px solid var(--line); border-radius: 13px; }
.lecture-keyword-index summary { min-height: 62px; padding: 12px 50px 12px 16px; position: relative; display: grid; align-items: center; cursor: pointer; list-style: none; }
.lecture-keyword-index summary::-webkit-details-marker { display: none; }
.lecture-keyword-index summary::after { content: "▼"; position: absolute; right: 17px; color: var(--accent); font-size: 12px; }
.lecture-keyword-index[open] summary::after { content: "▲"; }
.lecture-keyword-index summary span { display: grid; gap: 2px; }
.lecture-keyword-index summary strong { font-size: 14px; }
.lecture-keyword-index summary small { color: var(--muted); font-size: 11px; font-weight: 500; }
.lecture-keyword-index__groups { padding: 4px 16px 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 22px; border-top: 1px solid var(--line); }
.lecture-keyword-index__groups section { min-width: 0; padding-top: 14px; }
.lecture-keyword-index__groups h3 { margin: 0 0 9px; color: var(--muted); font-size: 12px; }
.lecture-keyword-index__groups section > div { display: flex; flex-wrap: wrap; gap: 7px; }
.lecture-keyword-index__groups a { min-height: 38px; padding: 7px 11px; display: inline-flex; align-items: center; color: var(--ink); background: #fff; border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line)); border-radius: 999px; font-size: 12px; font-weight: 800; line-height: 1.45; text-decoration: none; white-space: normal; }
.lecture-keyword-index__groups a:hover { color: var(--accent); border-color: var(--accent); }
.lecture-reading-state { width: fit-content; margin: 12px 0 0; padding: 5px 10px; color: var(--muted); background: rgb(255 255 255 / 74%); border-radius: 999px; font-size: 11px; font-weight: 800; }
.lecture-reading-state.is-keyword-reading { color: var(--accent); }

.keyword-target { scroll-margin-top: 180px; border-radius: 4px; transition: background-color .45s ease, box-shadow .45s ease; }
.keyword-target:focus { outline: 2px solid color-mix(in srgb, #d49a00 62%, white); outline-offset: 3px; }
.keyword-target.is-keyword-highlighted { background: #fff0a8; box-shadow: 0 0 0 4px #fff0a8; }
.keyword-reading-tools {
  margin: 18px 0;
  padding: 15px 17px;
  display: grid;
  gap: 12px;
  color: var(--ink);
  background: #fff9dc;
  border: 1px solid #dfc76c;
  border-radius: 13px;
}
.keyword-reading-tools[hidden] { display: none; }
.keyword-reading-tools p { margin: 0; display: grid; gap: 1px; }
.keyword-reading-tools p span { color: var(--muted); font-size: 10px; font-weight: 800; }
.keyword-reading-tools p strong { color: #775900; font-size: 13px; }
.keyword-reading-tools nav { display: flex; flex-wrap: wrap; gap: 7px; }
.keyword-reading-tools a, .keyword-reading-tools button { min-height: 40px; padding: 8px 11px; color: var(--ink); background: #fff; border: 1px solid #d6c47b; border-radius: 999px; cursor: pointer; font-size: 11px; font-weight: 800; text-decoration: none; }

.cloze-toggle {
  width: 100%;
  margin-top: 14px;
  padding: 12px 10px 3px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
}
.cloze-toggle:hover { color: var(--accent); }
.cloze-toggle:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 35%, white); outline-offset: 3px; }

.page-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 30px;
  align-items: start;
}

.section-sidebar {
  position: sticky;
  top: 106px;
  min-width: 0;
  max-height: calc(100vh - 124px);
  padding: 20px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.88);
  transition: top .24s ease, max-height .24s ease;
}
.header-is-hidden .section-sidebar { top: 18px; max-height: calc(100vh - 36px); }
.section-sidebar > p {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
}
.lecture-course-nav { display: grid; gap: 4px; }
.course-field-group { display: grid; gap: 4px; }
.course-field-group.is-current {
  margin: 2px 0;
  padding: 5px;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent-soft) 66%, white);
}
.course-field-link {
  padding: 9px 11px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  text-decoration: none;
}
.course-field-link:hover { color: var(--ink); background: #fff; }
.course-field-link[aria-current="page"] { color: var(--ink); background: #fff; box-shadow: 0 5px 16px rgba(20, 48, 63, .07); }
.section-nav { display: grid; gap: 3px; margin-left: 12px; padding: 2px 0 4px 9px; border-left: 1px solid color-mix(in srgb, var(--accent) 38%, var(--line)); }
.section-nav a {
  padding: 7px 9px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  text-decoration: none;
}
.section-nav a span { color: var(--accent); font-size: 11px; font-variant-numeric: tabular-nums; font-weight: 800; }
.section-nav a:hover, .section-nav a.is-active { color: var(--ink); background: var(--accent-soft); }

.lecture-content { min-width: 0; min-height: 100vh; }
.lecture-section {
  margin: 0 0 30px;
  padding: clamp(24px, 4vw, 48px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  scroll-margin-top: 104px;
}
.section-heading {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 18px;
  align-items: start;
  margin-bottom: 26px;
}
.section-number {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--accent);
  border-radius: 17px;
  font-weight: 900;
}
.section-kicker { margin: 0 0 4px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: 0.13em; }
.section-heading h2 { margin: 0; font-size: clamp(25px, 3.4vw, 38px); line-height: 1.32; letter-spacing: -0.025em; }
.section-lead { margin: 12px 0 0; color: var(--muted); font-size: 16px; }

.lecture-section h3 { margin: 34px 0 12px; font-size: clamp(20px, 2.4vw, 27px); line-height: 1.45; }
.lecture-section h4 { margin: 24px 0 8px; font-size: 18px; }
.lecture-section p { margin: 0 0 16px; }
.section-body > p, .section-body > ul, .section-body > ol { max-width: none; }
.lecture-section ul, .lecture-section ol { margin: 12px 0 22px; padding-left: 1.45em; }
.lecture-section li + li { margin-top: 7px; }

.cloze {
  display: inline-grid;
  min-width: 2.8em;
  margin: 0 0.08em;
  padding: 0.02em 0.22em 0.08em;
  place-items: center;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 65%, white);
  border: 0;
  border-bottom: 2px solid var(--accent);
  border-radius: 6px 6px 2px 2px;
  cursor: pointer;
  font-weight: 800;
  line-height: 1.35;
  vertical-align: baseline;
}
.cloze-answer { visibility: visible; opacity: 1; transition: opacity 0.14s ease; }
.cloze.is-hidden .cloze-answer { visibility: hidden; opacity: 0; }
.cloze.is-hidden { background: color-mix(in srgb, var(--accent-soft) 35%, white); }
.cloze:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 28%, white); outline-offset: 2px; }

.concept-grid, .compare-grid, .three-grid {
  display: grid;
  gap: 16px;
  margin: 22px 0;
}
.concept-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.compare-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.concept-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfcfc;
}
.concept-card > :first-child { margin-top: 0; }
.concept-card h3, .concept-card h4 { margin: 0 0 8px; color: var(--accent); }
.concept-card p:last-child { margin-bottom: 0; }
.concept-card.warm,
.concept-card.green,
.concept-card.violet { background: #fff; border-color: var(--line); }

.key-point, .warning, .practice {
  margin: 24px 0;
  padding: 18px 20px;
  border-left: 5px solid var(--accent);
  border-radius: 0 14px 14px 0;
  background: var(--accent-soft);
}
.warning { border-left-color: var(--warm); background: var(--warm-soft); }
.practice { border-left-color: var(--green); background: var(--green-soft); }
.key-point > :last-child, .warning > :last-child, .practice > :last-child { margin-bottom: 0; }

.practice-solution {
  margin-top: 14px;
  overflow: clip;
  border: 1px solid color-mix(in srgb, var(--green) 28%, white);
  border-radius: 12px;
  background: #fff;
}
.practice-solution > summary {
  padding: 11px 42px 11px 14px;
  color: var(--green);
  cursor: pointer;
  font-weight: 800;
}
.practice-solution > div { padding: 14px; border-top: 1px solid var(--line); }
.practice-solution > div > :first-child { margin-top: 0; }
.practice-solution > div > :last-child { margin-bottom: 0; }

.formula {
  margin: 22px 0;
  padding: 18px 22px;
  overflow-x: auto;
  color: var(--navy);
  background: #f3f6f7;
  border: 1px solid var(--line);
  border-radius: 14px;
  font-family: "Cambria Math", "Times New Roman", serif;
  font-size: clamp(20px, 3vw, 30px);
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.table-wrap { margin: 22px 0; overflow-x: auto; border: 1px solid var(--line); border-radius: 15px; }
.lecture-table { width: 100%; min-width: 620px; border-collapse: collapse; background: #fff; font-size: 14px; }
.lecture-table th, .lecture-table td { padding: 13px 15px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.lecture-table th { color: var(--navy); background: var(--accent-soft); font-weight: 800; }
.lecture-table tr:last-child td { border-bottom: 0; }
.lecture-table code { font-size: 0.95em; }

.step-flow {
  display: grid;
  grid-template-columns: repeat(var(--steps, 4), minmax(0, 1fr));
  gap: 32px;
  margin: 24px 0;
}
.step-item {
  position: relative;
  min-height: 120px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}
.step-item:not(:last-child)::after {
  content: "→";
  position: absolute;
  right: -27px;
  top: 50%;
  width: 22px;
  color: var(--accent);
  font-size: 22px;
  font-weight: 900;
  text-align: center;
  transform: translateY(-50%);
}
.step-item b { display: block; margin-bottom: 7px; color: var(--accent); }
.step-item p { margin: 0; color: var(--muted); font-size: 14px; }

.layer-stack { display: grid; gap: 9px; margin: 24px 0; }
.layer-row {
  display: grid;
  grid-template-columns: 52px minmax(220px, .85fr) minmax(0, 1.15fr);
  gap: 16px;
  align-items: center;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-left: 6px solid var(--accent);
  border-radius: 13px;
  background: #fff;
}
.layer-row strong { color: var(--accent); }
.layer-row span:last-child { color: var(--muted); font-size: 14px; }

.protocol-figure, .signature-workflow { isolation: isolate; }
.protocol-endpoints {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  max-width: 760px;
  margin: 0 auto 18px;
}
.protocol-endpoints section {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  text-align: center;
}
.protocol-endpoints span, .protocol-endpoints strong, .protocol-endpoints small { display: block; }
.protocol-endpoints span { color: var(--muted); font-size: 11px; }
.protocol-endpoints strong { color: var(--navy); font-size: 18px; }
.protocol-endpoints small { margin-top: 2px; color: var(--accent); font-weight: 800; }
.protocol-endpoints > i { color: var(--accent); font-size: 28px; font-style: normal; font-weight: 900; }
.protocol-question { max-width: none !important; margin-bottom: 18px !important; color: var(--muted); text-align: center; }
.protocol-layers { margin: 0; }
.protocol-layers .layer-row > b {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--accent);
  border-radius: 50%;
}
.protocol-layers .layer-row > div > strong,
.protocol-layers .layer-row > div > span,
.protocol-example small,
.protocol-example em { display: block; }
.protocol-layers .layer-row > div > span { margin-top: 2px; color: var(--muted); font-size: 13px; }
.protocol-example { padding-left: 16px; border-left: 1px solid var(--line); }
.protocol-example small { color: var(--muted); font-size: 12px; }
.protocol-example em { margin-top: 3px; color: var(--navy); font-style: normal; font-weight: 800; }
.protocol-directions { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; color: var(--muted); font-size: 12px; font-weight: 700; }

.signature-prep {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto auto;
  gap: 10px 16px;
  align-items: center;
  margin-bottom: 22px;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.signature-prep > strong { color: var(--navy); }
.signature-prep > span { color: var(--muted); font-size: 13px; }
.signature-prep > b { padding: 7px 10px; border: 1px solid currentColor; border-radius: 9px; font-size: 12px; }
.private-key, .uses-private::marker { color: var(--warm); }
.public-key, .uses-public::marker { color: var(--accent); }
.signature-lanes { display: grid; grid-template-columns: minmax(0, 1fr) 84px minmax(0, 1fr); gap: 18px; align-items: stretch; }
.signature-lane { padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.signature-lane h3 { margin: 0 0 14px; color: var(--navy); font-size: 18px; }
.signature-lane ol { display: grid; gap: 10px; margin: 0; padding-left: 1.7em; }
.signature-lane li { padding: 13px 14px; color: var(--accent); border: 1px solid var(--line); border-radius: 12px; background: #fbfcfc; font-weight: 900; }
.signature-lane li::marker { font-weight: 900; }
.signature-lane li b, .signature-lane li span { display: block; }
.signature-lane li b { color: var(--navy); }
.signature-lane li span { margin-top: 4px; color: var(--muted); font-size: 12px; font-weight: 500; }
.signature-lane li.uses-private { border-left: 5px solid var(--warm); }
.signature-lane li.uses-public { border-left: 5px solid var(--accent); }
.signature-lane li.signature-result { color: var(--green); border-left: 5px solid var(--green); background: var(--green-soft); }
.signature-transfer { display: grid; align-content: center; justify-items: center; color: var(--accent); text-align: center; }
.signature-transfer span { font-size: 11px; font-weight: 800; }
.signature-transfer i { font-size: 32px; font-style: normal; line-height: 1; }

.html-figure {
  margin: 28px 0;
  padding: clamp(18px, 3vw, 28px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #f9fbfb;
  box-shadow: 0 10px 28px rgba(20, 48, 63, 0.05);
}
.html-figure > :first-child { margin-top: 0; }
.html-figure > figcaption {
  margin: 22px calc(clamp(18px, 3vw, 28px) * -1) calc(clamp(18px, 3vw, 28px) * -1);
  padding: 12px clamp(18px, 3vw, 28px) 14px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: #fff;
  font-size: 13px;
}
.html-figure .step-flow { margin-top: 0; }
.compact-grid { margin-top: 0; }

.knowledge-ladder {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
  margin-top: 22px;
}
.knowledge-ladder > span {
  position: relative;
  min-width: 0;
  padding: 14px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  text-align: center;
}
.knowledge-ladder > span:not(:last-child)::after {
  content: "→";
  position: absolute;
  top: 50%;
  right: -24px;
  color: var(--accent);
  font-weight: 900;
  transform: translateY(-50%);
}
.knowledge-ladder b, .knowledge-ladder small { display: block; }
.knowledge-ladder b { color: var(--accent); }
.knowledge-ladder small { margin-top: 4px; color: var(--muted); line-height: 1.45; }

.classification-flow, .hierarchy-tree { display: grid; gap: 24px; }
.classification-root, .tree-root {
  position: relative;
  width: min(100%, 430px);
  margin: 0 auto;
  padding: 15px 18px;
  color: #fff;
  background: var(--navy);
  border-radius: 14px;
  text-align: center;
}
.classification-root strong, .classification-root small { display: block; }
.classification-root small { margin-top: 4px; color: #dce9ee; }
.classification-branches, .tree-branches {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding-top: 18px;
}
.tree-branches { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.copyright-tree .tree-branches, .processing-tree { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.classification-branches::before, .tree-branches::before {
  content: "";
  position: absolute;
  top: 0;
  right: calc(12.5% - 7px);
  left: calc(12.5% - 7px);
  border-top: 1px solid var(--accent);
}
.tree-branches::before { right: calc(16.66% - 7px); left: calc(16.66% - 7px); }
.copyright-tree .tree-branches::before, .processing-tree::before { right: calc(25% - 7px); left: calc(25% - 7px); }
.classification-root::after, .tree-root::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -25px;
  height: 25px;
  border-left: 1px solid var(--accent);
}
.classification-branches article, .tree-branches > article {
  position: relative;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.classification-branches article::before, .tree-branches > article::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -19px;
  height: 19px;
  border-left: 1px solid var(--accent);
}
.classification-branches b, .classification-branches span { display: block; }
.classification-branches b, .tree-branches h3 { color: var(--accent); }
.classification-branches span { margin-top: 5px; color: var(--muted); font-size: 13px; }
.tree-branches h3 { margin: 0 0 7px; font-size: 17px; }
.tree-branches p { margin: 0; }
.tree-branches small { display: block; margin-top: 8px; color: var(--muted); line-height: 1.5; }
.nested-rights { display: grid; gap: 8px; margin-top: 12px; }
.nested-rights > span { padding: 11px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 9px 9px 0; }
.nested-rights b, .nested-rights small { display: block; }
.topic-focus .tree-branches > article {
  transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
}
.focus-industrial .industrial-branch,
.focus-copyright .copyright-branch {
  border-color: var(--green);
  background: var(--green-soft);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--green) 22%, transparent);
}
.focus-industrial .industrial-branch h3,
.focus-copyright .copyright-branch h3 { color: var(--green); }

.notation-example-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 24px 0;
}
.notation-example-grid > article {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfcfc;
}
.notation-example-grid h3 { margin-top: 0; font-size: 19px; }
.notation-example-grid p:last-child { margin-bottom: 0; }
.common-test-code { min-height: 0; white-space: pre-wrap; }
.common-notation-table code { white-space: nowrap; }
.sort-flow .step-item p { font-weight: 800; letter-spacing: .08em; }

.balance-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}
.balance-grid article { padding: 20px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.balance-grid article > span { color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.balance-grid article strong { display: block; margin-top: 5px; }
.balance-grid article p { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.balance-grid > b { color: var(--accent); font-size: 24px; }

.radix-grid, .encoding-grid, .image-type-grid, .structure-grid, .trace-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.radix-grid article, .encoding-grid article, .image-type-grid article, .structure-grid > article, .trace-grid section {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
}
.radix-grid span, .radix-grid strong, .radix-grid p { display: block; }
.radix-grid span { color: var(--accent); font-weight: 800; }
.radix-grid strong { margin-top: 5px; font-size: 23px; }
.radix-grid p { margin: 8px 0 0; color: var(--muted); font-family: "Cambria Math", "Times New Roman", serif; }
.state-count {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 18px;
  margin-top: 18px;
  padding: 15px;
  border-radius: 13px;
  background: var(--accent-soft);
}
.state-count strong { color: var(--accent); font-size: 22px; }
.state-count span:last-child { color: var(--muted); }

.conversion-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.conversion-grid section { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.conversion-grid h3, .encoding-grid h3, .image-type-grid h3, .trace-grid h3, .structure-grid h3 { margin: 0 0 14px; color: var(--accent); }
.division-trace { margin: 0; padding: 0; display: grid; gap: 6px; list-style: none; }
.division-trace li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; background: #f4f7f8; border-radius: 8px; font-family: "Cambria Math", "Times New Roman", serif; }
.division-trace b { color: var(--accent); }
.read-direction { margin: 10px 0 0; color: var(--accent); font-weight: 800; text-align: right; }
.place-values { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.place-values > span { padding: 12px 6px; border: 1px solid var(--line); border-radius: 10px; text-align: center; }
.place-values b, .place-values small { display: block; }
.place-values b { color: var(--accent); font-size: 25px; }
.place-values small { margin-top: 3px; color: var(--muted); }

.encoding-grid article { display: flex; flex-direction: column; }
.encoding-grid article > p { margin: auto 0 0; padding-top: 12px; color: var(--muted); font-size: 13px; }
.code-sequence, .code-pair { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.code-sequence code, .code-pair code { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #f4f7f8; font-size: 16px; }
.code-sequence span, .code-pair span { color: var(--muted); font-size: 11px; }
.code-pair b { font-size: 28px; }
.bit-band { display: flex; min-height: 68px; overflow: hidden; border: 1px solid var(--accent); border-radius: 10px; }
.bit-band > span { flex: var(--bit-share); min-width: 48px; display: grid; place-content: center; padding: 8px 4px; border-left: 1px solid color-mix(in srgb, var(--accent) 45%, white); background: var(--accent-soft); text-align: center; }
.bit-band > span:first-child { border-left: 0; }
.bit-band b, .bit-band small { display: block; }
.bit-band small { color: var(--muted); }

.logic-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.logic-grid article { padding: 15px 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; text-align: center; }
.logic-grid b, .logic-grid code, .logic-grid span { display: block; }
.logic-grid b { color: var(--accent); }
.logic-grid code { margin: 7px 0; font-size: 20px; }
.logic-grid span { color: var(--muted); font-size: 12px; }

.image-type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.image-type-grid p { margin-bottom: 0; color: var(--muted); font-size: 14px; }
.pixel-preview { width: 120px; height: 90px; margin: 0 auto 14px; display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--navy); }
.pixel-preview i { border: 1px solid #fff; background: var(--accent); opacity: calc(.35 + var(--pixel-opacity, .3)); }
.pixel-preview i:nth-child(2n) { background: var(--navy); }
.pixel-preview i:nth-child(3n) { opacity: .35; }
.vector-preview { position: relative; width: 120px; height: 90px; margin: 0 auto 14px; border: 1px solid var(--line); background: #fff; }
.vector-preview::before { content: ""; position: absolute; left: 20px; top: 17px; width: 76px; height: 52px; border: 4px solid var(--accent); border-radius: 50%; transform: rotate(-18deg); }
.vector-preview::after { content: ""; position: absolute; left: 17px; right: 17px; top: 43px; border-top: 3px solid var(--navy); transform: rotate(25deg); }

.computer-architecture { display: grid; grid-template-columns: minmax(120px, .65fr) 42px minmax(310px, 1.9fr) 42px minmax(120px, .65fr); grid-template-rows: auto 64px auto 68px auto; gap: 10px 12px; align-items: center; }
.architecture-node { padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: #fff; text-align: center; }
.architecture-node b, .architecture-node strong, .architecture-node span { display: block; }
.architecture-node b, .architecture-node strong { color: var(--accent); }
.architecture-node span { margin-top: 6px; color: var(--muted); font-size: 13px; }
.architecture-arrow { color: var(--accent); font-size: 25px; font-weight: 900; text-align: center; }
.input-node { grid-column: 1; grid-row: 3; }
.input-memory-arrow { grid-column: 2; grid-row: 3; }
.cpu-node { grid-column: 3; grid-row: 1; background: var(--accent-soft); border-color: var(--accent); }
.cpu-main-link { grid-column: 3; grid-row: 2; }
.main-memory-node { grid-column: 3; grid-row: 3; background: #fff; border: 2px solid var(--accent); }
.main-storage-link { grid-column: 3; grid-row: 4; }
.storage-node { grid-column: 3; grid-row: 5; background: #f7fafb; }
.memory-output-arrow { grid-column: 4; grid-row: 3; }
.output-node { grid-column: 5; grid-row: 3; }
.architecture-vertical-link { display: grid; grid-template-columns: 34px minmax(0, 210px); gap: 10px; align-items: center; justify-content: center; min-height: 54px; color: var(--accent); }
.architecture-vertical-link b { font-size: 31px; line-height: 1; }
.architecture-vertical-link span { color: var(--muted); font-size: 12px; line-height: 1.45; text-align: left; }

.process-list { margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; counter-reset: process-step; list-style: none; }
.public-data-process { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.process-list li { position: relative; min-width: 0; padding: 42px 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; counter-increment: process-step; }
.process-list li::before { content: counter(process-step, decimal-leading-zero); position: absolute; top: 10px; left: 12px; color: var(--accent); font-size: 12px; font-weight: 900; }
.process-list li:not(:last-child)::after { content: "→"; position: absolute; top: 50%; right: -11px; z-index: 1; width: 18px; color: var(--accent); background: #f9fbfb; font-weight: 900; text-align: center; transform: translateY(-50%); }
.process-list b, .process-list span { display: block; }
.process-list b { color: var(--ink); line-height: 1.45; }
.process-list span { margin-top: 7px; color: var(--muted); font-size: 12px; line-height: 1.55; }

.relational-example { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.25fr); gap: 16px; align-items: center; }
.relational-example section { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.relational-example h3 { margin: 0 0 10px; color: var(--accent); font-size: 15px; }
.relational-example p { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.relation-arrow { color: var(--accent); font-weight: 900; white-space: nowrap; }
.split-tables { display: grid; gap: 12px; }
.mini-data-table { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--line); border-radius: 9px; font-size: 11px; }
.mini-data-table.three-col { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mini-data-table.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mini-data-table > * { min-width: 0; padding: 7px 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.mini-data-table > span:nth-child(-n+4) { color: var(--navy); background: var(--accent-soft); font-weight: 800; }
.mini-data-table.three-col > span:nth-child(-n+3), .mini-data-table.two-col > span:nth-child(-n+2) { color: var(--navy); background: var(--accent-soft); font-weight: 800; }
.mini-data-table em { display: block; color: var(--accent); font-size: 9px; font-style: normal; }

.relational-workflow { display: grid; gap: 18px; }
.database-stage { position: relative; }
.database-stage > section { padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.database-stage h3 { margin: 0 0 15px; color: var(--navy); font-size: 18px; }
.database-stage p { margin: 13px 0 0; color: var(--muted); font-size: 13px; }
.database-stage-label { position: absolute; top: -10px; right: 18px; z-index: 1; padding: 5px 11px; color: #fff; background: var(--accent); border-radius: 999px; font-size: 11px; font-weight: 900; }
.database-table-cluster { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1fr) minmax(0, 1.1fr); gap: 12px; align-items: start; }
.database-table-cluster > div { min-width: 0; }
.database-table-cluster > div > b { display: block; margin-bottom: 7px; color: var(--accent); font-size: 13px; }
.database-join-arrow { display: grid; place-items: center; gap: 3px; color: var(--accent); text-align: center; }
.database-join-arrow b { font-size: 15px; }
.database-join-arrow span { font-size: 12px; }
.database-output .mini-data-table { width: min(720px, 100%); margin-inline: auto; }
.parity-table { text-align: center; }
.parity-table th { white-space: nowrap; }
.parity-table small { color: var(--muted); font-weight: 700; }
.parity-error-row th, .parity-footer th { background: var(--accent-soft); }
.parity-error-cell { color: #8d3f24; background: #fff0e7 !important; box-shadow: inset 0 0 0 3px #d37a47; font-weight: 900; }

.encryption-lanes { display: grid; gap: 16px; }
.encryption-lanes section { padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.encryption-lanes h3 { margin: 0 0 14px; color: var(--accent); }
.process-lane { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: center; }
.process-lane > span { padding: 12px; background: #f4f7f8; border-radius: 10px; }
.process-lane b, .process-lane small { display: block; }
.process-lane small { margin-top: 4px; color: var(--muted); }
.process-lane i { color: var(--accent); font-size: 20px; font-style: normal; font-weight: 900; }
.rsa-result { font-family: "Cambria Math", "Times New Roman", serif; }

.flowchart-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
.mini-flowchart { min-width: 0; padding: 17px 14px 20px; border: 1px solid var(--line); border-radius: 16px; background: #fff; text-align: center; }
.mini-flowchart h3 { margin: 0 0 16px; color: var(--navy); font-size: 18px; }
.flow-node { width: min(210px, 92%); min-height: 46px; display: grid; place-items: center; margin: 0 auto; padding: 9px 15px; color: var(--navy); background: #fff; font-size: 13px; font-weight: 800; }
.flow-terminal { border: 2px solid var(--accent); border-radius: 999px; }
.flow-process { border: 2px solid var(--accent); }
.flow-io { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); clip-path: polygon(10% 0, 100% 0, 90% 100%, 0 100%); }
.flow-arrow { display: block; margin: 3px 0; color: var(--accent); font-style: normal; font-weight: 900; line-height: 1.1; }
.flow-decision { position: relative; z-index: 0; width: 138px; height: 88px; display: grid; place-items: center; margin: 5px auto 10px; color: var(--navy); font-size: 13px; font-weight: 800; }
.flow-decision::before, .flow-decision::after { content: ""; position: absolute; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.flow-decision::before { z-index: -2; inset: 0; background: var(--accent); }
.flow-decision::after { z-index: -1; inset: 2px; background: #fff; }
.flow-split, .flow-loop-paths { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; align-items: start; width: 100%; }
.flow-split section, .flow-loop-paths section { min-width: 0; }
.flow-split section > b, .flow-loop-paths section > b { color: var(--accent); font-size: 12px; }
.flow-split .flow-node, .flow-loop-paths .flow-node { width: 100%; min-height: 48px; padding-inline: 10px; }
.flow-merge { margin: 8px 0 4px; color: var(--accent); font-size: 11px; font-weight: 800; }
.flow-loop-paths { grid-template-columns: minmax(0, 1.45fr) minmax(92px, .8fr); }
.flow-return { margin-top: 8px; padding: 7px; color: var(--accent); border: 1px dashed var(--accent); border-radius: 9px; font-size: 11px; font-weight: 800; }

.trace-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.trace-grid.single-trace { grid-template-columns: minmax(0, 1fr); }
.trace-grid section { overflow-x: auto; }
.trace-grid p { margin: 10px 0 0; color: var(--muted); font-size: 12px; }
.trace-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(52px, 1fr); min-width: max-content; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.trace-row > * { min-width: 52px; padding: 7px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); text-align: center; }
.trace-head { color: var(--navy); background: var(--accent-soft); font-weight: 800; }

.function-flow { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; align-items: center; }
.function-flow section { padding: 17px; border: 1px solid var(--line); border-radius: 13px; background: #fff; text-align: center; }
.function-flow span, .function-flow strong, .function-flow small { display: block; }
.function-flow span { color: var(--accent); font-size: 12px; font-weight: 800; }
.function-flow strong { margin-top: 5px; font-family: Consolas, monospace; font-size: 14px; }
.function-flow small { margin-top: 6px; color: var(--muted); }
.function-flow > i { color: var(--accent); font-size: 21px; font-style: normal; font-weight: 900; }

.logic-gate-grid,
.figure-pair {
  display: grid;
  gap: 16px;
  align-items: start;
  margin: 28px 0;
}
.logic-gate-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.figure-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.logic-trace-pair { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
.adder-pair { grid-template-columns: minmax(0, 1.45fr) minmax(280px, 1fr); }
.logic-gate-grid .raster-figure,
.figure-pair .raster-figure { margin: 0; }

.raster-figure {
  margin: 28px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(20, 48, 63, 0.06);
}
.figure-zoom-trigger {
  position: relative;
  width: 100%;
  display: block;
  padding: 0;
  overflow: hidden;
  color: inherit;
  background: #f7f9fb;
  border: 0;
  cursor: zoom-in;
}
.raster-figure picture { display: block; }
.raster-figure img, .raster-figure video { display: block; width: 100%; max-width: 100%; height: auto; background: #f7f9fb; }
.raster-figure video { aspect-ratio: var(--media-aspect, auto); }
.figure-zoom-trigger:focus-visible { outline: 4px solid color-mix(in srgb, var(--accent) 40%, white); outline-offset: -4px; }
.raster-figure figcaption { padding: 12px 16px 14px; color: var(--muted); border-top: 1px solid var(--line); font-size: 13px; }
.lecture-animation__expand {
  min-height: 36px;
  margin: 8px 0 0 12px;
  padding: 6px 12px;
  color: var(--accent);
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--line));
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.mobile-lecture-position { display: none; }
.lecture-back-to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 46;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--navy);
  border: 0;
  border-radius: 50%;
  box-shadow: 0 8px 24px rgba(17, 57, 75, .22);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity .18s ease, transform .18s ease;
}
.lecture-back-to-top.is-visible { opacity: 1; pointer-events: auto; transform: translateY(0); }

.figure-lightbox {
  width: min(1600px, calc(100vw - 24px));
  height: min(900px, calc(100dvh - 24px));
  max-width: none;
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  color: #fff;
  background: #10252d;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, .45);
}
.figure-lightbox::backdrop { background: rgba(4, 15, 20, .78); backdrop-filter: blur(4px); }
.figure-lightbox__inner { position: relative; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; max-height: calc(100dvh - 24px); }
.figure-lightbox__toolbar { min-height: 48px; display: flex; align-items: center; justify-content: flex-end; padding: 7px 10px; background: #10252d; }
.figure-lightbox__close { padding: 7px 12px; color: #fff; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.24); border-radius: 999px; cursor: pointer; font-size: 12px; font-weight: 800; }
.figure-lightbox__viewport { position: relative; min-height: 0; overflow: hidden; overscroll-behavior: contain; background: #fff; cursor: grab; touch-action: none; -webkit-user-select: none; user-select: none; }
.figure-lightbox__viewport:active { cursor: grabbing; }
.figure-lightbox__viewport.is-zoomed { cursor: grab; }
.figure-lightbox__canvas { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); transform-origin: center; }
.figure-lightbox__viewport img { display: block; width: 100%; height: 100%; max-width: none; margin: 0; object-fit: fill; background: #fff; opacity: 0; transition: opacity .16s ease; }
.figure-lightbox__viewport img.is-ready { opacity: 1; }
.figure-lightbox__caption { margin: 0; padding: 12px 16px 14px; color: #dce9ee; background: #10252d; font-size: 13px; }

.code-block {
  margin: 22px 0;
  padding: 20px 22px;
  overflow-x: auto;
  color: #e8f0f4;
  background: #122c3b;
  border-radius: 16px;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre;
}
.code-block .comment { color: #9fc4b4; }
.code-block .keyword { color: #f1b96f; }

.mini-quiz {
  margin-top: 26px;
  padding: 20px;
  border: 1px dashed var(--accent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--accent-soft) 55%, white);
}
.mini-quiz b { color: var(--accent); }

.site-footer { padding: 58px 0 24px; color: #fffef9; background: #102f35; font-family: "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif; line-height: 1.8; }
.footer-grid { width: min(1180px, calc(100% - 40px)); margin: 0 auto; display: flex; justify-content: space-between; gap: 40px; }
.footer-brand { margin: 0; color: #fffef9; }
.footer-brand small { color: rgb(255 255 255 / 60%); }
.footer-brand:hover { color: #fffef9; opacity: .88; }
.footer-copy { margin: 6px 0 0; color: rgb(255 255 255 / 60%); font-size: .78rem; }
.footer-grid nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px 26px; }
.footer-grid nav a { color: rgb(255 255 255 / 78%); font-size: .78rem; text-underline-offset: 5px; }
.copyright { width: min(1180px, calc(100% - 40px)); margin: 50px auto 0; padding-top: 17px; border-top: 1px solid rgb(255 255 255 / 13%); color: rgb(255 255 255 / 45%); }

.deep-dive {
  margin: 28px 0;
  overflow: clip;
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(23, 48, 66, 0.06);
}

.deep-dive summary {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 15px 54px 15px 18px;
  position: relative;
  color: var(--navy);
  font-weight: 800;
  line-height: 1.55;
  cursor: pointer;
  list-style: none;
}

.deep-dive summary::-webkit-details-marker { display: none; }
.deep-dive summary::after {
  content: "+";
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  border: 1px solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
  font-size: 20px;
  line-height: 1;
}

.deep-dive[open] summary {
  border-bottom: 1px solid var(--line);
  background: var(--accent-soft);
}

.deep-dive[open] summary::after { content: "−"; }
.deep-dive-label { color: var(--accent); }
.deep-dive-body { padding: 20px 20px 22px; }
.deep-dive-body > :first-child { margin-top: 0; }
.deep-dive-body > :last-child { margin-bottom: 0; }

.official-link {
  position: relative;
  margin: 20px 0 2px;
  padding: 16px 48px 16px 17px;
  display: grid;
  gap: 3px;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--line));
  border-radius: 13px;
  color: var(--ink);
  background: color-mix(in srgb, var(--accent-soft) 55%, white);
  text-decoration: none;
}
.official-link:hover { border-color: var(--accent); background: var(--accent-soft); }
.official-link:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 30%, white); outline-offset: 3px; }
.official-link-kicker { color: var(--accent); font-size: 10px; font-weight: 900; letter-spacing: 0.12em; }
.official-link strong { line-height: 1.45; }
.official-link small { color: var(--muted); font-size: 12px; line-height: 1.55; }
.official-link b {
  position: absolute;
  right: 17px;
  top: 50%;
  color: var(--accent);
  font-size: 18px;
  transform: translateY(-50%);
}

@media (max-width: 1080px) {
  .header-inner { min-height: 76px; }
  .global-nav { gap: 12px; }
  .global-nav a { font-size: 11px; }
  .page-main { width: min(100% - 28px, 1500px); }
  .page-layout { grid-template-columns: 1fr; }
  .section-sidebar { position: static; max-height: none; padding: 14px; overflow: visible; }
  .section-sidebar > p { margin-bottom: 8px; }
  .lecture-course-nav { display: flex; flex-wrap: wrap; gap: 6px; }
  .course-field-group.is-current { display: contents; }
  .course-field-link { flex: 0 0 auto; border: 1px solid var(--line); background: #fff; }
  .course-field-link[aria-current="page"] { color: #fff; background: var(--accent); border-color: var(--accent); box-shadow: none; }
  .section-nav { order: 10; flex: 1 0 100%; display: flex; min-width: 0; max-width: 100%; margin: 2px 0 0; padding: 0; overflow-x: auto; border-left: 0; }
  .section-nav a { min-width: 190px; border: 1px solid var(--line); background: #fff; }
  .cloze-toggle { width: auto; margin: 10px 0 0; padding: 9px 11px 0; }
  .process-list, .public-data-process { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .process-list li::after { display: none; }
  .computer-architecture { grid-template-columns: minmax(95px, .55fr) 34px minmax(250px, 1.8fr) 34px minmax(95px, .55fr); }
}

@media (max-width: 760px) {
  html { scroll-padding-top: 145px; }
  .header-inner { width: min(100% - 24px, 1180px); min-height: 0; padding: 12px 0; align-items: flex-start; flex-direction: column; gap: 8px; }
  .brand-mark { width: 36px; height: 36px; }
  .global-nav { width: 100%; padding-top: 7px; justify-content: flex-start; gap: 18px; overflow-x: auto; border-top: 1px solid var(--line); scrollbar-width: none; }
  .global-nav::-webkit-scrollbar { display: none; }
  .global-nav a { flex: 0 0 auto; }
  .page-main { width: min(100% - 18px, 1500px); }
  .course-hero { margin-top: 18px; padding: 28px 22px; border-radius: 22px; }
  .course-hero::after { right: -180px; top: -190px; }
  .lecture-section { padding: 24px 18px; border-radius: 18px; scroll-margin-top: 145px; }
  .section-heading { grid-template-columns: 44px 1fr; gap: 12px; }
  .section-number { width: 44px; height: 44px; border-radius: 13px; }
  .concept-grid, .compare-grid, .three-grid { grid-template-columns: 1fr; }
  .notation-example-grid { grid-template-columns: 1fr; }
  .step-flow { grid-template-columns: 1fr; gap: 30px; }
  .step-item { min-height: 0; }
  .step-item:not(:last-child)::after { content: "↓"; left: 50%; right: auto; top: auto; bottom: -30px; transform: translateX(-50%); }
  .layer-row { grid-template-columns: 42px 1fr; gap: 10px; }
  .protocol-example { grid-column: 2; padding: 9px 0 0; border-top: 1px solid var(--line); border-left: 0; }
  .protocol-endpoints { grid-template-columns: 1fr auto 1fr; gap: 8px; }
  .protocol-endpoints section { padding: 12px 8px; }
  .protocol-endpoints strong { font-size: 15px; }
  .protocol-endpoints > i { font-size: 21px; }
  .protocol-directions { align-items: stretch; flex-direction: column; gap: 4px; }
  .signature-prep { grid-template-columns: 1fr; }
  .signature-lanes { grid-template-columns: 1fr; }
  .signature-transfer { min-height: 54px; }
  .signature-transfer i { transform: rotate(90deg); }
  .html-figure { margin: 22px -4px; padding: 15px; border-radius: 15px; }
  .html-figure > figcaption { margin: 18px -15px -15px; padding: 11px 15px 13px; }
  .knowledge-ladder, .classification-branches, .tree-branches, .copyright-tree .tree-branches, .processing-tree,
  .radix-grid, .encoding-grid, .image-type-grid, .flowchart-grid, .trace-grid,
  .conversion-grid, .process-list, .public-data-process, .relational-example, .function-flow,
  .database-table-cluster {
    grid-template-columns: 1fr;
  }
  .knowledge-ladder { gap: 24px; }
  .knowledge-ladder > span:not(:last-child)::after { content: "↓"; top: auto; right: 50%; bottom: -23px; transform: translateX(50%); }
  .classification-branches, .tree-branches { padding-top: 0; }
  .classification-branches::before, .tree-branches::before, .classification-root::after, .tree-root::after,
  .classification-branches article::before, .tree-branches > article::before { display: none; }
  .balance-grid { grid-template-columns: 1fr; }
  .balance-grid > b { transform: rotate(90deg); text-align: center; }
  .logic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .state-count { align-items: stretch; flex-direction: column; text-align: center; }
  .computer-architecture { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto 38px auto 38px auto; gap: 8px 12px; }
  .computer-architecture .architecture-node { padding: 13px 10px; border-radius: 11px; }
  .computer-architecture .architecture-node b, .computer-architecture .architecture-node strong { font-size: 13px; line-height: 1.35; }
  .computer-architecture .architecture-node span { margin-top: 4px; font-size: 11px; line-height: 1.45; }
  .input-node { grid-column: 1; grid-row: 1; }
  .input-memory-arrow { display: block; grid-column: 1; grid-row: 2; transform: rotate(90deg); }
  .cpu-node { grid-column: 2; grid-row: 1; }
  .cpu-main-link { grid-column: 2; grid-row: 2; }
  .main-memory-node { grid-column: 1 / 3; grid-row: 3; }
  .memory-output-arrow { display: block; grid-column: 1; grid-row: 4; transform: rotate(90deg); }
  .main-storage-link { grid-column: 2; grid-row: 4; }
  .output-node { grid-column: 1; grid-row: 5; }
  .storage-node { grid-column: 2; grid-row: 5; }
  .architecture-vertical-link { display: flex; min-height: 38px; align-items: center; justify-content: center; }
  .architecture-vertical-link b { font-size: 24px; }
  .architecture-vertical-link span { display: none; }
  .process-list { gap: 9px; }
  .process-list li { padding: 15px 15px 15px 52px; }
  .process-list li::before { top: 15px; left: 15px; }
  .relation-arrow { transform: rotate(90deg); text-align: center; }
  .process-lane { grid-template-columns: 1fr; }
  .process-lane i { transform: rotate(90deg); text-align: center; }
  .function-flow > i { transform: rotate(90deg); text-align: center; }
  .logic-gate-grid, .figure-pair, .logic-trace-pair, .adder-pair { grid-template-columns: 1fr; }
  .raster-figure { width: 100%; margin: 22px 0; border-radius: 14px; }
  .logic-gate-grid, .figure-pair { gap: 14px; margin: 22px 0; }
  .logic-gate-grid .raster-figure, .figure-pair .raster-figure { margin: 0; }
  .raster-figure img { width: 100%; max-width: 100%; height: auto; }
  .figure-lightbox { width: calc(100vw - 12px); height: calc(100dvh - 12px); max-height: calc(100dvh - 12px); border-radius: 12px; }
  .figure-lightbox__inner { max-height: calc(100dvh - 12px); }
  .deep-dive { margin-inline: -4px; }
  .deep-dive summary { padding-left: 14px; font-size: 14px; }
  .deep-dive-body { padding: 16px 14px 18px; }
}

@media (max-width: 680px) {
  body { padding-bottom: calc(58px + env(safe-area-inset-bottom)); }
  .lecture-learning-guide { padding: 17px; }
  .lecture-learning-guide__choices, .lecture-keyword-index__groups { grid-template-columns: 1fr; }
  .lecture-learning-choice { min-height: 64px; }
  .lecture-keyword-index__groups { gap: 4px; }
  .lecture-keyword-index__groups a { min-height: 42px; }
  .keyword-reading-tools nav { display: grid; grid-template-columns: 1fr; }
  .keyword-reading-tools a, .keyword-reading-tools button { width: 100%; border-radius: 10px; text-align: left; }
  .mobile-lecture-position {
    position: fixed;
    right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    left: 8px;
    z-index: 49;
    display: block;
    color: #fff;
    background: rgb(17 57 75 / 96%);
    border: 1px solid rgb(255 255 255 / 18%);
    border-radius: 14px;
    box-shadow: 0 10px 34px rgb(5 24 32 / 28%);
    backdrop-filter: blur(12px);
  }
  .mobile-lecture-position__toggle {
    width: 100%;
    min-height: 48px;
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    color: inherit;
    background: transparent;
    border: 0;
    cursor: pointer;
    text-align: left;
  }
  .mobile-lecture-position__field, .mobile-lecture-position__count { color: #b9d3de; font-size: 10px; font-weight: 800; white-space: nowrap; }
  .mobile-lecture-position__title { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-lecture-position__panel {
    max-height: min(58dvh, 420px);
    padding: 6px;
    overflow-y: auto;
    border-top: 1px solid rgb(255 255 255 / 16%);
  }
  .mobile-lecture-position__panel[hidden] { display: none; }
  .mobile-lecture-position__panel a { display: grid; grid-template-columns: 56px 1fr; gap: 8px; padding: 10px 9px; color: rgb(255 255 255 / 84%); border-radius: 9px; text-decoration: none; font-size: 13px; }
  .mobile-lecture-position__panel a span { color: #b9d3de; font-size: 10px; font-weight: 800; }
  .mobile-lecture-position__panel a.is-active { color: #fff; background: rgb(255 255 255 / 12%); }
  .lecture-back-to-top { right: 14px; bottom: calc(72px + env(safe-area-inset-bottom)); }
  .footer-grid { align-items: flex-start; flex-direction: column; }
  .footer-grid nav { justify-content: flex-start; }
}

@media print {
  .site-header, .section-sidebar, .lecture-learning-guide, .keyword-reading-tools, .mobile-lecture-position, .lecture-back-to-top, .lecture-animation__expand, .site-footer { display: none !important; }
  .page-main { width: 100%; }
  .page-layout { display: block; }
  .lecture-section { break-inside: auto; box-shadow: none; }
  .lecture-animation { print-color-adjust: exact; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .site-header, .section-sidebar { transition: none; }
  .cloze-answer { transition: none; }
  .lecture-back-to-top { transition: none; }
  .lecture-learning-choice, .keyword-target { transition: none; }
}
