.official-feature {
  color: #204a39;
  background: #e5ecdd;
  border-top: 4px solid #39735b;
  border-radius: 3px;
  padding: clamp(24px, 3vw, 44px);
  box-shadow: 8px 8px 0 #f0efe5;
}
.official-label, .official-level { color: #37634e; font-weight: 700; }
.official-feature .official-label, .official-intro .official-label { font-size: .84rem; margin: 0 0 1rem; }
.official-feature h2, .official-intro h1, .official-stage h3 { font-family: "Songti SC", Georgia, serif; }
.official-feature h2 { font-size: clamp(1.7rem, 3vw, 2.7rem); line-height: 1.28; margin: 0; }
.official-feature p { margin: .8rem 0; line-height: 1.75; }
.official-feature .official-facts { font-weight: 700; }
.official-actions, .official-tools { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem 1.4rem; }
.official-actions { margin-top: 1.25rem; }
.official-actions a:not(.a-btn), .official-tools a, .official-stage a, .official-toc a, .official-back a, .course-content a {
  color: #205b47; text-decoration: underline; text-underline-offset: .2em;
}
.official-secondary { margin-top: 1rem; }
.official-compact { margin: 1.5rem 0 2rem; }
.official-compact h2 { font-size: clamp(1.4rem, 2.4vw, 2rem); }
.official-overview { max-width: 60rem; margin: 0 auto 4rem; }
.official-intro { padding: clamp(2rem, 5vw, 4.5rem) 0 1.6rem; }
.official-intro h1 { font-size: clamp(2rem, 4.8vw, 3.6rem); margin: 0; }
.official-intro p, .official-stage p { max-width: 48em; }
.official-tools { padding: 1rem 0; border-block: 1px solid #d2ded4; }
.official-overview > h2 { margin: 2rem 0 .6rem; }
.official-stage { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; padding: 1.5rem 0; border-bottom: 1px solid #d2ded4; }
.official-stage h3 { font-size: 1.6rem; margin: .35rem 0; }
.official-stage ol { margin: 0; padding-left: 1.5rem; }
.official-stage a, .official-toc a { display: inline-block; padding: .32rem 0; }
.official-reader { display: grid; grid-template-columns: minmax(10rem, 14rem) minmax(0, 48rem); gap: clamp(2rem, 5vw, 5rem); padding-block: 2.5rem 4rem; justify-content: center; }
.official-toc { position: sticky; top: 6.5rem; align-self: start; }
.official-toc > * { display: block; margin-bottom: .6rem; }
.official-toc ol { padding-left: 1.4rem; }
.official-reader .course-content { min-width: 0; font-size: 1.02rem; line-height: 1.85; overflow-wrap: anywhere; }
.course-content h1 { font-size: clamp(1.9rem, 3.5vw, 3rem); line-height: 1.3; }
.course-content h2 { margin: 0 0 1rem; font-size: 1.65rem; }
.course-content h3 { margin: 1.6rem 0 .5rem; font-size: 1.2rem; }
.course-content p { margin: .85rem 0; }
.course-content pre { white-space: pre; overflow: auto; padding: 1rem; border-radius: .4rem; background: #edf3ed; color: #1c3730; }
.course-content code { font-family: ui-monospace, monospace; font-size: .92em; }
.course-content table { display: block; overflow: auto; max-width: 100%; border-collapse: collapse; }
.course-content th, .course-content td { border: 1px solid #d3dfd4; padding: .45rem; text-align: left; }
.course-section, .course-content dt, .official-stage, #courses { scroll-margin-top: 7rem; }
.course-section { padding: 2rem 0; border-top: 1px solid #d3dfd4; }
.course-exercise, .course-reading { margin: 1.2rem 0; padding: .9rem 1.1rem; }
.course-exercise { background: #edf5ec; border-left: 3px solid #468267; }
.course-reading { border: 1px solid #d3dfd4; border-radius: .35rem; }
.course-exercise h3:first-child, .course-reading h3:first-child { margin-top: 0; }
.course-exercise summary { cursor: pointer; font-weight: 650; }
.course-pager { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .65rem; margin: 1.25rem 0; }
.course-diagram { margin: 1rem 0; overflow: auto; }
.course-diagram svg { display: block; width: 100%; min-width: 32rem; height: auto; }
.course-content dt { margin-top: 1rem; font-weight: 700; }
.course-content dd { margin: .2rem 0 .8rem; }
@media (max-width: 760px) {
  .home-hero:has(.official-feature) { display: grid; gap: .85rem; padding: 1.3rem 0 1.6rem; }
  .home-hero:has(.official-feature) .a-hero-copy { display: contents; }
  .home-hero:has(.official-feature) .a-hero-copy > :is(.home-eyebrow,p) { display: none; }
  .home-hero:has(.official-feature) h1 { grid-row: 1; margin: 0; font-size: clamp(1.8rem, 7vw, 2.5rem); }
  .home-hero .official-feature { grid-row: 2; padding: 1.1rem 1.25rem; }
  .home-hero .official-secondary { grid-row: 3; margin: .25rem 0 0; }
  .official-feature .official-label { margin-bottom: .45rem; }
  .official-feature h2 { font-size: 1.65rem; }
  .official-actions { margin-top: .75rem; }
  .official-stage, .official-reader { grid-template-columns: minmax(0, 1fr); gap: .75rem; }
  .official-toc { position: static; border-bottom: 1px solid #d3dfd4; }
  .official-toc ol { display: flex; flex-wrap: wrap; gap: .25rem 1.1rem; list-style: none; padding: 0; }
  .official-reader { padding: 1.2rem 0 3rem; }
}

/* Course diagrams keep their labels legible on narrow screens. */
.learning-visual { margin: 1.5rem 0; max-width: 560px; min-width: 0; container-type: inline-size; }
.learning-visual .diagram-frame { max-width: 100%; overflow-x: auto; }
.learning-visual .diagram-frame:focus-visible { outline: 2px solid #286b4f; outline-offset: 3px; }
.learning-visual svg { display: block; width: 100%; height: auto; }
.learning-visual figcaption { color: #526c60; font-size: .92rem; line-height: 1.6; margin-top: .55rem; }
@container (max-width: 343px) {
  .learning-visual figcaption::after { content: "图可左右滑动；键盘聚焦后可使用方向键。"; display: block; color: #526c60; font-size: .85rem; margin-top: .4rem; }
}
@media print {
  .learning-visual .diagram-frame { overflow-x: visible; }
  .learning-visual svg { min-width: 0 !important; }
  .learning-visual figcaption::after { display: none; }
}

/* 首页：以学习路径为视觉焦点，保留现有内容与操作。 */
.homepage .home-hero { gap: clamp(2rem, 6vw, 5rem); padding: clamp(3rem, 6vw, 5.5rem) 0; }
.homepage .home-hero h1 { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif; font-size: clamp(2.8rem, 5vw, 4.5rem); line-height: 1.18; letter-spacing: -.055em; }
.homepage .home-hero h1 em { font-family: inherit; color: #176e5b; }
.homepage .home-hero .home-eyebrow { color: #176e5b; letter-spacing: .04em; font-size: .78rem; }
.homepage .home-hero .a-hero-copy > p { font-size: 1.05rem; line-height: 1.85; color: #4d625b; }
.homepage .home-hero .official-feature { position: relative; overflow: hidden; border: 1px solid #cce2d9; border-radius: 24px; background: #e8f4ee; box-shadow: none; padding: clamp(2rem, 4vw, 3.5rem); }
.homepage .home-hero .official-feature::after { content: "L0 → L5"; display: block; margin-top: 2.8rem; padding-top: 1rem; border-top: 1px solid #bfdacf; color: #376b5a; font-size: .8rem; letter-spacing: .12em; font-weight: 700; }
.homepage .official-feature h2 { font-family: inherit; font-size: clamp(2rem, 3.2vw, 2.8rem); letter-spacing: -.04em; }
.homepage .official-feature p { max-width: 31rem; }
.homepage .official-actions .a-primary { border-radius: 999px; padding-inline: 1.5rem; }
.homepage .home-discover { gap: 12px; border: 0; }
.homepage .home-discover a, .homepage .home-discover a+a { border: 1px solid #dbe8df; border-radius: 16px; padding: 22px; background: #f6faf7; }
.homepage .home-discover a:hover { background: #eaf4ee; }
.homepage .home-discover strong { font-family: inherit; font-size: 1.12rem; }
.homepage .home-courses .free-course { border-radius: 16px; }
.homepage .home-courses .a-section-head h2, .homepage .a-section h2.a-serif, .homepage .home-courses .free-course-copy h3 { font-family: inherit; }
.homepage .a-level-card { border-radius: 16px; }
@media (max-width: 760px) {
 .homepage .home-hero:has(.official-feature) { gap: 1.4rem; padding: 2.3rem 0 2rem; }
 .homepage .home-hero:has(.official-feature) .a-hero-copy { display: block; }
 .homepage .home-hero:has(.official-feature) .a-hero-copy > :is(.home-eyebrow,p) { display: block; }
 .homepage .home-hero:has(.official-feature) h1 { font-size: clamp(2.15rem, 9vw, 3rem); margin: 0; }
 .homepage .home-hero .a-hero-copy > p { font-size: .94rem; margin: 1rem 0 0; }
 .homepage .home-hero .official-feature { padding: 1.5rem; border-radius: 20px; }
 .homepage .home-hero .official-feature::after { margin-top: 1.4rem; }
 .homepage .home-discover { grid-template-columns: 1fr; gap: 8px; }
 .homepage .home-discover a, .homepage .home-discover a+a { display: grid; grid-template-columns: 2.2rem 1fr; padding: 16px; border: 1px solid #dbe8df; }
 .homepage .home-discover-no { grid-row: 1 / 3; }
}
