/* ==========================================================================
   Agent Atlas — 视觉系统
   纸张质感 + 墨绿强调色 + 衬线标题，深浅双主题。
   ========================================================================== */

:root {
  --bg: #f7f5ef;
  --bg-2: #f2efe6;
  --card: #fffdf8;
  --card-2: #faf7ee;
  --ink: #171915;
  --ink-2: #3c413a;
  --muted: #6c7168;
  --faint: #979c92;
  --line: #e3dfd3;
  --line-strong: #cec8b8;
  --accent: #0e6b5d;
  --accent-ink: #084f45;
  --accent-2: #b45309;
  --accent-soft: #e2f0ea;
  --accent-softer: #eef6f2;
  --code-bg: #111816;
  --code-head: #17211e;
  --code-ink: #e4eee8;
  --danger: #b42318;
  --warn: #b45309;
  --info: #175cd3;
  --shadow-sm: 0 1px 2px rgba(23, 25, 21, 0.05);
  --shadow: 0 1px 2px rgba(23, 25, 21, 0.04), 0 18px 40px -26px rgba(23, 25, 21, 0.35);
  --shadow-lg: 0 30px 80px -30px rgba(23, 25, 21, 0.4);
  --sans: "Inter", "SF Pro Text", system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", "Source Han Serif SC", "Noto Serif SC", "Songti SC", SimSun,
    serif;
  --mono: "JetBrains Mono", "SFMono-Regular", "Cascadia Code", Consolas, "Liberation Mono", monospace;
  --radius: 12px;
  --topbar: 64px;
  --sidebar: 286px;
  --max: 1180px;
}

[data-theme="dark"] {
  --bg: #0b100f;
  --bg-2: #0e1413;
  --card: #121a17;
  --card-2: #151e1a;
  --ink: #e9eee8;
  --ink-2: #c2cbc2;
  --muted: #929d93;
  --faint: #6c776e;
  --line: #233029;
  --line-strong: #34443b;
  --accent: #5fe3c8;
  --accent-ink: #8af0da;
  --accent-2: #f0b45f;
  --accent-soft: #12332c;
  --accent-softer: #0f211d;
  --code-bg: #080d0c;
  --code-head: #0f1614;
  --code-ink: #deeae3;
  --danger: #ff8a7a;
  --warn: #f3b968;
  --info: #8ab4f8;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 24px 50px -30px rgba(0, 0, 0, 0.9);
  --shadow-lg: 0 40px 90px -30px rgba(0, 0, 0, 0.9);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar) + 24px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

body.is-locked {
  overflow: hidden;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

svg {
  width: 1.15em;
  height: 1.15em;
  flex: none;
}

img {
  max-width: 100%;
  height: auto;
}

kbd {
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1;
  padding: 4px 5px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--card);
  color: var(--muted);
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 200;
  background: var(--ink);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: 8px;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 10px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

/* --------------------------------------------------------------- topbar */

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  height: var(--topbar);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: 1600px;
  height: 100%;
  margin: 0 auto;
  padding: 0 22px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  min-width: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--ink);
  color: var(--bg);
  flex: none;
}
.brand-mark svg {
  width: 22px;
  height: 22px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}
.brand-text strong {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.brand-text small {
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 22px;
}

.topnav-link {
  padding: 7px 12px;
  border-radius: 7px;
  font-size: 13.5px;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.topnav-link:hover {
  color: var(--ink);
  background: var(--card-2);
}
.topnav-link.is-active {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 10px 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--card);
  color: var(--muted);
  font-size: 13px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-trigger:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}
.search-trigger svg {
  width: 15px;
  height: 15px;
}
.search-trigger kbd {
  margin-left: 4px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.icon-btn:hover {
  background: var(--card-2);
  border-color: var(--line);
  color: var(--ink);
}
.icon-btn svg {
  width: 18px;
  height: 18px;
}

.theme-btn .ico-sun,
.theme-btn .ico-moon {
  display: grid;
  place-items: center;
  grid-area: 1 / 1;
}
[data-theme="light"] .theme-btn .ico-moon {
  display: none;
}
[data-theme="dark"] .theme-btn .ico-sun {
  display: none;
}

.menu-btn {
  display: none;
}

.read-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: transparent;
}
.read-progress i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.1s linear;
}

/* --------------------------------------------------------------- sidebar */

.sidebar {
  position: fixed;
  top: var(--topbar);
  bottom: 0;
  left: 0;
  z-index: 45;
  width: var(--sidebar);
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}

.sidebar-scroll {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 14px 28px;
  scrollbar-width: thin;
}

.side-progress {
  padding: 12px 12px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  margin-bottom: 18px;
}
.sp-row {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}
.sp-row strong {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
}
.sp-bar,
.pp-bar {
  height: 4px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
}
.sp-bar i,
.pp-bar i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.35s ease;
}

.side-group {
  margin-bottom: 2px;
}

.side-group-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  color: var(--ink);
  text-align: left;
}
.side-group-head:hover {
  background: var(--card-2);
}
.sg-num {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--accent);
  letter-spacing: 0.06em;
}
.sg-title {
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.03em;
}
.sg-count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--faint);
}
.sg-chev {
  display: grid;
  place-items: center;
  color: var(--faint);
  transition: transform 0.2s;
}
.sg-chev svg {
  width: 13px;
  height: 13px;
  transform: rotate(0deg);
  transition: transform 0.18s;
}
.side-group.is-open .sg-chev svg {
  transform: rotate(90deg);
}

.side-list {
  list-style: none;
  margin: 0 0 6px;
  padding: 0;
  display: none;
}
.side-group.is-open .side-list {
  display: block;
}

.side-link {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 8px 7px 10px;
  margin: 1px 0;
  border-radius: 7px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
  border-left: 2px solid transparent;
  transition: background 0.15s, color 0.15s;
  position: relative;
}
.side-link:hover {
  background: var(--card-2);
  color: var(--ink);
}
.side-link.is-active {
  background: var(--card);
  color: var(--ink);
  border-left-color: var(--accent);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.sl-num {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--faint);
  padding-top: 3px;
  flex: none;
}
.side-link.is-active .sl-num {
  color: var(--accent);
}
.sl-title {
  flex: 1;
}
.sl-check {
  display: none;
  color: var(--accent);
  padding-top: 2px;
}
.sl-check svg {
  width: 12px;
  height: 12px;
}
.side-link.is-read .sl-check {
  display: block;
}

