:root {
  color-scheme: dark;
  --bg: #0a0d11;
  --panel: #111820;
  --panel-2: #17222b;
  --line: #29343d;
  --line-strong: #3a4c58;
  --text: #edf0ec;
  --text-2: #b7c0c0;
  --muted: #7d898c;
  --blue: #8dbbd0;
  --blue-dark: #34596a;
  --amber: #d0a561;
  --green: #86b394;
  --sans: "Microsoft YaHei UI", "Noto Sans CJK SC", "Segoe UI", sans-serif;
  --mono: "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(880px 520px at 72% -10%, rgba(77, 130, 156, .17), transparent 68%),
    var(--bg);
  color: var(--text-2);
  font: 16px/1.76 var(--sans);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .035;
  background-image: radial-gradient(#fff .55px, transparent .55px);
  background-size: 5px 5px;
}

.cover {
  width: min(1240px, calc(100% - 64px));
  margin: 0 auto;
  padding: 20px 0 28px;
}

.topbar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font: 12px/1.4 var(--mono);
}

.topbar a {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-left: -6px;
  padding: 5px 9px 5px 5px;
  border-radius: 6px;
  color: inherit;
  text-decoration: none;
  transition: color .16s ease, background .16s ease;
}

.topbar a:hover { background: rgba(255, 255, 255, .025); color: var(--text); }
.topbar a:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

.cover__layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, .65fr);
  gap: clamp(48px, 7vw, 96px);
  align-items: center;
  padding: 42px 0 34px;
}

h1 {
  max-width: 820px;
  margin: 0;
  color: var(--text);
  font-size: clamp(40px, 4.4vw, 56px);
  font-weight: 700;
  letter-spacing: -.045em;
  line-height: 1.12;
}

h1 em {
  margin-left: .16em;
  color: #dcebef;
  font-style: normal;
  text-decoration: underline;
  text-decoration-color: var(--blue);
  text-decoration-thickness: .1em;
  text-underline-offset: .13em;
}

.intro {
  max-width: 680px;
  margin: 24px 0 0;
  color: var(--text-2);
  font-size: 17px;
}

.intro strong {
  display: block;
  margin-bottom: 7px;
  color: var(--text);
  font-weight: 650;
}

.flow {
  position: relative;
  margin: 0;
  padding: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: linear-gradient(150deg, rgba(24, 34, 42, .94), rgba(13, 17, 21, .96));
  box-shadow: 18px 26px 70px rgba(0, 0, 0, .28);
}

.flow__step {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 14px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(9, 13, 17, .58);
}

.flow__step--question { border-color: #604f35; }
.flow__step--search { border-color: var(--blue-dark); background: rgba(34, 66, 82, .22); }
.flow__step--answer { border-color: #365644; }

.flow__index { color: var(--muted); font: 11px/1.5 var(--mono); }
.flow__step strong, .flow__step small { display: block; }
.flow__step strong { margin-bottom: 4px; color: var(--text); font-size: 15px; }
.flow__step small { color: var(--muted); font-size: 12px; line-height: 1.55; }
.flow__step--question .flow__index { color: var(--amber); }
.flow__step--search .flow__index { color: var(--blue); }
.flow__step--answer .flow__index { color: var(--green); }

.flow__connection { position: relative; height: 28px; }
.flow__connection::before { content: ""; position: absolute; left: 32px; top: 0; bottom: 0; width: 1px; background: var(--line-strong); }
.flow__connection span { position: absolute; left: 29px; bottom: 3px; width: 7px; height: 7px; border-right: 1px solid var(--muted); border-bottom: 1px solid var(--muted); transform: rotate(45deg); }

figcaption {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.chapter-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 13, 17, .93);
  backdrop-filter: blur(14px);
}

.chapter-nav__inner {
  display: flex;
  width: min(1240px, calc(100% - 64px));
  margin: 0 auto;
  padding-right: 8px;
  gap: clamp(24px, 3vw, 42px);
  overflow-x: auto;
  scrollbar-width: none;
}

.chapter-nav__inner::-webkit-scrollbar { display: none; }

.chapter-nav a {
  flex: 0 0 auto;
  padding: 16px 0 14px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
  transition: color .16s ease, border-color .16s ease;
}

.chapter-nav a:hover { color: var(--text-2); }
.chapter-nav a.is-current { border-bottom-color: var(--blue); color: var(--text); }
.chapter-nav a:focus-visible { outline: 2px solid var(--blue); outline-offset: -4px; }

.article {
  width: min(1080px, calc(100% - 64px));
  min-height: 55vh;
  margin: 0 auto;
}

.lesson-section { padding: 72px 0; }
.lesson-section + .lesson-section { padding-top: 48px; }

.lesson-section__head {
  display: grid;
  grid-template-columns: minmax(240px, .7fr) minmax(0, 1.3fr);
  gap: clamp(54px, 8vw, 110px);
  align-items: start;
  padding-bottom: 0;
}

.lesson-section h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(34px, 3.5vw, 44px);
  font-weight: 680;
  letter-spacing: -.035em;
  line-height: 1.2;
}

