:root {
  color-scheme: light;
  --paper: #f6f5ec;
  --ink: #18372e;
  --muted: #52645b;
  --line: #d7dfd2;
  --green: #205b4c;
  --white: #fffefb;
  --gold: #ffe090;
  --radius: 19px;
  font-family: "PingFang HK", "Microsoft JhengHei", "Noto Sans CJK TC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid #a45117;
  outline-offset: 3px;
}
.wrap { width: min(1440px, calc(100% - 64px)); margin-inline: auto; }
.mast { background: #173e37; color: #fffef0; }
.mast a { display: inline-block; padding-block: 17px; text-decoration: none; font-weight: 800; letter-spacing: .075em; }
.sr, .skip:not(:focus) {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.skip:focus { position: absolute; z-index: 10; top: 8px; left: 8px; background: white; padding: .7em; }
.hero {
  position: relative; isolation: isolate; overflow: hidden; margin-top: 34px; padding: clamp(24px, 7vw, 88px);
  border-radius: 27px; background: #dce8d7; border: 1px solid #ccd9c9;
}
.hero-inner { position: relative; max-width: 680px; }
.hero h1, .lesson-head h1 { font-family: "Songti TC", "Noto Serif CJK TC", "PMingLiU", serif; letter-spacing: .045em; }
.hero h1 { font-size: clamp(2.1rem, 5.5vw, 5rem); margin: .2em 0; line-height: 1.12; }
.hero p { font-size: 1.07rem; line-height: 1.75; }
.hero p:first-child { font-weight: 800; margin-top: 0; letter-spacing: .16em; }
.hero-link { background: #194d40; color: white; border-radius: 9px; display: inline-block; padding: .75em 1em; text-decoration: none; font-weight: 700; }
.hero-link:hover { background: #103a31; }
.book-art { position: absolute; z-index: -1; width: 37%; height: 85%; bottom: -15%; right: -4%; opacity: .7; transform: rotate(-13deg); }
.book-art i { display: block; position: absolute; width: 72%; height: 82%; border-radius: 12px; }
.book-art i:nth-child(1) { background: #779c80; top: 5%; left: 17%; transform: rotate(14deg); }
.book-art i:nth-child(2) { background: #deb568; top: 13%; left: 22%; transform: rotate(27deg); }
.book-art i:nth-child(3) { background: repeating-linear-gradient(#f5edcf 0 25px, #d8cba4 26px 27px); top: 19%; left: 12%; border: 10px solid #f5edcf; }
.contents { padding-block: 26px 50px; }
.contents h2, .notes h2 { margin: 0 0 18px; font-size: 1.5rem; }
.contents ol { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3,minmax(0, 1fr)); gap: 13px; }
.card { display: grid; grid-template-columns: auto 1fr auto; gap: 13px; height: 100%; align-items: center; background: var(--white); border: 1px solid var(--line); padding: 16px; border-radius: 13px; text-decoration: none; line-height: 1.5; }
.card:hover { background: #e8f0e3; border-color: #859e8e; }
.card-num { display: grid; place-items: center; background: #e5ece0; border-radius: 9px; min-width: 2.4em; height: 2.4em; font-weight: 800; font-variant-numeric: tabular-nums; }
.card strong, .card small { display: block; }
.card small { margin-top: 2px; color: var(--muted); }
.arrow { color: var(--green); }
.lesson-head { padding-block: 23px 18px; }
.back { color: var(--green); text-underline-offset: 4px; }
.lesson-meta { margin-top: 17px; color: var(--muted); font-size: .95rem; }
.lesson-meta span { padding-inline: .35rem; }
.lesson-head h1 { margin: 6px 0 0; font-size: clamp(1.75rem, 4vw, 3.4rem); line-height: 1.25; }
.jump { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.jump a { padding: .48em .8em; border-radius: 999px; background: #e2ece0; text-decoration: none; font-size: .88rem; font-weight: 700; }
.jump a:hover { text-decoration: underline; }
.workbench { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 17px; }
.panel { min-width: 0; display: flex; flex-direction: column; height: clamp(520px, 73vh, 790px); border: 1px solid var(--line); background: var(--white); border-radius: var(--radius); overflow: hidden; }
.panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; padding: 14px 19px; border-bottom: 1px solid var(--line); background: #e5eee2; }
.panel-head h2 { font-size: 1.16rem; margin: 0; }
.panel-head output { color: var(--muted); font-size: .83rem; }
.panel-body { flex: 1; min-height: 0; overflow: auto; scrollbar-gutter: stable; padding: clamp(14px, 2.2vw, 32px); scroll-padding-block: 16px; }
.passage-block { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 1.125rem; line-height: 1.93; margin: 0 0 1.12em; }
.passage-block:last-child { margin-bottom: 0; }
mark { color: inherit; background: var(--gold); border-radius: 3px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.question-group h3 { margin: 0 0 13px; color: var(--green); }
.question-group + .question-group { margin-top: 28px; }
.question { padding: 15px 0 20px; border-top: 1px solid var(--line); }
.question fieldset { padding: 0; min-width: 0; border: 0; margin: 0 0 11px; }
.question legend { padding: 0; font-size: 1.04rem; font-weight: 750; white-space: pre-wrap; line-height: 1.66; overflow-wrap: anywhere; }
.qnum { color: var(--green); }
.inputs { display: grid; gap: 7px; margin-top: 10px; }
.option { display: grid; grid-template-columns: auto auto 1fr; gap: .55em; align-items: start; cursor: pointer; padding: .6em .7em; border: 1px solid var(--line); border-radius: 9px; line-height: 1.6; }
.option:hover { background: #f1f5ec; }
.option:has(input:checked) { border-color: #3d7565; background: #e3efe7; }
.option input { margin: .34em 0 0; accent-color: var(--green); width: 1.05rem; height: 1.05rem; }
.letter { color: var(--green); font-weight: 800; }
.option-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.blank { display: flex; align-items: center; gap: .7em; font-size: .92rem; }
textarea, input[type=text] { font: inherit; color: var(--ink); border: 1px solid #82988b; border-radius: 7px; padding: .57em .65em; background: #fff; min-width: 0; }
.blank input { flex: 1; }
textarea { width: 100%; resize: vertical; }
button { cursor: pointer; background: #205b4c; color: white; border: 1px solid transparent; border-radius: 7px; padding: .58em .85em; font: inherit; font-weight: 700; }
button:hover { background: #154637; }
.secondary { color: var(--green); background: var(--white); border-color: #809688; }
.secondary:hover { color: #143f34; background: #e8efe4; }
.feedback { margin-top: 10px; padding: .75em .85em; border: 1px solid #c6d4c7; background: #edf4eb; border-radius: 9px; line-height: 1.65; }
.feedback[data-state="wrong"] { border-color: #d5af7d; background: #fff2da; }
.feedback[data-state="empty"] { background: #f6f3ec; }
.feedback p { margin: .45em 0 .65em; }
.feedback p:empty { display: none; }
.notes { margin-block: 22px 0; padding: clamp(16px, 2.8vw, 34px); background: #e8eee1; border: 1px solid var(--line); border-radius: var(--radius); }
.notes dl { margin: 0; display: grid; grid-template-columns: repeat(3,minmax(0, 1fr)); gap: 12px; }
.notes dl div { background: var(--white); border-radius: 10px; padding: 13px 15px; }
.notes dt { font-weight: 800; margin-bottom: .35em; }
.notes dd { margin: 0; font-size: 1rem; line-height: 1.7; }
.pagination { display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: center; text-align: center; gap: 5px; padding: 22px 0 30px; }
.pagination a { padding: .45em .1em; color: var(--green); text-underline-offset: 4px; font-weight: 700; }
@media (max-width: 1000px) {
  .wrap { width: calc(100% - 36px); }
  .contents ol, .notes dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .wrap { width: calc(100% - 24px); }
  .hero { margin-top: 15px; }
  .book-art { opacity: .25; }
  .workbench, .contents ol, .notes dl { grid-template-columns: minmax(0, 1fr); }
  .panel { height: auto; }
  .reading .panel-body { max-height: 60vh; }
  .quiz { overflow: visible; scrollbar-gutter: auto; }
  .passage-block { font-size: 1.06rem; }
}