.side-extra {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 2px;
}
.side-special {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 12.5px;
  color: var(--muted);
}
.side-special svg {
  width: 14px;
  height: 14px;
  color: var(--faint);
}
.side-special:hover,
.side-special.is-active {
  background: var(--card-2);
  color: var(--accent);
}
.side-special:hover svg,
.side-special.is-active svg {
  color: var(--accent);
}

.sidebar-scrim {
  position: fixed;
  inset: var(--topbar) 0 0 0;
  background: rgba(9, 14, 12, 0.45);
  backdrop-filter: blur(2px);
  z-index: 44;
}

/* --------------------------------------------------------------- layout */

.layout {
  margin-left: var(--sidebar);
  max-width: 1240px;
  padding: 44px 44px 96px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 56px;
  align-items: start;
}

.layout-special {
  max-width: 1120px;
  grid-template-columns: minmax(0, 1fr);
}

.main {
  min-width: 0;
}

/* ----------------------------------------------------------- article head */

.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--faint);
  margin-bottom: 26px;
  flex-wrap: wrap;
}
.crumbs a {
  color: var(--muted);
  border-bottom: 1px solid transparent;
}
.crumbs a:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.crumbs em {
  font-style: normal;
  font-family: var(--mono);
  color: var(--accent);
  font-size: 11px;
}

.article {
  max-width: 760px;
}

.article-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.kicker-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  border: 1px solid var(--line-strong);
  background: var(--card);
  padding: 3px 7px;
  border-radius: 5px;
}
.kicker-chapter {
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.article-head h1 {
  font-family: var(--serif);
  font-size: clamp(2.35rem, 4.2vw, 3.2rem);
  line-height: 1.18;
  letter-spacing: -0.025em;
  font-weight: 700;
  margin: 0 0 18px;
  color: var(--ink);
}

.article-desc {
  font-size: 17px;
  line-height: 1.75;
  color: var(--muted);
  margin: 0 0 24px;
  max-width: 660px;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--faint);
}
.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.meta-item svg {
  width: 13px;
  height: 13px;
}
.meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--line-strong);
}
.level {
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 99px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  letter-spacing: 0.03em;
}
.level-入门 {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  background: var(--accent-softer);
}
.level-高级 {
  color: var(--accent-2);
  border-color: color-mix(in srgb, var(--accent-2) 35%, transparent);
}

.article-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.tag {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--faint);
  letter-spacing: 0.02em;
}

/* ---------------------------------------------------------------- prose */

.prose {
  margin-top: 38px;
  font-size: 16.5px;
  line-height: 1.95;
  color: var(--ink-2);
}

.prose > *:first-child {
  margin-top: 0;
}

.prose p {
  margin: 1.15em 0;
}

.prose h2 {
  position: relative;
  font-family: var(--serif);
  font-size: 1.72rem;
  line-height: 1.35;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.015em;
  margin: 2.8em 0 0.9em;
  padding-top: 1.35em;
  border-top: 1px solid var(--line);
}
.prose h2::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 44px;
  height: 2px;
  background: var(--accent);
}
.prose h3 {
  font-size: 1.16rem;
  line-height: 1.5;
  font-weight: 700;
  color: var(--ink);
  margin: 2.1em 0 0.7em;
  letter-spacing: -0.005em;
}
.prose h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  margin: 1.8em 0 0.5em;
}

.prose .anchor {
  position: absolute;
  left: -1.1em;
  top: 0;
  color: var(--accent);
  opacity: 0;
  text-decoration: none;
  font-family: var(--sans);
  font-weight: 400;
  transition: opacity 0.15s;
}
.prose h2,
.prose h3 {
  scroll-margin-top: calc(var(--topbar) + 24px);
}
.prose h2:hover .anchor,
.prose h3:hover .anchor {
  opacity: 0.45;
}

.prose strong {
  color: var(--ink);
  font-weight: 700;
}

.prose em {
  color: var(--ink);
}

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  transition: text-decoration-color 0.15s;
}
.prose a:hover {
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
}
.prose a .ext {
  font-size: 0.75em;
  vertical-align: super;
  margin-left: 1px;
  opacity: 0.6;
  text-decoration: none;
  display: inline-block;
}

.prose ul,
.prose ol {
  margin: 1.1em 0;
  padding-left: 1.45em;
}
.prose li {
  margin: 0.42em 0;
  padding-left: 0.2em;
}
.prose ul > li::marker {
  color: var(--accent);
}
.prose ol > li::marker {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.85em;
}
.prose li > ul,
.prose li > ol {
  margin: 0.35em 0;
}
.prose li::marker {
  font-size: 0.9em;
}

.prose blockquote {
  margin: 1.6em 0;
  padding: 2px 20px;
  border-left: 3px solid var(--accent);
  background: var(--card);
  border-radius: 0 8px 8px 0;
  color: var(--muted);
}
.prose blockquote p {
  margin: 0.8em 0;
}

.prose hr {
  border: 0;
  height: 1px;
  background: var(--line);
  margin: 3em 0;
}

.prose code:not(pre code) {
  font-family: var(--mono);
  font-size: 0.84em;
  padding: 0.18em 0.42em;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  border: 1px solid color-mix(in srgb, var(--accent) 12%, transparent);
  white-space: nowrap;
}

.prose .table-wrap {
  margin: 1.8em 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.65;
  min-width: 520px;
}
.prose th {
  text-align: left;
  font-weight: 650;
  color: var(--ink);
  background: color-mix(in srgb, var(--accent) 7%, var(--card));
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.prose td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  color: var(--ink-2);
}
.prose tr:last-child td {
  border-bottom: 0;
}
.prose tbody tr:hover {
  background: color-mix(in srgb, var(--accent) 4%, transparent);
}