.lesson-section__intro p {
  max-width: 640px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
}

.lesson-section__intro p + p { margin-top: 10px; }
.lesson-section__intro strong { color: var(--text); font-weight: 650; }

.exam-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(14, 19, 24, .72);
  overflow: hidden;
}

.exam-comparison article { padding: 26px 28px 28px; }
.exam-comparison article + article { border-left: 1px solid var(--line); }
.exam-comparison__rag { background: linear-gradient(145deg, rgba(30, 52, 63, .28), rgba(14, 19, 24, .4)); }

.exam-comparison__title {
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 16px;
  align-items: start;
  padding-bottom: 0;
}

.exam-comparison__title > span {
  padding: 3px 0;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.exam-comparison__rag .exam-comparison__title > span { border-color: var(--blue-dark); color: var(--blue); }
.exam-comparison h3 { margin: 0; color: var(--text); font-size: 20px; }
.exam-comparison__title p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.exam-comparison ul { margin: 20px 0 0; padding: 0; list-style: none; }
.exam-comparison li { position: relative; padding-left: 18px; color: var(--text-2); }
.exam-comparison li + li { margin-top: 9px; }
.exam-comparison li::before { content: ""; position: absolute; left: 1px; top: .75em; width: 5px; height: 1px; background: var(--muted); }
.exam-comparison__rag li::before { background: var(--blue); }

.use-cases {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 28px;
}

.use-cases article {
  position: relative;
  min-height: 210px;
  padding: 25px 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(14, 19, 24, .72);
  overflow: hidden;
}

.use-cases h3 { margin: 0 0 14px; color: var(--text); font-size: 18px; }
.use-cases p { margin: 0; color: var(--muted); font-size: 15px; }

.approach-choice { margin-top: 44px; }
.approach-choice > h3 { margin: 0; color: var(--text); font-size: 22px; }
.approach-choice > p { max-width: 680px; margin: 8px 0 20px; color: var(--muted); font-size: 15px; }

.approach-table-wrap { overflow-x: auto; border-radius: 6px; }
.approach-table {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-collapse: collapse;
  background: rgba(14, 19, 24, .72);
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.65;
}

.approach-table th,
.approach-table td { padding: 15px 18px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.approach-table thead th { background: rgba(36, 48, 58, .62); color: var(--text); font-size: 13px; font-weight: 650; }
.approach-table tbody th { width: 18%; color: var(--text); font-size: 15px; font-weight: 650; white-space: nowrap; }
.approach-table td { width: 41%; }

.phase-section .lesson-section__head { grid-template-columns: 1fr; gap: 10px; }
.phase-section .lesson-section__intro { max-width: 760px; }
.phase-section .lesson-section__intro p { margin: 0; }
.phase-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 26px; }
.phase-card { position: relative; padding: 26px 28px 28px; border: 1px solid var(--line); border-radius: 8px; background: rgba(14, 19, 24, .72); overflow: hidden; }
.phase-card header { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.phase-card header h3 { margin: 0; color: var(--text); font-size: 20px; }
.phase-card header p { margin: 0; color: var(--muted); font-size: 13px; }
.phase-steps { position: relative; display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.phase-steps::before { content: ""; position: absolute; top: 13px; bottom: 13px; left: 5px; width: 1px; background: var(--line); }
.phase-steps li { position: relative; min-height: 62px; padding: 0 0 18px 28px; }
.phase-steps li:last-child { min-height: 0; padding-bottom: 0; }
.phase-steps li::before { content: ""; position: absolute; top: 8px; left: 0; width: 11px; height: 11px; border: 2px solid var(--blue); border-radius: 50%; background: var(--bg); }
.phase-card--online .phase-steps li::before { border-color: var(--amber); }
.phase-steps strong { display: block; color: var(--text); font-size: 15px; font-weight: 650; }
.phase-steps span { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.phase-footnote { margin: 16px 0 0; color: var(--muted); font-size: 14px; }
.phase-footnote::before { content: "•"; margin-right: 8px; color: var(--blue); }
.phase-footnote strong { color: var(--text-2); }

.pipeline-card { margin-top: 26px; padding: 26px; border: 1px solid var(--line); border-radius: 8px; background: rgba(14, 19, 24, .72); }
.pipeline-card + .pipeline-card { margin-top: 12px; }
.pipeline-card__head { display: flex; align-items: baseline; gap: 18px; margin-bottom: 24px; }
.pipeline-card__head h3 { margin: 0; color: var(--text); font-size: 22px; }
.pipeline-card__head p { margin: 0; color: var(--muted); font-size: 14px; }
.pipeline-card__body { display: grid; grid-template-columns: .9fr 1.1fr; gap: 34px; align-items: start; }
.pipeline-explain > p { margin: 0; color: var(--text-2); font-size: 15px; }
.pipeline-explain .pipeline-rule { margin-top: 18px; color: var(--muted); font-size: 14px; }
.pipeline-rule strong { color: var(--text-2); }
.chunk-tradeoffs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 20px 0 0; }
.chunk-tradeoffs div { padding: 14px 15px; border-radius: 6px; background: rgba(23, 34, 43, .52); }
.chunk-tradeoffs dt { color: var(--text); font-size: 14px; font-weight: 650; }
.chunk-tradeoffs dd { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.code-sample { border: 1px solid var(--line); border-radius: 6px; background: #090d10; overflow: hidden; }
.code-sample header { padding: 9px 14px; background: rgba(23, 34, 43, .62); color: var(--muted); font: 12px/1.5 var(--mono); }
.code-sample pre { margin: 0; padding: 17px 18px 19px; overflow-x: auto; }
.code-sample code { color: #c4cecc; font: 13px/1.75 var(--mono); tab-size: 4; }
.code-keyword { color: #d9a76c; }
.code-function { color: #8dbbd0; }
.code-number { color: #a9c58d; }
.code-builtin { color: #c3a6cb; }
.code-string { color: #9fbd91; }
.code-constant { color: #c3a6cb; }

.retrieval-section .lesson-section__head { grid-template-columns: 1fr; gap: 10px; }
.retrieval-section .lesson-section__intro { max-width: 760px; }
.retrieval-section .lesson-section__intro p { margin: 0; }
.retrieval-map { max-width: 900px; margin-top: 30px; }
.retrieval-map__label { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.retrieval-levers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.retrieval-levers article { padding: 18px 19px; border: 1px solid var(--line); border-radius: 7px; background: rgba(14, 19, 24, .68); }
.retrieval-levers h3,
.retrieval-result h3,
.retrieval-check h3 { margin: 0 0 7px; color: var(--text); font-size: 17px; }
.retrieval-levers p,
.retrieval-check p { margin: 0; color: var(--muted); font-size: 14px; }
.retrieval-map__link { display: grid; justify-items: center; gap: 1px; padding: 10px 0 8px; color: var(--muted); font-size: 12px; line-height: 1.2; }
.retrieval-map__link b { color: var(--blue-dark); font-size: 18px; font-weight: 400; }
.retrieval-result { max-width: 620px; margin: 0 auto; padding: 20px 22px; border: 1px solid var(--line-strong); border-radius: 7px; background: rgba(52, 89, 106, .12); }
.retrieval-result ul { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 12px 0 0; padding: 0; list-style: none; }
.retrieval-result li { color: var(--text-2); font-size: 14px; line-height: 1.55; }
.retrieval-result li::before { content: "•"; margin-right: 7px; color: var(--blue); }
.retrieval-check { max-width: 620px; margin: 0 auto; padding: 18px 22px; border: 1px solid var(--line); border-radius: 7px; background: rgba(23, 34, 43, .52); }

.practice-section .lesson-section__head { grid-template-columns: 1fr; gap: 10px; }
.practice-section .lesson-section__intro { max-width: 760px; }
.practice-section .lesson-section__intro p { margin: 0; }
.myths-block { max-width: 900px; margin-top: 30px; }
.myths-block > h3 { margin: 0 0 14px; color: var(--text); font-size: 20px; }
.myths-list { border: 1px solid var(--line); border-radius: 8px; background: rgba(14, 19, 24, .68); overflow: hidden; }
.myths-list details + details { border-top: 1px solid var(--line); }
.myths-list details[open] { background: rgba(23, 34, 43, .34); }
.myths-list summary { position: relative; padding: 16px 54px 16px 20px; color: var(--text); font-size: 15px; font-weight: 650; cursor: pointer; list-style: none; }
.myths-list summary::-webkit-details-marker { display: none; }
.myths-list summary::after { content: "+"; position: absolute; top: 15px; right: 20px; color: var(--muted); font: 18px/1 var(--mono); }
.myths-list details[open] summary::after { content: "−"; }
.myths-list details p { margin: 0; padding: 0 54px 18px 20px; color: var(--muted); font-size: 14px; }
.start-block { max-width: 760px; margin-top: 44px; }
.start-block > h3 { margin: 0 0 20px; color: var(--text); font-size: 20px; }
.start-steps { position: relative; display: grid; gap: 24px; margin: 0; padding: 0; list-style: none; }
.start-steps::before { content: ""; position: absolute; top: 18px; bottom: 18px; left: 17px; width: 1px; background: var(--line); }
.start-steps li { position: relative; display: grid; grid-template-columns: 36px 1fr; gap: 18px; align-items: start; }
.start-steps li > span { position: relative; z-index: 1; display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--bg); color: var(--blue); font: 13px/1 var(--mono); }
.start-steps h4 { margin: 1px 0 5px; color: var(--text); font-size: 17px; }
.start-steps p { margin: 0; color: var(--muted); font-size: 14px; }

@media (max-width: 900px) {
  .cover__layout { grid-template-columns: 1fr; gap: 54px; }
  .flow { width: min(100%, 560px); }
  .lesson-section__head { grid-template-columns: 1fr; gap: 24px; }
  .exam-comparison { grid-template-columns: 1fr; }
  .exam-comparison article + article { border-left: 0; border-top: 1px solid var(--line); }
  .use-cases { grid-template-columns: 1fr; }
  .use-cases article { min-height: 0; }
  .phase-cards { grid-template-columns: 1fr; }
  .pipeline-card__body { grid-template-columns: 1fr; }
  .retrieval-result ul { grid-template-columns: 1fr; gap: 6px; }
}

@media (max-width: 600px) {
  .cover { width: min(100% - 30px, 1240px); padding-top: 18px; }
  .cover__layout { display: block; padding: 36px 0 42px; }
  h1 { font-size: clamp(36px, 10vw, 46px); }
  h1 em { display: block; margin: 4px 0 0; }
  .intro { margin-top: 22px; font-size: 16px; }
  .approach-table { min-width: 660px; font-size: 13px; }
  .approach-table th,
  .approach-table td { padding: 13px 14px; }
  .phase-card { padding: 22px 20px 24px; }
  .phase-card header { display: block; margin-bottom: 20px; }
  .phase-card header p { margin-top: 3px; }
  .pipeline-card { padding: 22px 20px; }
  .pipeline-card__head { display: block; margin-bottom: 20px; }
  .pipeline-card__head p { margin-top: 3px; }
  .chunk-tradeoffs { grid-template-columns: 1fr; }
  .retrieval-levers { grid-template-columns: 1fr; }
  .flow { margin-top: 34px; padding: 18px; }
  .chapter-nav__inner { width: calc(100% - 30px); gap: 26px; }
  .article { width: calc(100% - 30px); }
  .lesson-section { padding: 52px 0; }
  .lesson-section + .lesson-section { padding-top: 40px; }
  .lesson-section h2 { font-size: 32px; }
  .lesson-section__intro p { font-size: 16px; }
  .exam-comparison article { padding: 22px 20px 24px; }
}

@media (prefers-reduced-motion: no-preference) {
  .cover__copy { animation: enter .55s ease both; }
  .flow { animation: enter .55s .12s ease both; }
  @keyframes enter { from { opacity: 0; transform: translateY(10px); } }
}
/* 阅读正文的内联强调只改变颜色，不切换中文字重。 */
body :is(b,strong){font-weight:inherit !important}
.flow__step strong,.phase-steps strong{font-weight:600 !important}
svg text,svg tspan{font-weight:400 !important}
