:root {
  color-scheme: light;
  --paper: #f8f4ec;
  --light: #fffcf6;
  --ink: #2b211b;
  --muted: #695c50;
  --red: #942d2e;
  --red-dark: #752122;
  --line: #e1d5c5;
  --gold: #967243;
  --heading: "Songti SC", "Noto Serif SC", SimSun, serif;
  --sans: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.75 var(--sans); }
h1,h2,h3,p { margin: 0; }
h1,h2,h3 { font-family: var(--heading); line-height: 1.24; }
h1 { font-size: clamp(36px, 5.2vw, 76px); letter-spacing: .035em; }
h2 { font-size: clamp(28px, 3.2vw, 44px); }
h3 { font-size: 27px; }
p { color: var(--muted); }
a { color: inherit; text-decoration: none; }
button,input,select { font: inherit; }
button { cursor: pointer; color: inherit; }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 2px solid #b5732c; outline-offset: 4px; }
.skip { position: fixed; top: -100px; left: 15px; z-index: 5; background: white; padding: 10px; }
.skip:focus { top: 10px; }
.wrap { width: min(1200px, calc(100% - 96px)); margin-inline: auto; }
.top { background: var(--light); border-bottom: 1px solid var(--line); }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 78px; }
.brand { display: flex; align-items: center; gap: 11px; flex: none; line-height: 1.3; }
.brand strong { display: block; font: bold 23px/1.15 var(--heading); letter-spacing: .12em; }
.brand small { color: var(--muted); font-size: 11px; letter-spacing: .06em; }
nav { display: flex; align-self: stretch; align-items: stretch; gap: clamp(18px, 3vw, 44px); }
nav a { display: grid; place-items: center; position: relative; white-space: nowrap; font-size: 14px; }
nav a[aria-current] { color: var(--red); font-weight: 700; }
nav a[aria-current]::after { position: absolute; content: ""; bottom: 0; width: 100%; height: 2px; background: var(--red); }
.profile { white-space: nowrap; max-width: 130px; overflow: hidden; text-overflow: ellipsis; background: transparent; border: 1px solid var(--line); padding: 6px 13px; border-radius: 3px; font-size: 13px; }
main { min-height: 66vh; }
.hero { position: relative; overflow: hidden; isolation: isolate; background: #eee3d4; border-bottom: 1px solid var(--line); }
.hero-image { position: absolute; z-index: -2; height: 100%; width: 100%; inset: 0; object-fit: cover; object-position: center 27%; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, #f0e7da 0%, #f0e7da 17%, #f0e7daeb 34%, transparent 60%); }
.hero-inner { min-height: 524px; padding-block: 69px 66px; display: flex; align-items: center; position: relative; }
.hero-content { max-width: 650px; }
.eyebrow { color: var(--red); font-size: 12px; font-weight: 700; letter-spacing: .17em; display: flex; align-items: center; gap: 11px; }
.eyebrow::before { content: ""; width: 26px; height: 1px; background: currentColor; flex: none; }
.hero h1 { margin: 22px 0 15px; }
.hero h1 span { display: block; color: var(--red); font-size: .86em; }
.hero .subtitle { font: bold clamp(17px, 2vw, 25px)/1.35 var(--heading); color: #48362d; letter-spacing: .06em; }
.hero .intro { margin: 16px 0 24px; max-width: 420px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 9px 20px; border: 1px solid transparent; border-radius: 3px; font-size: 14px; font-weight: 650; }
.primary { color: white; background: var(--red); }
.primary:hover { background: var(--red-dark); }
.outline { background: #fff9ef66; border-color: #bca68b; }
.outline:hover, .profile:hover { background: #ede2d4; }
.icon { width: 19px; height: 19px; flex: none; vertical-align: middle; }
.hero-mark { position: absolute; right: 2px; bottom: 19px; color: #fff9e8; background: #3e1b15b8; padding: 4px 11px; font-size: 11px; letter-spacing: .12em; }
.quick { background: #fdf9f1; border-bottom: 1px solid var(--line); }
.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.quick-grid a { display: flex; align-items: center; gap: 14px; padding: 20px 18px; }
.quick-grid a + a { border-left: 1px solid var(--line); }
.quick-grid a:hover { background: #f4e9dc; }
.quick-grid strong { font-family: var(--heading); display: block; font-size: 19px; line-height: 1.4; }
.quick-grid small { color: var(--muted); display: block; line-height: 1.5; }
.quick-icon, .module-icon { width: 42px; height: 42px; display: grid; place-items: center; background: #f1e3d8; color: var(--red); border-radius: 50%; flex: none; }
.section { padding-block: 62px; }
.section + .section { border-top: 1px solid var(--line); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.section-head h2, .page-head h1 { margin-top: 8px; }
.section-head p:not(.eyebrow), .page-head p:not(.eyebrow) { margin-top: 8px; }
.text-link,.text-button { color: var(--red); background: none; border: 0; padding: 0; font-weight: 650; }
.text-link:hover,.text-button:hover { text-decoration: underline; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.opera-card { border: 1px solid var(--line); background: var(--light); display: flex; flex-direction: column; min-width: 0; }
.red { --tone: #8c272b; --tone-light: #f8e9e4; }
.green { --tone: #335c50; --tone-light: #e9f0e7; }
.ochre { --tone: #83582d; --tone-light: #f6e9d8; }
.card-art { height: 119px; background: var(--tone); color: #fff4df; position: relative; overflow: hidden; padding: 16px 18px; display: flex; justify-content: space-between; align-items: start; isolation: isolate; }
.card-art::after { content: ""; position: absolute; z-index: -1; inset: 0; background: repeating-radial-gradient(ellipse at 96% 155%, transparent 0 11px, #ffefd723 12px 13px, transparent 14px 24px); }
.card-art b { font: 72px/.95 var(--heading); opacity: .6; align-self: end; margin-right: 12px; }
.card-art small { letter-spacing: .12em; font-size: 11px; }
.card-body { padding: 18px; display: grid; gap: 8px; flex: 1; align-content: start; }
.card-body .text-link { justify-self: start; margin-top: 5px; }
.tag { display: inline-block; width: fit-content; padding: 2px 9px; color: var(--tone, #684731); background: var(--tone-light, #f0e6d8); border-radius: 2px; font-size: 12px; }
.page-head { padding-block: 42px 28px; }
.page-head h1 { font-size: clamp(35px, 5vw, 60px); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.pills { display: flex; gap: 7px; flex-wrap: wrap; }
.pill { background: var(--light); border: 1px solid var(--line); padding: 6px 13px; border-radius: 3px; }
.pill[aria-pressed=true] { color: white; background: var(--red); border-color: var(--red); }
input { min-height: 42px; border: 1px solid #cdbda8; background: var(--light); color: var(--ink); border-radius: 3px; padding: 7px 12px; }
.search { margin-left: auto; width: min(100%, 285px); }
.list-section { margin-top: 32px; }
.list-section h2 { font-size: 27px; margin-bottom: 14px; }
.ext-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.ext-card,.panel { background: var(--light); border: 1px solid var(--line); padding: 21px; }
.ext-card { display: block; }
.ext-card:hover,.module:hover { border-color: #ac7f63; }
.ext-card h3 { font-size: 22px; }
.ext-card p { font-size: 13px; }
.page-bottom { padding-bottom: 60px; }
.detail-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-block: 18px 22px; }
.detail-head h1 { font-size: clamp(36px, 5vw, 60px); margin: 9px 0; }
.detail-head p { max-width: 640px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 14px; }
.panel h2 { font-size: 26px; margin-bottom: 10px; }
.panel h3 { font-size: 21px; }
.panel .actions { margin-top: 14px; }
.note { background: #f3eadb; border-left: 3px solid #a97d4a; padding: 10px 13px; font-size: 13px; color: #66513c; }
.resource-list { display: grid; gap: 8px; margin-top: 14px; }
.resource-row { padding: 10px 0; border-top: 1px solid var(--line); display: grid; gap: 9px; }
.resource-row p { font-size: 13px; }
.resource-row audio { width: min(100%, 375px); height: 40px; }
.score { display: flex; flex-wrap: wrap; gap: 4px; font: 600 16px/1.65 ui-monospace, monospace; }
.score span { min-width: 24px; text-align: center; background: #eee6d9; border-bottom: 1px solid #cab69b; }
.stage { position: relative; isolation: isolate; color: #ffeed5; background: radial-gradient(ellipse at 50% 20%, #6c4130, #241618 71%); border: 1px solid #552f27; overflow: hidden; }
.stage::before,.stage::after { content: ""; position: absolute; z-index: -1; inset-block: 0; width: 23%; background: repeating-linear-gradient(95deg, #451518, #7e282d 15%, #522026 28%); clip-path: polygon(0 0,100% 0,72% 25%,49% 45%,30% 100%,0 100%); opacity: .8; }
.stage::before { left: 0; }
.stage::after { right: 0; transform: scaleX(-1); }
.stage-content { text-align: center; padding: 38px 17%; min-height: 205px; }
.stage-content .eyebrow { color: #efc191; justify-content: center; }
.stage-content h1,.stage-content h2 { margin: 10px 0; font-size: clamp(30px, 5vw, 54px); }
.stage-content p { color: #f7e3cb; }
.setup { display: grid; gap: 24px; margin-top: 22px; }
.setup h2 { font-size: 25px; margin-bottom: 10px; }
.module { text-align: left; background: var(--light); border: 1px solid var(--line); padding: 17px; }
.module strong { font: bold 21px/1.25 var(--heading); display: block; margin: 8px 0 5px; }
.module p { font-size: 13px; }
.module[aria-pressed=true] { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.quiz { width: min(100%, 850px); margin: 20px auto 0; }
.quiz-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
progress { width: 100%; height: 8px; accent-color: var(--red); }
.quiz .note { margin: 10px 0 13px; }
.quiz audio { width: 100%; max-width: 475px; height: 43px; }
.options { display: grid; gap: 8px; margin: 15px 0; }
.options label { display: flex; align-items: center; padding: 9px 12px; border: 1px solid var(--line); cursor: pointer; gap: 9px; }
.options label:has(input:checked) { border-color: var(--red); background: #f8ece6; }
.options input { min-height: 0; accent-color: var(--red); }
.feedback { margin: 12px 0; padding: 14px; background: #edf2e9; border-left: 3px solid #42624b; }
.feedback.wrong { background: #f8e9e2; border-color: #9a3f34; }
.feedback .score { margin-top: 6px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 10px 0 18px; }
.stat { padding: 15px; border: 1px solid var(--line); background: var(--light); }
.stat b { display: block; color: var(--red); font: bold 35px/1.3 var(--heading); }
.history { display: grid; gap: 9px; margin-top: 13px; }
.history details { background: var(--light); border: 1px solid var(--line); padding: 12px 15px; }
summary { cursor: pointer; }
.history ul { padding-left: 20px; }
.road { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.road article { border-top: 2px solid var(--red); padding: 14px 0; }
.road h3 { margin-bottom: 7px; font-size: 23px; }
.road ol { margin: 0; padding-left: 22px; color: var(--muted); }
footer { border-top: 1px solid var(--line); background: #eee6da; }
.foot { display: flex; justify-content: space-between; gap: 12px; padding-block: 20px; color: var(--muted); font-size: 12px; }
dialog { width: min(490px, calc(100% - 32px)); border: 1px solid var(--line); background: var(--light); padding: 27px; color: var(--ink); }
dialog::backdrop { background: #2317139c; }
dialog h2 { margin: 8px 0; font-size: 29px; }
dialog label { display: block; margin-top: 13px; }
dialog input { width: 100%; margin-top: 5px; }
#profile-form .actions { margin-top: 14px; }
.profile-exits { font-size: 13px; }
.profile-error { margin-top: 10px; color: var(--red-dark); }
.profile-local { margin-top: 13px; font-size: 12px; }
@media (max-width: 900px) {
  .wrap { width: calc(100% - 48px); }
  .hero-inner { min-height: 460px; }
  .hero-image { object-position: 61% 25%; }
  .ext-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .wrap { width: calc(100% - 32px); }
  .top-inner { flex-wrap: wrap; column-gap: 8px; row-gap: 0; min-height: 0; padding-top: 10px; }
  .top nav { order: 3; width: 100%; justify-content: space-between; gap: 3px; min-height: 45px; }
  nav a { font-size: 13px; }
  .brand img { width: 34px; height: 34px; }
  .brand strong { font-size: 19px; }
  .hero-inner { min-height: 435px; padding-block: 38px 45px; align-items: end; }
  .hero-image { object-position: 72% center; }
  .hero::before { background: linear-gradient(90deg,#f0e7daf7, #f0e7dae3 38%,#f0e7da44 82%), linear-gradient(0deg,#f0e7da,transparent 65%); }
  .hero-content { max-width: min(100%, 350px); }
  .hero h1 span { font-size: clamp(26px, 7.4vw, 34px); }
  .hero h1 { margin-block: 13px; }
  .hero-mark { display: none; }
  .quick-grid a { flex-direction: column; gap: 6px; text-align: center; padding: 13px 3px; }
  .quick-grid strong { font-size: 15px; }
  .quick-grid small { display: none; }
  .quick-icon { width: 34px; height: 34px; }
  .section { padding-block: 38px; }
  .section-head { align-items: start; flex-wrap: wrap; gap: 8px; }
  .grid,.detail-grid,.road { grid-template-columns: 1fr; }
  .ext-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ext-card { padding: 12px; }
  .detail-head { align-items: start; flex-direction: column; gap: 10px; }
  .search { margin-left: 0; }
  .foot { flex-direction: column; gap: 3px; }
}
@media print {
  .top,footer,.actions,.text-link,.skip { display: none; }
  body,.panel,.stat { background: white; }
  .wrap { width: 100%; }
}