.prose img {
  display: block;
  margin: 1.8em auto;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.prose input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin: 0 7px 0 0;
  vertical-align: -2px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: var(--card);
  opacity: 1;
  position: relative;
  cursor: default;
}
.prose input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.prose input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 7px;
  border-right: 1.5px solid var(--bg);
  border-bottom: 1.5px solid var(--bg);
  transform: rotate(40deg);
}
.prose .task-list-item {
  list-style: none;
  margin-left: -1.2em;
}

/* code blocks */

.code-block {
  margin: 1.7em 0;
  border-radius: 11px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--code-bg) 80%, #fff 10%);
  background: var(--code-bg);
  box-shadow: var(--shadow-sm);
}
.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 13px;
  background: var(--code-head);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.code-lang {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7d9a8f;
}
.copy-btn {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: #9db3a9;
  font-size: 10.5px;
  padding: 3px 8px;
  border-radius: 5px;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.copy-btn:hover {
  color: #e8f2ec;
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.05);
}
.copy-btn.is-done {
  color: #6ee7b7;
  border-color: rgba(110, 231, 183, 0.4);
}
.code-block pre {
  margin: 0;
  padding: 16px 18px 18px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 12.8px;
  line-height: 1.75;
  color: var(--code-ink);
  tab-size: 2;
}
.code-block code {
  font-family: inherit;
  white-space: pre;
  background: none;
  padding: 0;
  border: 0;
}

/* syntax */

.hljs-comment,
.hljs-quote {
  color: #6d8579;
  font-style: italic;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-literal,
.hljs-section,
.hljs-doctag,
.hljs-name {
  color: #7dd3b0;
}
.hljs-string,
.hljs-regexp,
.hljs-addition,
.hljs-attribute,
.hljs-meta .hljs-string {
  color: #e8c07d;
}
.hljs-number,
.hljs-symbol,
.hljs-bullet,
.hljs-variable,
.hljs-template-variable {
  color: #f0a68a;
}
.hljs-title,
.hljs-title.function_,
.hljs-function .hljs-title,
.hljs-built_in,
.hljs-class .hljs-title {
  color: #8ec5ff;
}
.hljs-attr,
.hljs-selector-attr,
.hljs-selector-class,
.hljs-selector-id,
.hljs-property {
  color: #c4b5fd;
}
.hljs-type,
.hljs-params,
.hljs-meta {
  color: #9fd6c8;
}
.hljs-tag {
  color: #9db3a9;
}
.hljs-deletion {
  color: #ff9b8c;
}
.hljs-emphasis {
  font-style: italic;
}
.hljs-strong {
  font-weight: 700;
}

/* callouts */

.callout {
  margin: 1.8em 0;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: var(--card);
  padding: 14px 18px 4px;
}
.callout-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin-bottom: 2px;
}
.callout-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.callout-body {
  font-size: 15px;
  line-height: 1.85;
  color: var(--ink-2);
}
.callout-body > p:first-child {
  margin-top: 0.5em;
}
.callout-body > p:last-child {
  margin-bottom: 0.9em;
}
.callout-tip {
  border-left-color: var(--accent);
  background: var(--accent-softer);
}
.callout-warn {
  border-left-color: var(--warn);
  background: color-mix(in srgb, var(--warn) 7%, var(--card));
}
.callout-warn .callout-head {
  color: var(--warn);
}
.callout-danger {
  border-left-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 6%, var(--card));
}
.callout-danger .callout-head {
  color: var(--danger);
}
.callout-info {
  border-left-color: var(--info);
  background: color-mix(in srgb, var(--info) 6%, var(--card));
}
.callout-info .callout-head {
  color: var(--info);
}
.callout-note {
  border-left-color: var(--faint);
}
.callout-note .callout-head {
  color: var(--muted);
}
.callout-quote {
  border-left-color: var(--accent-2);
  background: color-mix(in srgb, var(--accent-2) 6%, var(--card));
}
.callout-quote .callout-head {
  color: var(--accent-2);
}

/* diagrams (hand-written HTML in markdown) */

.diagram {
  margin: 2em 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  overflow-x: auto;
}
.diagram-cap {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 16px;
}
.flow-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  min-width: 520px;
}
.flow-node {
  flex: 1;
  min-width: 96px;
  padding: 12px 12px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--card-2);
}
.flow-node b {
  display: block;
  font-size: 13px;
  color: var(--ink);
  margin-bottom: 3px;
}
.flow-node span {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
  display: block;
}
.flow-node.accent {
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  background: var(--accent-softer);
}
.flow-arrow {
  display: flex;
  align-items: center;
  color: var(--faint);
  font-size: 15px;
  flex: none;
}
.flow-note {
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--muted);
}
.loop-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  min-width: 520px;
}
.loop-step {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card-2);
  position: relative;
}
.loop-step .ls-n {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--accent);
  display: block;
  margin-bottom: 6px;
}
.loop-step b {
  display: block;
  font-size: 13.5px;
  margin-bottom: 3px;
}
.loop-step span {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.55;
}
.topo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  min-width: 520px;
}
.topo {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card-2);
}
.topo h4 {
  margin: 0 0 4px;
  font-size: 13px;
  color: var(--ink);
}
.topo p {
  margin: 0;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.6;
}
.topo svg {
  width: 100%;
  height: 54px;
  margin-top: 9px;
  color: var(--accent);
}
.steps {
  counter-reset: step;
  margin: 1.6em 0;
  display: grid;
  gap: 8px;
}
.steps > div {
  position: relative;
  padding: 12px 14px 12px 46px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card);
  font-size: 14.5px;
  line-height: 1.7;
}
.steps > div::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 14px;
  top: 12px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
}
.steps b {
  color: var(--ink);
}

/* ---------------------------------------------------------- article end */

