/* 微课 UI: scoped, keyboard accessible and narrow-screen friendly. */
.lesson-workspace { --lesson-teal: #0f766e; --lesson-muted: #526277; }
.lesson-workspace h1 { font-size: clamp(23px, 5.5vw, 32px); line-height: 1.35; margin: 6px 0 12px; }
.lesson-workspace p { margin: 8px 0; }
.lesson-workspace .card { padding: clamp(16px, 3vw, 25px); }
.lesson-workspace .tag { white-space: normal; }
.lesson-workspace :is(button, input, select, textarea, summary):focus-visible { outline: 3px solid #2563eb; outline-offset: 3px; }
.lesson-workspace :is(h1, section, article, .lesson-feedback-wrap):focus { outline: none; }
.lesson-workspace [hidden] { display: none !important; }
.lesson-topline, .lesson-preview-footer, .lesson-bottom { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.lesson-topline { margin-bottom: 14px; }
.lesson-save, .lesson-note { color: var(--lesson-muted); font-size: 13px; line-height: 1.7; }
.lesson-save { margin-left: auto; }
.lesson-eyebrow { font-size: 13px; font-weight: 650; color: var(--lesson-teal); letter-spacing: .03em; }
.lesson-heading { border-top: 4px solid var(--lesson-teal); }
.lesson-heading > p { max-width: 72ch; color: var(--ink-2); }
.lesson-heading .row { margin-top: 14px; }
.lesson-hub-intro { background: #eff9f7; border-color: #b7ddd7; }
.lesson-library { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.lesson-preview { display: flex; flex-direction: column; min-width: 0; margin: 0; }
.lesson-preview h2 { font-size: 21px; line-height: 1.5; margin-top: 6px; }
.lesson-preview ul { padding-left: 21px; margin: 10px 0 22px; }
.lesson-preview-footer { margin-top: auto; }
.lesson-preview-footer .btn { flex-shrink: 0; }
.lesson-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin: 20px 0; }
.lesson-steps button { display: flex; gap: 8px; align-items: center; justify-content: center; padding: 12px 6px; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--ink-2); cursor: pointer; font-size: 14px; }
.lesson-steps button span { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #f1f5f9; font-weight: 700; flex-shrink: 0; }
.lesson-steps button[aria-current] { background: #0f766e; color: #fff; border-color: #0f766e; }
.lesson-steps button[aria-current] span { background: #115e59; }
.lesson-list { padding-left: 23px; }
.lesson-list li { margin: 7px 0; }
.lesson-reveal { padding: 12px 0; border-bottom: 1px solid var(--line); }
.lesson-reveal:last-child { border-bottom: 0; }
.lesson-reveal summary { cursor: pointer; font-weight: 600; }
.lesson-reveal p { padding: 5px 12px; background: #f8fafc; }
.lesson-idea { padding: 5px 0 12px; }
.lesson-prose { white-space: pre-line; overflow-wrap: anywhere; }
.lesson-boundary { border-left: 4px solid #d97706; }
.lesson-section-intro { background: #f8fafc; }
.lesson-worked-steps { list-style: none; padding: 0; counter-reset: worked; }
.lesson-worked-steps li { counter-increment: worked; display: flex; gap: 12px; margin: 18px 0; }
.lesson-worked-steps li::before { content: counter(worked); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: #e3f4f0; color: #115e59; font-weight: 700; }
.lesson-worked-steps li > div { min-width: 0; white-space: pre-line; }
.lesson-passage { line-height: 1.95; }
.lesson-passage > p { margin: 14px 0; white-space: pre-line; }
.lesson-paragraph { display: inline-block; background: #f1f5f9; color: #526277; border-radius: 4px; margin-right: 8px; padding: 0 7px; font-size: 12px; }
.lesson-question h3 { font-size: 17px; line-height: 1.8; margin: 12px 0 15px; }
.lesson-options { border: 0; min-width: 0; }
.lesson-option { display: flex; gap: 12px; align-items: flex-start; padding: 12px; margin: 8px 0; border: 1px solid #cbd5e1; border-radius: 8px; cursor: pointer; }
.lesson-option:has(input:checked) { border-color: #2563eb; background: #eff6ff; }
.lesson-option input { width: 19px; height: 19px; flex-shrink: 0; margin-top: 3px; accent-color: #2563eb; }
.lesson-answer-label { display: block; font-weight: 600; margin: 8px 0; }
.lesson-number { width: 180px; max-width: 100%; margin-right: 10px; }
.lesson-question-actions, .lesson-rating { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.lesson-question-actions .btn { min-height: 42px; }
.lesson-text-button { border: none; background: transparent; color: #475569; text-decoration: underline; padding: 8px 3px; cursor: pointer; }
.lesson-hint { margin-top: 12px; border-left: 3px solid #d97706; background: #fffbeb; padding: 12px 15px; }
.lesson-feedback { border-radius: 8px; border: 1px solid #cbd5e1; padding: 15px; margin-top: 14px; }
.lesson-feedback.correct { background: #effaf4; border-color: #b8dbc8; }
.lesson-feedback.incorrect { background: #fff4f1; border-color: #edc2b7; }
.lesson-feedback.self { background: #f5f3ff; border-color: #dcd3fa; }
.lesson-feedback h4 { margin-top: 14px; }
.lesson-answer-changed { font-weight: 650; color: #92400e; }
.lesson-rating-selected { background: #e0e7ff !important; color: #3730a3 !important; border-color: #6366f1 !important; opacity: 1 !important; }
.lesson-rating .btn:disabled:not(.lesson-rating-selected) { color: #475569; }
.lesson-finish { border: 1px solid #9bcbbd; }
.lesson-bottom { margin: 22px 0; }
.lesson-status { background: #eff6ff; border-left: 3px solid #3b82f6; padding: 12px; margin: 12px 0; }
.lesson-status.is-safe { background: #effaf4; border-color: #0f766e; }
.lesson-status.is-unsafe { background: #fff1ed; border-color: #c2410c; }
.lesson-experiment { border-top: 4px solid #0f766e; }
.lesson-experiment > .lesson-list { margin-bottom: 22px; }
.lesson-slider-row { display: flex; align-items: center; gap: 12px; }
.lesson-slider-row span { flex-shrink: 0; font-size: 13px; }
.lesson-slider-row input { width: 100%; min-width: 60px; accent-color: #0f766e; min-height: 36px; }
.lesson-graph, .lesson-circuit { display: block; width: 100%; max-width: 560px; height: auto; margin: 10px auto; background: #f8fafc; border-radius: 8px; }
.lesson-graph text, .lesson-circuit text { font-size: 13px; fill: #475569; font-family: inherit; }
.lesson-axis { fill: none; stroke: #64748b; stroke-width: 1.4; }
.lesson-curve { fill: none; stroke: #0f766e; stroke-width: 3; }
.lesson-point { fill: #2563eb; stroke: white; stroke-width: 2; }
.lesson-guide { stroke: #94a3b8; stroke-dasharray: 4 4; }
.lesson-wire, .lesson-resistor { stroke: #334155; stroke-width: 2; fill: none; }
.lesson-resistor { fill: #e3f4f0; }
.lesson-component-label { fill: #f8fafc; }
.lesson-readings { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 20px; padding: 12px; background: #eff9f7; border-radius: 8px; }
.lesson-readings b { color: #115e59; }
.lesson-equation { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 18px 0; font-size: 20px; }
.lesson-equation label { display: inline-flex; gap: 7px; align-items: center; }
.lesson-equation input { width: 64px; font-size: 18px; }
.lesson-arrow { margin: 0 7px; }
.lesson-atom-grid { display: grid; grid-template-columns: 1fr 1.4fr 1.4fr; max-width: 550px; margin: 20px auto; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.lesson-atom-grid > * { padding: 10px; text-align: center; border-bottom: 1px solid var(--line); }
.lesson-atom-grid > div { background: #f1f5f9; font-size: 13px; }
.lesson-select-label { display: block; font-weight: 600; margin: 14px 0; }
.lesson-select-label select { display: block; width: 100%; min-height: 44px; margin-top: 7px; white-space: normal; font-weight: 400; }
.lesson-claim { background: #eff9f7; padding: 14px; border-radius: 8px; }
.lesson-dialogue-line { max-width: 92%; padding: 15px; border-radius: 12px; background: #f1f5f9; margin: 15px 0; }
.lesson-dialogue-line:nth-child(even) { margin-left: auto; background: #eff9f7; }
.lesson-section-label { margin: 26px 0 14px; }
.lesson-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media(max-width: 640px) {
  .lesson-library { grid-template-columns: 1fr; }
  .lesson-steps { gap: 4px; }
  .lesson-steps button { font-size: 12px; gap: 5px; padding: 9px 2px; flex-direction: column; }
  .lesson-save { margin-left: 0; width: 100%; }
  .lesson-bottom .btn { padding: 10px 12px; }
  .lesson-dialogue-line { max-width: 100%; }
  .lesson-select-label select { font-size: 16px; }
  .lesson-workspace :is(input[type=text], input[type=number], textarea) { font-size: 16px; }
}
@media print {
  .lesson-steps, .lesson-topline, .lesson-bottom, .lesson-question-actions, .lesson-rating, .lesson-finish, .lesson-workspace button { display: none !important; }
  .lesson-workspace .card { break-inside: avoid; box-shadow: none; }
}

/* Science inquiry: native inputs remain usable on touch and keyboard. */
.lesson-table-scroll { overflow-x: auto; }
.lesson-table-scroll .lesson-number { min-width: 110px; width: 100%; max-width: 180px; }
.lesson-table-scroll th { vertical-align: middle; }
.lesson-sequence-step { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 12px; }
.lesson-mass-givens dt { font-weight: 700; margin-top: 12px; }
.lesson-mass-givens dd { margin: 4px 0 12px; }
.lesson-option input[type=checkbox] { width: 20px; height: 20px; flex-shrink: 0; }

/* Language workspaces: visible operations, accessible without drag-and-drop. */
.lesson-evidence-scope { border-left: 3px solid #7c3aed; background: #f5f3ff; padding: 10px 13px; font-size: 13px; line-height: 1.8; }
.lesson-quote { display: block; margin: 6px 0; padding: 8px 12px; border-left: 3px solid #94a3b8; background: #f8fafc; font-weight: 400; }
.lesson-clause-cards { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 14px 0; line-height: 1.9; }
.lesson-clause-chunk { padding: 7px 9px; background: #f1f5f9; border-radius: 6px; max-width: 100%; overflow-wrap: anywhere; }
.lesson-break { min-width: 44px; min-height: 44px; border: 1px dashed #64748b; border-radius: 6px; color: #334155; background: white; font-size: 20px; cursor: pointer; }
.lesson-break[aria-pressed=true] { border: 2px solid #0f766e; background: #def5ef; color: #115e59; font-weight: 800; }
.lesson-paragraph-cards { padding: 0; list-style: none; }
.lesson-paragraph-cards li { display: flex; gap: 14px; align-items: center; justify-content: space-between; border: 1px solid #cbd5e1; border-radius: 9px; padding: 14px; margin: 12px 0; }
.lesson-paragraph-cards li > div { min-width: 0; }
.lesson-card-actions { display: flex; gap: 7px; flex-shrink: 0; }
.lesson-card-actions button { min-height: 44px; min-width: 52px; }
.lesson-writing-prompt { background: #eff9f7; border-radius: 8px; padding: 12px 16px; }
.lesson-writing-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 16px 0; }
.lesson-writing-grid > div { min-width: 0; padding: 12px; background: #f8fafc; border-radius: 8px; }
.lesson-writing-grid textarea { display: block; width: 100%; min-height: 96px; resize: vertical; }
.lesson-writing-body { margin-top: 24px; }
.lesson-writing-body .lesson-question { border-top: 3px solid #7c3aed; }
@media(max-width: 640px) {
  .lesson-writing-grid { grid-template-columns: 1fr; }
  .lesson-paragraph-cards li { align-items: stretch; flex-direction: column; }
  .lesson-card-actions { justify-content: flex-end; }
}
