:root {
  color-scheme: light;
  --red: #8c1515;
  --ink: #262626;
  --muted: #626262;
  --line: #dedbd7;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body { margin: 0; color: var(--ink); background: #f6f4f1; font-family: Arial, "PingFang SC", "Microsoft YaHei", sans-serif; line-height: 1.7; }
a { color: var(--red); text-underline-offset: 3px; }
a:hover { color: #5e1010; }
button { font: inherit; cursor: pointer; }
a:focus-visible, button:focus-visible, pre:focus-visible { outline: 3px solid #2563a6; outline-offset: 4px; }
.skip-link { position: absolute; top: -100px; left: 16px; background: white; padding: 8px 16px; z-index: 3; }
.skip-link:focus { top: 10px; }
.lab-header { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 15px max(20px, calc((100% - 940px) / 2)); color: white; background: var(--red); }
.course-home { color: white; font-family: Georgia, "Songti SC", serif; font-size: 21px; text-decoration: none; }
.course-home:hover { color: white; text-decoration: underline; }
.language-switch { display: flex; gap: 3px; padding: 3px; background: #701111; border-radius: 25px; }
.language-switch button { border: 0; border-radius: 20px; padding: 5px 13px; color: white; background: transparent; font-size: 13px; font-weight: 700; }
.language-switch button[aria-pressed="true"] { background: white; color: var(--red); }
main { width: min(100% - 40px, 940px); margin: 36px auto; padding: 42px 48px; border: 1px solid var(--line); background: white; }
.eyebrow { margin: 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: .1em; color: var(--red); }
h1, h2 { font-family: Georgia, "Songti SC", serif; font-weight: 500; line-height: 1.3; }
h1 { margin: 0; font-size: clamp(28px, 4vw, 40px); }
.summary { margin: 14px 0 24px; color: var(--muted); font-size: 17px; }
.section-nav { display: flex; flex-wrap: wrap; gap: 8px 22px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 13px 0; font-size: 14px; }
section { padding: 28px 0 0; }
h2 { font-size: 26px; margin: 0 0 15px; }
h3 { font-size: 17px; margin: 20px 0 8px; line-height: 1.5; }
p { margin: 8px 0 14px; }
ul, ol { padding-left: 24px; margin: 10px 0; }
li { margin: 7px 0; overflow-wrap: anywhere; }
.instruction { padding: 14px 18px; border-left: 3px solid var(--red); background: #fbf5f4; }
.task { padding: 1px 0 5px; }
.code-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 16px; }
.code-heading h3 { margin: 0; }
.code-heading a { font-size: 14px; }
pre { margin: 14px 0 24px; padding: 20px; border: 1px solid var(--line); border-radius: 4px; overflow: auto; max-width: 100%; background: #f7f8fa; font-size: 13px; line-height: 1.65; tab-size: 4; }
code { font-family: Menlo, Consolas, "Liberation Mono", monospace; }
.expected-output { background: #f4f7f3; border-left: 3px solid #5e7852; }
.lab-nav { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-top: 34px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 14px; }
.lab-nav a:first-child { margin-right: auto; }
footer { text-align: center; color: var(--muted); font-size: 13px; padding: 0 20px 28px; }
@media (max-width: 600px) {
  .lab-header { padding: 12px 16px; }
  .course-home { font-size: 17px; }
  main { width: calc(100% - 24px); margin: 18px auto; padding: 26px 20px; }
  .summary { font-size: 15px; }
  h2 { font-size: 23px; }
  h3 { font-size: 16px; }
  .section-nav { gap: 8px 18px; }
  pre { padding: 14px; font-size: 12px; }
}
@media print {
  body { background: white; font-size: 11pt; }
  .lab-header, .section-nav, .lab-nav, footer, .skip-link, .code-heading a { display: none; }
  main { width: 100%; margin: 0; border: 0; padding: 0; }
  section { padding-top: 20px; }
  h2, h3 { break-after: avoid; }
  pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 9pt; }
}