.article-end {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 42px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}
.read-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  background: var(--card);
  color: var(--muted);
  font-size: 13px;
  transition: all 0.15s;
}
.read-toggle svg {
  width: 14px;
  height: 14px;
}
.read-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.read-toggle.is-read {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}
.end-note {
  font-size: 12px;
  color: var(--faint);
}

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 34px;
}
.pager-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.pager-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.pager-card.next {
  text-align: right;
  align-items: flex-end;
}
.pager-dir {
  font-size: 11px;
  color: var(--faint);
  letter-spacing: 0.05em;
}
.pager-card strong {
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink);
}
.pager-card small {
  font-size: 11px;
  color: var(--faint);
}

.related {
  margin-top: 52px;
}
.related > h2 {
  font-family: var(--serif);
  font-size: 1.35rem;
  margin: 0 0 16px;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.related-card {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.15s, transform 0.15s;
}
.related-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.rc-num {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--accent);
}
.related-card strong {
  font-size: 13.5px;
  line-height: 1.5;
}
.related-card p {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rc-more {
  margin-top: auto;
  padding-top: 6px;
  font-size: 11px;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 4px;
}
.rc-more svg {
  width: 12px;
  height: 12px;
}

.article-foot {
  margin-top: 44px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 11.5px;
  color: var(--faint);
  flex-wrap: wrap;
}
.article-foot a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.article-foot a:hover {
  color: var(--accent);
}

/* ------------------------------------------------------------------ toc */

.toc {
  position: sticky;
  top: calc(var(--topbar) + 36px);
  max-height: calc(100vh - var(--topbar) - 60px);
  overflow-y: auto;
}
.toc-inner {
  border-left: 1px solid var(--line);
  padding-left: 16px;
}
.toc-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 10px;
}
.toc nav {
  display: flex;
  flex-direction: column;
}
.toc-link {
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  padding: 4px 0;
  border-left: 2px solid transparent;
  margin-left: -18px;
  padding-left: 16px;
  transition: color 0.15s, border-color 0.15s;
}
.toc-link:hover {
  color: var(--ink);
}
.toc-link.is-sub {
  padding-left: 27px;
  font-size: 11.5px;
  color: var(--faint);
}
.toc-link.is-active {
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
}
.toc-top {
  display: inline-block;
  margin-top: 18px;
  font-size: 11px;
  color: var(--faint);
}
.toc-top:hover {
  color: var(--accent);
}

/* ------------------------------------------------------------------ home */

.hero {
  position: relative;
  padding: calc(var(--topbar) + 64px) 24px 76px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.hero-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: 0.42;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 20%, transparent 75%);
}
.hero-glow {
  position: absolute;
  width: 620px;
  height: 620px;
  right: -160px;
  top: -220px;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 18%, transparent), transparent 65%);
  filter: blur(20px);
  opacity: 0.8;
}

.hero-inner {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.04fr 0.96fr;
  gap: 64px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  background: var(--card);
  padding: 6px 10px;
  border-radius: 99px;
}
.pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent);
  }
  70% {
    box-shadow: 0 0 0 7px transparent;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(3.1rem, 6vw, 5rem);
  line-height: 1.04;
  letter-spacing: -0.04em;
  font-weight: 700;
  margin: 22px 0 24px;
}
.hero h1 em {
  font-style: italic;
  color: var(--accent);
  position: relative;
  white-space: nowrap;
}
.hero h1 em::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.06em;
  height: 0.09em;
  background: var(--accent);
  opacity: 0.28;
  transform: rotate(-0.8deg);
}

.hero-lead {
  font-size: 16.5px;
  line-height: 1.9;
  color: var(--muted);
  max-width: 520px;
  margin: 0 0 30px;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: stretch;
}

