:root {
  color-scheme: light;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #1d2340;
  background: #f5f6fc;
  --ink: #1d2340;
  --muted: #58627b;
  --line: #e2e5f0;
  --paper: #fff;
  --accent: #4d44a4;
  --soft: #eeebff;
  --edge: #dad3fe;
  line-height: 1.55;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
p, h1, h2, h3 { margin: 0; }
a { color: var(--accent); text-decoration: none; }
button, select, input { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid #6150d8; outline-offset: 3px; }
.shell { width: min(1184px, calc(100% - 64px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.masthead { background: #fff; border-bottom: 1px solid var(--line); }
.masthead-inner { display: flex; align-items: center; min-height: 67px; gap: 32px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-size: 19px; font-weight: 780; white-space: nowrap; }
.masthead-nav { display: flex; gap: 5px; }
.masthead-nav a { color: var(--muted); font-size: 14px; font-weight: 680; border-radius: 8px; padding: 7px 12px; }
.masthead-nav a:hover, .masthead-nav a[aria-current="page"] { color: var(--accent); background: var(--soft); }
.local-progress { margin-inline-start: auto; color: var(--muted); font-size: 13px; text-align: end; }
.workspace { padding: 27px 0 26px; }
.workspace-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 17px; }
.back-link { display: inline-block; color: var(--muted); font-size: 13px; font-weight: 680; margin-bottom: 6px; }
.back-link:hover { color: var(--accent); text-decoration: underline; }
.workspace-heading h1 { font-size: clamp(27px, 4vw, 40px); letter-spacing: -.045em; line-height: 1.2; }
.paper-meter { width: clamp(120px, 18vw, 204px); flex: 0 0 auto; display: grid; gap: 5px; color: var(--muted); font-size: 13px; text-align: end; }
progress { display: block; width: 100%; height: 6px; border: 0; border-radius: 4px; appearance: none; background: var(--edge); accent-color: var(--accent); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--edge); }
progress::-webkit-progress-value { background: var(--accent); }
progress::-moz-progress-bar { background: var(--accent); }
.library, .transcript, .question, .review-bar { background: var(--paper); border: 1px solid var(--line); }
.library { min-width: 0; border-radius: 16px; margin-bottom: 20px; }
.library-head { padding: 11px 15px 0; display: flex; align-items: center; gap: 12px; }
.library-head h2, .questions-head h2, .transcript h2 { font-size: 16px; font-weight: 760; }
#papers { max-width: 100%; min-height: 36px; padding: 3px 9px; background: #fbfbff; color: var(--ink); border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
#rail-help { margin-inline-start: auto; font-size: 13px; color: var(--muted); }
#segments { display: flex; gap: 8px; overflow: auto; padding: 11px 15px 12px; scrollbar-color: var(--edge) transparent; scrollbar-width: thin; }
.segment { min-width: 143px; flex: 1 0 auto; padding: 7px 9px; display: grid; grid-template-columns: auto 1fr; column-gap: 8px; text-align: start; background: #f9faff; color: var(--ink); border: 1px solid var(--line); border-radius: 9px; }
.segment:hover { border-color: var(--accent); }
.segment[aria-current="true"] { border-color: var(--accent); color: var(--accent); background: var(--soft); }
.segment-section { display: grid; align-self: start; place-items: center; min-width: 23px; height: 22px; margin-top: 1px; color: var(--accent); background: var(--soft); border-radius: 6px; font-size: 11px; font-weight: 760; }
.segment[aria-current="true"] .segment-section { background: var(--accent); color: #fff; }
.segment-name { display: block; font-size: 13px; font-weight: 760; }
.segment-range, .segment-state { color: var(--muted); font-size: 11px; }
.segment-state { grid-column: 2; }
.practice { min-width: 0; display: grid; grid-template-columns: minmax(0, .93fr) minmax(0, 1.07fr); gap: 20px; align-items: start; }
.player-column { position: sticky; top: 15px; min-width: 0; }
.player { position: relative; isolation: isolate; overflow: hidden; color: white; background: linear-gradient(125deg, #171536, #282252 78%, #3a345f); border-radius: 18px; padding: 21px 22px 19px; box-shadow: 0 10px 24px #2118401c; }
.player :focus-visible { outline-color: #d6e2ff; }
#segment-paper { color: #d4ddf5; font-size: 12px; font-weight: 670; }
.player h2 { margin: 3px 0; font-size: 29px; line-height: 1.22; letter-spacing: -.032em; }
#segment-meta { color: #d6dff1; font-size: 13px; }
.timeline { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding-top: 47px; margin-top: 15px; }
.waveform { position: absolute; inset: 0 0 auto; height: 43px; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; align-items: center; gap: 3px; pointer-events: none; }
.waveform span { background: #a8bbec64; height: var(--height); border-radius: 5px; }
.waveform span.is-past { background: #d7e4ff; }
#seek { width: 100%; height: 43px; position: absolute; inset: 0 0 auto; margin: 0; opacity: 0; cursor: pointer; }
.timeline:focus-within .waveform { outline: 2px solid #d6e2ff; outline-offset: 3px; border-radius: 5px; }
.time { color: #e1e7f6; font-size: 12px; font-variant-numeric: tabular-nums; }
#duration { justify-self: end; }
.player-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 13px; }
.player-controls button, .speed { min-height: 41px; padding: 0 10px; border-radius: 8px; font-size: 13px; font-weight: 720; }
.play { display: flex; align-items: center; gap: 7px; background: #edf2ff; color: #252c4e; border: 1px solid #edf2ff; }
.play:hover { background: #d8e2ff; }
.play-shape { display: inline-block; height: 11px; width: 10px; background: currentColor; clip-path: polygon(1% 0,100% 50%,1% 100%); }
.play.is-playing .play-shape { clip-path: polygon(0 0,36% 0,36% 100%,0 100%,0 0,65% 0,100% 0,100% 100%,65% 100%,65% 0); }
.player-secondary, .speed, .transcript-toggle { border: 1px solid #b3c3ec6b; color: #f6f7ff; background: #b3c3ec20; }
.speed option { background: #273455; color: #fff; }
.player-secondary:hover, .speed:hover, .transcript-toggle:hover { background: #b3c3ec40; }
.transcript-toggle { margin-inline-start: auto; }
.transcript-toggle[aria-expanded="true"] { color: #252c4e; background: #edefff; }
.audio-status { color: #ffdea9; font-size: 13px; margin-top: 9px; }
.transcript { border-radius: 15px; margin-top: 13px; overflow: hidden; }
.transcript-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 15px; border-bottom: 1px solid var(--line); }
.transcript-lines { margin: 0; padding: 8px 15px 9px 38px; max-height: clamp(120px, calc(100dvh - 340px), 380px); overflow: auto; }
.transcript-lines li { padding: 5px 7px; margin: 4px 0; border-radius: 6px; white-space: pre-line; overflow-wrap: anywhere; font-size: 15px; line-height: 1.64; }
.transcript-lines li::marker { color: var(--muted); font: 650 12px "Segoe UI", sans-serif; }
.transcript-lines .is-evidence { background: var(--soft); outline: 1px solid var(--edge); }
.source { color: var(--muted); padding: 9px 1px; font-size: 12px; }
.source a { text-decoration: underline; text-underline-offset: 3px; }
.questions { min-width: 0; }
.questions-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 9px; }
.answer-count { background: var(--soft); color: var(--accent); border-radius: 20px; padding: 3px 10px; font-size: 12px; font-weight: 710; }
.question-nav { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 11px; }
.question-nav button { min-width: 37px; min-height: 33px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 13px; font-weight: 720; }
.question-nav button:hover, .question-nav button.is-answered { background: var(--soft); color: var(--accent); border-color: var(--edge); }
.question-nav button.is-correct { background: #e8f6ed; border-color: #b8ddc6; color: #20664b; }
.question-nav button.is-wrong { background: #fff0f0; border-color: #eec6c8; color: #9c3543; }
.question { padding: 14px 15px 10px; margin-bottom: 10px; border-radius: 14px; scroll-margin-top: 14px; }
.question h3 { display: flex; align-items: baseline; gap: 10px; font-size: 17px; font-weight: 710; line-height: 1.44; }
.question-number { color: var(--accent); font-weight: 780; font-variant-numeric: tabular-nums; }
.options { border: 0; padding: 0; margin: 11px 0 4px; min-width: 0; display: grid; gap: 6px; }
.option { position: relative; display: flex; align-items: center; gap: 9px; min-width: 0; min-height: 43px; padding: 6px 9px; border-radius: 9px; border: 1px solid var(--line); cursor: pointer; background: #fbfbff; color: var(--ink); font-size: 15px; }
.option input { position: absolute; width: 1px; height: 1px; padding: 0; margin: 0; clip-path: inset(50%); }
.option:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.option:has(input:disabled) { cursor: default; }
.option-letter { display: grid; place-items: center; flex: 0 0 auto; width: 25px; height: 25px; border: 1px solid var(--line); border-radius: 7px; font: 740 12px "Segoe UI", sans-serif; color: var(--accent); background: white; }
.option-text { overflow-wrap: anywhere; }
.option:hover, .option.is-selected { background: var(--soft); border-color: var(--edge); }
.option.is-selected .option-letter { background: var(--accent); border-color: var(--accent); color: #fff; }
.option.is-correct { background: #edf8f0; border-color: #b8ddc6; }
.option.is-correct .option-letter { background: #256c4e; border-color: #256c4e; color: white; }
.option.is-wrong { background: #fff1f1; border-color: #ebc2c6; }
.option.is-wrong .option-letter { background: #9c3543; border-color: #9c3543; color: white; }
.option-status { flex: 0 0 auto; margin-inline-start: auto; color: #20664b; font-size: 12px; font-weight: 690; }
.option.is-wrong .option-status { color: #932f3d; }
.analysis summary, .text-button { width: fit-content; color: var(--accent); border: 0; background: transparent; padding: 5px 3px; font-size: 13px; font-weight: 710; cursor: pointer; }
.analysis summary:hover, .text-button:hover { text-decoration: underline; }
.analysis-body { background: var(--soft); border-radius: 8px; margin-top: 4px; padding: 9px 12px; color: var(--ink); font-size: 14px; overflow-wrap: anywhere; }
.analysis-body p + p { margin-top: 7px; }
.analysis-body .evidence { padding-inline-start: 9px; border-inline-start: 2px solid var(--accent); }
.review-bar { display: flex; flex-wrap: wrap; gap: 7px 10px; justify-content: space-between; align-items: center; position: sticky; bottom: 8px; z-index: 2; padding: 9px 10px; border-radius: 12px; box-shadow: 0 6px 18px #1c1b3820; }
.segment-controls, .review-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
#result { color: var(--accent); font-weight: 750; font-size: 13px; }
.previous-next, .primary { min-height: 39px; padding: 0 10px; border-radius: 8px; font-size: 13px; font-weight: 740; }
.previous-next { color: var(--accent); background: var(--soft); border: 1px solid var(--edge); }
.previous-next:hover { border-color: var(--accent); }
.primary { color: #fff; background: var(--accent); border: 1px solid var(--accent); }
.primary:hover { filter: brightness(.86); }
.previous-next:disabled, .primary:disabled { color: #687286; background: #f5f6fa; border-color: var(--line); filter: none; }
.notice { padding: 14px 0; color: #913f25; }
@media (prefers-reduced-motion: no-preference) {
  .course-card, .option, .segment, button { transition: box-shadow .17s ease, transform .17s ease, background .16s ease, border-color .16s ease; }
}
@media (max-width: 900px) {
  .shell { width: calc(100% - 42px); }
  .practice { gap: 13px; }
  .player { padding-inline: 15px; }
  .transcript-toggle { margin-inline-start: 0; }
}
@media (max-width: 690px) {
  .shell { width: calc(100% - 30px); }
  .masthead-inner { min-height: 56px; gap: 10px; }
  .wordmark { gap: 6px; font-size: 16px; }
  .workspace { padding-top: 17px; }
  .workspace-heading h1 { font-size: clamp(20px, 6vw, 30px); }
  .paper-meter { width: 85px; font-size: 11px; }
  .library { margin-bottom: 13px; }
  .library-head { padding: 8px 10px 0; gap: 8px; }
  .library-head h2, #papers { font-size: 13px; }
  #rail-help { font-size: 11px; }
  #segments { padding: 8px 10px 9px; }
  .segment { min-width: 123px; }
  .practice { grid-template-columns: minmax(0,1fr); }
  .player-column { position: static; }
  .player { padding: 16px 13px; }
  .player h2 { font-size: 24px; }
  .waveform { gap: 2px; }
  .player-controls button, .speed { min-height: 44px; padding-inline: 7px; }
  .transcript-lines { max-height: 47dvh; }
  .question { padding: 12px 10px 9px; }
  .question h3 { font-size: 16px; }
  .option { min-height: 44px; }
}
