/* Teacher workbench and classroom viewers: calibrated against D:\ENGLISH v12 screenshots/source. */
.teacher-workspace.teacher-home {
  box-sizing: border-box;
  /* Keep the workspace inside the scroll container's usable width, like the legacy teacher page. */
  width: 100%;
  max-width: none;
  margin: 0;
  /* Match the original fullscreen #mBody gutters plus the inner 24px home padding. */
  padding: 52px calc(clamp(24px, 3vw, 56px) + 24px) 36px;
  color: #26384e;
  text-align: left;
  font-family: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
}
.teacher-home .teacher-home-hero {
  position: relative;
  min-height: 82px;
  align-items: center;
  padding: 19px 22px;
  margin: 0 0 16px;
  border: 1px solid #d4dde6;
  border-left: 4px solid #b78a2d;
  border-radius: 4px;
  background: linear-gradient(135deg, #f8fafc 0%, #eef3f7 100%);
  box-shadow: 0 4px 16px rgba(31, 55, 80, .07);
}
.teacher-home .teacher-home-hero-kicker { margin-bottom: 5px; color: #b78a2d; font-size: 10px; font-weight: 800; letter-spacing: 1.8px; }
.teacher-home .teacher-home-hero h2 { margin: 0; color: #17365d; font: 700 24px/1.25 "Segoe UI", "Microsoft YaHei UI", sans-serif; }
.teacher-home .teacher-home-hero p { margin: 7px 0 0; color: #6b7a8d; font-size: 12px; line-height: 1.65; }
.teacher-home .teacher-home-hero-mark { width: 58px; height: 58px; font-size: 27px; }
.teacher-home-back { align-self: flex-start; padding: 7px 11px; border: 1px solid #cbd7e2; border-radius: 5px; background: #fffdf7; color: #294767; font: inherit; font-size: 11px; cursor: pointer; }
.teacher-home .teacher-home-nav {
  position: sticky;
  top: 4px;
  z-index: 18;
  display: flex;
  gap: 4px;
  margin: 0 0 14px;
  padding: 5px;
  border: 1px solid #cbd7e2;
  border-radius: 7px;
  background: #17365d;
  box-shadow: 0 5px 14px rgba(23, 54, 93, .12);
}
.teacher-home .teacher-home-tab { flex: 0 0 132px; min-width: 132px; height: 40px; padding: 0 12px; border: 0; border-radius: 5px; background: transparent; color: #dbe7f2; font-size: 12px; font-weight: 700; cursor: pointer; }
.teacher-home .teacher-home-tab span { margin-right: 7px; font-size: 16px; }
.teacher-home .teacher-home-tab:hover { background: rgba(255,255,255,.1); color: #fff; }
.teacher-home .teacher-home-tab.active { background: #fffdf7; color: #17365d; box-shadow: 0 3px 0 #d6e0e8, 0 7px 13px rgba(4,18,35,.2); }
.teacher-home-subnav { display: flex; align-items: center; gap: 7px; min-height: 38px; margin: 0 0 14px; padding: 0 4px 9px; border-bottom: 1px solid #dbe2e8; }
.teacher-home-subnav button { min-height: 30px; padding: 0 13px; border: 1px solid #d3dce5; border-radius: 5px; background: #fff; color: #53677d; font: inherit; font-size: 11px; cursor: pointer; }
.teacher-home-subnav button[aria-current="page"] { border-color: #b78a2d; background: #fff8e6; color: #6d4c12; font-weight: 700; }
.teacher-home-content { min-width: 0; }
.teacher-home-content .teacher-notice { margin: 0 0 12px; }
.teacher-home-content .teacher-materials-stack { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 14px; }
.teacher-home-content .teacher-documents-layout { display: block; min-width: 0; padding: 0; }
.teacher-home-content .teacher-document-library { min-height: 190px; padding: 14px; border: 1px solid #d7e0e8; border-top: 3px solid #b78a2d; border-radius: 7px; background: #fffdf7; box-shadow: 0 4px 13px rgba(31,55,80,.06); }
.teacher-home-content .teacher-document-library > header h3 { color: #17365d; font: 700 15px/1.35 "Segoe UI", "Microsoft YaHei UI", sans-serif; }
.teacher-home-content .teacher-document-library > header p { color: #6b7a8d; font-size: 10px; }
.teacher-home-content .teacher-document-library > header small { color: #b78a2d; font-size: 9px; }
.teacher-home-content .teacher-document-upload { padding: 8px; font-size: 10px; }
.teacher-home-content .teacher-document-upload input { font-size: 10px; }
.teacher-home-content .teacher-document-library form > button { height: 32px; font-size: 10px; }
.teacher-home-content .teacher-document-item { grid-template-columns: minmax(0,1fr) auto; padding: 8px; background: #fff; }
.teacher-home-content .teacher-document-item b { color: #294767; font-size: 11px; }
.teacher-home-content .teacher-document-item span, .teacher-home-content .teacher-document-item small { font-size: 9px; }
.teacher-home-content .teacher-document-viewer[hidden] { display: none !important; }
.teacher-home-content .teacher-document-viewer { min-width: 0; margin-top: 12px; }
.teacher-classroom-tools-layout { display: grid; gap: 14px; min-width: 0; }
.teacher-classroom-schedule > header, .teacher-classroom-records > header,
.teacher-classroom-record-form > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.teacher-classroom-schedule > header h3, .teacher-classroom-records > header h3,
.teacher-classroom-record-form > header h3 { margin: 3px 0; color: #17365d; font-size: 16px; }
.teacher-classroom-schedule > header p, .teacher-classroom-records > header p { margin: 4px 0 0; color: #718096; font-size: 11px; }
.teacher-classroom-schedule > header small, .teacher-classroom-records > header small,
.teacher-classroom-record-form > header small { color: #b78a2d; font-size: 9px; font-weight: 800; letter-spacing: 1px; }
.teacher-schedule-gate { display: grid; grid-template-columns: minmax(160px,1fr) minmax(180px,300px) auto auto; align-items: center; gap: 8px; margin-top: 14px; padding: 12px; border: 1px solid #dbe2e8; border-radius: 7px; background: #f8fafc; }
.teacher-schedule-gate > div { display: grid; gap: 3px; color: #294767; font-size: 12px; }
.teacher-schedule-gate > div span { color: #718096; font-size: 10px; }
.teacher-schedule-gate input, .teacher-classroom-record-fields input,
.teacher-classroom-record-fields select, .teacher-classroom-record-fields textarea { box-sizing: border-box; width: 100%; min-width: 0; border: 1px solid #cbd5e1; border-radius: 5px; background: #fff; color: #26384e; font: inherit; font-size: 12px; }
.teacher-schedule-gate input, .teacher-classroom-record-fields input, .teacher-classroom-record-fields select { min-height: 34px; padding: 6px 9px; }
.teacher-schedule-gate button, .teacher-classroom-record-form > header button,
.teacher-classroom-record-row button { min-height: 32px; padding: 6px 11px; border: 1px solid #cbd7e2; border-radius: 5px; background: #fff; color: #294767; font: inherit; font-size: 11px; cursor: pointer; }
.teacher-schedule-gate button[type="submit"] { border-color: #b78a2d; background: #b78a2d; color: #fff; }
.teacher-schedule-gate [data-schedule-gate-error] { grid-column: 1 / -1; min-height: 14px; margin: 0; color: #b42318; font-size: 11px; }
.teacher-schedule-import { display: inline-flex; }
.teacher-schedule-status { min-width: 120px; color: #718096; font-size: 10px; }
.teacher-schedule-list { display: grid; gap: 8px; }
.teacher-classroom-record-form { margin-top: 14px; padding: 13px; border: 1px solid #dbe2e8; border-radius: 7px; background: #f8fafc; }
.teacher-classroom-record-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin: 10px 0; }
.teacher-classroom-record-fields label { display: grid; gap: 5px; color: #53677d; font-size: 11px; }
.teacher-classroom-record-fields .wide { grid-column: 1 / -1; }
.teacher-classroom-record-fields textarea { min-height: 78px; padding: 8px 9px; resize: vertical; }
.teacher-classroom-record-form > button.primary { min-height: 34px; padding: 7px 14px; }
.teacher-classroom-record-list { display: grid; gap: 8px; margin-top: 12px; }
.teacher-classroom-record-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; border: 1px solid #dbe2e8; border-radius: 7px; background: #fff; }
.teacher-classroom-record-row > div:first-child { display: grid; min-width: 0; gap: 3px; }
.teacher-classroom-record-row small { color: #718096; font-size: 10px; }
.teacher-classroom-record-row b { color: #294767; font-size: 12px; }
.teacher-classroom-record-row span, .teacher-classroom-record-row p { overflow-wrap: anywhere; margin: 0; color: #53677d; font-size: 11px; }
.teacher-classroom-record-row > div:last-child { display: flex; flex: 0 0 auto; gap: 5px; }
.teacher-classroom-record-row button.danger { border-color: #fecaca; color: #b42318; }

/* Teacher materials landing page follows the legacy three-entry and two-column library layout. */
.teacher-home-content .teacher-materials-stack { display: block; }
.teacher-home-content .teacher-materials-stack > .teacher-home-section-label { margin: 14px 0 8px; color: #294767; font-size: 13px; font-weight: 700; }
.teacher-home-content .teacher-home-quick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.teacher-home-content .teacher-home-action { box-sizing: border-box; width: 100%; text-align: left; font: inherit; }
.teacher-home-content .teacher-home-action-head { display: flex; align-items: center; gap: 9px; }
.teacher-home-content .teacher-home-action-desc { display: block; }
.teacher-home-content .teacher-upload-proxies[hidden],
.teacher-home-content .teacher-document-viewer[hidden] { display: none !important; }
.teacher-home-content .teacher-material-grid { grid-template-columns: minmax(0, 1.18fr) minmax(280px, .82fr); margin-top: 18px; }
.teacher-home-content .teacher-tool-panel { min-width: 0; margin: 0; padding: 14px 16px; border: 1px solid #dbe2e8; border-radius: 9px; background: #fff; box-shadow: 0 2px 8px rgba(15,23,42,.04); text-align: left; }
.teacher-home-content .teacher-tool-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; color: #263238; font-size: 14px; font-weight: 700; }
.teacher-home-content .teacher-tool-panel-heading small { color: #94a3b8; font-size: 10px; font-weight: 400; }
.teacher-home-content .teacher-home-column { display: grid; gap: 14px; min-width: 0; }
.teacher-home-content .teacher-word-list { display: grid; gap: 6px; margin: 0; text-align: left; }
.teacher-home-content .teacher-material-list-row { box-sizing: border-box; width: 100%; min-width: 0; min-height: 40px; margin: 0; padding: 8px 10px; border: 1px solid #dbe2e8; border-radius: 7px; background: #fff; }
.teacher-home-content .teacher-material-list-row:hover { border-color: #607d8b; background: #f8fafc; }
.teacher-home-content .teacher-material-list-row.selected { border-color: #b78a2d; background: #fffdf7; }
.teacher-home-content .teacher-material-list-icon { flex: 0 0 auto; font-size: 17px; }
.teacher-home-content .teacher-material-open { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex: 1 1 auto; min-width: 0; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.teacher-home-content .teacher-material-open:hover { background: transparent; }
.teacher-home-content .teacher-material-open .teacher-word-list-name { display: block; }
.teacher-home-content .teacher-material-open small,
.teacher-home-content .teacher-saved-paper small { flex: 0 0 auto; color: #94a3b8; font-size: 10px; }
.teacher-home-content .teacher-material-delete { flex: 0 0 auto; padding: 3px 7px; border: 1px solid #fecaca; border-radius: 5px; background: #fff; color: #b42318; font: inherit; font-size: 10px; cursor: pointer; }
.teacher-home-content .teacher-saved-paper { box-sizing: border-box; width: 100%; margin: 0; text-align: left; font: inherit; }
.teacher-home-content .teacher-saved-paper:hover { background: #f8fafc; }
.teacher-home-content .teacher-material-viewer { min-width: 0; margin-top: 18px; }
.teacher-home-content .teacher-home-tip p { margin: 0; color: #6b7a8d; font-size: 11px; line-height: 1.8; }
@media (max-width: 980px) {
  .teacher-home-content .teacher-material-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .teacher-home .teacher-home-tab { flex: 1 0 118px; min-width: 118px; }
  .teacher-home-content .teacher-home-quick-grid { grid-template-columns: 1fr; }
  .teacher-home-content .teacher-material-list-row { align-items: flex-start; }
  .teacher-home-content .teacher-material-open { align-items: flex-start; flex-direction: column; gap: 3px; }
  .teacher-schedule-gate { grid-template-columns: 1fr 1fr; }
  .teacher-schedule-gate > div, .teacher-schedule-gate [data-schedule-gate-error] { grid-column: 1 / -1; }
  .teacher-classroom-record-fields { grid-template-columns: 1fr; }
  .teacher-classroom-record-fields .wide { grid-column: auto; }
  .teacher-classroom-record-row { align-items: flex-start; flex-direction: column; }
}

/* Word lecture toolbar and document canvas reproduce the legacy dark classroom surface. */
.teacher-word-viewer.teacher-document-preview { position: relative; overflow: hidden; margin: 0; padding: 0; border: 1px solid #cbd5e1; border-radius: 8px; background: #e5e7eb; color: #1f2937; }
.teacher-word-viewer > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #d5dde6; background: #f8fafc; }
.teacher-word-viewer > header h3 { color: #17365d; font: 700 16px/1.35 "Segoe UI", "Microsoft YaHei UI", sans-serif; }
.teacher-word-viewer > header small, .teacher-word-viewer > header span { color: #718096; font-size: 10px; }
.teacher-word-viewer .teacher-word-toolbar { position: relative; z-index: 10; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 9px 11px; border-radius: 0; background: #263238; color: #fff; }
.teacher-word-viewer .teacher-word-toolbar button { min-height: 30px; padding: 5px 8px; border: 1px solid rgba(255,255,255,.35); border-radius: 5px; background: rgba(255,255,255,.1); color: #fff; font: inherit; font-size: 11px; white-space: nowrap; cursor: pointer; }
.teacher-word-viewer .teacher-word-toolbar button:hover, .teacher-word-viewer .teacher-word-toolbar button.active { border-color: #93c5fd; background: #2563eb; }
.teacher-word-viewer .teacher-word-toolbar button:disabled { opacity: .42; cursor: not-allowed; }
.teacher-word-viewer .teacher-word-toolbar [hidden] { display: none !important; }
.teacher-word-viewer .teacher-word-control { display: inline-flex; align-items: center; gap: 4px; color: #e2e8f0; font-size: 10px; white-space: nowrap; }
.teacher-word-viewer .teacher-word-control select { height: 27px; padding: 0 5px; border: 1px solid rgba(255,255,255,.35); border-radius: 4px; background: #37474f; color: #fff; font-size: 10px; }
.teacher-word-viewer .teacher-word-control input[type="color"] { width: 27px; height: 27px; padding: 2px; border: 1px solid rgba(255,255,255,.35); border-radius: 4px; background: #37474f; }
.teacher-word-viewer .teacher-word-control input[type="range"] { width: 58px; accent-color: #93c5fd; }
.teacher-word-viewer .teacher-word-control output { min-width: 29px; color: #cbd5e1; font-size: 10px; text-align: right; }
.teacher-word-viewer .teacher-word-status, .teacher-word-viewer [data-word-zoom-label] { color: #cbd5e1; font-size: 10px; }
.teacher-word-viewer .teacher-word-timer { display: inline-flex; align-items: center; gap: 4px; color: #fef3c7; font-size: 11px; font-variant-numeric: tabular-nums; }
.teacher-word-viewer .teacher-word-timer button { min-height: 25px; padding: 3px 7px; }
.teacher-word-viewer .teacher-word-save { border-color: #86efac !important; background: #39745a !important; }
.teacher-word-viewer .teacher-word-close { border-color: #fecaca !important; background: #b42318 !important; }
.teacher-word-viewer .teacher-word-back { border-color: #c4b5fd !important; background: #8b5cf6 !important; }
.teacher-word-viewer .teacher-document-note-help { margin: 0; padding: 7px 12px; border-bottom: 1px solid #d1d9e2; background: #f8fafc; color: #64748b; font-size: 10px; }
.teacher-word-viewer .teacher-document-scroll { position: relative; max-height: 68vh; padding: 22px; overflow: auto; background: #e5e7eb; }
.teacher-word-viewer .teacher-document-canvas { position: relative; min-height: 420px; max-width: 920px; margin: 0 auto; padding: 34px 42px; border: 1px solid #d7dee7; background: #fff; box-shadow: 0 4px 18px rgba(15,23,42,.12); color: #1f2937; font: 15px/1.9 Cambria, "Times New Roman", "Microsoft YaHei", serif; }
.teacher-word-viewer .teacher-document-content { position: relative; z-index: 1; max-height: none; overflow: visible; padding: 0; color: #1f2937; font: inherit; line-height: inherit; }
.teacher-word-viewer .teacher-document-content p { white-space: pre-wrap; }
.teacher-word-viewer .teacher-document-note-layer { z-index: 6; }
.teacher-document-note-layer.editing { pointer-events: auto; }
.teacher-document-note-editor { position: absolute; z-index: 12; box-sizing: border-box; width: min(320px, calc(100vw - 48px)); max-height: min(72vh, 580px); overflow: auto; padding: 12px; border: 1px solid #2563eb; border-radius: 9px; background: #fffdf7; box-shadow: 0 12px 32px rgba(15, 23, 42, .32); color: #24364b; font: 11px/1.45 "Segoe UI", "Microsoft YaHei", sans-serif; }
.teacher-document-note-editor-title { margin: 0 0 8px; color: #17365d; font-size: 13px; font-weight: 750; }
.teacher-document-note-editor > label { display: grid; gap: 4px; margin: 7px 0; color: #52677d; font-size: 10px; }
.teacher-document-note-editor input, .teacher-document-note-editor select, .teacher-document-note-editor textarea { box-sizing: border-box; width: 100%; min-height: 32px; padding: 6px 8px; border: 1px solid #cbd7e2; border-radius: 6px; background: #fff; color: #26384e; font: inherit; font-size: 11px; }
.teacher-document-note-editor textarea { min-height: 66px; resize: vertical; }
.teacher-document-note-editor .teacher-note-editor-row { display: flex; align-items: center; gap: 8px; margin: 8px 0; color: #52677d; font-size: 10px; }
.teacher-document-note-editor .teacher-note-editor-row input[type="color"] { width: 42px; min-height: 28px; padding: 2px; }
.teacher-document-note-editor-error { min-height: 15px; color: #b42318; font-size: 10px; }
.teacher-document-note-editor-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 8px; }
.teacher-document-note-editor-actions button { min-height: 30px; padding: 5px 10px; border: 1px solid #cbd7e2; border-radius: 6px; background: #fff; color: #294767; font: inherit; cursor: pointer; }
.teacher-document-note-editor-actions button.primary { border-color: #b78a2d; background: #b78a2d; color: #fff; font-weight: 700; }
.teacher-word-ink-layer { position: absolute; inset: 0; z-index: 4; width: 100%; height: 100%; overflow: visible; pointer-events: none; touch-action: none; user-select: none; -webkit-user-select: none; }
.teacher-word-ink-layer path { pointer-events: none; }
.teacher-word-page.teacher-mark-active { cursor: crosshair; }
.teacher-word-page.teacher-mark-underline, .teacher-word-page.teacher-mark-highlight, .teacher-word-page.teacher-mark-eraser { cursor: text; }
.teacher-word-text-highlight { background-color: #fde68a; }
.teacher-word-text-underline { text-decoration: underline 2px #dc2626; text-underline-offset: 3px; }
.teacher-word-note-marker { position: absolute; z-index: 8; transform: translate(-50%,-50%); }
.teacher-word-note-dot { width: 21px; height: 21px; padding: 0; border: 2px solid #fff; border-radius: 50%; background: #f59e0b; color: #fff; box-shadow: 0 1px 7px rgba(30,41,59,.35); font-size: 11px; cursor: pointer; }
.teacher-word-note-marker:has(.teacher-word-note-card:not(:empty)) .teacher-word-note-dot { background: #2563eb; }
.teacher-word-note-card { display: none; position: absolute; left: 15px; top: 8px; width: 230px; padding: 9px 10px; border: 1px solid #f59e0b; border-radius: 6px; background: #fff7ed; box-shadow: 0 4px 14px rgba(0,0,0,.2); color: #7c2d12; font-size: 12px; line-height: 1.5; white-space: pre-wrap; }
.teacher-word-note-marker.open .teacher-word-note-card { display: block; }
.teacher-word-note-remove { position: absolute; top: -8px; right: -8px; display: none; width: 19px; height: 19px; padding: 0; border: 1px solid #cbd5e1; border-radius: 50%; background: #fff; color: #475569; cursor: pointer; }
.teacher-word-note-marker:hover .teacher-word-note-remove { display: block; }
.teacher-word-note-card header { display: flex; align-items: center; justify-content: space-between; gap: 5px; margin: -2px -2px 6px; color: #1e3a8a; font-size: 11px; font-weight: 700; }
.teacher-word-note-card header button { padding: 2px 4px; border: 1px solid #cbd5e1; border-radius: 3px; background: #fff; color: #475569; font: inherit; font-size: 10px; cursor: pointer; }
.teacher-word-note-text { white-space: pre-wrap; }
.teacher-word-note-editor { position: absolute; z-index: 12; display: flex; flex-direction: column; gap: 7px; width: 290px; max-width: calc(100vw - 44px); padding: 11px; transform: translate(8px,8px); box-sizing: border-box; border: 1px solid #2563eb; border-radius: 8px; background: #fff; box-shadow: 0 8px 26px rgba(15,23,42,.27); }
.teacher-word-note-editor-title { color: #1e3a8a; font-size: 13px; font-weight: 700; }
.teacher-word-note-editor textarea { width: 100%; min-height: 82px; box-sizing: border-box; padding: 7px; border: 1px solid #cbd5e1; border-radius: 5px; outline: none; resize: vertical; color: #1e293b; font: 12px/1.5 "Microsoft YaHei",sans-serif; }
.teacher-word-note-editor textarea:focus { border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37,99,235,.12); }
.teacher-word-note-editor-error { min-height: 15px; color: #b42318; font-size: 10px; }
.teacher-word-note-editor-actions { display: flex; justify-content: flex-end; gap: 6px; }
.teacher-word-note-editor-actions button { padding: 6px 10px; border: 1px solid #cbd5e1; border-radius: 5px; background: #fff; color: #475569; font-size: 11px; cursor: pointer; }
.teacher-word-note-editor-actions button.primary { border-color: #2563eb; background: #2563eb; color: #fff; }
.teacher-word-student-note-editor { width: 280px; max-height: min(76vh, 620px); overflow-y: auto; border-color: #2563eb; background: #fff; color: #1e293b; }
.teacher-word-student-note-editor label { display: flex; flex-direction: column; gap: 3px; color: #64748b; font-size: 11px; }
.teacher-word-student-note-editor input[type="text"], .teacher-word-student-note-editor select, .teacher-word-student-note-editor textarea { width: 100%; box-sizing: border-box; padding: 6px 7px; border: 1px solid #cbd5e1; border-radius: 5px; outline: none; background: #fff; color: #1e293b; font: 12px/1.45 "Microsoft YaHei",sans-serif; }
.teacher-word-student-note-editor input[type="text"], .teacher-word-student-note-editor select { min-height: 31px; }
.teacher-word-student-note-editor textarea { min-height: 68px; resize: vertical; }
.teacher-word-student-note-editor input:focus, .teacher-word-student-note-editor select:focus, .teacher-word-student-note-editor textarea:focus { border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37,99,235,.12); }
.teacher-word-student-note-color { display: flex; align-items: center; gap: 8px; color: #64748b; font-size: 11px; }
.teacher-word-student-note-color select { flex: 1; }
.teacher-word-student-note-editor [data-word-student-save]:disabled { opacity: .55; cursor: wait; }
.teacher-word-viewer.teacher-spotlight-active .teacher-document-content { filter: brightness(.48); }
.teacher-word-viewer.teacher-spotlight-active .teacher-spotlight { position: absolute; inset: 0; z-index: 9; pointer-events: none; background: radial-gradient(circle 115px at var(--teacher-spotlight-x,50%) var(--teacher-spotlight-y,50%), transparent 0 75px, rgba(15,23,42,.76) 120px); }
.teacher-word-viewer .teacher-projector-hint { position: fixed; right: 16px; bottom: 14px; z-index: 120004; padding: 7px 10px; border-radius: 6px; background: rgba(15,23,42,.78); color: #e2e8f0; font-size: 11px; pointer-events: none; opacity: 0; }
.teacher-word-viewer.teacher-projector-mode .teacher-projector-hint { opacity: .85; }
.teacher-word-viewer.teacher-projector-mode { border-color: #294767; }
.teacher-word-viewer.teacher-word-fullscreen { position: fixed; inset: 0; z-index: 120000; display: flex; flex-direction: column; margin: 0; border: 0; border-radius: 0; background: #0f172a; }
.teacher-word-fullscreen > header, .teacher-word-fullscreen .teacher-document-note-help { display: none !important; }
.teacher-word-fullscreen .teacher-word-toolbar { position: fixed; top: 0; left: 0; right: 0; flex-wrap: wrap; align-content: center; overflow-x: hidden; overflow-y: auto; z-index: 120002; min-height: 60px; max-height: 128px; box-sizing: border-box; }
.teacher-word-fullscreen .teacher-document-scroll { padding-top: 136px; }
.teacher-word-fullscreen .teacher-word-toolbar .teacher-word-spacer, .teacher-word-fullscreen .teacher-word-toolbar .teacher-word-status { display: none; }
.teacher-word-fullscreen .teacher-word-toolbar.teacher-projector-toolbar-hidden { transform: translateY(-105%); opacity: .18; pointer-events: none; }
.teacher-word-fullscreen.teacher-projector-mode .teacher-word-toolbar { transition: transform .22s ease, opacity .22s ease; box-shadow: 0 5px 22px rgba(0,0,0,.28); }
.teacher-word-fullscreen.teacher-projector-mode.teacher-mark-underline .teacher-word-toolbar, .teacher-word-fullscreen.teacher-projector-mode.teacher-mark-highlight .teacher-word-toolbar, .teacher-word-fullscreen.teacher-projector-mode.teacher-mark-eraser .teacher-word-toolbar, .teacher-word-fullscreen.teacher-projector-mode.teacher-mark-text .teacher-word-toolbar, .teacher-word-fullscreen.teacher-projector-mode.teacher-mark-student-note .teacher-word-toolbar, .teacher-word-fullscreen.teacher-projector-mode.teacher-mark-teacher-note .teacher-word-toolbar, .teacher-word-fullscreen.teacher-projector-mode.teacher-mark-pen .teacher-word-toolbar, .teacher-word-fullscreen.teacher-projector-mode.teacher-mark-draw-highlight .teacher-word-toolbar, .teacher-word-fullscreen.teacher-projector-mode.teacher-mark-ink-eraser .teacher-word-toolbar { transform: translateY(0) !important; opacity: 1 !important; pointer-events: auto !important; }
.teacher-word-fullscreen .teacher-document-scroll { flex: 1; height: 100vh; max-height: none; min-height: 0; padding: 92px 34px 34px; box-sizing: border-box; background: #111827; }
.teacher-word-fullscreen .teacher-document-canvas { min-height: calc(100vh - 150px); max-width: 1050px; padding: 54px 72px; font-size: 19px; line-height: 2.05; }
.teacher-word-fullscreen.teacher-projector-mode .teacher-document-scroll { padding-top: 136px; }
.teacher-word-fullscreen.teacher-projector-mode .teacher-document-canvas { max-width: 1180px; padding: 64px 86px; box-shadow: 0 8px 28px rgba(0,0,0,.32); }
.teacher-word-fullscreen.teacher-projector-mode .teacher-word-surface { background: #111827; }
.teacher-whiteboard-overlay { position: fixed; inset: 0; z-index: 120005; display: none; flex-direction: column; background: #0f172a; color: #e2e8f0; }
.teacher-whiteboard-overlay.open { display: flex; }
.teacher-whiteboard-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 58px; padding: 9px 13px; background: #1e293b; box-shadow: 0 3px 14px rgba(0,0,0,.28); }
.teacher-whiteboard-toolbar h3 { margin: 0 8px 0 0; font-size: 15px; }
.teacher-whiteboard-toolbar button { padding: 7px 11px; border: 1px solid rgba(255,255,255,.3); border-radius: 6px; background: rgba(255,255,255,.1); color: #fff; font-size: 12px; cursor: pointer; }
.teacher-whiteboard-toolbar button.active { background: #2563eb; border-color: #93c5fd; }
.teacher-whiteboard-toolbar .teacher-whiteboard-spacer { flex: 1; }
.teacher-whiteboard-toolbar .teacher-whiteboard-clear { background: #7f1d1d; }
.teacher-whiteboard-toolbar .teacher-whiteboard-close { background: #475569; }
.teacher-whiteboard-surface { position: relative; flex: 1; overflow: auto; padding: 24px; background: #cbd5e1; }
.teacher-whiteboard-page { position: relative; max-width: 1180px; min-height: calc(100vh - 130px); margin: 0 auto; padding: 42px 54px; box-sizing: border-box; background: #fff; color: #172554; box-shadow: 0 8px 30px rgba(15,23,42,.24); font: 21px/1.85 Cambria, "Microsoft YaHei", serif; }
.teacher-whiteboard-text { position: relative; z-index: 1; min-height: calc(100vh - 215px); outline: none; white-space: pre-wrap; overflow-wrap: anywhere; }
.teacher-whiteboard-text:empty::before { content: "点击这里输入讲解文字；切换到画笔后可在白板上书写"; color: #94a3b8; pointer-events: none; }
.teacher-whiteboard-ink { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; pointer-events: none; overflow: visible; touch-action: none; user-select: none; -webkit-user-select: none; }
.teacher-whiteboard-ink.teacher-whiteboard-pen-active { pointer-events: all; cursor: crosshair; }

/* Keep presentation and PDF controls legible while retaining the dark legacy lecture stage. */
.teacher-ppt-preview, .teacher-pdf-preview { border-color: #334155; border-radius: 8px; background: #0f172a; color: #e2e8f0; }
.teacher-ppt-preview > header, .teacher-pdf-preview > header { padding: 12px 15px; border-color: #334155; }
.teacher-ppt-preview > header small, .teacher-pdf-preview > header small { color: #e2b957; font-size: 9px; }
.teacher-ppt-preview > header h3, .teacher-pdf-preview > header h3 { color: #f8fafc; font: 700 16px/1.35 "Segoe UI", "Microsoft YaHei UI", sans-serif; }
.teacher-ppt-preview > header span, .teacher-pdf-preview > header span { color: #cbd5e1; font-size: 10px; }
.teacher-ppt-toolbar, .teacher-pdf-toolbar { gap: 6px; padding: 9px 10px; background: #263238; }
.teacher-ppt-toolbar button, .teacher-pdf-toolbar button { min-height: 30px; padding: 5px 8px; border-color: rgba(255,255,255,.35); border-radius: 5px; background: rgba(255,255,255,.1); color: #fff; font: inherit; font-size: 10px; }
.teacher-ppt-toolbar button.active, .teacher-pdf-toolbar button.active { border-color: #93c5fd; background: #2563eb; color: #fff; }
.teacher-ppt-toolbar span, .teacher-pdf-toolbar span, .teacher-ppt-toolbar label, .teacher-pdf-toolbar label { color: #e2e8f0; font-size: 10px; }
.teacher-ppt-stage, .teacher-pdf-stage { min-height: 440px; background: #111827; }
.teacher-ppt-slide-shell, .teacher-pdf-page-shell { box-shadow: 0 10px 32px rgba(0,0,0,.4); }
.teacher-ppt-preview:fullscreen, .teacher-pdf-preview:fullscreen { padding: 10px; background: #0f172a; }
.teacher-ppt-preview:fullscreen .teacher-ppt-stage, .teacher-pdf-preview:fullscreen .teacher-pdf-stage { flex: 1; min-height: 0; max-height: none; background: #030617; }
.teacher-ppt-preview:fullscreen .teacher-ppt-toolbar, .teacher-pdf-preview:fullscreen .teacher-pdf-toolbar { position: sticky; top: 0; z-index: 120002; }

/* Match the legacy classroom viewers' docked toolbar, navy stage and pseudo-fullscreen projector mode. */
.teacher-ppt-preview.teacher-ppt-viewer, .teacher-pdf-preview.teacher-pdf-viewer { position: relative; margin-top: 14px; padding: 0; border: 1px solid #1e293b; border-radius: 9px; background: #0f172a; color: #e2e8f0; overflow: hidden; min-height: 520px; }
.teacher-ppt-toolbar, .teacher-pdf-toolbar { display: flex; align-items: center; justify-content: flex-start; gap: 6px; flex-wrap: wrap; padding: 9px 10px; background: #172554; border-bottom: 1px solid #334155; position: relative; z-index: 3; }
.teacher-ppt-toolbar button, .teacher-pdf-toolbar button { height: 32px; min-height: 32px; padding: 0 9px; border: 1px solid #64748b; border-radius: 5px; background: #1e3a8a; color: #e0f2fe; font: inherit; font-size: 11px; cursor: pointer; white-space: nowrap; }
.teacher-ppt-toolbar button:hover, .teacher-pdf-toolbar button:hover { background: #2563eb; }
.teacher-ppt-toolbar button.active, .teacher-pdf-toolbar button.active { background: #f59e0b; border-color: #fbbf24; color: #451a03; }
.teacher-ppt-toolbar button:disabled, .teacher-pdf-toolbar button:disabled { opacity: .45; cursor: not-allowed; }
.teacher-ppt-toolbar .teacher-ppt-spacer, .teacher-pdf-toolbar .teacher-pdf-spacer { flex: 1; }
.teacher-ppt-toolbar .teacher-ppt-status, .teacher-pdf-toolbar .teacher-pdf-status { color: #cbd5e1; font-size: 11px; white-space: nowrap; }
.teacher-ppt-toolbar output, .teacher-pdf-toolbar output { min-width: 37px; text-align: center; color: #e5e7eb; font-size: 11px; }
.teacher-ppt-toolbar label, .teacher-pdf-toolbar label { display: inline-flex; align-items: center; gap: 4px; color: #e2e8f0; font-size: 11px; white-space: nowrap; }
.teacher-ppt-toolbar select, .teacher-pdf-toolbar select, .teacher-ppt-toolbar input[type=color], .teacher-pdf-toolbar input[type=color] { height: 28px; border: 1px solid #9ca3af; border-radius: 4px; background: #fff; color: #334155; font-size: 11px; }
.teacher-ppt-toolbar input[type=color], .teacher-pdf-toolbar input[type=color] { width: 34px; padding: 2px; }
.teacher-ppt-toolbar input[type=range], .teacher-pdf-toolbar input[type=range] { width: 76px; vertical-align: middle; }
.teacher-pdf-toolbar input[type=number] { width: 54px; height: 25px; padding: 2px 5px; border: 1px solid #9ca3af; border-radius: 4px; background: #fff; color: #334155; text-align: center; }
.teacher-ppt-stage { position: relative; display: flex; align-items: center; justify-content: center; min-height: 455px; padding: 20px; background: #020617; overflow: auto; }
.teacher-pdf-stage { position: relative; display: flex; align-items: flex-start; justify-content: center; min-height: 560px; max-height: 74vh; padding: 20px; background: #111827; overflow: auto; }
.teacher-ppt-slide-shell { position: relative; width: min(100%, 1200px); aspect-ratio: var(--teacher-ppt-aspect,1.7778); background: #fff; box-shadow: 0 12px 30px rgba(0,0,0,.35); overflow: hidden; touch-action: none; user-select: none; }
.teacher-ppt-slide-shell > .teacher-ppt-source-svg, .teacher-ppt-source-svg > svg { display: block; width: 100%; height: 100%; }
.teacher-ppt-viewer.teacher-ppt-mark-active .teacher-ppt-slide-shell, .teacher-pdf-viewer.teacher-pdf-mark-active .teacher-pdf-page-shell { cursor: crosshair; }
.teacher-ppt-fullscreen, .teacher-pdf-fullscreen { position: fixed !important; inset: 0 !important; z-index: 120000 !important; display: flex !important; flex-direction: column; box-sizing: border-box; margin: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; background: #020617 !important; }
.teacher-ppt-fullscreen .teacher-ppt-toolbar, .teacher-pdf-fullscreen .teacher-pdf-toolbar { position: fixed; top: 0; left: 0; right: 0; z-index: 120002; }
.teacher-ppt-fullscreen .teacher-ppt-stage, .teacher-pdf-fullscreen .teacher-pdf-stage { flex: 1; width: 100%; height: 100vh; min-height: 0; max-height: none; box-sizing: border-box; padding: 70px 20px 20px; background: #020617; }
.teacher-ppt-fullscreen .teacher-ppt-slide-shell { width: min(96vw,calc(96vh * var(--teacher-ppt-aspect,1.7778))); max-width: none; }
.teacher-ppt-fullscreen .teacher-ppt-slide-shell { transform: none; }
.teacher-pdf-fullscreen .teacher-pdf-stage { align-items: flex-start; }
.teacher-pdf-fullscreen .teacher-pdf-page-shell { max-width: none; }
.teacher-ppt-text-note, .teacher-pdf-text-note { cursor: grab; touch-action: none; }
.teacher-ppt-text-note:hover, .teacher-pdf-text-note:hover { z-index: 6; box-shadow: 0 5px 16px rgba(15,23,42,.28); }
.teacher-pdf-teacher-note-card-head { display: flex; align-items: center; gap: 4px; margin-bottom: 5px; }
.teacher-pdf-teacher-note-card-head strong { flex: 1; }
.teacher-pdf-teacher-note-card-head button { padding: 2px 5px; border: 1px solid #93c5fd; border-radius: 4px; background: #fff; color: #1e3a8a; font-size: 10px; cursor: pointer; }
.teacher-pdf-text-note .teacher-classroom-note-actions, .teacher-pdf-text-note .teacher-classroom-note-actions button { font-size: 10px; }
.teacher-pdf-viewer .teacher-pdf-note-editor { position: absolute; z-index: 10; transform: translate(-5px,-5px); width: 245px; padding: 9px; border: 1px solid #f59e0b; border-radius: 6px; background: #fff; color: #334155; box-shadow: 0 6px 18px rgba(0,0,0,.22); pointer-events: auto; }
@media (max-width: 640px) {
  .teacher-ppt-viewer, .teacher-pdf-viewer { min-height: 390px; }
  .teacher-ppt-stage { min-height: 325px; padding: 10px; }
  .teacher-pdf-stage { min-height: 400px; padding: 10px; }
  .teacher-ppt-toolbar, .teacher-pdf-toolbar { overflow-x: auto; flex-wrap: nowrap; }
  .teacher-ppt-toolbar .teacher-ppt-status, .teacher-ppt-toolbar .teacher-ppt-spacer, .teacher-pdf-toolbar .teacher-pdf-status, .teacher-pdf-toolbar .teacher-pdf-spacer { display: none; }
  .teacher-ppt-fullscreen .teacher-ppt-toolbar, .teacher-pdf-fullscreen .teacher-pdf-toolbar { min-height: 52px; padding-left: 8px; padding-right: 8px; }
  .teacher-ppt-fullscreen .teacher-ppt-stage, .teacher-pdf-fullscreen .teacher-pdf-stage { padding: 62px 10px 10px; }
}

@media (max-width: 980px) {
  .teacher-workspace.teacher-home { width: 100%; max-width: none; padding: 22px calc(clamp(24px, 3vw, 56px) + 12px) 28px; }
  .teacher-home-content .teacher-materials-stack { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .teacher-workspace.teacher-home { width: 100%; padding-top: 14px; padding-right: 36px; padding-left: 36px; }
  .teacher-home .teacher-home-hero { align-items: flex-start; padding: 14px; }
  .teacher-home .teacher-home-hero-mark { display: none; }
  .teacher-home .teacher-home-nav { overflow-x: auto; }
  .teacher-home .teacher-home-tab { flex: 0 0 auto; min-width: 118px; }
  .teacher-home-subnav { overflow-x: auto; }
  .teacher-home-content .teacher-materials-stack { grid-template-columns: 1fr; }
  .teacher-word-viewer .teacher-word-toolbar { flex-wrap: nowrap; overflow-x: auto; }
  .teacher-word-viewer .teacher-document-scroll { max-height: 62vh; padding: 10px; }
  .teacher-word-viewer .teacher-document-canvas { min-height: 380px; padding: 22px 18px; font-size: 14px; }
  .teacher-word-fullscreen .teacher-word-toolbar { max-height: 90px; }
  .teacher-word-fullscreen .teacher-document-scroll { padding: 76px 12px 18px; }
  .teacher-word-fullscreen .teacher-document-canvas { padding: 28px 20px; font-size: 17px; }
  .teacher-word-note-editor { width: 250px; max-width: calc(100vw - 30px); }
  .teacher-whiteboard-surface { padding: 12px; }
  .teacher-whiteboard-page { min-height: calc(100vh - 100px); padding: 25px 20px; font-size: 17px; }
  .teacher-whiteboard-text { min-height: calc(100vh - 170px); }
  .teacher-ppt-stage, .teacher-pdf-stage { min-height: 270px; padding: 9px; }
  .teacher-ppt-toolbar, .teacher-pdf-toolbar { overflow-x: auto; flex-wrap: nowrap; }
}

@media (max-width: 980px) {
  .teacher-word-viewer.teacher-word-fullscreen .teacher-word-toolbar { flex-wrap: wrap; max-height: 150px; overflow-x: hidden; }
  .teacher-word-viewer.teacher-word-fullscreen .teacher-document-scroll { padding-top: 158px; }
  .teacher-word-viewer.teacher-word-fullscreen.teacher-projector-mode .teacher-document-scroll { padding-top: 158px; }
}

/* Preserve Word-page annotation anchors: keep one intrinsic layout and scale the whole page. */
.teacher-word-viewer .teacher-document-scale-frame { position: relative; display: block; flex: 0 0 auto; margin: 0 auto; }
.teacher-word-viewer .teacher-document-canvas { position: absolute; top: 0; left: 0; width: 920px !important; max-width: none !important; min-width: 920px; min-height: 420px !important; margin: 0 !important; box-sizing: border-box; padding: 34px 42px !important; transform-origin: top left; will-change: transform; font-size: 15px !important; line-height: 1.9 !important; }
.teacher-word-viewer .teacher-document-content { font-size: inherit; line-height: inherit; }
.teacher-word-viewer .teacher-document-canvas { box-sizing: border-box; }
body.detail-view-active.teacher-classroom-active #teacher-view:not([hidden]) { z-index: 120001 !important; }
body.teacher-classroom-active .topbar,
body.teacher-classroom-active #detail-page-header { visibility: hidden !important; pointer-events: none !important; }
.teacher-word-fullscreen .teacher-document-scale-frame { flex: 0 0 auto; }
.teacher-word-fullscreen .teacher-document-canvas { width: 920px !important; max-width: none !important; min-width: 920px; min-height: 420px !important; padding: 34px 42px !important; font-size: 15px !important; line-height: 1.9 !important; }

/* Match the flatter legacy teacher landing page instead of the newer embossed theme. */
.teacher-workspace.teacher-home .teacher-home-hero {
  align-items: flex-end !important;
  padding: 22px 24px !important;
  border: 1px solid #d4dde6 !important;
  border-left: 4px solid #b78a2d !important;
  border-radius: 4px !important;
  background: linear-gradient(135deg, #f8fafc 0%, #eef3f7 100%) !important;
  box-shadow: none !important;
}
.teacher-workspace.teacher-home .teacher-home-hero h2 {
  color: #17365d !important;
  text-shadow: none !important;
}
.teacher-workspace.teacher-home .teacher-home-hero p { color: #6b7a8d !important; }
.teacher-workspace.teacher-home .teacher-home-hero-kicker { color: #b78a2d !important; }
.teacher-workspace.teacher-home .teacher-home-hero-mark {
  border: 1px solid #d7c38d !important;
  border-radius: 50% !important;
  background: #fff !important;
  box-shadow: 0 6px 18px rgba(31, 55, 80, .08) !important;
}
.teacher-workspace.teacher-home .teacher-home-nav {
  border: 1px solid #cbd7e2 !important;
  border-radius: 7px !important;
  background: #17365d !important;
  box-shadow: 0 5px 14px rgba(23, 54, 93, .12) !important;
}
.teacher-workspace.teacher-home .teacher-home-tab { border-radius: 5px !important; }
.teacher-workspace.teacher-home .teacher-home-tab.active {
  border-radius: 5px !important;
  background: #fffdf7 !important;
  box-shadow: 0 2px 7px rgba(0, 0, 0, .16) !important;
}
.teacher-workspace.teacher-home .teacher-home-action,
.teacher-workspace.teacher-home .teacher-home-schedule-card,
.teacher-workspace.teacher-home .teacher-tool-panel,
.teacher-workspace.teacher-home .teacher-student-panel,
.teacher-workspace.teacher-home .teacher-note-stats-panel,
.teacher-workspace.teacher-home .teacher-chart-panel,
.teacher-workspace.teacher-home .teacher-note-jump-panel {
  border-radius: 4px !important;
  background: #fff !important;
  box-shadow: 0 2px 7px rgba(15, 23, 42, .045) !important;
}
.teacher-workspace.teacher-home .teacher-home-action {
  border-top-width: 3px !important;
  border-top-color: #607d9b !important;
  transform: none !important;
}
.teacher-workspace.teacher-home .teacher-home-action.primary { border-top-color: #b78a2d !important; }
.teacher-workspace.teacher-home .teacher-home-action.ppt { border-top-color: #a05a40 !important; }
.teacher-workspace.teacher-home .teacher-home-action.pdf { border-top-color: #a33d3d !important; }
.teacher-workspace.teacher-home .teacher-home-action.primary { background: #fffdf7 !important; }
.teacher-workspace.teacher-home .teacher-home-action:hover,
.teacher-workspace.teacher-home .teacher-home-schedule-card:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 7px 18px rgba(15, 23, 42, .09) !important;
}
.teacher-workspace.teacher-home .teacher-word-list-item,
.teacher-workspace.teacher-home .teacher-pdf-card,
.teacher-workspace.teacher-home .teacher-ppt-card,
.teacher-workspace.teacher-home .teacher-schedule-summary-card,
.teacher-workspace.teacher-home .teacher-note-stat-card,
.teacher-workspace.teacher-home .teacher-material-list-row,
.teacher-workspace.teacher-home .teacher-saved-paper {
  border-radius: 4px !important;
  box-shadow: 0 1px 3px rgba(28, 51, 74, .04) !important;
}
@media (max-width: 560px) {
  .teacher-workspace.teacher-home .teacher-home-hero {
    align-items: flex-start !important;
    padding: 16px !important;
  }
  .teacher-workspace.teacher-home .teacher-home-hero-mark {
    display: grid !important;
    width: 48px !important;
    height: 48px !important;
    font-size: 23px !important;
  }
}

/* Teacher shell matches the legacy title strip: title/close at left and return-home in the top bar. */
@media (min-width: 761px) {
  body.detail-view-active.detail-teacher-active #detail-page-header {
    top: 62px !important;
    height: 68px !important;
    min-height: 68px !important;
    max-height: 68px !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    padding: 0 28px !important;
  }
  body.detail-view-active.detail-teacher-active #detail-page-title {
    position: static !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    display: block !important;
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    color: #f4f7fa !important;
    font: 700 16px/1.3 "Microsoft YaHei UI", "Microsoft YaHei", "Segoe UI", sans-serif !important;
    pointer-events: auto !important;
  }
  body.detail-view-active.detail-teacher-active #detail-page-title::before {
    content: "👨‍🏫" !important;
    display: inline-block !important;
    margin-right: 2px !important;
    color: inherit !important;
    font: inherit !important;
  }
  body.detail-view-active.detail-teacher-active #detail-page-header #detail-page-back {
    display: none !important;
  }
  body.detail-view-active.detail-teacher-active #detail-page-header #detail-page-close {
    display: inline-flex !important;
    flex: 0 0 34px !important;
    width: 34px !important;
    min-width: 34px !important;
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  body.detail-view-active.detail-teacher-active #teacher-view:not([hidden]) {
    top: 130px !important;
  }
  body.detail-view-active.detail-teacher-active #teacher-view .teacher-workspace.teacher-home {
    padding-top: 56px !important;
  }
  body.detail-teacher-active #top-sync-button,
  body.detail-teacher-active #top-logout-button,
  body.detail-teacher-active #system-maintenance-open {
    display: none !important;
  }
  body.detail-teacher-active #teacher-home-return:not([hidden]) {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 36px !important;
    min-width: 121px !important;
    width: 121px !important;
    margin-left: 4px !important;
    margin-right: 4px !important;
    padding: 0 14px !important;
    border: 1px solid #f1d178 !important;
    border-radius: 5px !important;
    background: linear-gradient(135deg, #e2bd64, #c99a31) !important;
    color: #182a3d !important;
    box-shadow: 0 2px 5px rgba(5, 17, 30, .18) !important;
    font: 700 12px/1.2 "Microsoft YaHei UI", "Microsoft YaHei", "Segoe UI", sans-serif !important;
    white-space: nowrap !important;
    cursor: pointer !important;
  }
}
.teacher-chip-name.is-selected,
.teacher-chip-name[aria-pressed="true"] { border-radius: 999px; background: #d7a334; color: #17293d; font-weight: 700; box-shadow: 0 1px 4px rgba(15, 23, 42, .22); }
.teacher-chip-name:focus-visible { outline: 2px solid #d7a334; outline-offset: 2px; }
.teacher-home[data-teacher-section="students"] .teacher-student-panel,
.teacher-home[data-teacher-section="students"] .teacher-tool-panel,
.teacher-home[data-teacher-section="students"] .teacher-note-stats-panel,
.teacher-home[data-teacher-section="students"] .teacher-chart-panel {
  border: 1px solid #e3d8c2 !important;
  border-radius: 13px !important;
  background: linear-gradient(150deg, #fffaf0 0%, #f6efdf 100%) !important;
  box-shadow: 0 6px 0 #c9c3b4, 0 10px 18px rgba(28, 51, 74, .075), inset 0 1px #fff !important;
}
.teacher-home[data-teacher-section="students"] .teacher-note-stat-card {
  border-color: #dbe3ec !important;
  border-radius: 12px !important;
  background: linear-gradient(150deg, #fbfcfe, #eef3f8) !important;
  box-shadow: 0 4px 0 #dfe7ee, 0 6px 12px rgba(28, 51, 74, .06) !important;
}
.teacher-home[data-teacher-section="students"] .teacher-note-stat-section {
  background: #fffbeb !important;
  border-color: #f4d978 !important;
}
@media (max-width: 760px) {
  .teacher-home[data-teacher-section="students"] .teacher-note-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .teacher-home[data-teacher-section="students"] .teacher-note-stat-columns { grid-template-columns: 1fr; }
  .teacher-home[data-teacher-section="students"] .teacher-report-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .teacher-home[data-teacher-section="students"] .teacher-report-row { grid-template-columns: 1fr; }
}

/* The legacy teacher pages start with the five-item section bar. The intro
   banner and separate overlay title were PHP additions and pushed the actual
   classroom workspace below the first screen. */
@media (min-width: 761px) {
  body.detail-view-active.detail-teacher-active .topbar {
    box-sizing: border-box !important;
    height: 26px !important;
    min-height: 26px !important;
    padding: 0 clamp(24px, 3vw, 56px) !important;
    gap: 8px !important;
  }
  body.detail-view-active.detail-teacher-active .brand { gap: 8px !important; }
  body.detail-view-active.detail-teacher-active .brand-mark { font-size: 9px !important; }
  body.detail-view-active.detail-teacher-active .brand-copy { gap: 0 !important; }
  body.detail-view-active.detail-teacher-active .brand-copy strong { font-size: 12px !important; }
  body.detail-view-active.detail-teacher-active .brand-copy small { font-size: 7px !important; }
  body.detail-view-active.detail-teacher-active .top-meta { display: none !important; }
  body.detail-view-active.detail-teacher-active .top-actions { gap: 5px !important; }
  body.detail-view-active.detail-teacher-active .legacy-header-nav { gap: 2px !important; }
  body.detail-view-active.detail-teacher-active .legacy-header-nav button { padding: 2px 4px !important; font-size: 8px !important; }
  body.detail-view-active.detail-teacher-active .power-topbar { gap: 3px !important; }
  body.detail-view-active.detail-teacher-active .power-trigger {
    box-sizing: border-box !important;
    min-width: 166px !important;
    height: 21px !important;
    padding: 1px 5px !important;
    gap: 4px !important;
  }
  body.detail-view-active.detail-teacher-active .power-trigger small { font-size: 7px !important; }
  body.detail-view-active.detail-teacher-active .power-medal-trigger { height: 21px !important; min-width: 27px !important; padding: 0 4px !important; font-size: 9px !important; }
  body.detail-view-active.detail-teacher-active .power-time { font-size: 7px !important; }
  body.detail-view-active.detail-teacher-active .ai-quota-brief { min-height: 20px !important; padding: 2px 5px !important; gap: 3px !important; font-size: 8px !important; }
  body.detail-view-active.detail-teacher-active .top-user { gap: 4px !important; font-size: 8px !important; }
  body.detail-view-active.detail-teacher-active .top-user i { width: 19px !important; height: 19px !important; font-size: 11px !important; }
  body.detail-view-active.detail-teacher-active .top-action,
  body.detail-view-active.detail-teacher-active .teacher-home-return {
    box-sizing: border-box !important;
    min-height: 20px !important;
    min-width: 0 !important;
    height: 20px !important;
    width: auto !important;
    padding: 2px 6px !important;
    font-size: 8px !important;
  }
  body.detail-view-active.detail-teacher-active #detail-page-header { display: none !important; }
  body.detail-view-active.detail-teacher-active #teacher-view:not([hidden]) { top: 26px !important; }
  body.detail-view-active.detail-teacher-active #teacher-view .teacher-workspace.teacher-home {
    padding: 0 clamp(24px, 3vw, 56px) 36px !important;
    padding-right: calc(clamp(24px, 3vw, 56px) + 8px) !important;
  }
  body.detail-view-active.detail-teacher-active #teacher-view .teacher-home-hero { display: none !important; }
  body.detail-view-active.detail-teacher-active #teacher-view .teacher-home-nav {
    box-sizing: border-box !important;
    position: sticky !important;
    top: 0 !important;
    height: 46px !important;
    min-height: 46px !important;
    margin: 0 !important;
    padding: 2px 5px !important;
    border-radius: 0 0 13px 13px !important;
    box-shadow: 0 4px 10px rgba(4, 18, 35, .24) !important;
  }
  body.detail-view-active.detail-teacher-active #teacher-home-return {
    display: none !important;
  }
  body.detail-view-active.detail-teacher-active #teacher-view .teacher-home-tab {
    flex: 0 0 140px !important;
    min-width: 140px !important;
    height: 40px !important;
  }
  body.detail-view-active.detail-teacher-active #teacher-view .teacher-home-tab.active {
    background: linear-gradient(180deg, #fff9e5, #e6d8ad) !important;
    box-shadow: 0 3px 0 #b58a2f !important;
  }
  body.detail-view-active.detail-teacher-active #teacher-view .teacher-home-content { padding-top: 0 !important; }
  body.detail-view-active.detail-teacher-active #teacher-view .teacher-home-section-label {
    margin: 22px 0 9px !important;
    color: #e7c570 !important;
    font-size: 11px !important;
    line-height: 16px !important;
    letter-spacing: .4px !important;
    text-transform: none !important;
  }
  body.detail-view-active.detail-teacher-active #teacher-view .teacher-home-section-label::after { background: #a9905a !important; }
}

@media (max-width: 760px) {
  body.detail-view-active.detail-teacher-active #detail-page-header { display: none !important; }
  body.detail-view-active.detail-teacher-active #teacher-home-return { display: none !important; }
  body.detail-view-active.detail-teacher-active #teacher-view:not([hidden]) { top: 54px !important; }
  body.detail-view-active.detail-teacher-active #teacher-view .teacher-workspace.teacher-home { padding-top: 0 !important; }
  body.detail-view-active.detail-teacher-active #teacher-view .teacher-home-hero { display: none !important; }
  body.detail-view-active.detail-teacher-active #teacher-view .teacher-home-nav { top: 0 !important; margin-bottom: 0 !important; }
}

/* Keep the teacher workspace inside the visible viewport. The former fixed label
   overlapped the first tab, and fixed-width tracks clipped the right-hand panels. */
body.detail-view-active.detail-teacher-active #teacher-view:not([hidden]),
body.detail-view-active.detail-teacher-active #teacher-view .teacher-workspace.teacher-home,
body.detail-view-active.detail-teacher-active #teacher-view .teacher-home-content,
body.detail-view-active.detail-teacher-active #teacher-view .teacher-home-quick-grid,
body.detail-view-active.detail-teacher-active #teacher-view .teacher-material-grid {
  box-sizing: border-box !important;
  min-width: 0 !important;
  max-width: 100% !important;
}
body.detail-view-active.detail-teacher-active #teacher-view .teacher-workspace.teacher-home,
body.detail-view-active.detail-teacher-active #teacher-view .teacher-home-content,
body.detail-view-active.detail-teacher-active #teacher-view .teacher-home-quick-grid,
body.detail-view-active.detail-teacher-active #teacher-view .teacher-material-grid {
  width: 100% !important;
}
body.detail-view-active.detail-teacher-active #teacher-view .teacher-home-nav::before {
  content: none !important;
  display: none !important;
}
body.detail-view-active.detail-teacher-active #teacher-view .teacher-home-action {
  box-sizing: border-box !important;
  min-width: 0 !important;
}
@media (min-width: 981px) and (max-width: 1600px) {
  body.detail-view-active.detail-teacher-active #teacher-view .teacher-home-quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  body.detail-view-active.detail-teacher-active #teacher-view .teacher-material-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}
@media (max-width: 980px) {
  body.detail-view-active.detail-teacher-active #teacher-view .teacher-home-quick-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  body.detail-view-active.detail-teacher-active #teacher-view .teacher-material-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}
/* Final teacher overlay bounds and an always-visible return control. */
body.detail-view-active.detail-teacher-active {
  width: 100vw !important;
  max-width: 100vw !important;
  overflow-x: hidden !important;
}
body.detail-view-active.detail-teacher-active .page-shell,
body.detail-view-active.detail-teacher-active .topbar,
body.detail-view-active.detail-teacher-active #teacher-view:not([hidden]) {
  box-sizing: border-box !important;
  width: 100vw !important;
  max-width: 100vw !important;
}
body.detail-view-active.detail-teacher-active #teacher-view:not([hidden]) {
  right: auto !important;
  left: 0 !important;
  overflow-x: hidden !important;
}
body.detail-view-active.detail-teacher-active #teacher-view .teacher-workspace.teacher-home,
body.detail-view-active.detail-teacher-active #teacher-view .teacher-home-content,
body.detail-view-active.detail-teacher-active #teacher-view .teacher-home-quick-grid,
body.detail-view-active.detail-teacher-active #teacher-view .teacher-material-grid {
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
}
body.detail-view-active.detail-teacher-active #teacher-home-return:not([hidden]) {
  position: fixed !important;
  top: 31px !important;
  right: 12px !important;
  z-index: 120010 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  min-width: 112px !important;
  width: auto !important;
  height: 32px !important;
  min-height: 32px !important;
  margin: 0 !important;
  padding: 0 12px !important;
  border: 1px solid #e1c477 !important;
  border-radius: 6px !important;
  background: linear-gradient(135deg, #fff8e4, #dfc780) !important;
  color: #17324d !important;
  box-shadow: 0 2px 6px rgba(4, 18, 35, .25) !important;
  font: 700 11px/1.2 "Microsoft YaHei UI", "Microsoft YaHei", "Segoe UI", sans-serif !important;
  white-space: nowrap !important;
  cursor: pointer !important;
}
@media (max-width: 760px) {
  body.detail-view-active.detail-teacher-active #teacher-home-return:not([hidden]) {
    top: 9px !important;
    right: 8px !important;
    min-width: 104px !important;
    height: 34px !important;
    min-height: 34px !important;
  }
}

/* Add breathing room below the global header before the teacher navigation. */
@media (min-width: 761px) {
  body.detail-view-active.detail-teacher-active #teacher-view .teacher-workspace.teacher-home {
    padding-top: 16px !important;
  }
  body.detail-view-active.detail-teacher-active #teacher-home-return:not([hidden]) {
    top: 47px !important;
  }
}
@media (max-width: 760px) {
  body.detail-view-active.detail-teacher-active #teacher-view .teacher-workspace.teacher-home {
    padding-top: 14px !important;
  }
}

/* Smaller classroom markers with clear drag handles. */
.teacher-word-note-marker,
.teacher-doc-note-marker,
.teacher-ppt-text-note,
.teacher-ppt-teacher-note,
.teacher-pdf-text-note,
.teacher-pdf-teacher-note {
  touch-action: none;
}
.teacher-word-note-marker.dragging,
.teacher-doc-note-marker.dragging,
.teacher-ppt-text-note.dragging,
.teacher-ppt-teacher-note.dragging,
.teacher-pdf-text-note.dragging,
.teacher-pdf-teacher-note.dragging {
  z-index: 20;
  cursor: grabbing !important;
}
.teacher-word-note-dot { width: 16px; height: 16px; font-size: 9px; cursor: grab; touch-action: none; }
.teacher-word-note-card { left: 12px; top: 6px; width: 200px; max-width: min(200px, calc(100vw - 44px)); padding: 7px 8px; font-size: 11px; }
.teacher-word-note-card header { cursor: grab; touch-action: none; user-select: none; }
.teacher-word-note-card header button,
.teacher-word-note-remove,
.teacher-doc-note-card button,
.teacher-ppt-teacher-note-card button,
.teacher-pdf-teacher-note-card button { cursor: pointer; touch-action: manipulation; }
.teacher-word-note-text { cursor: grab; touch-action: none; user-select: none; }
.teacher-word-note-marker.dragging .teacher-word-note-dot,
.teacher-doc-note-marker.dragging .teacher-doc-note-dot,
.teacher-ppt-teacher-note.dragging .teacher-ppt-teacher-note-dot,
.teacher-pdf-teacher-note.dragging .teacher-pdf-teacher-note-dot { cursor: grabbing; }
.teacher-doc-note-dot { width: 17px; height: 17px; font-size: 8px; }
.teacher-doc-note-card { left: 12px; top: 7px; width: 200px; max-width: min(200px, calc(100vw - 44px)); padding: 7px 8px; }
.teacher-doc-note-card header { cursor: grab; touch-action: none; user-select: none; }
.teacher-ppt-text-note,
.teacher-pdf-text-note { max-width: 205px; padding: 4px 6px; font-size: 12px; cursor: grab; user-select: none; }
.teacher-ppt-text-note-content,
.teacher-pdf-text-note-content { cursor: grab; touch-action: none; }
.teacher-ppt-teacher-note-dot,
.teacher-pdf-teacher-note-dot { border-right-width: 7px; border-bottom-width: 12px; border-left-width: 7px; cursor: grab; touch-action: none; }
.teacher-ppt-teacher-note-card,
.teacher-pdf-teacher-note-card { left: 15px; width: 190px; max-width: min(190px, calc(100vw - 44px)); padding: 7px; }
.teacher-ppt-teacher-note-card-head,
.teacher-pdf-teacher-note-card-head { cursor: grab; touch-action: none; user-select: none; }
@media (max-width: 760px) {
  .teacher-word-note-card,
  .teacher-doc-note-card,
  .teacher-ppt-teacher-note-card,
  .teacher-pdf-teacher-note-card { width: min(190px, calc(100vw - 44px)); }
}

/* Teacher remark cards follow the pointer; desktop hover opens and pointer exit closes. */
.teacher-word-note-marker:hover .teacher-word-note-card,
.teacher-ppt-teacher-note:hover .teacher-ppt-teacher-note-card,
.teacher-pdf-teacher-note:hover .teacher-pdf-teacher-note-card { display: block; }
.teacher-word-note-card header .teacher-word-note-remove {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  padding: 2px 4px;
  border-radius: 3px;
  background: #fff;
  font: inherit;
  font-size: 10px;
  white-space: nowrap;
}