.hero-search {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  height: 44px;
  min-width: 280px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--card);
  color: var(--muted);
  font-size: 13px;
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.hero-search:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}
.hero-search svg {
  width: 16px;
  height: 16px;
}
.hero-search kbd {
  margin-left: auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 44px;
  padding: 0 18px;
  border-radius: 9px;
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 600;
  transition: transform 0.15s, background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.btn svg {
  width: 15px;
  height: 15px;
}
.btn-primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
  transform: translateY(-1px);
}
.btn-ghost {
  background: var(--card);
  border-color: var(--line-strong);
  color: var(--ink);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.btn-sm {
  height: 32px;
  padding: 0 11px;
  font-size: 12px;
  border-radius: 7px;
}

.hero-stats {
  display: flex;
  gap: 26px;
  margin-top: 38px;
  flex-wrap: wrap;
}
.hero-stats > div {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding-right: 26px;
  border-right: 1px solid var(--line);
}
.hero-stats > div:last-child {
  border-right: 0;
  padding-right: 0;
}
.hero-stats strong {
  font-family: var(--serif);
  font-size: 1.5rem;
  line-height: 1.2;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.hero-stats span {
  font-size: 10.5px;
  color: var(--faint);
  letter-spacing: 0.04em;
}

.hero-visual {
  position: relative;
  padding: 10px 6px;
}

.trace-card {
  border-radius: 14px;
  overflow: hidden;
  background: #0c1311;
  border: 1px solid #22322c;
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.03);
  transform: rotate(0.6deg);
}
.trace-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: #101917;
  border-bottom: 1px solid #1d2b26;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: block;
}
.dot.r {
  background: #ff5f57;
}
.dot.y {
  background: #febc2e;
}
.dot.g {
  background: #28c840;
}
.trace-title {
  margin-left: 8px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: #6f8a7f;
  letter-spacing: 0.05em;
}
.trace-live {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: #5fe3c8;
  border: 1px solid rgba(95, 227, 200, 0.3);
  background: rgba(95, 227, 200, 0.08);
  border-radius: 4px;
  padding: 2px 5px;
}
.trace-body {
  padding: 16px 16px 14px;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.65;
  color: #c6d4cc;
}
.trace-row {
  display: flex;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px dashed #1e2c27;
  margin-bottom: 13px;
}
.tr-k {
  color: #5fe3c8;
  flex: none;
}
.tr-v {
  color: #dbe6df;
}
.trace-step {
  display: flex;
  gap: 11px;
  position: relative;
  padding-bottom: 12px;
}
.trace-step:not(:last-of-type)::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 20px;
  bottom: 0;
  width: 1px;
  background: #22332c;
}
.ts-i {
  flex: none;
  width: 17px;
  height: 17px;
  border-radius: 4px;
  background: #16231f;
  border: 1px solid #263a32;
  display: grid;
  place-items: center;
  font-size: 8.5px;
  color: #7d968b;
  margin-top: 2px;
}
.trace-step > div {
  min-width: 0;
}
.ts-k {
  font-size: 9px;
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 1px;
}
.ts-k.thought {
  color: #8ec5ff;
}
.ts-k.action {
  color: #e8c07d;
}
.ts-k.obs {
  color: #7dd3b0;
}
.trace-step p {
  margin: 0;
  color: #b9c8c0;
  font-size: 11px;
}
.trace-step code {
  color: #c4b5fd;
  background: none;
  padding: 0;
  font-size: 10.5px;
}
.trace-foot {
  padding-top: 10px;
  border-top: 1px solid #1d2b26;
  color: #8aa196;
  font-size: 10px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.trace-ok {
  color: #5fe3c8;
}
.caret {
  width: 6px;
  height: 11px;
  background: #5fe3c8;
  display: inline-block;
  margin-left: 2px;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}

.float-chip {
  position: absolute;
  font-family: var(--mono);
  font-size: 10px;
  padding: 6px 10px;
  border-radius: 7px;
  background: var(--card);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  color: var(--muted);
  white-space: nowrap;
}
.chip-a {
  top: 58px;
  right: -18px;
  transform: rotate(2deg);
}
.chip-b {
  bottom: 34px;
  left: -118px;
  transform: rotate(-2deg);
}

/* sections */

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 84px 24px;
}
.section + .section {
  padding-top: 10px;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 40px;
  margin-bottom: 34px;
}
.section-eyebrow {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin: 0 0 12px;
}
.section-head h2,
.method-copy h2,
.cta-copy h2 {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3.2vw, 2.45rem);
  line-height: 1.25;
  letter-spacing: -0.03em;
  margin: 0;
  font-weight: 700;
}
.section-sub {
  max-width: 360px;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--muted);
  margin: 0 0 4px;
}

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.chapter-card {
  display: flex;
  flex-direction: column;
  padding: 20px 18px 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card);
  min-height: 248px;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  position: relative;
  scroll-margin-top: calc(var(--topbar) + 20px);
}
.chapter-card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 18px;
  width: 28px;
  height: 2px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.15s;
}
.chapter-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.chapter-card:hover::before {
  opacity: 1;
}
.cc-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 18px;
}
.cc-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.06em;
}
.cc-en {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--faint);
  text-transform: uppercase;
}
.chapter-card h3 {
  font-family: var(--serif);
  font-size: 1.35rem;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}
.chapter-card > p {
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
  margin: 0 0 14px;
}
.cc-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.cc-list span {
  font-size: 11px;
  color: var(--faint);
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.5;
}
.cc-list span::before {
  content: "·";
  color: var(--accent);
}
.cc-list .more {
  color: var(--accent);
}
.cc-list .more::before {
  display: none;
}
.cc-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  font-size: 10.5px;
  color: var(--faint);
}
.cc-go {
  color: var(--accent);
  display: grid;
  place-items: center;
  transition: transform 0.15s;
}
.cc-go svg {
  width: 14px;
  height: 14px;
}
.chapter-card:hover .cc-go {
  transform: translateX(3px);
}

.feature-list {
  border-top: 1px solid var(--line-strong);
}
.feature-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 160px 30px;
  gap: 18px;
  align-items: center;
  padding: 20px 10px;
  border-bottom: 1px solid var(--line);
  transition: background 0.15s, padding 0.15s;
}
.feature-row:hover {
  background: var(--card);
  padding-left: 18px;
  padding-right: 18px;
}
.fr-index {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
}
.feature-row h3 {
  font-family: var(--serif);
  font-size: 1.22rem;
  margin: 0 0 3px;
  letter-spacing: -0.015em;
}
.feature-row p {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.65;
}
.fr-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: right;
  font-size: 10.5px;
  color: var(--faint);
}
.fr-arrow {
  color: var(--faint);
  display: grid;
  place-items: center;
  transition: transform 0.15s, color 0.15s;
}
.fr-arrow svg {
  width: 16px;
  height: 16px;
}
.feature-row:hover .fr-arrow {
  color: var(--accent);
  transform: translateX(3px);
}

.section-method {
  padding-top: 40px;
}
.method-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 60px;
  padding: 46px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-2);
  align-items: center;
}
.method-copy p:not(.section-eyebrow) {
  font-size: 14px;
  line-height: 1.85;
  color: var(--muted);
  margin: 16px 0 22px;
}
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
}
.text-link svg {
  width: 14px;
  height: 14px;
  transition: transform 0.15s;
}
.text-link:hover svg {
  transform: translateX(3px);
}
.method-steps {
  display: grid;
  gap: 10px;
}
.method-step {
  display: flex;
  gap: 14px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 9px;
}
.method-step > span {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--accent);
  padding-top: 2px;
}
.method-step h3 {
  font-size: 13.5px;
  margin: 0 0 3px;
}
.method-step p {
  margin: 0;
  font-size: 12px;
  line-height: 1.65;
  color: var(--muted);
}

