@charset "UTF-8";
:root {
  --paper: #f8f8f5;
  --white: #fff;
  --ink: #172723;
  --muted: #737d78;
  --green: #245c49;
  --pale: #eaf2ed;
  --line: #e2e7e1;
  --sidebar: 242px;
  --header: 82px;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.65;
  background: var(--paper);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input {
  font: inherit;
}
button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
a,
button {
  touch-action: manipulation;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid #8bbba5;
  outline-offset: 4px;
}
button {
  color: var(--green);
}
[hidden] {
  display: none !important;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  line-height: 1.4;
}
button {
  border: 0;
  background: none;
}
svg.icon {
  width: 23px;
  height: 23px;
  flex-shrink: 0;
  vertical-align: middle;
}
.skip {
  position: fixed;
  top: -80px;
  left: 20px;
  background: white;
  padding: 14px;
  z-index: 50;
}
.skip:focus {
  top: 10px;
}
.topbar {
  height: var(--header);
  display: flex;
  align-items: center;
  gap: 46px;
  padding: 0 38px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 253, 0.97);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand {
  font-size: 29px;
  font-weight: 750;
  letter-spacing: -1.2px;
  white-space: nowrap;
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 20px;
}
.brand span {
  font-size: 13px;
  letter-spacing: 1px;
  font-weight: 400;
  color: var(--muted);
  border-left: 1px solid #d7ded7;
  padding-left: 19px;
}
.topbar > nav {
  display: flex;
  align-self: stretch;
  gap: 32px;
  white-space: nowrap;
}
.topbar > nav a {
  position: relative;
  display: flex;
  align-items: center;
  font-weight: 600;
  color: #646e68;
  font-size: 16px;
}
.topbar > nav a.selected {
  color: var(--green);
}
.topbar > nav a.selected:after {
  content: "";
  position: absolute;
  bottom: 15px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--green);
}
.searchbox {
  margin-left: auto;
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 340px;
  max-width: 32vw;
  border: 1px solid #dce2db;
  border-radius: 9px;
  padding: 9px 13px;
  background: white;
}
.searchbox > span {
  font-size: 24px;
  line-height: 1;
  color: #637269;
}
.searchbox input {
  width: 100%;
  border: 0;
  outline: 0;
  background: none;
  font-size: 14px;
  min-width: 0;
}
.searchbox kbd {
  font-size: 12px;
  background: #f3f4f0;
  padding: 0 6px;
  border-radius: 3px;
  color: #9b9f99;
}
#results {
  position: absolute;
  right: 0;
  top: calc(100% + 9px);
  width: 400px;
  max-width: 90vw;
  border: 1px solid var(--line);
  background: white;
  box-shadow: 0 14px 36px #213c2b16;
  border-radius: 10px;
  padding: 12px;
  z-index: 30;
}
#results > small {
  color: var(--muted);
  padding: 6px 10px;
}
#results a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 10px;
  border-radius: 6px;
}
#results a:hover,
#results a:focus {
  background: var(--pale);
}
#results a span {
  flex: 1;
}
#results strong,
#results small {
  display: block;
  font-size: 14px;
}
#results small {
  color: var(--muted);
  font-size: 12px;
}
#results p {
  padding: 10px;
}
.layout {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: calc(100vh - var(--header));
}
.sidebar {
  border-right: 1px solid var(--line);
  padding: 34px 23px;
  position: sticky;
  top: var(--header);
  height: calc(100vh - var(--header));
  background: #fafbf8;
  display: flex;
  flex-direction: column;
  font-size: 14px;
}
.side-label {
  font-size: 15px;
  font-weight: 650;
  margin-bottom: 23px;
  padding: 0 10px;
}
.course-choice {
  display: flex;
  align-items: center;
  gap: 13px;
  background: var(--pale);
  color: var(--green);
  padding: 15px 13px;
  border-radius: 8px;
  font-weight: 600;
}
.course-choice small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: #668475;
  margin-top: 2px;
}
.side-divider {
  height: 1px;
  background: var(--line);
  margin: 27px 10px;
}
.side-nav a {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 14px 13px;
  border-radius: 6px;
  margin: 4px 0;
  color: #65726a;
}
.side-nav a.active {
  background: var(--pale);
  color: var(--green);
  box-shadow: inset 3px 0 var(--green);
}
.sidebar-bottom {
  margin-top: auto;
  padding: 28px 8px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.9;
}
.sidebar-bottom small {
  display: block;
}
.small-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #799f89;
  border-radius: 50%;
  margin-right: 6px;
}
.side-back {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--green);
  margin: 0 10px 24px;
  font-size: 13px;
}
.topic-label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  color: #55685c;
}
.tree-group {
  margin: 3px 0 18px;
}
.tree-group summary {
  cursor: pointer;
  padding: 9px 10px;
  color: var(--green);
}
.tree-children {
  margin: 0 0 16px 19px;
  border-left: 1px solid #dce3da;
}
.tree-children a {
  display: block;
  padding: 11px 12px;
  font-size: 13px;
  margin: 3px 0 3px -1px;
  border-left: 2px solid transparent;
}
.tree-children a.active {
  background: var(--pale);
  border-color: var(--green);
  color: var(--green);
  font-weight: 600;
  border-radius: 0 5px 5px 0;
}
main {
  padding: 35px 40px 0;
  min-width: 0;
  max-width: 1550px;
  width: 100%;
  margin: 0 auto;
}
.eyebrow {
  font-size: 12px;
  color: #79847c;
  letter-spacing: 0.4px;
  margin-bottom: 16px;
}
.page-heading {
  margin-bottom: 27px;
}
.page-heading h1 {
  font-size: 34px;
  letter-spacing: -0.8px;
  font-weight: 650;
}
.page-heading p {
  color: var(--muted);
  font-size: 16px;
  margin-top: 10px;
}
.page-heading .badge {
  margin-bottom: 12px;
}
.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 25px 26px;
}
.panel h2 {
  font-size: 18px;
  font-weight: 650;
}
.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.panel-title > span {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 1px;
}
.hero {
  display: flex;
  gap: 35px;
  padding: 30px 32px;
  margin-bottom: 24px;
  min-height: 257px;
}
.hero-main {
  flex: 1;
}
.date-line {
  display: flex;
  gap: 15px;
  align-items: center;
  font-size: 14px;
  flex-wrap: wrap;
}
.date-line > span:last-child {
  color: var(--muted);
  font-size: 12px;
  border-left: 1px solid var(--line);
  padding-left: 15px;
}
.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  background: var(--pale);
  color: var(--green);
  padding: 5px 10px;
  border-radius: 5px;
}
.hero h2 {
  font-size: 32px;
  margin-top: 24px;
  letter-spacing: -0.6px;
}
.hero h2 span {
  font-weight: 450;
}
.hero p {
  font-size: 17px;
  color: #6a756d;
  margin-top: 9px;
}
.hero-actions {
  display: flex;
  gap: 28px;
  align-items: center;
  margin-top: 25px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 11px 18px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: #f6f9f4;
  color: var(--green);
  min-height: 44px;
}
.button.primary {
  background: var(--green);
  border-color: var(--green);
  color: white;
}
.button:hover {
  filter: brightness(0.95);
}
.button .icon {
  width: 20px;
}
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--green);
  font-size: 14px;
  font-weight: 550;
}
.text-link .icon {
  width: 18px;
}
.lesson-outline {
  border-left: 1px solid var(--line);
  padding: 8px 0 8px 32px;
  width: 235px;
  flex-shrink: 0;
}
.lesson-outline h3 {
  font-size: 14px;
  margin-bottom: 12px;
}
.lesson-outline ol {
  list-style: none;
  padding: 0;
  margin: 0;
}
.lesson-outline li {
  display: flex;
  align-items: center;
  gap: 17px;
  font-size: 14px;
  position: relative;
  padding: 9px 0;
}
.lesson-outline li span,
.number {
  width: 37px;
  height: 37px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--pale);
  color: var(--green);
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: 19px;
  flex-shrink: 0;
}
.lesson-outline li:not(:last-child):after {
  content: "";
  position: absolute;
  width: 1px;
  height: 18px;
  top: 46px;
  left: 18px;
  background: var(--line);
}
.course-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(270px, 1fr);
  gap: 23px;
}
.resource {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 21px 0;
  border-bottom: 1px solid #edf0eb;
  min-width: 0;
}
.resource:last-of-type {
  border-bottom: 0;
}
.resource:hover strong {
  color: var(--green);
}
.resource-icon {
  background: #f0f6f1;
  color: var(--green);
  padding: 11px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.resource strong {
  font-size: 14px;
  font-weight: 600;
  display: block;
}
.resource small {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 5px;
}
.chevron {
  margin-left: auto;
  font-size: 24px;
  color: #7d8c80;
}
.resource > span:nth-child(2) {
  min-width: 0;
}
.related .resource {
  padding: 19px 0;
}
.related .resource-icon {
  padding: 8px;
}
.related .text-link {
  margin-top: 12px;
}
.panel-note {
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid #edf0eb;
  padding-top: 15px;
}
.course-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 23px;
  padding: 19px 24px;
  background: #f0f3ed;
  border-radius: 8px;
  font-size: 12px;
  color: #65735f;
}
.course-bottom .icon {
  width: 18px;
  margin-right: 10px;
}
.course-bottom a {
  color: var(--green);
  white-space: nowrap;
  margin-left: 15px;
}
.pagefoot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 10px;
  color: #889085;
  padding: 26px 0 18px;
}
.prerequisite {
  display: flex;
  gap: 22px;
  align-items: center;
  border: 1px solid var(--line);
  background: #f0f5ee;
  border-radius: 9px;
  padding: 19px 24px;
  font-size: 13px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}
