:root {
  --cream-50: #fffdf8;
  --cream-100: #fbf7ef;
  --cream-200: #f3ecdf;
  --cream-300: #eadfcf;
  --ink: #322f2a;
  --muted: #82796c;
  --line: #e9e1d4;
  --mint: #b8e3d0;
  --mint-deep: #2f7764;
  --coral: #f3ad8d;
  --coral-deep: #a7583c;
  --lavender: #d9d4f2;
  --shadow: 0 14px 34px rgba(87, 67, 42, .08);
  --radius: 14px;
  font-family: "PingFang SC", "苹方-简", -apple-system, BlinkMacSystemFont, "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--cream-100);
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--cream-100); font-size: 13px; line-height: 1.65; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 246px minmax(0, 1fr); }
.shell.sidebar-collapsed { grid-template-columns: 76px minmax(0, 1fr); }

.sidebar { position: sticky; top: 0; align-self: start; height: 100vh; max-height: 100vh; overflow-y: auto; min-width: 0; background: var(--cream-50); border-right: 1px solid var(--line); padding: 24px 16px; display: flex; flex-direction: column; gap: 28px; transition: padding .2s; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sidebar-toggle { flex: 0 0 34px; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 9px; background: var(--cream-50); color: var(--muted); font-size: 20px; display: grid; place-items: center; padding: 0; }
.sidebar-toggle:hover { background: var(--cream-200); color: var(--ink); }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 10px; }
.brand-mark { width: 36px; height: 36px; border-radius: 12px; background: var(--coral); color: #fffaf4; display: grid; place-items: center; font-size: 18px; font-weight: 700; box-shadow: 0 7px 16px rgba(243,173,141,.28); }
.brand strong { display: block; font-size: 15px; letter-spacing: 0; }
.brand span { color: var(--muted); font-size: 13px; display: block; margin-top: 2px; }
.tenant { background: var(--cream-200); border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; margin: 0 4px; }
.tenant-label { color: var(--muted); font-size: 13px; display: block; margin-bottom: 5px; }
.tenant strong { font-size: 13px; }
.nav { display: grid; min-width: 0; gap: 5px; }
.nav-heading { color: #a1988a; font-size: 13px; padding: 0 12px 6px; letter-spacing: 0; }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 42px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); text-align: left; font-size: 13px; transition: background .2s, color .2s; }
.nav-item:hover { background: var(--cream-200); color: var(--ink); }
.nav-item.active { background: #e7f3eb; color: var(--mint-deep); font-weight: 600; }
.nav-icon { width: 18px; height: 18px; display: grid; place-items: center; font-size: 15px; color: currentColor; }
.sidebar-footer { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; line-height: 1.55; }
.shell.sidebar-collapsed .sidebar { padding-inline: 12px; }
.shell.sidebar-collapsed .sidebar-head { flex-direction: column; }
.shell.sidebar-collapsed .brand { padding: 0; }
.shell.sidebar-collapsed .brand-copy,
.shell.sidebar-collapsed .tenant,
.shell.sidebar-collapsed .nav-heading,
.shell.sidebar-collapsed .nav-label,
.shell.sidebar-collapsed .sidebar-footer { display: none; }
.shell.sidebar-collapsed .nav-item { justify-content: center; padding: 0; }
.shell.sidebar-collapsed .nav-icon { width: 24px; height: 24px; font-size: 18px; }

.main { min-width: 0; }
.topbar { height: 74px; padding: 0 34px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; background: rgba(255,253,248,.7); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 4; }
.breadcrumb { font-size: 13px; color: var(--muted); }
.breadcrumb strong { color: var(--ink); font-weight: 600; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.signed-in-user { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 600; }
.logout-button { min-height: 36px; border: 0; border-left: 1px solid var(--line); padding: 0 0 0 12px; background: transparent; color: var(--muted); }
.logout-button:hover { color: var(--coral-deep); }
.role-select { height: 40px; min-height: 40px; border: 1px solid var(--cream-300); border-radius: 8px; padding: 0 34px 0 12px; background-color: var(--cream-50); color: var(--ink); font-size: 13px; font-weight: 500; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--lavender); font-size: 13px; font-weight: 700; color: #585075; }
.content { max-width: 1440px; padding: 38px 34px 48px; margin: 0 auto; }
.view { display: none; }
.view.active { display: block; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 22px; margin-bottom: 30px; }
.page-head > div:first-child { display: grid; align-content: center; gap: 0; min-width: 0; }
.eyebrow { color: var(--coral-deep); font-size: 13px; font-weight: 700; letter-spacing: 0; text-transform: uppercase; margin-bottom: 8px; }
h1 { margin: 0; font-size: clamp(25px, 3vw, 30px); line-height: 1.35; letter-spacing: 0; font-weight: 600; }
h2 { margin: 0; font-size: 18px; line-height: 1.4; letter-spacing: 0; }
h3 { margin: 0; font-size: 14px; line-height: 1.45; }
.subtle { color: var(--muted); font-size: 13px; margin: 11px 0 0; line-height: 1.75; }
.button { min-height: 40px; border: 1px solid transparent; border-radius: 10px; padding: 0 15px; font-size: 13px; font-weight: 600; transition: transform .15s, box-shadow .2s, background .2s; }
.button:active { transform: scale(.98); }
.button.primary { background: var(--mint-deep); color: #fff; box-shadow: 0 6px 14px rgba(47,119,100,.18); }
.button.primary:hover { box-shadow: 0 8px 18px rgba(47,119,100,.27); }
.button.secondary { background: var(--cream-50); border-color: var(--line); color: var(--ink); }
.button.secondary:hover { background: var(--cream-200); }
.button.danger { background: #fff6f3; border-color: #e7b6a6; color: #a64d35; }
.button.danger:hover { background: #ffeadf; border-color: #d9957e; }
.button.coral { background: var(--coral); color: #5d2c20; }
.button.small { min-height: 34px; padding: 0 11px; font-size: 13px; }
.button:focus-visible, .nav-item:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid rgba(47,119,100,.25); outline-offset: 2px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.metric { background: var(--cream-50); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.metric-top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 13px; }
.metric-icon { width: 29px; height: 29px; border-radius: 9px; display: grid; place-items: center; font-size: 14px; }
.metric-icon.mint { background: #e0f3e9; color: var(--mint-deep); }
.metric-icon.coral { background: #ffeadf; color: var(--coral-deep); }
.metric-icon.lavender { background: #eeebff; color: #615993; }
.metric-icon.cream { background: var(--cream-200); color: #8c6d43; }
.metric-value { font-size: 28px; font-weight: 700; margin-top: 13px; letter-spacing: 0; }
.metric-note { color: var(--muted); font-size: 13px; margin-top: 5px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(300px, .7fr); gap: 18px; }
.panel { background: var(--cream-50); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-head { min-height: 68px; padding: 18px 21px; display: flex; justify-content: space-between; align-items: center; gap: 14px; border-bottom: 1px solid var(--line); }
.panel-head > div:first-child { display: grid; align-content: center; gap: 4px; min-width: 0; }
.panel-head .subtle { line-height: 1.5; }
.panel-body { padding: 21px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { height: 54px; color: #948a7b; text-align: left; vertical-align: middle; font-weight: 500; font-size: 13px; padding: 14px; line-height: 1.45; white-space: nowrap; }
td { padding: 13px 14px; border-top: 1px solid #f0e9df; vertical-align: middle; }
td:first-child, th:first-child { padding-left: 19px; }
td:last-child, th:last-child { padding-right: 19px; }
.person { display: flex; align-items: center; gap: 9px; min-width: 150px; }
.mini-avatar { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: #f8ded3; color: #99503c; font-size: 13px; font-weight: 700; }
.person strong { font-size: 13px; display: block; }
.person span { color: var(--muted); font-size: 13px; display: block; margin-top: 2px; }
.status { display: inline-flex; align-items: center; gap: 5px; border-radius: 20px; padding: 5px 8px; font-size: 13px; white-space: nowrap; }
.status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status.green { color: var(--mint-deep); background: #e5f4eb; }
.status.orange { color: #9a6d26; background: #fff3d5; }
.status.gray { color: #83796c; background: #f0ece6; }
.status.purple { color: #655d94; background: #efecff; }
.link-button { border: 0; background: transparent; color: var(--mint-deep); font-weight: 600; font-size: 13px; padding: 5px 0; }
.link-button:hover { color: var(--coral-deep); }
.timeline { display: grid; gap: 0; }
.timeline-item { position: relative; display: grid; grid-template-columns: 82px 16px minmax(0, 1fr); gap: 10px; padding-bottom: 20px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-date { color: var(--muted); font-size: 13px; text-align: right; padding-top: 2px; }
.timeline-line { position: relative; display: flex; justify-content: center; }
.timeline-line::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--coral); border: 3px solid #fff0e8; z-index: 1; margin-top: 3px; }
.timeline-line::after { content: ""; position: absolute; top: 13px; bottom: -20px; width: 1px; background: var(--line); }
.timeline-item:last-child .timeline-line::after { display: none; }
.timeline-content strong { font-size: 13px; }
.timeline-content p { margin: 5px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag { display: inline-flex; border-radius: 6px; padding: 4px 7px; background: var(--cream-200); color: #756b5e; font-size: 13px; }
.practice-actions { display: inline-flex; align-items: center; flex-wrap: nowrap; gap: 2px; margin: 0; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: var(--cream-200); white-space: nowrap; }
.practice-button { min-height: 30px; padding: 0 9px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 13px; }
.practice-button:hover { background: var(--cream-200); color: var(--ink); }
.practice-button.active { background: var(--cream-50); color: var(--mint-deep); font-weight: 600; box-shadow: 0 1px 5px rgba(87,67,42,.12); }
.practice-button.active.needs-help { background: #ffeadf; color: var(--coral-deep); }
.question-browser { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: 560px; }
.topic-directory { border-right: 1px solid var(--line); padding: 10px; max-height: 680px; overflow: auto; }
.topic-directory-title { padding: 7px 9px 10px; color: var(--muted); font-size: 13px; font-weight: 600; }
.topic-group-label { padding: 13px 9px 5px; color: var(--coral-deep); font-size: 13px; font-weight: 700; }
.topic-button { width: 100%; min-height: 44px; border: 0; border-radius: 8px; padding: 8px 9px; background: transparent; color: var(--muted); text-align: left; font-size: 13px; line-height: 1.45; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.topic-button:hover { background: var(--cream-200); color: var(--ink); }
.topic-button.active { background: #e7f3eb; color: var(--mint-deep); font-weight: 600; }
.topic-count { flex: 0 0 auto; color: #a1988a; }
.topic-button-end { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.topic-content { padding: 20px; min-width: 0; }
.topic-content-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.question-card { padding: 14px 0; border-bottom: 1px solid var(--line); }
.question-card:last-child { border-bottom: 0; }
.question-card-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 20px; align-items: start; }
.question-card-copy { min-width: 0; }
.question-card .question-copy { margin: 8px 0 0; font-size: 14px; line-height: 1.65; font-weight: 500; }
.question-card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.cue-points { margin-top: 8px; padding-left: 12px; border-left: 3px solid var(--cream-300); color: var(--muted); font-size: 13px; line-height: 1.65; }
.novelty { display: inline-flex; align-items: center; min-height: 22px; padding: 2px 6px; border-radius: 6px; font-size: 13px; line-height: 1.2; white-space: nowrap; }
.novelty.new { color: #a34e31; background: #ffeadf; }
.novelty.old { color: #6f675d; background: #efebe5; }
.novelty.base { color: #2f7764; background: #e5f4eb; }
.novelty.overseas { color: #285d8d; background: #e6f1fb; }
.topic-button .novelty { min-height: 19px; padding: 2px 5px; font-size: 13px; }
.topic-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.bank-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 12px; font-size: 13px; }
.bank-summary span { color: var(--muted); }
.visibility-note { padding: 4px 7px; border-radius: 6px; background: #ffeadf; color: var(--coral-deep) !important; }
.visibility-note.current { background: #e5f4eb; color: var(--mint-deep) !important; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 20px; }
.search { flex: 1 1 240px; position: relative; }
.search input { width: 100%; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: var(--cream-50); padding: 0 13px 0 36px; color: var(--ink); font-size: 13px; }
.search-icon { position: absolute; left: 13px; top: 12px; color: #a79d8f; font-size: 13px; }
.filter { height: 40px; border: 1px solid var(--cream-300); border-radius: 8px; background-color: var(--cream-50); color: var(--ink); padding: 0 34px 0 12px; font-size: 13px; font-weight: 500; }
select { appearance: none; -webkit-appearance: none; min-height: 40px; border: 1px solid var(--cream-300); border-radius: 8px; padding: 0 34px 0 12px; background-color: var(--cream-50); background-image: linear-gradient(45deg, transparent 50%, #8b8275 50%), linear-gradient(135deg, #8b8275 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; color: var(--ink); font-size: 13px; box-shadow: 0 2px 8px rgba(87, 67, 42, .05); transition: border-color .2s, background-color .2s, box-shadow .2s; }
select:hover { border-color: #cfc2af; background-color: #fffefa; }
select:focus-visible { outline: none; border-color: #8fc6ad; box-shadow: 0 0 0 3px rgba(47,119,100,.12); }
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--cream-200); border-radius: 10px; margin-bottom: 16px; width: fit-content; }
.tab { border: 0; background: transparent; color: var(--muted); border-radius: 7px; padding: 8px 13px; font-size: 13px; }
.tab.active { background: var(--cream-50); color: var(--mint-deep); box-shadow: 0 2px 8px rgba(87,67,42,.08); font-weight: 600; }

.lesson-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr); gap: 18px; align-items: start; }
.lesson-notes-panel .panel-head > div:first-child { display: grid; gap: 3px; }
.lesson-notes-panel > .panel-body { font-size: var(--note-editor-font-size, 15px); }
.lesson-notes-panel .rich-input { font-size: var(--note-editor-font-size, 15px); }
.note-view-actions, .editor-size-control { display: flex; align-items: center; gap: 8px; }
.editor-size-control > span { color: var(--muted); font-size: 13px; }
.editor-size-control select { width: 72px; min-height: 34px; height: 34px; padding-left: 10px; }
.lesson-notes-panel.notes-fullscreen { position: fixed; inset: 0; z-index: 30; display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; border: 0; border-radius: 0; background: var(--cream-50); box-shadow: 0 24px 70px rgba(58,43,29,.25); }
.lesson-notes-panel.notes-fullscreen > .panel-head { padding: 14px 20px; }
.lesson-notes-panel.notes-fullscreen > .panel-body { overflow: auto; padding: 22px max(22px, calc((100vw - 1100px) / 2)); }
body:has(.lesson-notes-panel.notes-fullscreen) { overflow: hidden; }
.head-actions, .picker-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.inline-button { display: inline-flex; align-items: center; gap: 7px; }
.lesson-import-zone { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 86px; margin-bottom: 16px; padding: 16px; border: 1px dashed #cfc2af; border-radius: 12px; background: rgba(255,253,248,.65); color: var(--ink); cursor: pointer; transition: border-color .2s, background .2s, box-shadow .2s; }
.lesson-import-zone:hover, .lesson-import-zone.dragging { border-color: #78b89a; background: #eef8f2; box-shadow: 0 0 0 3px rgba(47,119,100,.08); }
.import-zone-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: #e5f4eb; color: var(--mint-deep); font-size: 20px; }
.lesson-import-zone strong, .lesson-import-zone small { display: block; }
.lesson-import-zone small { margin-top: 3px; color: var(--muted); font-size: 13px; font-weight: 400; }
.lesson-record { display: grid; grid-template-columns: minmax(180px, 1.35fr) repeat(4, minmax(90px, .7fr)) auto; align-items: center; gap: 20px; min-height: 94px; padding: 16px 20px; }
.lesson-record + .lesson-record { border-top: 1px solid var(--line); }
.lesson-record-person { display: flex; align-items: center; gap: 11px; min-width: 0; }
.lesson-record-person > div:last-child, .lesson-record-fact { display: grid; gap: 3px; }
.lesson-record-person span, .lesson-record-fact > span:first-child { color: var(--muted); font-size: 13px; font-weight: 500; }
.lesson-record-person strong, .lesson-record-fact strong { font-size: 13px; }
.lesson-record-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; white-space: nowrap; }
.no-margin { margin: 0; }
.lesson-picker-section { margin-top: 23px; }
.section-head { padding: 0 0 13px; border: 0; }
.picker-tools { margin-bottom: 12px; }
.picker-tools .search { min-width: 220px; }
.category-tabs { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.category-button { min-height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: #fffefa; color: var(--muted); font-size: 13px; }
.category-button:hover { background: var(--cream-200); color: var(--ink); }
.category-button.active { border-color: #a4d5be; background: #e7f3eb; color: var(--mint-deep); font-weight: 600; }
.lesson-question-browser { display: grid; grid-template-columns: 190px minmax(0, 1fr); min-height: 420px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.lesson-question-browser .topic-directory { max-height: 520px; }
.lesson-question-browser .topic-content { padding: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { display: grid; gap: 7px; }
.field-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; min-width: 0; }
.field-label-row label { flex-shrink: 0; }
.field-hint { min-width: 0; color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.4; text-align: right; }
.field.full { grid-column: 1 / -1; }
label { font-size: 13px; color: var(--muted); font-weight: 600; }
input, textarea { border: 1px solid var(--line); border-radius: 9px; background: #fffefa; color: var(--ink); padding: 10px 11px; min-height: 40px; font-size: 13px; }
textarea { min-height: 76px; resize: vertical; line-height: 1.6; }
.question-pick { display: grid; gap: 8px; max-height: 440px; overflow: auto; }
.pick-item { display: flex; align-items: flex-start; gap: 10px; padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--cream-50); }
.pick-item:has(input:checked) { border-color: #a4d5be; background: #f4fbf6; }
.pick-item input { min-height: auto; margin-top: 2px; accent-color: var(--mint-deep); }
.pick-meta { color: var(--muted); font-size: 13px; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.pick-state { display: inline-flex; align-items: center; min-height: 20px; padding: 0 6px; border-radius: 999px; font-size: 12px; line-height: 1.4; font-weight: 600; }
.pick-state.taught { color: #2f7764; background: #e7f3eb; }
.pick-state.help { color: #a7583c; background: #fff0e8; }
.pick-state.practiced { color: #655d94; background: #eeeafb; }
.pick-state.pending { color: #82796c; background: #f3ecdf; }
.pick-text { font-size: 13px; line-height: 1.5; }
.pick-points { margin-top: 5px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.note-stack { display: grid; gap: 14px; }
.question-bank-notes { display: grid; gap: 7px; margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.question-bank-notes > span { color: var(--mint-deep); font-weight: 700; }
.question-note-entry { display: grid; gap: 4px; padding: 9px 10px; border: 1px solid #dcebe2; border-radius: 8px; background: #fbfffc; color: var(--ink); line-height: 1.65; }
.question-note-entry b { color: var(--muted); font-size: 13px; font-weight: 600; }
.note-block { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fffefa; }
.note-title { padding: 11px 13px; background: var(--cream-200); display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; font-size: 13px; font-weight: 600; }
.note-title-copy { display: grid; gap: 4px; min-width: 0; }
.lesson-notes-panel .note-title-copy > strong { font-size: var(--note-editor-font-size, 15px); line-height: 1.5; }
.note-title-copy > span { color: var(--muted); font-size: 13px; font-weight: 400; }
.note-title-points { margin-top: 4px; color: var(--muted); font-size: 13px; font-weight: 400; line-height: 1.65; }
.general-note-block { border-color: #bedfce; background: #fbfffc; }
.general-note-block .note-title { align-items: center; background: #e7f3eb; }
.general-note-hint { color: var(--mint-deep); font-size: 13px; font-weight: 400; text-align: right; }
.general-note-input { min-height: 130px; }
.remove-note-question { flex: 0 0 32px; width: 32px; height: 32px; border: 1px solid #e6cfc3; border-radius: 8px; background: #fff8f4; color: var(--coral-deep); font-size: 22px; line-height: 1; }
.remove-note-question:hover { background: #ffeadf; border-color: #e9ad96; }
.note-editor-wrap { padding: 13px; }
.rich-editor { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #fffefa; }
.rich-toolbar { display: flex; align-items: center; gap: 5px; min-height: 40px; padding: 5px 7px; border-bottom: 1px solid var(--line); background: var(--cream-100); }
.format-button, .color-button { width: 32px; height: 30px; border: 1px solid var(--line); border-radius: 7px; background: #fffefa; color: var(--ink); font-size: 13px; font-weight: 700; display: grid; place-items: center; padding: 0; }
.format-button:hover, .color-button:hover { border-color: #a4d5be; background: #f4fbf6; }
.format-button.underline { text-decoration: underline; }
.format-button.strike { text-decoration: line-through; }
.color-button { width: 26px; height: 26px; border-radius: 50%; color: transparent; }
.rich-input { min-height: 92px; padding: 10px 11px; outline: 0; font-size: 13px; line-height: 1.6; white-space: pre-wrap; }
.rich-input:empty::before { content: attr(data-placeholder); color: #a79d8f; pointer-events: none; }
.rich-input:focus { box-shadow: inset 0 0 0 2px rgba(47,119,100,.18); }
.lesson-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 17px; }
.lesson-actions.no-top-margin { margin-top: 0; }
.notes-fullscreen .note-save-actions { position: sticky; bottom: -22px; z-index: 2; margin: 18px -2px -22px; padding: 14px 2px 16px; background: linear-gradient(to bottom, rgba(255,253,248,0), var(--cream-50) 28%); }
.student-home { max-width: 1240px; }
.student-home .student-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.student-home .metric { border-radius: 8px; box-shadow: none; }
.student-section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.student-section-head h2 { margin: 0; font-size: 18px; }
.student-section-head .link-button { min-height: 44px; }
.student-recent { margin: 8px 0 28px; padding: 18px 0 24px; border-bottom: 1px solid var(--line); }
.recent-lesson-list { display: grid; gap: 14px; }
.student-recent .latest-lesson { padding-left: 18px; border-left: 3px solid var(--mint-deep); }
.latest-lesson-copy > strong { display: block; margin: 4px 0 10px; font-size: 21px; }
.latest-lesson-date { color: var(--muted); }
.student-recent .lesson-actions { flex-shrink: 0; }
.student-recent .button { min-height: 44px; }
.student-homework { margin-bottom: 22px; }
.homework-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
.homework-column { min-width: 0; }
.homework-column-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 6px 12px; padding: 12px 0; border-top: 3px solid var(--mint-deep); }
.homework-column.practice .homework-column-head { border-color: #456d97; }
.homework-column-head h3 { margin: 0; color: var(--mint-deep); font-size: 16px; }
.homework-column.practice h3 { color: #456d97; }
.homework-column-head > span { color: var(--muted); font-size: 13px; }
.homework-topic { border-bottom: 1px solid var(--line); }
.homework-topic > summary { display: flex; align-items: center; gap: 12px; min-height: 78px; padding: 14px 0; cursor: pointer; list-style: none; }
.homework-topic > summary::-webkit-details-marker, .homework-more > summary::-webkit-details-marker, .report-summary::-webkit-details-marker { display: none; }
.homework-topic > summary:hover, .homework-more > summary:hover { color: var(--mint-deep); }
.homework-topic-copy { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.homework-topic-copy strong { display: block; font-size: 15px; font-weight: 600; }
.homework-topic-copy small { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; }
.homework-topic-count { flex-shrink: 0; color: var(--muted); font-size: 13px; }
.disclosure-chevron { display: inline-grid; place-items: center; flex: 0 0 24px; width: 24px; height: 24px; font-size: 24px; line-height: 1; transition: transform .15s; }
details[open] > summary > .disclosure-chevron { transform: rotate(90deg); }
.homework-question-list { padding: 0 0 12px 12px; border-left: 2px solid var(--line); margin-bottom: 12px; }
.homework-question-link { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; width: 100%; padding: 8px; border: 0; background: transparent; color: var(--ink); text-align: left; }
.homework-question-link > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.homework-question-link:hover { color: var(--mint-deep); background: #edf5f1; }
.homework-more > summary { min-height: 44px; display: flex; align-items: center; justify-content: space-between; padding-block: 10px; color: var(--muted); cursor: pointer; list-style: none; }
.completed-homework { margin-top: 8px; border-top: 1px dashed var(--line); }
.completed-homework > summary { color: #347768; }
.homework-column .empty { padding: 32px 12px; text-align: left; }
.student-report-list { display: grid; gap: 12px; }
.student-report { min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--cream-50); overflow: hidden; }
.report-summary { display: flex; align-items: center; gap: 24px; padding: 20px; min-height: 100px; cursor: pointer; list-style: none; }
.report-summary:hover { background: #f0f6f3; }
.report-heading { flex: 0 0 170px; }
.report-heading strong { display: block; font-size: 17px; }
.report-heading > span { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; }
.report-topics { flex: 1; min-width: 0; margin: 0; }
.report-topics .tag { white-space: normal; overflow-wrap: anywhere; }
.report-content { padding: 20px; border-top: 1px solid var(--line); }
.report-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.report-actions .button { min-height: 44px; }
.student-report .note-stack { gap: 18px; }
.student-report .note-block { border: 0; border-radius: 0; border-bottom: 1px solid var(--line); background: transparent; }
.student-report .note-title { background: transparent; }
.homework-topic > summary:focus-visible, .homework-more > summary:focus-visible, .report-summary:focus-visible, .homework-question-link:focus-visible { outline: 2px solid var(--mint-deep); outline-offset: -2px; }
@media (max-width: 1000px) { .student-home .latest-lesson { align-items: flex-start; flex-direction: column; } .student-home .lesson-actions { flex-wrap: wrap; } .report-summary { gap: 14px; } .report-heading { flex-basis: 145px; } }
@media (max-width: 760px) {
  .student-home .student-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .homework-columns { grid-template-columns: 1fr; gap: 24px; }
  .student-recent { margin-bottom: 24px; }
  .report-summary { display: grid; grid-template-columns: minmax(0, 1fr) 24px; gap: 12px; padding: 16px; }
  .report-heading { grid-column: 1; }
  .report-summary > .disclosure-chevron { grid-column: 2; grid-row: 1; }
  .report-topics { grid-column: 1 / -1; }
  .report-content { padding: 16px; }
}
.homework-picker { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-top: 10px; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--cream-200); }
.homework-picker > span { padding: 0 7px; color: var(--muted); font-size: 13px; }
.homework-picker button { min-height: 34px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 13px; }
.homework-picker button:hover { background: rgba(255,255,255,.65); color: var(--ink); }
.homework-picker button.active { background: var(--cream-50); color: var(--mint-deep); font-weight: 600; box-shadow: 0 2px 7px rgba(87,67,42,.08); }
.latest-lesson { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.latest-lesson > div:first-child { min-width: 0; }
.readonly-note { padding: 14px 16px; font-size: 13px; line-height: 1.75; overflow-wrap: anywhere; }
.lesson-detail-topics { margin: 0 0 18px; }
.history-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.question-progress-labels:empty { display: none; }
.question-progress-labels { margin-top: 12px; }

.empty { padding: 36px 18px; text-align: center; color: var(--muted); font-size: 13px; }
.empty strong { display: block; color: var(--ink); margin-bottom: 5px; }
.notice { background: #fff4d9; color: #8a6624; border: 1px solid #f0dfb3; padding: 10px 12px; border-radius: 9px; font-size: 13px; line-height: 1.5; margin-bottom: 16px; }
.notice.success { background: #eaf6ef; color: var(--mint-deep); border-color: #cde6d8; }
.import-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 15px; }
.import-meta div { padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--cream-100); }
.import-meta span, .import-meta strong { display: block; font-size: 13px; }
.import-meta span { color: var(--muted); margin-bottom: 4px; }
.import-question-list { display: grid; gap: 8px; max-height: 300px; overflow: auto; padding-right: 4px; }
.import-question-list > div { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 9px; padding-bottom: 8px; border-bottom: 1px solid var(--line); font-size: 13px; line-height: 1.55; }
.import-split-list { display: grid; gap: 7px; margin-bottom: 14px; }
.import-split-list > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--cream-100); }
.import-split-list span { color: var(--mint-deep); white-space: nowrap; }
.metric-grid.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.student-lessons { margin-bottom: 18px; }
.student-lesson-tabs { display: flex; gap: 8px; padding: 12px 18px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.student-lesson-button { display: grid; gap: 3px; min-width: 92px; min-height: 48px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fffefa; color: var(--ink); text-align: left; }
.student-lesson-button span { color: var(--muted); font-size: 13px; }
.student-lesson-button:hover { border-color: #a4d5be; background: #f4fbf6; }
.student-lesson-button.active { border-color: #8fc8ad; background: #e7f3eb; color: var(--mint-deep); }
.student-lesson-summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 18px; }
.student-lesson-summary > div:first-child { display: grid; align-content: start; gap: 4px; }
.student-lesson-summary > div:first-child > span { color: var(--muted); font-size: 13px; }
.lesson-question-preview { max-height: 420px; overflow: auto; padding: 0 18px 16px; }
.lesson-question-preview-head { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; gap: 12px; padding: 10px 0 8px; background: var(--cream-50); color: var(--muted); font-size: 13px; }
.lesson-question-preview-head strong { color: var(--ink); }
.lesson-question-preview-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 8px 0; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; }
.lesson-question-preview-item:hover { color: var(--mint-deep); background: var(--cream-100); }
.lesson-question-preview-item > span:nth-child(2) { min-width: 0; }
.lesson-question-preview-item small, .lesson-question-preview-item strong { display: block; overflow-wrap: anywhere; }
.lesson-question-preview-item small { margin-bottom: 3px; color: var(--muted); font-size: 12px; }
.lesson-question-preview-item strong { font-size: 13px; line-height: 1.45; }
.preview-arrow { color: var(--muted); }
.lesson-topics { display: flex; flex-wrap: wrap; gap: 8px; }
.lesson-topic { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--cream-100); color: var(--ink); font-size: 13px; line-height: 1.4; }
.lesson-topic b { color: var(--coral-deep); }
.lesson-topic:hover { border-color: #9bcbb4; background: #edf7f1; }
.progress-filters { display: grid; grid-template-columns: minmax(240px, 1fr) repeat(3, minmax(140px, auto)); gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--cream-100); }
.progress-filters label { display: grid; align-content: end; gap: 6px; }
.progress-filters .search, .progress-filters .filter { width: 100%; min-width: 0; }
.student-progress-browser { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: 520px; }
.progress-directory { max-height: 680px; }
.progress-content { min-width: 0; }
.progress-topic-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 66px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.progress-topic-head > div { display: grid; gap: 3px; }
.progress-topic-head > div span, .progress-topic-head > span { color: var(--muted); font-size: 13px; }
.progress-topic-head strong { font-size: 15px; }
.progress-topic-actions { display: flex !important; align-items: center; gap: 14px !important; }
.note-width-control { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.note-width-control input { width: 112px; min-height: 24px; padding: 0; accent-color: var(--mint-deep); }
.progress-table-wrap { max-height: 620px; overflow: auto; }
.progress-table { min-width: 800px; }
.progress-table thead { position: sticky; top: 0; z-index: 1; background: var(--cream-50); }
.progress-table th:first-child { width: 90px; }
.progress-table th:nth-child(3) { width: 350px; }
.progress-table th:nth-child(4) { width: 150px; }
.progress-table th:last-child { width: var(--note-width); }
.progress-topic { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; line-height: 1.5; }
.progress-question-copy { line-height: 1.6; }
.progress-question-copy > span { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; }
.progress-note { width: var(--note-width); min-width: var(--note-width); line-height: 1.65; }
.progress-note-entry + .progress-note-entry { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.progress-note-entry > b { display: block; margin-bottom: 3px; color: var(--coral-deep); font-size: 13px; }
.progress-labels { display: flex; flex-wrap: wrap; gap: 6px; }
.progress-label { padding: 4px 7px; border: 1px solid transparent; border-radius: 6px; font-size: 13px; white-space: nowrap; }
.progress-label.taught { background: #fde7e5; border-color: #f3c1bc; color: #9d3f37; }
.progress-label.practiced { background: #efecff; color: #655d94; }
.progress-label.retold { background: #fce9f0; border-color: #efbfd0; color: #92516a; }
.progress-label.help { background: #fff1b8; border-color: #ead37a; color: #755b08; }
.progress-label.homework { background: #fff2c9; border-color: #ead28b; color: #75570a; }
.progress-label.pending { background: #f3efe8; color: var(--muted); }
.progress-table tr.homework-target td { background: #fff7d9; transition: background 1.8s ease; }
.pdf-export-stage { position: fixed; left: -10000px; top: 0; }
.pdf-export-root { position: relative; width: 657px; background: #fff; color: #181818; font-family: "PingFang SC", "苹方-简", "Microsoft YaHei", sans-serif; font-size: 13px; line-height: 1.7; }
.pdf-export-root * { box-sizing: border-box; }
.pdf-export-root h1 { margin: 0; font-size: 17px; line-height: 1.45; }
.pdf-logo { display: block; width: 128px; height: auto; margin-bottom: 18px; }
.pdf-meta { display: flex; flex-wrap: wrap; gap: 6px 24px; margin-top: 7px; color: #555; }
.pdf-watermark { position: absolute; left: 50%; top: 420px; transform: translateX(-50%) rotate(-35deg); color: rgba(224, 224, 224, .55); font-size: 66px; font-weight: 700; white-space: nowrap; z-index: 0; }
.pdf-export-root header, .pdf-general-note, .pdf-questions, .pdf-export-root footer { position: relative; z-index: 1; }
.pdf-general-note { margin-top: 22px; padding: 13px 15px; border: 1px solid #cfe1d7; background: #f6fbf8; break-inside: avoid; page-break-inside: avoid; }
.pdf-general-note > b { display: block; margin-bottom: 5px; color: #2f7764; }
.pdf-questions { margin-top: 24px; }
.pdf-question { break-inside: avoid; page-break-inside: avoid; padding: 17px 0; border-top: 1px solid #dedede; }
.pdf-question:first-child { padding-top: 0; border-top: 0; }
.pdf-question-label { margin-bottom: 3px; color: #555; font-weight: 600; }
.pdf-question-text { font-size: 14px; font-weight: 700; }
.pdf-cue { margin: 6px 0 10px; color: #666; }
.pdf-note { margin-top: 11px; }
.pdf-export-root footer { margin-top: 24px; padding-top: 8px; border-top: 1px solid #dedede; color: #777; }
.toast { position: fixed; right: 24px; bottom: 24px; background: #332f29; color: #fff; border-radius: 10px; padding: 11px 14px; font-size: 13px; box-shadow: var(--shadow); z-index: 20; opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translateY(0); }
.modal-backdrop { position: fixed; inset: 0; background: rgba(50,47,42,.26); display: none; align-items: center; justify-content: center; z-index: 10; padding: 20px; }
.modal-backdrop.open { display: flex; }
.modal { width: min(680px, 100%); max-height: 90vh; overflow: auto; background: var(--cream-50); border-radius: 16px; border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(58,43,29,.2); }
.modal .panel-head { position: sticky; top: 0; background: var(--cream-50); z-index: 1; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 28px 18px; background: var(--cream-100); }
.login-card { width: min(460px, 100%); padding: 36px; border: 1px solid var(--line); border-radius: 12px; background: var(--cream-50); box-shadow: var(--shadow); }
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand strong, .login-brand span { display: block; }
.login-brand strong { font-size: 16px; }
.login-brand span { margin-top: 1px; color: var(--muted); }
.login-copy { margin: 30px 0 26px; }
.login-copy > span { color: var(--coral-deep); font-weight: 700; }
.login-copy h1 { margin-top: 7px; }
.login-copy p { margin: 10px 0 0; color: var(--muted); }
.login-form, .account-form { display: grid; gap: 16px; }
.login-form input, .account-form input { width: 100%; min-height: 46px; border: 1px solid var(--cream-300); border-radius: 8px; padding: 0 13px; background: #fffefa; color: var(--ink); }
.login-error { min-height: 21px; margin: -5px 0 0; color: #a34e31; }
.login-submit { width: 100%; min-height: 46px; }
.login-submit:disabled, .account-form button:disabled { cursor: wait; opacity: .65; }
.login-change-key { display: block; margin: 12px auto 0; }
.login-setup-note { margin-bottom: 16px; padding: 12px 14px; border-left: 3px solid var(--coral); background: #fff8ee; color: var(--muted); }
.login-loading { text-align: center; }
.login-loading .login-brand { justify-content: center; }
.login-loading p { margin: 16px 0 0; color: var(--muted); }
.loading-dot { width: 26px; height: 26px; margin: 42px auto 0; border: 3px solid var(--cream-300); border-top-color: var(--mint-deep); border-radius: 50%; animation: login-spin .8s linear infinite; }
@keyframes login-spin { to { transform: rotate(360deg); } }
.account-modal { width: min(520px, 100%); }
.account-success h3 { margin: 14px 0 18px; font-size: 20px; }
.account-success dl { display: grid; gap: 1px; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--line); }
.account-success dl > div { display: grid; grid-template-columns: 90px 1fr; gap: 16px; padding: 11px 13px; background: #fffefa; }
.account-success dt { color: var(--muted); }
.account-success dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.account-success p { margin: 15px 0 0; color: var(--muted); }

@media (max-width: 1080px) { .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-2, .lesson-grid { grid-template-columns: 1fr; } }
@media (max-width: 1080px) { .lesson-record { grid-template-columns: minmax(180px, 1.2fr) repeat(2, minmax(100px, 1fr)); } .lesson-record-actions { grid-column: 2 / -1; } }
@media (max-width: 760px) { .shell, .shell.sidebar-collapsed { grid-template-columns: 1fr; } .sidebar { position: sticky; top: 0; z-index: 5; align-self: auto; height: auto; max-height: none; overflow-y: visible; padding: 12px 14px; border-right: 0; border-bottom: 1px solid var(--line); gap: 11px; } .sidebar-head { display: block; } .sidebar-toggle { display: none; } .brand { padding: 0 4px; } .shell.sidebar-collapsed .brand-copy { display: block; } .tenant, .sidebar-footer, .nav-heading { display: none; } .nav { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 1px; } .nav-item, .shell.sidebar-collapsed .nav-item { min-width: max-content; min-height: 36px; padding: 0 10px; justify-content: flex-start; } .shell.sidebar-collapsed .nav-label { display: inline; } .nav-icon, .shell.sidebar-collapsed .nav-icon { width: 18px; height: 18px; font-size: 15px; } .topbar { height: 60px; padding: 0 16px; } .content { padding: 22px 16px 40px; } .page-head { align-items: flex-start; flex-direction: column; } .metric-grid, .metric-grid.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; } .metric { padding: 14px; } .metric-value { font-size: 23px; } .form-grid { grid-template-columns: 1fr; } .field.full { grid-column: auto; } .table-wrap { margin: 0 -19px; } table { min-width: 620px; } .question-browser, .lesson-question-browser { grid-template-columns: 1fr; } .topic-directory, .lesson-question-browser .topic-directory { border-right: 0; border-bottom: 1px solid var(--line); max-height: 210px; } .topic-content { padding: 16px; } .import-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); } .student-lesson-summary { grid-template-columns: 1fr; gap: 12px; } .progress-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } .progress-search { grid-column: 1 / -1; } .latest-lesson { align-items: flex-start; flex-direction: column; } .latest-lesson .lesson-actions { justify-content: flex-start; flex-wrap: wrap; } .student-report .panel-head { align-items: flex-start; } .modal { border-radius: 8px; } }
@media (max-width: 480px) { .progress-filters { grid-template-columns: 1fr; } .progress-search { grid-column: auto; } }
@media (max-width: 480px) { .homework-jump { width: 100%; } .homework-picker > span { width: 100%; padding-block: 4px 2px; } }
@media (max-width: 480px) { .field-label-row { align-items: flex-start; flex-direction: column; gap: 2px; } .field-hint { text-align: left; } }
@media (max-width: 480px) { .lesson-notes-panel.notes-fullscreen > .panel-head { align-items: flex-start; } .note-view-actions { flex-wrap: wrap; justify-content: flex-end; } .general-note-hint { display: none; } }
@media (max-width: 480px) { .login-card { padding: 25px 20px; } .login-copy { margin-top: 34px; } .signed-in-user > span { display: none; } }
@media (max-width: 760px) {
  .lesson-record { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; padding: 16px; }
  .lesson-record-person, .lesson-record-actions { grid-column: 1 / -1; }
  .lesson-record-actions { justify-content: flex-start; }
  .student-progress-browser { grid-template-columns: 1fr; }
  .progress-directory { max-height: 220px; border-right: 0; border-bottom: 1px solid var(--line); }
  .progress-table-wrap { max-height: none; margin: 0; overflow: visible; }
  .progress-table { display: block; min-width: 0; width: 100%; }
  .progress-table thead { display: none; }
  .progress-table tbody { display: block; }
  .progress-table tr { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 12px; padding: 15px 16px; border-top: 1px solid #f0e9df; }
  .progress-table td, .progress-table td:first-child, .progress-table td:last-child { padding: 0; border: 0; min-width: 0; }
  .progress-question-copy { align-self: center; }
  .progress-status-cell, .progress-note { grid-column: 1 / -1; }
  .progress-note { width: auto; min-width: 0; padding-top: 2px !important; }
  .note-width-control { display: none; }
}
@media (max-width: 420px) { .metric-grid { grid-template-columns: 1fr 1fr; } .metric-note { font-size: 13px; } .role-select { max-width: 110px; } h1 { font-size: 25px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; } }

/* Student pages share the teacher shell palette; color is reserved for small widgets. */
.student-shell .metric:nth-child(1) { background: #e7f3eb; border-color: #c8e3d4; }
.student-shell .metric:nth-child(2) { background: #fbe8ef; border-color: #efd0dc; }
.student-shell .metric:nth-child(3) { background: #e8f0fa; border-color: #cddced; }
.student-shell .metric:nth-child(4) { background: #fff3d5; border-color: #eadcae; }
.student-shell .button { border-radius: 8px; }
.student-shell .metric-icon { background: #ffffffa6; }
.student-shell .tag { background: #e7f3eb; color: var(--mint-deep); border-radius: 6px; }
.student-shell .tag:nth-child(3n+2) { background: #fff3d5; color: #8a6624; }
.student-shell .tag:nth-child(3n+3) { background: #e8f0fa; color: #285d8d; }
.student-shell .student-section-head h2 { display: flex; align-items: center; gap: 10px; font-size: 19px; }
.student-shell .student-recent { border-bottom: 1px dashed var(--line); }
.student-shell .student-recent .latest-lesson { border-left: 3px solid var(--coral); padding: 8px 0 8px 20px; }
.student-shell .homework-column-head { border-top: 0; padding: 12px 14px; background: #e9f4f0; border-left: 3px solid #8bc2ab; }
.student-shell .homework-column.practice .homework-column-head { background: #edf1fc; border-left-color: #9dafe0; }
.student-shell .homework-topic { border-bottom: 1px dashed var(--line); }
.student-shell .homework-topic > summary { padding-inline: 12px; }
.student-shell .homework-topic > summary:hover { background: var(--cream-200); }
.student-shell .homework-topic[open] > summary { background: var(--cream-100); }
.student-shell .student-report { border-color: var(--line); }
.student-shell .report-summary:hover { background: #fff0e8; }
.student-shell .topic-button.active { background: #e7f3eb; color: var(--mint-deep); }
.student-brand-logo { width: 84px; height: 54px; object-fit: contain; mix-blend-mode: multiply; }
.notebook-sticker { display: inline-block; flex: 0 0 25px; width: 25px; height: 29px; border: 2px solid var(--coral-deep); border-left: 5px solid var(--coral-deep); border-radius: 3px; background: repeating-linear-gradient(#fff0e8 0 6px, #f3ad8d 6px 7px); transform: rotate(-7deg); box-shadow: 2px 2px 0 #f3ecdf; }
.pencil-sticker { display: inline-block; flex: 0 0 8px; width: 8px; height: 27px; margin-inline: 8px; border: 1px solid #b79952; border-bottom: 5px solid #685d57; border-top: 5px solid #dda8b7; border-radius: 2px; background: #f8d986; transform: rotate(22deg); }
.learning-status { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; }
.learning-status .progress-labels:empty { display: none; }
.learning-status .practice-actions { margin-top: 0; }
.learning-status .practice-button { min-height: 30px; }
.homework-completion { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 5px 8px; min-height: 34px; max-width: 100%; background: #fff5d6; border: 1px solid #e5d398; border-radius: 6px; color: #795c1b; font-size: 13px; line-height: 1.35; }
label.homework-completion { cursor: pointer; }
.homework-completion small { font-size: 12px; }
.homework-completion.complete { color: #316854; background: #eaf5ef; border-color: #b9d8c6; }
.homework-completion input, .homework-bulk input, .draw-overseas input { width: 17px; height: 17px; min-height: 17px; flex-shrink: 0; margin: 0; padding: 0; accent-color: #447e68; }
.homework-completion:has(input:disabled), .homework-bulk:has(input:disabled) { opacity: .65; cursor: wait; }
.homework-completion:focus-within, .homework-bulk:focus-within { outline: 2px solid #477e72; outline-offset: 2px; }
.homework-bulk { display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 8px; color: var(--mint-deep); cursor: pointer; border-bottom: 1px solid var(--line); }
.homework-bulk > span { margin-left: auto; }
.homework-assignment { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; }
.homework-assignment + .homework-assignment { border-top: 1px solid var(--line); }
.homework-assignment .homework-question-link { padding: 4px 8px; }
.homework-topic-count { max-width: 115px; white-space: normal; text-align: right; }
.homework-topic-count.complete { color: #347768; }
.lesson-question-state { padding: 12px 16px 0; }
.lesson-question-state .learning-status { display: flex; align-items: center; flex-wrap: wrap; }
.question-card .learning-status { justify-content: flex-end; max-width: 620px; }
.question-card .learning-status .practice-actions { order: 0; }
.question-card .learning-status .progress-labels { order: 1; }
.question-card .learning-status .homework-completion { order: 2; }
.question-card-feedback { display: grid; justify-items: end; gap: 8px; }
.difficulty-control { display: inline-flex; flex-direction: column; align-items: stretch; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: var(--cream-100); white-space: nowrap; }
.difficulty-control > span { padding: 0 5px; color: var(--muted); font-size: 12px; }
.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; }
.difficulty-control button { min-width: 32px; min-height: 28px; padding: 0 7px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 13px; }
.difficulty-control button:hover { background: #fff; color: var(--ink); }
.difficulty-control button.active { color: #fff; font-weight: 650; }
.difficulty-control button.active.easy { background: var(--mint-deep); }
.difficulty-control button.active.medium { background: #b07a1e; }
.difficulty-control button.active.hard { background: var(--coral-deep); }
.difficulty-readonly { display: inline-flex; min-width: 30px; min-height: 28px; align-items: center; justify-content: center; border-radius: 6px; color: #fff; font-size: 13px; font-weight: 650; }
.difficulty-readonly.easy { background: var(--mint-deep); }
.difficulty-readonly.medium { background: #b07a1e; }
.difficulty-readonly.hard { background: var(--coral-deep); }
.aggregate-difficulty { display: inline-flex; align-items: center; min-height: 30px; padding: 4px 9px; border-radius: 7px; font-size: 13px; white-space: nowrap; }
.aggregate-difficulty.easy { background: #e7f3eb; color: var(--mint-deep); }
.aggregate-difficulty.medium { background: #fff2c9; color: #795c1b; }
.aggregate-difficulty.hard { background: #ffeadf; color: var(--coral-deep); }
.aggregate-difficulty.tied, .aggregate-difficulty.unrated { background: var(--cream-200); color: var(--muted); }
.question-bank-notes > summary { cursor: pointer; min-height: 44px; padding: 10px 0; color: var(--mint-deep); font-weight: 600; }
.question-note-source { display: grid; gap: 3px; padding: 8px 10px; border-radius: 7px; background: var(--cream-100); color: var(--ink); }
.question-note-source > span, .student-note-readonly > b { color: var(--muted); font-size: 12px; font-weight: 600; }
.student-note-editor { min-height: 42px; margin-top: 7px; padding: 8px 10px; border: 1px dashed #d9c48b; border-radius: 7px; background: #fffdf3; color: var(--ink); outline: 0; }
.student-note-editor:empty::before { content: attr(data-placeholder); color: #a79d8f; pointer-events: none; }
.student-note-editor:focus { border-color: #cda94b; box-shadow: 0 0 0 2px rgba(205,169,75,.15); }
.progress-note-editor { min-height: 64px; margin-top: 6px; background: var(--cream-50); }
.student-note-readonly { display: grid; gap: 3px; margin-top: 7px; padding: 8px 10px; border-radius: 7px; background: #fffdf3; color: var(--ink); }
.practice-draw-form { padding: 0 0 24px; border-bottom: 1px solid var(--line); }
.draw-filters, .draw-counts { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) minmax(140px, .7fr); gap: 20px; align-items: end; max-width: 960px; }
.draw-counts { margin-top: 20px; }
.draw-filters .field, .draw-counts .field { min-width: 0; }
.draw-filters select, .draw-counts input { width: 100%; }
.draw-counts .field small { color: var(--muted); font-size: 13px; }
.draw-counts .button { min-height: 44px; align-self: center; }
.draw-overseas { display: flex; align-items: center; gap: 9px; min-height: 44px; cursor: pointer; }
.draw-error { color: #a34050; margin: 12px 0 0; min-height: 22px; }
.practice-results { margin-top: 26px; }
.draw-browser { display: grid; grid-template-columns: 230px minmax(0, 1fr); border-top: 1px solid var(--line); }
.draw-browser .topic-directory { max-height: 660px; background: transparent; }
.draw-browser .topic-button { min-height: 62px; }
.draw-browser .topic-button small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); margin-bottom: 3px; }
.draw-questions { min-width: 0; padding: 18px 24px; }
.draw-questions > h3 { font-size: 20px; margin: 0 0 18px; overflow-wrap: anywhere; }
.draw-questions .question-card { border-radius: 8px; padding: 14px; margin-bottom: 14px; }
.student-shell .draw-questions .question-card { background: var(--cream-50); border-color: var(--line); box-shadow: 3px 3px 0 var(--cream-200); }
@media (max-width: 1050px) { .homework-assignment { grid-template-columns: 1fr; gap: 6px; } .homework-assignment .homework-completion { justify-self: start; margin-left: 8px; } }
@media (max-width: 760px) {
  .student-shell .page-head { flex-direction: row; align-items: center; gap: 12px; }
  .student-brand-logo { width: 64px; height: 42px; }
  .student-shell .student-section-head h2 { font-size: 18px; }
  .draw-filters, .draw-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .draw-overseas, .draw-counts .button { grid-column: 1 / -1; }
  .draw-browser { grid-template-columns: 1fr; }
  .draw-browser .topic-directory { max-height: 230px; border-right: 0; border-bottom: 1px solid var(--line); }
  .draw-questions { padding: 18px 0; }
  .practice-results .student-section-head { align-items: flex-start; flex-wrap: wrap; }
  .question-card-row { grid-template-columns: 1fr; gap: 10px; }
  .question-card .learning-status { justify-content: flex-start; max-width: none; }
}


@media print { .sidebar, .topbar, .button, .toolbar, .tabs { display: none !important; } .shell { display: block; } .content { padding: 0; } .panel { box-shadow: none; } }