.section-cta {
  padding-bottom: 96px;
}
.cta-box {
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 40px;
  padding: 44px 48px;
  border-radius: 18px;
  background: #101a17;
  color: #e9f0eb;
  border: 1px solid #22332c;
}
.cta-box::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(to right, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 80% 20%, #000, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 80% 20%, #000, transparent 70%);
}
.cta-copy {
  position: relative;
}
.cta-copy .section-eyebrow {
  color: #5fe3c8;
}
.cta-copy h2 {
  color: #f0f5f1;
}
.cta-copy p:not(.section-eyebrow) {
  color: #9fb3a8;
  font-size: 13.5px;
  max-width: 440px;
  margin: 10px 0 0;
}
.cta-actions {
  position: relative;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.cta-box .btn-primary {
  background: #5fe3c8;
  border-color: #5fe3c8;
  color: #0a1411;
}
.cta-box .btn-primary:hover {
  background: #8af0da;
  border-color: #8af0da;
}
.cta-box .btn-ghost {
  background: transparent;
  border-color: #33483f;
  color: #dbe7e0;
}
.cta-box .btn-ghost:hover {
  border-color: #5fe3c8;
  color: #5fe3c8;
}

/* ------------------------------------------------------------- specials */

.page-head {
  margin-bottom: 34px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--line);
}
.page-head h1 {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 4.5vw, 3.3rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
}
.page-lead {
  font-size: 16px;
  line-height: 1.85;
  color: var(--muted);
  max-width: 720px;
  margin: 0;
}
.page-head .section-eyebrow {
  margin-bottom: 10px;
}
.glossary-stats {
  display: flex;
  gap: 20px;
  margin-top: 22px;
  font-size: 11.5px;
  color: var(--faint);
}
.glossary-stats strong {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 13px;
}
.page-foot-note {
  margin-top: 40px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.7;
  color: var(--faint);
}
.page-foot-note a {
  color: var(--accent);
}

.glossary-tools {
  position: sticky;
  top: var(--topbar);
  z-index: 20;
  background: var(--bg);
  padding: 14px 0 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid transparent;
}
.glossary-search {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  border-radius: 9px;
  margin-bottom: 12px;
}
.glossary-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}
.glossary-search svg {
  color: var(--faint);
  width: 16px;
  height: 16px;
}
.glossary-search input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: 0;
  font-size: 14px;
}
.glossary-search input::placeholder {
  color: var(--faint);
}
.gs-count {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--faint);
}
.filter-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.chip {
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  transition: all 0.15s;
}
.chip:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}
.chip.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.glossary-group {
  margin-bottom: 30px;
}
.gg-head {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin: 26px 0 12px;
}
.gg-head h2 {
  font-family: var(--serif);
  font-size: 1.28rem;
  margin: 0;
}
.gg-head span {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--faint);
}
.glossary-list {
  display: grid;
  grid-template-columns: 1fr;
}
.term {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  margin-bottom: 8px;
  scroll-margin-top: 140px;
}
.term-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 5px;
  flex-wrap: wrap;
}
.term h3 {
  font-size: 14.5px;
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.term-en {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--faint);
  font-weight: 400;
  letter-spacing: 0.02em;
}
.term-level {
  margin-left: auto;
  font-size: 9.5px;
  color: var(--faint);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 1px 6px;
}
.term p {
  margin: 0;
  font-size: 13px;
  line-height: 1.75;
  color: var(--ink-2);
}
.term-alias {
  margin-top: 5px !important;
  font-size: 11px !important;
  color: var(--faint) !important;
}
.term-link {
  display: inline-block;
  margin-top: 7px;
  font-size: 11px;
  color: var(--accent);
}
.term-link:hover {
  text-decoration: underline;
}
.glossary-empty {
  padding: 50px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* path */

.path-progress-box {
  margin-top: 24px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  max-width: 520px;
}
.pp-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 9px;
}
.pp-row strong {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--accent);
}
.path-progress-box p {
  margin: 10px 0 0;
  font-size: 11px;
  color: var(--faint);
}
.path-list {
  display: grid;
  gap: 6px;
}
.path-phase {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 16px;
}
.phase-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 6px;
}
.phase-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: var(--bg);
  flex: none;
}
.phase-line {
  width: 1px;
  flex: 1;
  background: var(--line);
  margin-top: 6px;
}
.path-phase:last-child .phase-line {
  display: none;
}
.phase-body {
  padding: 0 0 34px;
}
.phase-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.phase-weeks {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  background: var(--accent-softer);
  padding: 3px 8px;
  border-radius: 5px;
  white-space: nowrap;
}
.phase-head h2 {
  font-family: var(--serif);
  font-size: 1.45rem;
  margin: 0;
  letter-spacing: -0.02em;
}
.phase-goal {
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--muted);
  margin: 8px 0 14px;
}
.task-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 2px;
}
.task {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.task:hover {
  background: var(--card);
}
.task input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.task-box {
  width: 16px;
  height: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--card);
  flex: none;
  margin-top: 2px;
  display: grid;
  place-items: center;
  transition: all 0.15s;
}
.task-box::after {
  content: "";
  width: 8px;
  height: 4px;
  border-left: 1.6px solid var(--bg);
  border-bottom: 1.6px solid var(--bg);
  transform: rotate(-45deg) scale(0);
  transition: transform 0.15s;
  margin-top: -2px;
}
.task input:checked + .task-box {
  background: var(--accent);
  border-color: var(--accent);
}
.task input:checked + .task-box::after {
  transform: rotate(-45deg) scale(1);
}
.task input:focus-visible + .task-box {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.task-text {
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-2);
}
.task-text a {
  color: var(--accent);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.task input:checked ~ .task-text {
  color: var(--faint);
  text-decoration: line-through;
  text-decoration-color: var(--line-strong);
}
.task-tag {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--faint);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
  white-space: nowrap;
  flex: none;
}
.phase-project {
  display: flex;
  gap: 12px;
  margin-top: 14px;
  padding: 13px 15px;
  background: var(--accent-softer);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
  border-radius: 9px;
}
.pp-label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  color: var(--accent);
  white-space: nowrap;
  padding-top: 2px;
}
.phase-project strong {
  display: block;
  font-size: 13px;
  margin-bottom: 2px;
}
.phase-project p {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--muted);
}

/* quiz */