.prerequisite strong {
  color: var(--green);
  font-size: 14px;
}
.prerequisite a {
  color: #657562;
}
.knowledge-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr);
  gap: 26px;
}
.section-title {
  font-size: 22px;
  margin-bottom: 17px;
}
.learning-list {
  display: grid;
  gap: 14px;
}
.learning-row {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 23px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.learning-row .number {
  margin-top: 5px;
  width: 43px;
  height: 43px;
  font-size: 21px;
}
.learning-row small {
  font-size: 11px;
  color: #738171;
}
.learning-row h3 {
  font-size: 19px;
  margin: 4px 0 8px;
}
.learning-row p {
  font-size: 13px;
  color: var(--muted);
}
.learning-row.featured {
  border-color: #b7cfc0;
  box-shadow: 0 3px 12px #29472b05;
}
.featured .badge {
  padding: 3px 8px;
}
.tags {
  display: flex;
  gap: 8px;
  margin: 15px 0 20px;
}
.tags span {
  background: #f3f4f0;
  color: #74806f;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
}
.advice {
  margin-top: 48px;
  padding: 24px;
}
.advice ol {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
}
.advice li {
  display: flex;
  gap: 14px;
  margin-bottom: 27px;
}
.advice li:last-child {
  margin-bottom: 4px;
}
.advice li > span {
  font-family: Georgia, serif;
  color: #739681;
  font-size: 20px;
  line-height: 1.4;
}
.advice strong {
  font-size: 14px;
}
.advice p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 7px;
  line-height: 1.9;
}
.course-callout {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px 6px;
  color: var(--green);
  font-size: 14px;
}
.course-callout small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}
.exercise-strip {
  display: flex;
  gap: 25px;
  align-items: center;
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
  margin-top: 25px;
  padding: 13px 24px;
}
.exercise-strip h2 {
  font-size: 15px;
  white-space: nowrap;
}
.exercise-strip .resource {
  flex: 1;
  border: 0;
  padding: 10px 0;
}
.exercise-strip .resource-icon {
  padding: 8px;
}
.lesson-note {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  background: #edf3eb;
  border: 1px solid #dce7d9;
  padding: 23px 25px;
  border-radius: 9px;
  margin-bottom: 25px;
  font-size: 14px;
  color: #41614d;
}
.lesson-note p {
  margin-top: 7px;
  font-size: 13px;
  color: #687d6b;
}
.lesson-note .text-link {
  margin-top: 10px;
}
.lead-material {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 25px 0;
  border-bottom: 1px solid var(--line);
}
.lead-material > span:last-child {
  margin-left: auto;
  color: var(--green);
}
.lead-material small {
  color: var(--muted);
  font-size: 12px;
}
.lead-material h3 {
  font-size: 19px;
  margin: 5px 0;
}
.lead-material p {
  color: var(--muted);
  font-size: 12px;
}
.step-list a {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid #eef0eb;
  font-size: 14px;
}
.step-list a > span:first-child {
  font-family: Georgia, serif;
  color: #97aa99;
}
.step-list a > span:last-child {
  margin-left: auto;
  color: #78917b;
}
.step-list strong {
  font-weight: 450;
}
.homework-note {
  padding: 25px 10px;
}
.homework-note h3 {
  font-size: 15px;
}
.homework-note p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 13px;
}
.schedule table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-top: 22px;
}
.schedule th {
  text-align: left;
  font-weight: 500;
  color: var(--muted);
  font-size: 12px;
}
.schedule th,
.schedule td {
  padding: 17px 14px;
  border-bottom: 1px solid var(--line);
}
.schedule small {
  display: block;
  font-size: 12px;
  color: var(--green);
}
.schedule tr.current {
  background: #f1f6ef;
}
.schedule td:first-child {
  font-family: Georgia, serif;
}
.schedule td:nth-child(2) {
  white-space: nowrap;
}
.schedule a {
  color: var(--green);
  white-space: nowrap;
}
.muted {
  color: var(--muted);
  font-size: 12px;
}
.intro {
  max-width: 900px;
  padding: 36px;
}
.intro h2 {
  font-size: 26px;
  margin: 20px 0;
}
.intro p,
.intro li {
  font-size: 15px;
  color: #657465;
  line-height: 2;
}
.intro h3 {
  font-size: 18px;
  margin: 25px 0 10px;
}
.intro .button {
  margin-top: 22px;
}
.intro-facts {
  display: flex;
  gap: 30px;
  justify-content: space-between;
  padding: 25px 0;
  margin-top: 20px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.intro-facts small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.intro-facts strong {
  font-size: 14px;
  display: block;
  margin-top: 8px;
}
.reader main {
  padding: 32px 34px 0;
}
.reader-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 225px;
  gap: 35px;
}
.reader-layout article {
  min-width: 0;
}
.reader-heading {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  justify-content: space-between;
  margin: 17px 0 25px;
}
.reader-heading h1 {
  font-size: 29px;
  letter-spacing: -0.7px;
  line-height: 1.5;
}
.reader-heading p {
  font-size: 14px;
  color: var(--muted);
  margin-top: 7px;
}
.focus-button {
  font-size: 12px;
  padding: 8px 12px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 6px;
}
.focus-button .icon {
  width: 17px;
}
.return-link {
  font-size: 13px;
  color: var(--green);
  display: inline-block;
  margin: 4px 0 7px;
}
.goal-box {
  background: #edf4ed;
  border: 1px solid #dce7db;
  border-radius: 7px;
  padding: 17px 22px;
  margin: 20px 0 30px;
}
.goal-box strong {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--green);
  font-size: 15px;
}
.goal-box p {
  color: #607260;
  margin: 6px 0 0 33px;
  font-size: 14px;
}
.reader-aside {
  position: sticky;
  top: 105px;
  align-self: start;
  max-height: calc(100vh - 125px);
  overflow: auto;
  padding: 0 3px 20px 14px;
  font-size: 13px;
}
.reader-aside section {
  border-bottom: 1px solid var(--line);
  padding: 0 0 23px;
  margin-bottom: 23px;
}
.reader-aside h2 {
  font-size: 15px;
  margin-bottom: 20px;
}
.reader-aside #toc {
  border-left: 1px solid #dce4d9;
  padding-left: 15px;
}
.reader-aside #toc a {
  display: block;
  padding: 8px 0;
  line-height: 1.7;
  font-size: 12px;
  color: #7d887b;
}
.reader-aside #toc a.active {
  color: var(--green);
  font-weight: 650;
}
.reader-aside .resource {
  padding: 12px 0;
  gap: 9px;
}
.reader-aside .resource-icon {
  padding: 7px;
}
.reader-aside .resource-icon .icon {
  width: 18px;
}
.reader-aside .resource strong {
  font-size: 12px;
}
.reader-aside .resource small {
  font-size: 10px;
}
.reader-aside .chevron {
  display: none;
}
.reader-aside .text-link {
  font-size: 12px;
}
.prose {
  font-size: 16px;
  line-height: 1.95;
  overflow-wrap: anywhere;
  color: #35453a;
}
.prose h2,
.prose h3,
.prose h4 {
  scroll-margin-top: 110px;
  color: var(--ink);
}
.prose h2 {
  font-size: 24px;
  margin: 36px 0 17px;
  line-height: 1.6;
}
.prose h3 {
  font-size: 19px;
  margin: 30px 0 15px;
}
.prose h4 {
  font-size: 17px;
  margin: 25px 0 12px;
}
.prose p {
  margin: 15px 0;
}
.prose strong {
  font-weight: 600;
  color: #23392a;
}
.prose ul,
.prose ol {
  padding-left: 24px;
}
.prose li {
  padding: 3px 0;
}
.prose a {
  color: var(--green);
  text-decoration: underline;
  text-decoration-color: #b1c9b5;
  text-underline-offset: 4px;
}
.prose blockquote {
  margin: 20px 0;
  background: #f0f4ed;
  border-left: 3px solid #8aac91;
  padding: 7px 20px;
  border-radius: 0 5px 5px 0;
  font-size: 14px;
  color: #62755e;
}
.prose blockquote p {
  margin: 8px 0;
}
.prose code {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.85em;
  background: #edf0e9;
  border-radius: 4px;
  padding: 2px 5px;
  color: #245b48;
}
.table-scroll {
  overflow-x: auto;
  max-width: 100%;
  margin: 20px 0;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.7;
}
.prose th {
  background: #f0f4ee;
  font-weight: 600;
  color: #40523f;
}
.prose th,
.prose td {
  padding: 11px 14px;
  border: 1px solid var(--line);
  min-width: 70px;
}
.codeblock {
  margin: 22px 0;
  border: 1px solid #dce5d8;
  border-radius: 8px;
  overflow: hidden;
  background: #f0f4ed;
}
.codebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 15px;
  border-bottom: 1px solid #dce5d8;
  font: 11px monospace;
  color: #7d8c76;
}
.codebar button {
  font-size: 11px;
  min-height: 28px;
}
.prose pre {
  overflow: auto;
  padding: 20px;
  margin: 0;
  line-height: 1.75;
  font-size: 14px;
  tab-size: 4;
}
.prose pre code {
  padding: 0;
  background: none;
  color: #24292e;
  font-size: 13px;
  border: 0;
}
.prose hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 30px 0;
}
.prose .katex {
  font-size: 1.05em;
}
.prose .katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 6px 0;
}
.reading-end {
  margin-top: 45px;
  background: #eef4ec;
  border: 1px solid #dce8d8;
  border-radius: 8px;
  padding: 25px;
}
.reading-end strong {
  font-size: 17px;
}
.reading-end p {
  font-size: 13px;
  color: var(--muted);
  margin: 7px 0 17px;
}
.reading-end > div {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  color: var(--green);
  font-size: 13px;
}
.problem-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
  font-size: 13px;
  color: var(--green);
  flex-wrap: wrap;
}
.focused .sidebar,
.focused .reader-aside {
  display: none;
}
.focused .layout {
  grid-template-columns: 1fr;
}
.focused .reader-layout {
  grid-template-columns: 1fr;
  max-width: 860px;
  margin: auto;
}
.focused .reader-heading h1 {
  font-size: 34px;
}
.focused .prose {
  font-size: 18px;
}
.mobilebar {
  display: none;
}
#toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: #244a36;
  color: white;
  border-radius: 8px;
  padding: 12px 22px;
  z-index: 60;
  font-size: 14px;
}
@media (min-width: 1600px) {
  main {
    padding: 45px 55px 0;
  }
  .hero {
    padding: 38px;
  }
  .course-grid {
    grid-template-columns: 1.8fr 1fr;
  }
  .reader-layout {
    gap: 50px;
    grid-template-columns: minmax(0, 1fr) 250px;
  }
  .reader-heading h1 {
    font-size: 34px;
  }
  .prose {
    font-size: 18px;
  }
}
@media (max-width: 1180px) {
  :root {
    --sidebar: 205px;
  }
  .topbar {
    gap: 28px;
    padding: 0 25px;
  }
  .brand span {
    display: none;
  }
  .topbar > nav {
    gap: 25px;
  }
  .searchbox {
    width: 300px;
  }
  .sidebar {
    padding: 30px 16px;
  }
  main {
    padding: 30px 28px 0;
  }
  .hero {
    gap: 22px;
    padding: 25px;
  }
  .hero h2 {
    font-size: 28px;
  }
  .lesson-outline {
    width: 185px;
    padding-left: 22px;
  }
  .course-grid {
    grid-template-columns: 1.4fr 1fr;
    gap: 18px;
  }
  .panel {
    padding: 22px;
  }
  .resource strong {
    font-size: 13px;
  }
  .resource {
    gap: 10px;
  }
  .resource-icon {
    padding: 8px;
  }
  .knowledge-grid {
    grid-template-columns: 1fr;
  }
  .knowledge-grid > aside {
    display: none;
  }
  .exercise-strip {
    flex-wrap: wrap;
  }
  .exercise-strip h2 {
    width: 100%;
  }
  .reader-layout {
    grid-template-columns: minmax(0, 1fr) 170px;
    gap: 22px;
  }
  .reader main {
    padding: 27px 25px;
  }
  .reader-aside {
    padding-left: 0;
  }
  .reader-heading {
    flex-wrap: wrap;
  }
  .reader-heading h1 {
    font-size: 28px;
  }
  .prose {
    font-size: 16px;
  }
}
@media (max-width: 900px) {
  :root {
    --sidebar: 180px;
    --header: 72px;
  }
  .topbar {
    gap: 25px;
    padding: 0 20px;
  }
  .brand {
    font-size: 25px;
  }
  .topbar > nav a {
    font-size: 14px;
  }
  .searchbox {
    max-width: 32vw;
    padding: 7px 10px;
  }
  .searchbox input {
    font-size: 12px;
  }
  .searchbox kbd {
    display: none;
  }
  .sidebar {
    font-size: 13px;
    padding: 25px 13px;
  }
  .course-choice {
    gap: 8px;
    padding: 12px 10px;
  }
  .course-choice small {
    font-size: 10px;
  }
  .page-heading h1 {
    font-size: 28px;
  }
  .hero {
    display: block;
  }
  .lesson-outline {
    display: none;
  }
  .course-grid {
    grid-template-columns: 1fr;
  }
  .related {
    display: none;
  }
  .reader-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .reader-aside {
    position: static;
    max-height: none;
    border-top: 1px solid var(--line);
    padding-top: 25px;
  }
  .reader-aside section:not(:first-child) {
    display: none;
  }
  .reader-heading {
    flex-wrap: nowrap;
  }
  .reader-heading h1 {
    font-size: 27px;
  }
  .goal-box p {
    margin-left: 0;
  }
  .course-bottom {
    display: block;
  }
  .course-bottom a {
    display: inline-block;
    margin: 12px 0 0;
  }
  .exercise-strip {
    gap: 15px;
  }
  .exercise-strip .resource {
    flex-basis: 100%;
  }
  .intro-facts {
    flex-wrap: wrap;
  }
  .prose h2 {
    font-size: 22px;
  }
}
@media (max-width: 680px) {
  :root {
    --header: 112px;
  }
  .topbar {
    height: 112px;
    padding: 12px 20px;
    gap: 0;
    flex-wrap: wrap;
    align-content: center;
  }
  .brand {
    font-size: 24px;
    flex: 1;
  }
  .topbar > nav {
    height: 38px;
    gap: 24px;
    align-self: auto;
  }
  .topbar > nav a.selected:after {
    bottom: 0;
  }
  .searchbox {
    width: 100%;
    max-width: none;
    margin-top: 9px;
    height: 36px;
  }
  .searchbox input {
    font-size: 13px;
  }
  .searchbox > span {
    font-size: 21px;
  }
  #results {
    width: 100%;
  }
  .mobilebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 19px;
    border-bottom: 1px solid var(--line);
    font-size: 12px;
    background: #f7faf4;
  }
  .mobilebar button {
    padding: 5px 0;
    font-size: 12px;
    min-height: 28px;
  }
  .mobilebar > span {
    color: #8a9385;
    margin-left: auto;
  }
  .mobilebar #mobileToc {
    margin-left: 20px;
  }
  .layout {
    display: block;
  }
  .sidebar {
    display: none;
    position: fixed;
    top: 112px;
    left: 0;
    bottom: 0;
    width: 255px;
    height: calc(100dvh - 112px);
    z-index: 25;
    background: #fcfdf9;
    box-shadow: 10px 0 30px #233c231a;
    padding: 25px;
  }
  .menu-open .sidebar {
    display: flex;
  }
  main,
  .reader main {
    padding: 23px 19px 0;
  }
  .eyebrow {
    font-size: 11px;
    margin-bottom: 13px;
  }
  .page-heading {
    margin-bottom: 23px;
  }
  .page-heading h1 {
    font-size: 27px;
  }
  .page-heading p {
    font-size: 14px;
    margin-top: 9px;
  }
  .hero {
    padding: 23px 20px;
  }
  .date-line {
    gap: 9px;
    font-size: 12px;
  }
  .date-line > span:last-child {
    padding-left: 0;
    border: 0;
    font-size: 11px;
  }
  .badge {
    font-size: 11px;
    padding: 4px 7px;
  }
  .hero h2 {
    font-size: 27px;
    margin-top: 22px;
  }
  .hero p {
    font-size: 14px;
  }
  .hero-actions {
    gap: 21px;
    margin-top: 23px;
  }
  .button {
    font-size: 13px;
    padding: 10px 13px;
  }
  .hero-actions .text-link {
    font-size: 12px;
  }
  .panel {
    padding: 20px;
  }
  .panel h2 {
    font-size: 17px;
  }
  .resource {
    padding: 21px 0;
    gap: 12px;
  }
  .resource strong {
    font-size: 14px;
  }
  .resource small {
    font-size: 11px;
  }
  .resource-icon {
    padding: 9px;
  }
  .course-bottom {
    font-size: 11px;
    padding: 17px;
  }
  .pagefoot {
    font-size: 9px;
    flex-wrap: wrap;
    gap: 4px;
    padding: 22px 0 14px;
  }
  .prerequisite {
    gap: 12px;
    padding: 17px;
    font-size: 12px;
    margin-bottom: 23px;
  }
  .prerequisite .icon {
    width: 19px;
  }
  .prerequisite strong {
    font-size: 13px;
  }
  .prerequisite a {
    margin-left: 0;
  }
  .section-title {
    font-size: 20px;
  }
  .learning-row {
    padding: 20px 17px;
    gap: 14px;
  }
  .learning-row .number {
    width: 33px;
    height: 33px;
    font-size: 18px;
  }
  .learning-row h3 {
    font-size: 17px;
  }
  .learning-row p {
    font-size: 12px;
  }
  .learning-row .button {
    margin-top: 0;
  }
  .tags {
    flex-wrap: wrap;
  }
  .exercise-strip {
    padding: 18px;
    gap: 5px;
  }
  .lesson-note {
    padding: 19px;
    gap: 12px;
  }
  .lesson-note strong {
    font-size: 13px;
  }
  .lesson-note p {
    font-size: 12px;
  }
  .lead-material {
    gap: 12px;
  }
  .lead-material h3 {
    font-size: 16px;
  }
  .step-list a {
    font-size: 13px;
    gap: 14px;
  }
  .schedule {
    padding: 18px 14px;
  }
  .schedule th,
  .schedule td {
    font-size: 12px;
    padding: 12px 8px;
  }
  .schedule td:nth-child(3) {
    min-width: 160px;
  }
  .schedule td:last-child {
    min-width: 95px;
  }
  .intro {
    padding: 23px;
  }
  .intro h2 {
    font-size: 23px;
  }
  .intro-facts {
    display: grid;
    gap: 20px;
  }
  .intro p,
  .intro li {
    font-size: 14px;
  }
  .reader-heading {
    display: block;
    margin-top: 15px;
  }
  .reader-heading h1,
  .focused .reader-heading h1 {
    font-size: 28px;
    line-height: 1.45;
  }
  .focus-button {
    margin-top: 15px;
    font-size: 11px;
    min-height: 36px;
  }
  .return-link {
    font-size: 12px;
  }
  .reader-layout {
    display: block;
  }
  .prose,
  .focused .prose {
    font-size: 16px;
  }
  .prose h2 {
    font-size: 22px;
    scroll-margin-top: 130px;
  }
  .prose h3 {
    font-size: 18px;
    scroll-margin-top: 130px;
  }
  .prose table {
    font-size: 12px;
  }
  .prose th,
  .prose td {
    padding: 9px 10px;
  }
  .prose pre {
    padding: 16px;
    font-size: 12px;
  }
  .prose blockquote {
    font-size: 13px;
    padding: 7px 14px;
  }
  .goal-box {
    padding: 15px 17px;
  }
  .goal-box p {
    font-size: 13px;
  }
  .goal-box strong {
    font-size: 14px;
  }
  .reader-aside {
    display: none;
  }
  .reader-aside.toc-open {
    display: block;
    position: fixed;
    right: 15px;
    left: 15px;
    top: 158px;
    max-height: 65vh;
    overflow: auto;
    background: white;
    z-index: 24;
    padding: 25px;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 12px 30px #20391f20;
  }
  .reader-aside #toc a {
    font-size: 14px;
    padding: 9px 0;
  }
  .reading-end {
    padding: 20px;
  }
  .reading-end > div {
    display: grid;
    gap: 10px;
  }
  .focused .mobilebar #mobileToc {
    display: none;
  }
}
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
  main {
    animation: arrive 0.3s ease-out;
  }
  @keyframes arrive {
    from {
      opacity: 0.3;
      transform: translateY(6px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  a,
  button {
    transition:
      background-color 0.15s,
      color 0.15s;
  }
}

.reading-notes {
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding: 0 0 15px;
  margin-bottom: 24px;
}
.reading-notes summary {
  cursor: pointer;
  width: fit-content;
  padding: 4px 0;
}
.reading-notes blockquote {
  font-size: 13px;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.topic-grid .panel {
  min-width: 0;
}
.prose img {
  max-width: 100%;
  height: auto;
}
.prerequisite {
  flex-wrap: wrap;
}
.solution > summary {
  cursor: pointer;
  color: var(--green, #255c49);
  padding: 16px;
  background: #f1f5ef;
  border-radius: 10px;
}
.sidebar details summary {
  padding: 12px 4px;
  cursor: pointer;
}
@media (max-width: 760px) {
  .topic-grid {
    grid-template-columns: 1fr;
  }
}

.sidebar {
  overflow-y: auto;
}
.side-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 12px;
  margin: 3px 0;
  border-radius: 8px;
}
.side-link.active {
  color: var(--green);
  background: var(--pale);
  font-weight: 600;
}
.side-link .icon {
  flex-shrink: 0;
}
.page-footer {
  margin-top: 44px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.9;
}
.page-footer span {
  display: block;
}

/* Mermaid shares the local reader's SVG + collapsible source presentation. */
.prose .diagram-view {
  margin: 1.5rem 0 0.5rem;
  overflow-x: auto;
  text-align: center;
}
.prose .diagram-view svg {
  max-width: 100%;
  height: auto;
}
.prose .diagram-source {
  margin-bottom: 1.5rem;
}
.prose .diagram-source summary {
  cursor: pointer;
  color: var(--muted);
}
