:root {
  color-scheme: light dark;
  --bg: #eef3f7;
  --surface: #ffffff;
  --surface-2: #f4f7fa;
  --ink: #17212b;
  --muted: #607080;
  --line: #d8e1e8;
  --navy: #123b5d;
  --navy-2: #0a2b45;
  --teal: #087e78;
  --teal-soft: #e1f4f1;
  --amber: #a65a00;
  --amber-soft: #fff0d8;
  --danger: #a53932;
  --shadow: 0 12px 34px rgba(20, 48, 68, .09);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c151d;
    --surface: #121f29;
    --surface-2: #192a36;
    --ink: #edf4f7;
    --muted: #a5b5c1;
    --line: #2a3d4a;
    --navy: #82b9dc;
    --navy-2: #07121a;
    --teal: #57d0c5;
    --teal-soft: #123d3b;
    --amber: #f2b55f;
    --amber-soft: #4a3214;
    --danger: #ff8f87;
    --shadow: 0 12px 34px rgba(0, 0, 0, .28);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.65 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; }
a { color: inherit; }
button, input, select { font: inherit; }
button, .button { min-height: 44px; }
.shell { width: min(1180px, 100%); margin: 0 auto; padding: 24px clamp(16px, 4vw, 40px) 64px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: .9rem; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--teal); }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: white; background: var(--navy-2); font-weight: 900; letter-spacing: -.05em; }
.masthead { display: grid; grid-template-columns: 1.25fr .75fr; gap: 28px; align-items: end; padding: clamp(24px, 5vw, 52px); border-radius: 28px; color: white; background: radial-gradient(circle at 85% 5%, rgba(86, 206, 196, .35), transparent 30%), linear-gradient(135deg, var(--navy-2), #174d70); box-shadow: var(--shadow); }
.eyebrow { margin: 0 0 8px; color: #85ddd6; font-size: .78rem; font-weight: 800; letter-spacing: .14em; }
h1 { margin: 0; font-size: clamp(2rem, 5vw, 3.7rem); line-height: 1.1; letter-spacing: -.04em; text-wrap: balance; }
.lede { max-width: 42rem; margin: 16px 0 0; color: #d9e8ef; font-size: 1rem; }
.masthead-meta { border-left: 1px solid rgba(255,255,255,.24); padding-left: 24px; }
.masthead-meta strong { display: block; font-size: 2.4rem; line-height: 1; }
.masthead-meta span { color: #c4d8e2; font-size: .9rem; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 40px 0 14px; }
.section-head h2 { margin: 0; font-size: clamp(1.35rem, 3vw, 1.8rem); }
.section-head p { margin: 0; color: var(--muted); }
.course-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.course-card { position: relative; min-width: 0; display: flex; flex-direction: column; min-height: 230px; padding: 26px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); text-decoration: none; overflow: hidden; }
.course-card::after { content: attr(data-code); position: absolute; right: -8px; bottom: -28px; color: var(--surface-2); font-size: 6rem; font-weight: 950; letter-spacing: -.08em; }
.course-card > * { position: relative; z-index: 1; }
.course-card .tag { align-self: flex-start; border-radius: 999px; padding: 4px 10px; color: var(--teal); background: var(--teal-soft); font-size: .78rem; font-weight: 800; }
.course-card h3 { margin: 28px 0 4px; font-size: 1.55rem; }
.course-card p { margin: 0; color: var(--muted); }
.course-card .enter { margin-top: auto; color: var(--teal); font-weight: 800; }
.course-card:hover { border-color: var(--teal); transform: translateY(-2px); }
.course-card:focus-visible, .button:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
.toolbar { position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 calc(-1 * clamp(16px, 4vw, 40px)) 24px; padding: 12px clamp(16px, 4vw, 40px); border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(14px); }
.toolbar label { color: var(--muted); font-size: .9rem; }
select, input[type="search"] { min-height: 44px; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; color: var(--ink); background: var(--surface); }
input[type="search"] { flex: 1 1 230px; }
.paper-list { display: grid; gap: 12px; }
.paper { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 18px 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); text-decoration: none; }
.paper:hover { border-color: var(--teal); }
.paper h3 { margin: 0; font-size: 1.02rem; line-height: 1.45; }
.paper-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; color: var(--muted); font-size: .82rem; }
.pill { border-radius: 999px; padding: 2px 8px; background: var(--surface-2); }
.pill.answer { color: var(--teal); background: var(--teal-soft); font-weight: 700; }
.pill.no-answer { color: var(--amber); background: var(--amber-soft); font-weight: 700; }
.paper .arrow { color: var(--teal); font-size: 1.4rem; }
.empty { padding: 52px 20px; border: 1px dashed var(--line); border-radius: 18px; color: var(--muted); text-align: center; background: var(--surface); }
.exam-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 18px; align-items: start; }
.exam-panel { position: sticky; top: 84px; padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.exam-panel h1 { color: var(--ink); font-size: 1.3rem; line-height: 1.4; letter-spacing: 0; }
.exam-panel .meta { margin: 10px 0 20px; color: var(--muted); font-size: .85rem; }
.timer { margin: 18px 0; padding: 16px; border-radius: 14px; background: var(--navy-2); color: white; text-align: center; }
.timer span { display: block; color: #a8c8db; font-size: .76rem; letter-spacing: .12em; }
.timer strong { display: block; margin-top: 4px; font: 800 2rem/1.1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.button { width: 100%; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 12px; padding: 10px 14px; color: white; background: var(--teal); text-decoration: none; font-weight: 800; cursor: pointer; }
.button.secondary { margin-top: 9px; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); }
.button.answer { margin-top: 9px; background: var(--amber); }
.note { margin: 14px 0 0; color: var(--muted); font-size: .8rem; }
.viewer { min-height: 76vh; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.viewer iframe { display: block; width: 100%; height: 82vh; border: 0; background: #d7dde1; }
.viewer-fallback { padding: 18px; color: var(--muted); font-size: .9rem; }
.status { margin: 10px 0 0; min-height: 1.5em; color: var(--danger); font-size: .82rem; }
.foot { margin-top: 44px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; }
@media (max-width: 760px) {
  .shell { padding-top: 16px; }
  .masthead { grid-template-columns: 1fr; border-radius: 22px; }
  .masthead-meta { border-left: 0; border-top: 1px solid rgba(255,255,255,.24); padding: 18px 0 0; }
  .course-grid { grid-template-columns: 1fr; }
  .exam-layout { grid-template-columns: 1fr; }
  .exam-panel { position: static; }
  .viewer iframe { height: 72vh; }
}
@media (max-width: 480px) {
  .paper { grid-template-columns: minmax(0, 1fr); }
  .paper .arrow { display: none; }
  .viewer { margin-inline: -16px; border-radius: 0; border-inline: 0; }
}
@media print { .topbar, .toolbar, .exam-panel, .foot { display: none !important; } .shell { max-width: none; padding: 0; } .exam-layout { display: block; } .viewer { border: 0; box-shadow: none; } }