.quiz-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 24px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  flex-wrap: wrap;
}
.quiz-score {
  display: flex;
  align-items: baseline;
  gap: 5px;
}
.quiz-score span {
  font-size: 11px;
  color: var(--faint);
  letter-spacing: 0.05em;
}
.quiz-score strong {
  font-family: var(--serif);
  font-size: 1.7rem;
  color: var(--accent);
  line-height: 1;
}
.quiz-score small {
  font-size: 11px;
  color: var(--faint);
}
.quiz-hud-right {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 11.5px;
  color: var(--muted);
}
.quiz-list {
  display: grid;
  gap: 14px;
}
.quiz-item {
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card);
}
.quiz-q {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}
.q-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  padding-top: 4px;
  flex: none;
}
.quiz-q h2 {
  font-size: 15.5px;
  line-height: 1.65;
  margin: 0;
  font-weight: 650;
  font-family: var(--sans);
}
.quiz-q code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--accent-soft);
  padding: 1px 4px;
  border-radius: 4px;
}
.q-multi {
  font-size: 9.5px;
  color: var(--accent-2);
  border: 1px solid color-mix(in srgb, var(--accent-2) 30%, transparent);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 5px;
}
.quiz-options {
  display: grid;
  gap: 7px;
}
.quiz-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink-2);
  transition: border-color 0.15s, background 0.15s;
}
.quiz-option:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-softer);
}
.qo-key {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--faint);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  flex: none;
  margin-top: 1px;
}
.qo-text {
  flex: 1;
}
.qo-mark {
  flex: none;
  font-family: var(--mono);
  font-size: 12px;
}
.quiz-option.is-correct {
  border-color: var(--accent);
  background: var(--accent-softer);
}
.quiz-option.is-correct .qo-key {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}
.quiz-option.is-wrong {
  border-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 7%, var(--bg));
}
.quiz-option.is-wrong .qo-key {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--bg);
}
.quiz-option.is-dim {
  opacity: 0.62;
}
.quiz-option:disabled {
  cursor: default;
}
.quiz-explain {
  margin-top: 12px;
  padding: 12px 14px;
  border-left: 2px solid var(--accent);
  background: var(--bg-2);
  border-radius: 0 7px 7px 0;
}
.qe-head {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 3px;
}
.quiz-explain p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--ink-2);
}
.quiz-explain a {
  display: inline-block;
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--accent);
}
.quiz-item.is-answered {
  border-color: var(--line-strong);
}

/* error */

.error-main {
  min-height: calc(100vh - var(--topbar));
  display: grid;
  place-items: center;
  padding: 80px 24px;
}
.error-box {
  text-align: center;
  max-width: 460px;
}
.error-code {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--accent);
}
.error-box h1 {
  font-family: var(--serif);
  font-size: 2.6rem;
  margin: 8px 0 12px;
  letter-spacing: -0.03em;
}
.error-box p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
  margin: 0 0 24px;
}
.error-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------- search */

.search-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 9vh 18px 18px;
}
.search-modal[hidden] {
  display: none;
}
.search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 11, 9, 0.55);
  backdrop-filter: blur(5px);
}
.search-panel {
  position: relative;
  width: 100%;
  max-width: 680px;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: searchIn 0.18s ease-out;
}
@keyframes searchIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.99);
  }
}
.search-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  height: 56px;
  border-bottom: 1px solid var(--line);
}
.search-input-row > svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
}
.search-input-row input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 15px;
}
.search-input-row input::placeholder {
  color: var(--faint);
}
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}
.search-panel mark {
  background: color-mix(in srgb, var(--accent) 24%, transparent);
  color: var(--ink);
  border-radius: 2px;
  padding: 0 1px;
}
.esc-key {
  flex: none;
}
.search-close-btn {
  display: none;
  flex: none;
}
.search-body {
  max-height: min(56vh, 480px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.search-hints {
  padding: 18px 18px 10px;
}
.hint-label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 9px;
}
.hint-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.hint-chips button {
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--bg);
  color: var(--muted);
  font-size: 11.5px;
}
.hint-chips button:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.hint-pages {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.hint-pages a {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted);
  padding: 5px 9px;
  border-radius: 6px;
  background: var(--bg-2);
}
.hint-pages a:hover {
  color: var(--accent);
}
.hint-pages svg {
  width: 13px;
  height: 13px;
}
.search-results {
  padding: 6px 8px 10px;
}
.sr-group-label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  color: var(--faint);
  padding: 8px 10px 4px;
}
.sr-item {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.sr-item:hover,
.sr-item.is-active {
  background: var(--accent-softer);
}
.sr-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 2px;
}
.sr-title {
  font-size: 13.5px;
  font-weight: 650;
  color: var(--ink);
}
.sr-crumb {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--faint);
  margin-left: auto;
  white-space: nowrap;
}
.sr-snip {
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sr-snip mark {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  color: var(--ink);
  border-radius: 2px;
  padding: 0 1px;
}
.sr-empty {
  padding: 26px 18px;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
}
.search-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.search-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 16px;
  border-top: 1px solid var(--line);
  background: var(--bg-2);
  font-size: 10.5px;
  color: var(--faint);
  flex-wrap: wrap;
}
.search-foot span {
  display: flex;
  align-items: center;
  gap: 4px;
}
.search-foot .sf-count {
  margin-left: auto;
}

.back-top {
  position: fixed;
  right: 20px;
  bottom: 22px;
  z-index: 50;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--card);
  color: var(--muted);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.18s, visibility 0.18s, transform 0.18s, color 0.15s, border-color 0.15s;
  font-size: 16px;
}
.back-top:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.back-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* --------------------------------------------------------------- footer */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-2);
  padding: 48px 24px 26px;
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 60px;
  flex-wrap: wrap;
}
.footer-brand {
  display: flex;
  gap: 12px;
  max-width: 320px;
}
.footer-brand .brand-mark {
  width: 32px;
  height: 32px;
}
.footer-brand strong {
  display: block;
  font-size: 14px;
  margin-bottom: 2px;
}
.footer-brand p {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--faint);
}
.footer-cols {
  display: flex;
  gap: 60px;
  flex-wrap: wrap;
}
.footer-cols > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.footer-cols h4 {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 4px;
  font-weight: 500;
}
.footer-cols a {
  font-size: 12px;
  color: var(--muted);
}
.footer-cols a:hover {
  color: var(--accent);
}
.footer-bottom {
  max-width: var(--max);
  margin: 34px auto 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 10.5px;
  color: var(--faint);
}

/* ----------------------------------------------------------- responsive */

