:root {
  color-scheme: light;
  --paper: #f5f4ed;
  --surface: #fffefa;
  --ink: #162d25;
  --muted: #52645a;
  --green: #205b46;
  --line: #dcded3;
  --mist: #e9eee3;
  --warm: #f2e8cb;
  font: 16px/1.65 system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
.wrap { width: min(100% - 40px, 940px); margin-inline: auto; }
.top { border-bottom: 1px solid var(--line); background: var(--surface); }
.bar, .section-head, .footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bar { min-height: 68px; }
.bar nav, .footer div { display: flex; gap: 16px; align-items: center; }
a { color: var(--green); }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 700; text-decoration: none; white-space: nowrap; }
.brand b { border-radius: 10px; background: var(--green); color: white; padding: 5px 8px; font-variant-numeric: tabular-nums; }
.bar nav a { font-size: .9rem; text-decoration: none; padding: 10px 0; white-space: nowrap; }
.intro { display: grid; grid-template-columns: 1fr 228px; align-items: center; gap: 26px; margin-block: 26px; padding: clamp(20px, 5vw, 44px); background: var(--mist); border-radius: 20px; }
h1, h2, h3, h4, p { margin: 0 0 .65em; }
h1 { font-size: clamp(2.1rem, 6vw, 3.4rem); line-height: 1.13; letter-spacing: -.045em; }
h2 { font-size: 1.33rem; line-height: 1.32; }
h3 { font-size: 1.12rem; }
h4 { font-size: 1rem; }
p { color: var(--muted); }
.kicker, .section-head span, .overview > span { font-size: .83rem; color: var(--muted); }
.kicker { font-weight: 700; letter-spacing: .05em; }
.overview { display: grid; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.overview strong { font-size: 2rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.overview small { font-size: .95rem; color: var(--muted); font-weight: 500; }
progress { width: 100%; height: 9px; margin: 4px 0; accent-color: var(--green); }
button, textarea, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid #7d682a; outline-offset: 3px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 10px 16px; min-height: 46px; background: var(--green); border: 1px solid var(--green); border-radius: 10px; color: white; text-decoration: none; font-weight: 650; }
.button[hidden] { display: none; }
.button:disabled { opacity: .55; }
.intro .button { margin-top: 8px; }
.secondary { color: var(--green); background: var(--surface); border-color: var(--line); }
.calendar { margin-bottom: 24px; }
.section-head h2 { margin: 0; }
#days { display: grid; grid-template-columns: repeat(15,minmax(0,1fr)); gap: 6px; margin-top: 9px; }
#days a { display: grid; place-items: center; min-height: 44px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; text-decoration: none; font-variant-numeric: tabular-nums; }
#days a.done { background: var(--mist); }
#days a[aria-current="step"] { background: var(--green); color: white; font-weight: 700; }
#day { scroll-margin-top: 12px; }
.day-head, .panel { padding: clamp(17px, 4vw, 30px); background: var(--surface); border: 1px solid var(--line); border-radius: 15px; margin-bottom: 14px; }
.day-head { border-top: 4px solid var(--green); }
.day-head h2 { font-size: clamp(1.35rem, 4vw, 1.85rem); }
.badge { display: inline-block; margin-bottom: 10px; padding: 3px 9px; border-radius: 6px; background: var(--warm); font-size: .83rem; font-weight: 700; }
.schedule { margin: 0; font-size: .88rem; }
details summary { min-height: 44px; cursor: pointer; font-weight: 650; padding: 8px 0; }
details ul, details ol, .question ol { padding-left: 1.45rem; }
li + li { margin-top: .4em; }
.question { padding: 14px 0 18px; border-top: 1px solid var(--line); scroll-margin-top: 12px; }
.question:first-of-type { margin-top: 12px; }
.prompt { color: var(--ink); white-space: pre-wrap; }
.option { display: flex; gap: 10px; width: 100%; min-height: 46px; margin-top: 6px; text-align: left; padding: 8px 12px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 9px; }
.option[aria-pressed="true"] { background: var(--mist); border-color: var(--green); }
.option.correct { background: #e4efe0; border-color: #468268; }
.option.wrong { background: #fae9e2; border-color: #a34e41; }
.option b { min-width: 1em; }
.feedback { margin: 10px 0 0; padding: 10px 13px; background: var(--mist); border-radius: 8px; color: var(--ink); }
label.field { display: grid; gap: 6px; margin: 12px 0; font-weight: 650; }
textarea { width: 100%; min-height: 110px; resize: vertical; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font-size: 16px; font-weight: 400; }
pre { overflow-x: auto; border-radius: 8px; background: var(--mist); padding: 12px; }
.code-task { white-space: pre-wrap; color: var(--ink); }
.code-instructions code {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  overflow-wrap: anywhere;
}
#code-editor {
  min-height: 176px;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  line-height: 1.5;
  tab-size: 4;
}
.code-status { margin-block: 10px 6px; font-weight: 650; }
.code-status:empty { display: none; }
.code-test {
  display: grid;
  gap: 2px 10px;
  grid-template-columns: max-content minmax(0, 1fr);
  margin-block: 6px;
  padding: 8px 10px;
  background: var(--mist);
  border-radius: 8px;
  font-size: .9rem;
}
.code-test.fail { background: #fae9e2; }
.code-test strong { color: var(--green); }
.code-test.fail strong { color: #813c31; }
.code-test pre { grid-column: 1 / -1; margin: 2px 0; padding: 0; background: transparent; }
#code-results pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.check { display: flex; align-items: flex-start; gap: 8px; min-height: 44px; padding-block: 9px; }
.check input { width: 20px; height: 20px; accent-color: var(--green); flex: 0 0 auto; margin-top: 3px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.small, .source, .footer { font-size: .83rem; color: var(--muted); }
.source { margin-top: 8px; }
.footer { padding-block: 4px 26px; align-items: flex-start; }
.link { background: none; border: 0; color: var(--green); padding: 8px 0; text-decoration: underline; min-height: 44px; }
#status { padding-top: 8px; }
@media (max-width: 680px) {
  .wrap { width: calc(100% - 28px); }
  .intro { grid-template-columns: 1fr; gap: 16px; margin-block: 15px 20px; }
  .overview { grid-template-columns: 1fr auto; align-items: center; padding: 10px 13px; }
  .overview progress { grid-column: 1 / -1; }
  .overview strong { font-size: 1.25rem; }
  #days { grid-template-columns: repeat(5,minmax(0,1fr)); }
  .bar { min-height: 58px; }
  .bar nav { gap: 12px; }
}
@media (max-width: 380px) { .bar nav { gap: 8px; } .bar nav a { font-size: .81rem; } }