@media (max-width: 1360px) {
  .chapter-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 1280px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
    max-width: 900px;
    padding: 40px 40px 90px;
  }
  .toc {
    display: none;
  }
  .article {
    max-width: 780px;
  }
  .hero-inner {
    gap: 44px;
  }
  .hero h1 {
    font-size: clamp(2.9rem, 5.5vw, 4.2rem);
  }
}

@media (max-width: 1080px) {
  .topnav {
    display: none;
  }
  .sidebar {
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.24s ease, visibility 0.24s;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.is-open {
    transform: translateX(0);
    visibility: visible;
  }
  .menu-btn {
    display: grid;
  }
  .layout {
    margin-left: 0;
  }
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .hero {
    padding-top: calc(var(--topbar) + 48px);
  }
  .hero-visual {
    max-width: 560px;
    width: 100%;
  }
  .chapter-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .method-grid {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 32px;
  }
  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .section-sub {
    max-width: 560px;
  }
}

@media (max-width: 760px) {
  :root {
    --topbar: 58px;
  }
  .topbar-inner {
    padding: 0 14px;
    gap: 10px;
  }
  .brand-text small {
    display: none;
  }
  .search-trigger {
    width: 36px;
    padding: 0;
    justify-content: center;
    border-color: transparent;
    background: transparent;
  }
  .search-trigger .st-text,
  .search-trigger kbd {
    display: none;
  }
  .layout {
    padding: 26px 20px 70px;
  }
  .article-head h1 {
    font-size: 2.05rem;
  }
  .article-desc {
    font-size: 15px;
  }
  .prose {
    font-size: 15.5px;
    line-height: 1.9;
  }
  .prose h2 {
    font-size: 1.45rem;
  }
  .prose h3 {
    font-size: 1.08rem;
  }
  .prose .table-wrap {
    margin-left: -20px;
    margin-right: -20px;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
  .prose table {
    min-width: 460px;
  }
  .code-block {
    margin-left: -20px;
    margin-right: -20px;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
  .code-block pre {
    font-size: 12px;
  }
  .pager {
    grid-template-columns: 1fr;
  }
  .pager-card.next {
    text-align: left;
    align-items: flex-start;
  }
  .related-grid {
    grid-template-columns: 1fr;
  }
  .hero {
    padding: calc(var(--topbar) + 36px) 18px 54px;
  }
  .hero h1 {
    font-size: 2.85rem;
    margin: 18px 0 18px;
  }
  .hero-lead {
    font-size: 15px;
  }
  .hero-search {
    min-width: 0;
    width: 100%;
  }
  .hero-actions {
    gap: 8px;
  }
  .hero-actions .btn {
    flex: 1;
  }
  .hero-stats {
    gap: 0;
    justify-content: space-between;
  }
  .hero-stats > div {
    padding-right: 12px;
    flex: 1;
  }
  .hero-stats strong {
    font-size: 1.25rem;
  }
  .hero-stats span {
    font-size: 9px;
  }
  .float-chip {
    display: none;
  }
  .section {
    padding: 56px 18px;
  }
  .section + .section {
    padding-top: 6px;
  }
  .chapter-grid {
    grid-template-columns: 1fr;
  }
  .chapter-card {
    min-height: 0;
  }
  .feature-row {
    grid-template-columns: 34px minmax(0, 1fr) 24px;
    gap: 12px;
    padding: 16px 4px;
  }
  .fr-meta {
    display: none;
  }
  .feature-row h3 {
    font-size: 1.1rem;
  }
  .feature-row p {
    -webkit-line-clamp: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .method-grid {
    padding: 24px 20px;
    border-radius: 12px;
  }
  .cta-box {
    flex-direction: column;
    align-items: flex-start;
    padding: 30px 24px;
    gap: 24px;
  }
  .footer-cols {
    gap: 34px;
  }
  .footer-inner {
    gap: 30px;
  }
  .page-head h1 {
    font-size: 2.15rem;
  }
  .page-lead {
    font-size: 14.5px;
  }
  .glossary-tools {
    padding-top: 10px;
  }
  .term {
    padding: 14px;
  }
  .term-level {
    display: none;
  }
  .search-modal {
    padding: 0;
  }
  .search-panel {
    max-width: none;
    height: 100%;
    border-radius: 0;
    border: 0;
    display: flex;
    flex-direction: column;
  }
  .search-input-row {
    height: 64px;
    flex: none;
    padding-right: 10px;
  }
  .esc-key {
    display: none;
  }
  .search-close-btn {
    display: grid;
  }
  .search-body {
    flex: 1;
    max-height: none;
  }
  .search-foot {
    flex: none;
  }
  .search-foot .sf-count {
    display: none;
  }
  .quiz-item {
    padding: 16px;
  }
  .quiz-hud {
    padding: 12px;
  }
  .phase-project {
    flex-direction: column;
    gap: 6px;
  }
  .path-phase {
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 10px;
  }
  .task-tag {
    display: none;
  }
  .article-foot {
    flex-direction: column;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 4px;
  }
}

@media (max-width: 420px) {
  .hero h1 {
    font-size: 2.45rem;
  }
  .article-head h1 {
    font-size: 1.85rem;
  }
  .brand-text strong {
    font-size: 13.5px;
  }
  .hero-stats > div:nth-child(4) {
    display: none;
  }
}

/* --------------------------------------------------------------- motion */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------------------------------------------------------------- print */

@media print {
  .topbar,
  .sidebar,
  .toc,
  .site-footer,
  .search-modal,
  .article-end,
  .pager,
  .related,
  .article-foot,
  .back-top,
  .read-progress {
    display: none !important;
  }
  .layout {
    margin: 0;
    padding: 0;
    display: block;
    max-width: none;
  }
  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }
  .article {
    max-width: none;
  }
  .prose a {
    color: #000;
    text-decoration: underline;
  }
  .prose h2 {
    page-break-after: avoid;
  }
  .code-block {
    background: #f5f5f5;
    border: 1px solid #ddd;
  }
  .code-block pre {
    color: #111;
  }
}
