:root {
  --bg: #eef4ff;
  --panel: #ffffff;
  --text: #1f2f4a;
  --muted: #647799;
  --line: #d8e3f3;
  --brand: #2563c9;
  --brand-soft: #e6efff;
  --danger: #b23a48;
  --shadow: 0 18px 40px rgba(28, 65, 136, 0.10);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--text);
  line-height: 1.6;
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.72), transparent 32%),
    radial-gradient(circle at top right, rgba(205, 224, 255, 0.9), transparent 28%),
    linear-gradient(180deg, #f7faff 0%, #edf3ff 100%);
}

.hidden { display: none !important; }
.muted { color: var(--muted); }

.topbar {
  padding: 22px 32px;
  background: linear-gradient(135deg, #0f3f8a 0%, #1f5fbc 58%, #4f86de 100%);
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.topbar-inner {
  width: min(1380px, 100%);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.topbar-kicker {
  margin: 0 0 4px;
  color: rgba(232, 242, 255, 0.76);
  font-size: 11px;
  letter-spacing: 0.12em;
}
.topbar h1 {
  margin: 0 0 6px;
  font-size: 30px;
  letter-spacing: -0.02em;
  display: flex;
  gap: 12px;
  align-items: baseline;
  flex-wrap: wrap;
}
.topbar-mini-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(229, 240, 255, 0.84);
}
.topbar-subtitle { margin: 0; color: rgba(230, 239, 255, 0.88); }
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.topbar-actions a {
  color: #fff;
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  font-weight: 700;
  font-size: 14px;
}
.topbar-actions a:hover { background: rgba(255,255,255,0.14); }
.topbar-actions a.active {
  background: rgba(255,255,255,0.24);
  border-color: rgba(255,255,255,0.28);
}

.app-version-footer {
  text-align: center;
  padding: 12px 8px;
  color: #9e9e9e;
  font-size: 12px;
  opacity: 0.82;
}

.app-version-footer a {
  color: inherit;
  text-decoration: none;
}

.app-version-footer a:hover {
  color: #2563c9;
  text-decoration: underline;
}

.changelog-panel {
  width: min(980px, calc(100vw - 40px));
  margin: 42px auto 72px;
  padding: 28px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(216, 227, 243, 0.96);
  box-shadow: var(--shadow);
}

.changelog-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.changelog-head h2 {
  margin: 0;
  font-size: 28px;
}

.changelog-version {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #e6efff;
  color: #1e4d97;
  font-weight: 800;
  white-space: nowrap;
}

.changelog-list {
  display: grid;
  gap: 16px;
}

.changelog-entry {
  padding: 18px 20px;
  border-radius: 14px;
  background: #f8fbff;
  border: 1px solid rgba(216, 227, 243, 0.92);
}

.changelog-entry-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: baseline;
  margin-bottom: 8px;
}

.changelog-entry-head strong {
  font-size: 18px;
  color: #193766;
}

.changelog-entry-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.changelog-entry ul {
  margin: 10px 0 0;
  padding-left: 20px;
}

.changelog-entry li {
  margin: 4px 0;
}

.page-shell {
  width: min(1380px, 100%);
  margin: 0 auto;
  padding: 28px 32px 56px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
}
.accent { background: linear-gradient(145deg, #fcfdff 0%, #eaf2ff 100%); }

.hero-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1.2fr 1fr;
}
.landing-hero {
  gap: 16px;
  margin-bottom: 12px;
}

#landingBoardNote {
  display: none;
}

#landingPanel .panel.accent {
  padding: 18px 18px 12px;
}

#landingPanel .panel.accent .toolbar {
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 2px;
}

#landingPanel .panel.accent .toolbar > div {
  display: grid;
  gap: 0;
}

#landingPanel .panel.accent h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #1d2f52;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.status {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.92);
  color: var(--muted);
  font-size: 14px;
}
.status.error {
  color: var(--danger);
  border-color: rgba(178,58,72,.25);
  background: rgba(178,58,72,.08);
}

.cert-review-notice {
  margin: 18px 0;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(37, 99, 235, .22);
  background: #eff6ff;
  color: #17315d;
  box-shadow: 0 14px 32px rgba(37, 99, 235, .12);
}
.cert-review-notice.need {
  border-color: rgba(178, 58, 72, .28);
  background: #fff1f2;
  color: #7f1d1d;
}
.cert-review-notice.pending {
  border-color: rgba(202, 138, 4, .28);
  background: #fffbeb;
  color: #713f12;
}
.cert-review-notice.pass {
  border-color: rgba(22, 163, 74, .25);
  background: #f0fdf4;
  color: #14532d;
}
.cert-review-notice-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.cert-review-notice-head strong {
  font-size: 18px;
}
.cert-review-notice-head span {
  font-size: 13px;
  font-weight: 700;
}
.cert-review-notice p {
  margin: 10px 0 0;
  line-height: 1.6;
  font-weight: 700;
}
.cert-review-feedback {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed currentColor;
  line-height: 1.65;
  white-space: pre-wrap;
}

button {
  border: 0;
  border-radius: 14px;
  background: var(--brand);
  color: #fff;
  padding: 12px 18px;
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 10px 18px rgba(37, 99, 201, 0.18);
}
button:hover { background: #1d4fa3; }
button.secondary { background: #234f63; }
button.ghost {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: none;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  margin-top: 8px;
  font: inherit;
  background: rgba(255,255,255,0.92);
}
input[type="checkbox"],
input[type="radio"] {
  width: auto;
  border: 0;
  border-radius: 0;
  padding: 0;
  margin: 0;
  background: transparent;
}
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  margin-top: 8px;
  font: inherit;
  background: rgba(255,255,255,0.92);
}
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  margin-top: 8px;
  font: inherit;
  background: rgba(255,255,255,0.92);
  resize: vertical;
}
label { color: var(--muted); font-size: 14px; }
.form-grid {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.register-details {
  margin-top: 12px;
  border-top: 1px dashed var(--line);
  padding-top: 10px;
}
.register-details summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 14px;
  user-select: none;
}
.register-grid {
  margin-top: 8px;
}

.action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  background: var(--brand-soft);
  color: var(--brand);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  padding: 7px 12px;
  background: var(--brand-soft);
  color: var(--brand);
  border-radius: 999px;
  font-weight: 700;
}

.training-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 14px;
}
.training-grid.compact { margin-top: 18px; }
.training-card {
  background: rgba(255,255,255,0.96);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow);
}
.training-card h3,
.training-card h4 { margin: 0; font-size: 20px; }
.training-card p { margin: 0; color: var(--muted); }
.training-card-actions {
  margin-top: auto;
  display: flex;
  justify-content: flex-end;
}

.card-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}

.status-dot.pending {
  background: #f3f7fc;
  color: #58708f;
  border: 1px solid #d4deeb;
}

.status-dot.active {
  background: #e8f1ff;
  color: #2459a8;
  border: 1px solid #c9dbfb;
}

.card-actions {
  margin-top: auto;
}

.training-open-btn {
  width: 100%;
  min-height: 48px;
  border-radius: 14px;
  background: var(--brand) !important;
  color: #ffffff !important;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.board-grid {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}
.board-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,0.82);
  padding: 10px 12px;
}

.course-library-stage {
  display: grid;
  justify-items: center;
  gap: 0;
  padding: 22px 0 34px;
}
.course-library-row {
  width: min(1100px, 100%);
  display: flex;
  justify-content: center;
  align-items: end;
  gap: 34px;
  padding-bottom: 22px;
  flex-wrap: wrap;
}
.course-library-shelf {
  width: min(1040px, calc(100% - 44px));
  height: 22px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(161, 111, 45, 0.96) 0%, rgba(117, 76, 24, 0.98) 55%, rgba(86, 54, 16, 1) 100%);
  box-shadow: 0 14px 28px rgba(84, 55, 18, 0.18), inset 0 2px 0 rgba(255,255,255,0.22), inset 0 -3px 0 rgba(64, 37, 8, 0.28);
}

.book-volume {
  position: relative;
  width: 246px;
  height: 418px;
  filter: drop-shadow(0 18px 24px rgba(28, 46, 88, 0.16));
}
.book-pages {
  position: absolute;
  inset: 16px -10px 10px auto;
  width: 18px;
  border-radius: 0 16px 16px 0;
  background: repeating-linear-gradient(180deg, #f7f1e2 0, #f7f1e2 3px, #eadfcb 3px, #eadfcb 6px);
  box-shadow: inset 1px 0 0 rgba(113, 88, 55, 0.2), 4px 0 10px rgba(0, 0, 0, 0.08);
}
.book-cover {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 18px 14px 14px 18px;
  overflow: hidden;
}
.book-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.10), transparent 22%, transparent 78%, rgba(0,0,0,0.08)), linear-gradient(90deg, rgba(255,255,255,0.03), transparent 16%, transparent 82%, rgba(0,0,0,0.14));
  pointer-events: none;
}
.book-spine {
  position: absolute;
  inset: 0 auto 0 0;
  width: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(0,0,0,0.12)), linear-gradient(90deg, rgba(0,0,0,0.22), rgba(255,255,255,0.06));
  border-right: 1px solid rgba(255,255,255,0.12);
}
.book-spine span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  letter-spacing: 0.14em;
  font-size: 12px;
  font-weight: 900;
  color: rgba(250, 244, 232, 0.88);
}
.book-cover-inner {
  position: relative;
  height: 100%;
  margin-left: 34px;
  padding: 22px 20px 22px 22px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
  color: #fff8ee;
}
.book-badge-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.book-badge {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
  color: #fff7e9;
  font-size: 12px;
  font-weight: 800;
}
.book-badge.warm {
  background: rgba(255, 226, 163, 0.14);
  color: #ffd98f;
}
.book-title-block {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-self: center;
  min-height: 150px;
  gap: 14px;
}
.book-title-block h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.18;
  letter-spacing: -0.05em;
  color: #fff9f0;
}
.book-subtitle {
  margin: 0;
  min-height: 22px;
  font-size: 14px;
  line-height: 1.55;
  font-weight: 700;
  color: rgba(248, 241, 228, 0.84);
}
.book-primary-action {
  width: 100%;
  min-height: 58px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.22);
  background: linear-gradient(135deg, #fff4d2 0%, #efc662 48%, #d49724 100%);
  color: #3d2600;
  box-shadow: 0 10px 18px rgba(214, 153, 40, 0.24), inset 0 1px 0 rgba(255,255,255,0.62);
}
.book-volume-clinical .book-cover {
  background: radial-gradient(circle at 78% 12%, rgba(255, 226, 168, 0.10), transparent 22%), linear-gradient(165deg, #28594d 0%, #1b433b 52%, #143029 100%);
}
.book-volume-aigc .book-cover {
  background: radial-gradient(circle at 80% 14%, rgba(115,176,255,0.16), transparent 24%), linear-gradient(165deg, #243f75 0%, #1a2f59 50%, #11203f 100%);
}
.book-volume-hbdm .book-cover {
  background: radial-gradient(circle at 82% 14%, rgba(255, 206, 140, 0.14), transparent 24%), linear-gradient(165deg, #7a4330 0%, #5c2f25 52%, #3a1f18 100%);
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.9fr);
  gap: 20px;
  margin-bottom: 22px;
}
.hero-main-card,
.hero-stat-card {
  position: relative;
  overflow: hidden;
}
.hero-main-card::after,
.hero-stat-card::after {
  content: "";
  position: absolute;
  inset: auto -40px -40px auto;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.45), transparent 72%);
}
.hero-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.hero-stat-card {
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 18px;
  display: grid;
  gap: 6px;
}
.hero-stat-card strong {
  font-size: 24px;
  line-height: 1.1;
}

.section-kicker {
  margin: 0 0 10px;
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(37, 99, 201, 0.08);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--brand);
}

.section-header-panel { margin-bottom: 16px; }
.group-member-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.group-member-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255,255,255,0.92);
  display: grid;
  gap: 10px;
}
.group-member-card.current {
  border-color: rgba(37, 99, 201, 0.28);
  background: linear-gradient(180deg, #edf4ff 0%, #ffffff 100%);
}

.preview-banner {
  margin-bottom: 16px;
  border: 1px solid rgba(37, 99, 201, 0.20);
  background: linear-gradient(180deg, #eff5ff, #ffffff);
  display: grid;
  gap: 6px;
}

.training-identity-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.training-identity-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: rgba(37, 99, 201, 0.72);
}
.training-identity-item {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.88);
  border: 1px solid rgba(37, 99, 201, 0.10);
  color: var(--text);
  font-weight: 700;
}

.preclass-status-panel { margin-bottom: 16px; }
.training-hero { grid-template-columns: 1fr; margin-bottom: 16px; }

.task-roadmap-shell {
  margin-top: 16px;
  padding: 16px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,0.88), rgba(241, 246, 255, 0.94));
  border: 1px solid rgba(37, 99, 201, 0.10);
}
.task-roadmap-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.task-roadmap-progress-copy {
  display: grid;
  justify-items: end;
  gap: 2px;
  color: var(--muted);
}
.task-roadmap-progress-copy strong {
  font-size: 30px;
  line-height: 1;
  color: var(--brand);
}
.task-roadmap-grid {
  --roadmap-done: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  --roadmap-current: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  --roadmap-pending: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.task-roadmap-item {
  position: relative;
  min-width: 0;
  color: #fff;
}
.task-roadmap-main {
  position: relative;
  min-height: 58px;
  padding: 0 28px 0 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 50%, calc(100% - 22px) 100%, 0 100%, 14px 50%);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}
.task-roadmap-item:first-child .task-roadmap-main {
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 50%, calc(100% - 22px) 100%, 0 100%);
}
.task-roadmap-item:last-child .task-roadmap-main {
  clip-path: polygon(0 0, 100% 0, 100% 50%, 100% 100%, 0 100%, 14px 50%);
}
.task-roadmap-icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 28px;
  font-size: 14px;
  font-weight: 800;
  background: rgba(255,255,255,0.22);
  border: 1px solid rgba(255,255,255,0.32);
  color: #fff;
}
.task-roadmap-label {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0.5px;
}
.task-roadmap-state {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}
.task-roadmap-item.done .task-roadmap-main {
  background: var(--roadmap-done);
}
.task-roadmap-item.done .task-roadmap-state {
  color: #15803d;
}
.task-roadmap-item.current .task-roadmap-main {
  background: var(--roadmap-current);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 14px 28px rgba(245, 158, 11, 0.24);
}
.task-roadmap-item.current .task-roadmap-state {
  color: #b45309;
}
.task-roadmap-item.waiting .task-roadmap-main {
  background: var(--roadmap-pending);
  opacity: 0.88;
}
.task-roadmap-item.waiting .task-roadmap-state {
  color: #b91c1c;
}
.task-roadmap-hint {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #1d4ed8;
}
.detail-stage-steps {
  margin: 18px 0 20px;
  overflow-x: auto;
  padding-bottom: 6px;
}
.metro-progress-map.single-line {
  display: grid;
  gap: 10px;
  min-width: 1080px;
  width: max-content;
  margin: 0 auto;
}
.metro-stage-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
}
.metro-stage-label {
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  color: #64748b;
}
.metro-stage-label .zh,
.metro-stop-name .zh,
.metro-stop-status .zh {
  display: block;
}
.metro-stage-label .en,
.metro-stop-name .en,
.metro-stop-status .en {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  line-height: 1.2;
}
.metro-track-row {
  position: relative;
  display: grid;
  grid-template-columns: repeat(9, minmax(120px, 1fr));
  align-items: center;
}
.metro-track-row::before {
  content: "";
  position: absolute;
  left: 60px;
  right: 60px;
  top: 50%;
  height: 4px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: #d7deea;
}
.metro-track-row::after {
  content: "➜  ➜  ➜  ➜  ➜  ➜  ➜  ➜";
  position: absolute;
  left: 86px;
  right: 86px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  line-height: 1;
  letter-spacing: 5px;
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  pointer-events: none;
}
.metro-track-stop {
  position: relative;
  z-index: 1;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.metro-stop-dot {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  background: #94a3b8;
  box-shadow: 0 0 0 6px #fff;
}
.metro-text-row {
  display: grid;
  grid-template-columns: repeat(9, minmax(120px, 1fr));
}
.metro-text-stop {
  text-align: center;
  padding: 0 8px;
  min-height: 72px;
}
.metro-mobile-grid {
  display: none;
}
.metro-stop-name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  color: #1f2937;
}
.metro-stop-status {
  margin-top: 6px;
  font-size: 12px;
  color: #64748b;
}
.metro-track-stop.is-done .metro-stop-dot,
.metro-text-stop.is-done + .metro-stop-dot {
  background: #22c55e;
}
.metro-track-stop.is-done .metro-stop-dot {
  background: #22c55e;
}
.metro-text-stop.is-done .metro-stop-status {
  color: #15803d;
}
.metro-track-stop.is-current .metro-stop-dot {
  background: #f59e0b;
  box-shadow: 0 0 0 6px #fff, 0 0 0 10px rgba(245, 158, 11, 0.18);
}
.metro-text-stop.is-current .metro-stop-status {
  color: #b45309;
  font-weight: 700;
}
.metro-track-stop.is-pending .metro-stop-dot {
  background: #94a3b8;
}
.metro-text-stop.is-pending .metro-stop-name {
  color: #475569;
}
.metro-text-stop.is-pending .metro-stop-status {
  color: #94a3b8;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 14px;
}
.resource-box {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 10px 14px;
  background: rgba(255,255,255,.72);
  display: grid;
  gap: 6px;
  align-content: start;
}
.resource-box h3 {
  margin: 0;
  font-size: 15px;
}
.resource-box video {
  width: 100%;
  border-radius: 0;
  background: #101618;
  display: block;
}
.video-wrap {
  position: relative;
  width: 100%;
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: #1a1a2e;
}
.video-resource-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.video-resource-switch {
  max-width: 100%;
}
.video-resource-item {
  border: 1px solid #d7e2f2;
  border-radius: 16px;
  padding: 12px;
  background: linear-gradient(180deg, #fbfdff 0%, #f4f8fd 100%);
  display: grid;
  gap: 10px;
}
.video-resource-head {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: start;
}
.video-resource-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.video-resource-note {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}
.video-resource-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.video-progress-bar {
  position: relative;
  height: 6px;
  background: #2a3035;
  margin-top: 6px;
  border-radius: 3px;
  cursor: default;
  overflow: visible;
}
.vpb-watched {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: #4ade80;
  border-radius: 3px;
  transition: width 0.3s linear;
}
.vpb-head {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 4px rgba(0,0,0,0.5);
  pointer-events: none;
}
.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  text-decoration: none;
  background: #fff;
}
.teacher-ai-suggestion-card {
  border: 1px solid #d6e1f0;
  border-radius: 16px;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(247, 251, 255, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%);
  display: grid;
  gap: 10px;
}
.teacher-ai-suggestion-card strong {
  display: block;
  margin-bottom: 4px;
  color: #19355d;
}
.teacher-ai-suggestion-card .secondary {
  justify-self: start;
}
.stage-panel { margin-top: 16px; }
.stack { display: grid; gap: 14px; }
.upload-row {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.upload-row label {
  flex: 1 1 220px;
}

/* ── 粘贴/拖拽上传区 ─────────────────────────────────────────────── */
.paste-zone {
  position: relative;
  margin-top: 8px;
  min-height: 72px;
  border: 2px dashed var(--brand);
  border-radius: 14px;
  background: var(--brand-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 16px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  outline: none;
}
.paste-zone:hover, .paste-zone.drag-over {
  background: #dbeafe;
  border-color: #1d4ed8;
}
.paste-zone-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}
.paste-zone-icon { font-size: 22px; line-height: 1; }
.paste-zone-hint {
  font-size: 13px;
  color: var(--brand);
  text-align: center;
}
.paste-zone-status {
  font-size: 12px;
  color: var(--muted);
  width: 100%;
  text-align: center;
  min-height: 1em;
}
.training-image-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}
.training-image-wrapper {
  position: relative;
  display: grid;
}
.img-delete-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(220,38,38,0.85);
  color: #fff;
  border: none;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  padding: 0;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.15s;
}
.training-image-wrapper:hover .img-delete-btn {
  opacity: 1;
}
.img-delete-btn:hover {
  background: rgba(185,28,28,1);
}
.training-image-grid .muted {
  white-space: nowrap;
}
.training-image-item {
  display: grid;
  gap: 6px;
  text-decoration: none;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  background: rgba(255,255,255,0.9);
  cursor: zoom-in;
  font-family: inherit;
  text-align: center;
  width: 100%;
}
.training-image-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  background: #f2f6ff;
}
.training-image-item span {
  font-size: 12px;
  font-weight: 700;
}
.training-image-group {
  display: grid;
  gap: 6px;
}

.question-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255,255,255,.92);
  display: grid;
  gap: 10px;
}
.option-list {
  display: grid;
  gap: 8px;
}
.option-list label {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: start;
  gap: 10px;
  cursor: pointer;
}

.wordcloud-keyword-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

.wordcloud-keyword-item {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.92);
}

.wordcloud-keyword-item input {
  width: auto;
  border: 0;
  padding: 0;
  background: transparent;
  margin: 0;
}

/* === 词云浮动按钮 === */
.wordcloud-fab {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 960;
}
.learning-reminder-top {
  top: 152px;
  left: 20px;
  right: auto;
  bottom: auto;
}
.wordcloud-fab.hidden { display: none; }
.wordcloud-fab-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(11, 110, 142, 0.28);
  background: linear-gradient(135deg, rgba(8,126,173,0.96), rgba(16,83,173,0.96));
  box-shadow: 0 12px 32px rgba(13,43,97,0.26);
  color: #f0f8ff;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: transform 0.15s, box-shadow 0.15s;
}
.wordcloud-fab-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(13,43,97,0.32);
}
.learning-reminder-fab-btn {
  border-color: rgba(239, 68, 68, 0.18);
  background: linear-gradient(135deg, rgba(251,191,36,0.98), rgba(239,68,68,0.96));
  box-shadow: 0 12px 32px rgba(239,68,68,0.24);
  animation: reminderPulse 1.8s ease-in-out infinite;
  padding: 10px 14px 10px 12px;
}
.learning-reminder-fab-btn:hover {
  box-shadow: 0 18px 40px rgba(239,68,68,0.32);
}
.wordcloud-fab-btn:active { transform: translateY(0); }
@keyframes reminderPulse {
  0%, 100% { transform: translateY(0); box-shadow: 0 12px 32px rgba(239,68,68,0.24); }
  50% { transform: translateY(-2px); box-shadow: 0 18px 40px rgba(245,158,11,0.30); }
}
.wordcloud-fab-icon { font-size: 22px; line-height: 1; flex-shrink: 0; }
.wordcloud-fab-text { display: grid; gap: 2px; }
.wordcloud-fab-title { font-size: 14px; font-weight: 800; letter-spacing: 0.01em; }
.wordcloud-fab-subtitle { font-size: 10px; color: rgba(224,244,255,0.9); line-height: 1.3; }
.wordcloud-fab.is-active .wordcloud-fab-btn {
  border-color: rgba(20,143,92,0.4);
  background: linear-gradient(135deg, rgba(17,143,100,0.96), rgba(9,115,88,0.96));
  box-shadow: 0 12px 32px rgba(14,86,66,0.28);
}
.teacher-side-fab {
  position: fixed;
  bottom: 24px;
  z-index: 965;
}
.teacher-side-fab.hidden { display: none; }
.teacher-side-fab-left { left: 20px; }
.teacher-side-fab-right { right: 20px; }
.teacher-side-fab-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(10, 101, 145, 0.24);
  background: linear-gradient(135deg, rgba(8,126,173,0.96), rgba(16,83,173,0.96));
  box-shadow: 0 14px 34px rgba(13,43,97,0.24);
  color: #f0f8ff;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: transform 0.15s, box-shadow 0.15s;
}
.teacher-side-fab-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(13,43,97,0.3);
}
.teacher-side-fab-btn-ai {
  border-color: rgba(119, 77, 178, 0.22);
  background: linear-gradient(135deg, rgba(91, 68, 181, 0.96), rgba(46, 118, 215, 0.96));
}
.teacher-side-fab-icon { font-size: 22px; line-height: 1; flex-shrink: 0; }
.teacher-side-fab-text { display: grid; gap: 2px; }
.teacher-side-fab-title { font-size: 15px; font-weight: 800; letter-spacing: 0.01em; }
.teacher-side-fab-subtitle { font-size: 11px; color: rgba(224,244,255,0.92); line-height: 1.4; }
@media (max-width: 600px) {
  .wordcloud-fab { right: 12px; left: 12px; bottom: 14px; }
  .learning-reminder-top {
    top: 136px;
    left: 12px;
    right: 12px;
    bottom: auto;
  }
  .wordcloud-fab-btn { width: 100%; border-radius: 14px; }
  .teacher-side-fab {
    bottom: 86px;
  }
  .teacher-side-fab-left {
    left: 12px;
  }
  .teacher-side-fab-right {
    right: 12px;
  }
  .teacher-side-fab-btn {
    border-radius: 14px;
    padding: 11px 14px 11px 12px;
  }
}

/* === 词云弹层 === */
.wordcloud-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,25,70,0.52);
  backdrop-filter: blur(4px);
  z-index: 9100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.wordcloud-modal-overlay.hidden { display: none; }
.wordcloud-modal-box {
  background: var(--panel);
  border-radius: 24px;
  box-shadow: 0 32px 80px rgba(28,65,136,0.22);
  width: min(520px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  padding: 24px 24px 20px;
  display: grid;
  gap: 14px;
}
.wordcloud-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.wordcloud-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--brand);
}
.wordcloud-modal-close {
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 14px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-family: inherit;
}
.wordcloud-modal-close:hover { background: var(--brand-soft); color: var(--brand); }

/* === 教师端重点关注弹层 === */
.teacher-attention-btn {
  border-color: #234f63;
  background: #234f63;
  color: #fff;
}

.teacher-prep-advice-btn {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

.teacher-learning-analysis-btn {
  border-color: #0f766e;
  background: #0f766e;
  color: #fff;
}

.teacher-learning-survey-btn {
  border-color: #0d9488;
  background: #0d9488;
  color: #fff;
}

.teacher-attention-overlay {
  position: fixed;
  inset: 0;
  z-index: 9200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 22px;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(5px);
}
.teacher-attention-overlay.hidden { display: none; }
.teacher-attention-box {
  width: min(1080px, 100%);
  height: auto;
  max-height: calc(100vh - 44px);
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid #dbe7f5;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(15, 23, 42, 0.28);
  display: block;
  scrollbar-gutter: stable;
}
.teacher-attention-box::-webkit-scrollbar { width: 10px; }
.teacher-attention-box::-webkit-scrollbar-thumb {
  background: #c4d3e7;
  border-radius: 999px;
}
.teacher-attention-header {
  min-height: 0;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 14px;
  border-bottom: 1px solid #e6eef8;
}
.teacher-attention-header h3 {
  margin: 2px 0 6px;
  color: #10264a;
  font-size: 24px;
}
.teacher-attention-header p {
  margin: 0;
  color: #64748b;
  line-height: 1.55;
}
.teacher-attention-kicker {
  color: #2563eb;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
}
.teacher-attention-close {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid #dbe7f5;
  border-radius: 50%;
  background: #fff;
  color: #64748b;
  cursor: pointer;
}
.teacher-attention-close:hover { background: #eff6ff; color: #1d4ed8; }
.teacher-attention-summary {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 14px 24px;
  background: #f8fbff;
  border-bottom: 1px solid #e6eef8;
}
.teacher-attention-stat {
  min-height: 72px;
  border: 1px solid #dbe7f5;
  border-radius: 14px;
  background: #fff;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 12px 14px;
}
.teacher-attention-stat strong {
  color: #10264a;
  font-size: 28px;
  line-height: 1;
}
.teacher-attention-stat em {
  color: #64748b;
  font-size: 13px;
  font-style: normal;
  font-weight: 700;
}
.teacher-attention-stat.danger { border-color: #fecaca; background: #fff7f7; }
.teacher-attention-stat.warn { border-color: #fde68a; background: #fffbeb; }
.teacher-attention-stat.neutral { border-color: #bfdbfe; background: #eff6ff; }
.teacher-attention-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-bottom: 1px solid #e6eef8;
  background: #fff;
}
.teacher-attention-actions button {
  width: auto;
  min-width: 118px;
}
.teacher-attention-action-status {
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}
.teacher-attention-action-status.error { color: #b91c1c; }
.teacher-attention-archive-panel {
  margin: 18px 24px 0;
  padding: 14px;
  border: 1px solid #dbe7f5;
  border-radius: 16px;
  background: #fbfdff;
}
.teacher-attention-archive-panel.hidden { display: none; }
.teacher-attendance-archive-list {
  display: grid;
  gap: 10px;
}
.teacher-attendance-archive-item {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #dbe7f5;
  border-radius: 12px;
  background: #fff;
  color: #10264a;
  text-align: left;
  cursor: pointer;
}
.teacher-attendance-archive-item:hover { border-color: #93c5fd; background: #eff6ff; }
.teacher-attendance-archive-item strong,
.teacher-attendance-archive-item span {
  display: block;
}
.teacher-attendance-archive-item span {
  margin-top: 4px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.45;
}
.teacher-attendance-archive-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.teacher-attendance-archive-head strong {
  color: #10264a;
  font-size: 16px;
}
.teacher-attendance-archive-head p {
  margin: 4px 0 0;
  color: #64748b;
}
.teacher-attendance-archive-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.teacher-attendance-archive-stats span {
  min-height: 58px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid #dbe7f5;
  border-radius: 12px;
  background: #fff;
}
.teacher-attendance-archive-stats strong {
  color: #10264a;
  font-size: 22px;
  line-height: 1;
}
.teacher-attendance-archive-stats em {
  color: #64748b;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}
.teacher-attendance-archive-stats .makeup {
  border-color: #bbf7d0;
  background: #f0fdf4;
}
.teacher-attendance-archive-table { min-width: 1080px; }
.teacher-attendance-makeup {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  font-size: 12px;
  font-weight: 800;
}
.teacher-attendance-makeup-row td { background: #fbfff8; }
.teacher-attention-content {
  min-height: auto;
  overflow: visible;
  padding: 18px 24px 24px;
  display: grid;
  align-content: start;
  gap: 18px;
}
.teacher-attention-table-wrap::-webkit-scrollbar { width: 10px; height: 10px; }
.teacher-attention-table-wrap::-webkit-scrollbar-thumb {
  background: #c4d3e7;
  border-radius: 999px;
}
.teacher-attention-group {
  border: 1px solid #dbe7f5;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}
.teacher-attention-group h4 {
  margin: 0;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #10264a;
  background: #f8fbff;
  border-bottom: 1px solid #e6eef8;
  font-size: 16px;
}
.teacher-attention-group h4 span {
  color: #2563eb;
  font-size: 14px;
}
.teacher-attention-group.tone-danger h4 { background: #fff7f7; }
.teacher-attention-group.tone-warn h4 { background: #fffbeb; }
.teacher-attention-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
}
.teacher-attention-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  font-size: 13px;
}
.teacher-attention-table th,
.teacher-attention-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #edf2f7;
  text-align: left;
  vertical-align: top;
}
.teacher-attention-table th {
  color: #475569;
  background: #fbfdff;
  font-weight: 800;
}
.teacher-attention-table td {
  color: #1e293b;
  line-height: 1.45;
}

.teacher-prep-advice-box {
  width: min(1120px, 100%);
}

.teacher-prep-advice-content {
  gap: 14px;
}

.teacher-prep-advice-section {
  border: 1px solid #dbe7f5;
  border-radius: 16px;
  background: #fff;
  padding: 16px;
}

.teacher-prep-advice-section h4 {
  margin: 0 0 12px;
  color: #10264a;
  font-size: 17px;
}

.teacher-prep-advice-section p {
  margin: 0;
  color: #334155;
  line-height: 1.7;
}

.teacher-prep-advice-section ul,
.teacher-prep-advice-section ol {
  margin: 0;
  padding-left: 22px;
  color: #334155;
  line-height: 1.75;
}

.teacher-prep-advice-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.teacher-prep-advice-grid div {
  min-height: 64px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid #dbe7f5;
  border-radius: 12px;
  background: #f8fbff;
}

.teacher-prep-advice-grid strong {
  color: #1d4ed8;
  font-size: 24px;
  line-height: 1;
}

.teacher-prep-advice-grid span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.teacher-prep-eval-list {
  display: grid;
  gap: 8px;
}

.teacher-prep-eval-list div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #e6eef8;
  border-radius: 12px;
  background: #fbfdff;
}

.teacher-prep-eval-list span {
  min-width: 0;
  color: #1e293b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.teacher-prep-eval-list strong {
  color: #0f766e;
  font-size: 13px;
}

.teacher-prep-eval-list em {
  color: #64748b;
  font-style: normal;
  font-size: 13px;
  font-weight: 800;
}

.teacher-learning-analysis-box {
  width: min(1320px, 100%);
}

.teacher-learning-analysis-content {
  gap: 16px;
  background: linear-gradient(180deg, #fbfdff 0%, #ffffff 36%);
}

.teacher-learning-survey-box {
  width: min(1480px, 100%);
}

.teacher-learning-survey-hero {
  background:
    radial-gradient(circle at 90% 16%, rgba(20, 184, 166, 0.16), transparent 34%),
    linear-gradient(135deg, #f8fafc 0%, #ecfdf5 54%, #eff6ff 100%);
}

.teacher-learning-survey-grid {
  align-items: stretch;
}

.teacher-learning-survey-bars .teacher-learning-label-bars i {
  background: linear-gradient(90deg, #0f766e, #2563eb);
}

.teacher-learning-survey-advice ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.teacher-learning-survey-advice li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: start;
  padding: 14px;
  border: 1px solid #dbeafe;
  border-radius: 14px;
  background: #ffffff;
  color: #334155;
  line-height: 1.6;
}

.teacher-learning-survey-advice li strong {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  color: #fff;
  background: #0f766e;
  font-size: 14px;
}

.teacher-learning-analysis-grid div strong {
  color: #0f766e;
}

.teacher-learning-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 18px;
  padding: 22px;
  border: 1px solid #cfe2f8;
  border-radius: 20px;
  background:
    radial-gradient(circle at 82% 8%, rgba(15, 118, 110, 0.14), transparent 32%),
    linear-gradient(135deg, #f8fbff 0%, #eef7f6 100%);
}

.teacher-learning-hero-text > span {
  color: #0f766e;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.teacher-learning-hero h4,
.teacher-learning-panel h4,
.teacher-learning-profile-head h4 {
  margin: 0;
  color: #10264a;
  font-size: 18px;
}

.teacher-learning-hero p,
.teacher-learning-panel p {
  margin: 10px 0 0;
  color: #475569;
  line-height: 1.7;
}

.teacher-learning-hero-visual {
  min-height: 190px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(191, 219, 254, 0.8);
  border-radius: 18px;
  background: rgba(255,255,255,0.72);
}

.teacher-learning-hero-visual svg {
  width: min(100%, 280px);
  height: auto;
}

.teacher-learning-metrics {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.teacher-learning-metric {
  display: grid;
  align-content: center;
  gap: 6px;
  min-height: 88px;
  padding: 13px 14px;
  border: 1px solid #dbe7f5;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(15, 35, 70, 0.06);
}

.teacher-learning-metric > span,
.teacher-learning-metric small {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.teacher-learning-metric strong {
  color: #10264a;
  font-size: 30px;
  line-height: 1;
}

.teacher-learning-metric strong em {
  margin-left: 2px;
  color: #64748b;
  font-size: 14px;
  font-style: normal;
}

.teacher-learning-metric.good strong { color: #0f766e; }
.teacher-learning-metric.warn { border-color: #fde68a; background: #fffbeb; }
.teacher-learning-metric.warn strong { color: #b45309; }

.teacher-learning-dashboard {
  display: grid;
  grid-template-columns: minmax(280px, .85fr) minmax(0, 1.15fr);
  gap: 16px;
}

.teacher-learning-dashboard.wide {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.teacher-learning-panel {
  min-width: 0;
  border: 1px solid #dbe7f5;
  border-radius: 18px;
  background: #fff;
  padding: 16px;
  box-shadow: 0 10px 26px rgba(15, 35, 70, 0.05);
}

.teacher-learning-donut-card {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.teacher-learning-donut {
  width: 168px;
  height: 168px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px rgba(15, 35, 70, 0.08), 0 14px 28px rgba(15, 35, 70, 0.08);
}

.teacher-learning-donut > div {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  background: #fff;
  color: #10264a;
}

.teacher-learning-donut strong {
  font-size: 30px;
  line-height: 1;
}

.teacher-learning-donut span,
.teacher-learning-donut-legend em {
  color: #64748b;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.teacher-learning-donut-legend {
  display: grid;
  gap: 10px;
}

.teacher-learning-donut-legend span {
  display: grid;
  grid-template-columns: 12px 42px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  color: #10264a;
}

.teacher-learning-donut-legend i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.teacher-learning-readiness {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.teacher-learning-readiness-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.9fr) minmax(0, 1.8fr) 64px;
  gap: 12px;
  align-items: center;
}

.teacher-learning-readiness-row strong,
.teacher-learning-readiness-row span {
  display: block;
}

.teacher-learning-readiness-row strong {
  color: #10264a;
  font-size: 14px;
}

.teacher-learning-readiness-row span {
  margin-top: 2px;
  color: #64748b;
  font-size: 12px;
}

.teacher-learning-readiness-bar,
.teacher-learning-mini-bar,
.teacher-learning-group-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8f0fa;
}

.teacher-learning-readiness-bar i,
.teacher-learning-mini-bar i,
.teacher-learning-group-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f766e, #2563eb);
}

.teacher-learning-readiness-row.warn .teacher-learning-readiness-bar i { background: #d97706; }
.teacher-learning-readiness-row.danger .teacher-learning-readiness-bar i { background: #dc2626; }

.teacher-learning-readiness-row em {
  color: #0f766e;
  font-style: normal;
  font-weight: 900;
  text-align: right;
}

.teacher-learning-label-bars {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.teacher-learning-label-bars span {
  display: grid;
  grid-template-columns: minmax(110px, .75fr) minmax(0, 1.5fr) 54px;
  gap: 10px;
  align-items: center;
}

.teacher-learning-label-bars strong {
  color: #10264a;
  font-size: 13px;
}

.teacher-learning-label-bars i {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #0f766e, #93c5fd);
}

.teacher-learning-label-bars em {
  color: #64748b;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  text-align: right;
}

.teacher-learning-group-grid,
.teacher-learning-strategy-grid,
.teacher-learning-profile-cards {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.teacher-learning-group-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.teacher-learning-group-card,
.teacher-learning-strategy-card,
.teacher-learning-profile-card {
  border: 1px solid #e2ebf7;
  border-radius: 14px;
  background: #fbfdff;
  padding: 12px;
}

.teacher-learning-group-card div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.teacher-learning-group-card strong {
  color: #10264a;
}

.teacher-learning-group-card span,
.teacher-learning-group-card p {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.teacher-learning-group-card p {
  margin: 8px 0 0;
  line-height: 1.5;
}

.teacher-learning-strategy-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.teacher-learning-strategy-card {
  min-height: 132px;
  display: grid;
  align-content: start;
  gap: 8px;
}

.teacher-learning-strategy-card span {
  width: fit-content;
  padding: 4px 9px;
  border-radius: 999px;
  color: #fff;
  background: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.teacher-learning-strategy-card.layer-a span { background: #0f766e; }
.teacher-learning-strategy-card.layer-b span { background: #2563eb; }
.teacher-learning-strategy-card.layer-c span { background: #d97706; }
.teacher-learning-strategy-card.layer-d span { background: #dc2626; }
.teacher-learning-strategy-card strong { color: #10264a; }
.teacher-learning-strategy-card p { margin: 0; font-size: 13px; }

.teacher-learning-profile-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.teacher-learning-profile-head span {
  color: #2563eb;
  font-size: 13px;
  font-weight: 900;
}

.teacher-learning-profile-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 58px;
  gap: 10px;
  align-items: start;
}

.teacher-learning-profile-card.focus {
  border-color: #fde68a;
  background: #fffdf2;
}

.teacher-learning-profile-card.showcase {
  border-color: #bbf7d0;
  background: #f7fff9;
}

.teacher-learning-profile-avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #dbeafe, #ccfbf1);
  color: #0f3f68;
  font-weight: 900;
}

.teacher-learning-profile-main {
  min-width: 0;
}

.teacher-learning-profile-main > div {
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.teacher-learning-profile-main strong {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #10264a;
}

.teacher-learning-profile-main span,
.teacher-learning-profile-main small,
.teacher-learning-profile-score span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.teacher-learning-profile-main p {
  margin: 5px 0;
  color: #334155;
  font-size: 13px;
  line-height: 1.45;
}

.teacher-learning-profile-score {
  display: grid;
  justify-items: end;
  gap: 2px;
}

.teacher-learning-profile-score strong {
  color: #0f766e;
  font-size: 20px;
}

.teacher-learning-profile-empty {
  margin-top: 14px;
  padding: 16px;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  color: #64748b;
  background: #fbfdff;
}

.teacher-learning-analysis-table {
  min-width: 1260px;
}

.teacher-learning-analysis-table td:first-child {
  max-width: 92px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.teacher-learning-mini-bar {
  display: inline-block;
  width: 72px;
  vertical-align: middle;
}

.teacher-learning-mini-value {
  margin-left: 8px;
  color: #64748b;
  font-style: normal;
  font-weight: 800;
}

.teacher-learning-layer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.teacher-learning-layer-a { background: #ecfdf5; color: #047857; }
.teacher-learning-layer-b { background: #eff6ff; color: #1d4ed8; }
.teacher-learning-layer-c { background: #fffbeb; color: #b45309; }
.teacher-learning-layer-d { background: #fff1f2; color: #be123c; }

@media (max-width: 760px) {
  .teacher-attention-overlay { padding: 10px; }
  .teacher-attention-box { max-height: calc(100vh - 20px); border-radius: 18px; }
  .teacher-attention-header { padding: 18px 16px 12px; }
  .teacher-attention-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px 16px; }
  .teacher-attention-actions { padding: 12px 16px; }
  .teacher-attention-archive-panel { margin: 14px 16px 0; }
  .teacher-attendance-archive-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .teacher-attention-content { padding: 14px 16px 18px; }
  .teacher-prep-advice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .teacher-prep-eval-list div { grid-template-columns: minmax(0, 1fr) auto; }
  .teacher-prep-eval-list em { grid-column: 2; }
  .teacher-learning-hero,
  .teacher-learning-dashboard,
  .teacher-learning-dashboard.wide {
    grid-template-columns: 1fr;
  }
  .teacher-learning-metrics,
  .teacher-learning-strategy-grid,
  .teacher-learning-group-grid,
  .teacher-learning-survey-advice ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .teacher-learning-donut-card {
    grid-template-columns: 1fr;
    justify-items: center;
  }
  .teacher-learning-readiness-row,
  .teacher-learning-label-bars span {
    grid-template-columns: 1fr;
  }
  .teacher-learning-readiness-row em,
  .teacher-learning-label-bars em {
    text-align: left;
  }
}

.teacher-ai-quick-overlay {
  position: fixed;
  inset: 0;
  z-index: 1190;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(11, 24, 55, 0.5);
  backdrop-filter: blur(5px);
}

.teacher-ai-quick-overlay.hidden { display: none; }

.teacher-ai-quick-box {
  width: min(920px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border-radius: 28px;
  padding: 24px;
  background:
    radial-gradient(circle at top right, rgba(83, 116, 255, 0.14), transparent 32%),
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(245,248,255,0.98));
  box-shadow: 0 30px 90px rgba(19, 43, 94, 0.24);
  display: grid;
  gap: 18px;
}

.teacher-ai-quick-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.teacher-ai-quick-title {
  font-size: 26px;
  font-weight: 800;
  color: #1b3159;
}

.teacher-ai-quick-subtitle {
  margin: 6px 0 0;
  color: #5e7290;
  line-height: 1.6;
}

.teacher-ai-quick-close {
  border: 0;
  background: rgba(234,240,251,0.95);
  color: #56719d;
  border-radius: 999px;
  width: 38px;
  height: 38px;
  font-size: 20px;
  cursor: pointer;
}

.teacher-ai-quick-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.teacher-ai-quick-card {
  border: 1px solid rgba(50, 92, 175, 0.12);
  border-radius: 22px;
  padding: 18px;
  background: rgba(255,255,255,0.92);
  box-shadow: 0 12px 28px rgba(22, 53, 105, 0.08);
  display: grid;
  gap: 10px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.16s, box-shadow 0.16s, border-color 0.16s;
}

.teacher-ai-quick-card:hover {
  transform: translateY(-3px);
  border-color: rgba(37, 99, 201, 0.28);
  box-shadow: 0 18px 36px rgba(18, 49, 98, 0.14);
}

.teacher-ai-quick-card strong {
  font-size: 19px;
  color: #17355f;
}

.teacher-ai-quick-card span {
  color: #5f718e;
  line-height: 1.6;
}

.teacher-ai-quick-kicker {
  font-size: 12px;
  font-weight: 800;
  color: #315ea7;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.teacher-ai-quick-foot {
  display: flex;
  justify-content: flex-end;
}

.teacher-ai-work-quick {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(111, 138, 173, 0.18);
  border-radius: 20px;
  background: rgba(255,255,255,0.9);
}

.teacher-ai-agent-overlay {
  position: fixed;
  inset: 0;
  background: rgba(12, 22, 40, 0.52);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 18px;
  z-index: 1200;
  backdrop-filter: blur(8px);
}

.teacher-ai-agent-overlay.hidden { display: none; }

.teacher-ai-agent-box {
  width: min(1120px, 100%);
  max-height: calc(100vh - 56px);
  overflow: auto;
  background:
    linear-gradient(180deg, rgba(246, 251, 255, 0.98), rgba(255, 255, 255, 0.98));
  border: 1px solid rgba(111, 138, 173, 0.24);
  border-radius: 28px;
  box-shadow: 0 32px 90px rgba(15, 35, 68, 0.28);
  padding: 24px;
}

.teacher-ai-agent-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.teacher-ai-agent-title {
  font-size: 24px;
  font-weight: 800;
  color: #162544;
}

.teacher-ai-agent-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.teacher-ai-agent-close {
  min-width: 44px;
  min-height: 44px;
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: none;
}

.teacher-ai-agent-body {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 18px;
  margin-top: 16px;
}

.teacher-ai-agent-panel {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(111, 138, 173, 0.18);
  border-radius: 20px;
  padding: 16px;
  min-height: 360px;
}

.teacher-ai-agent-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.teacher-ai-agent-timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.teacher-ai-agent-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  padding: 8px 12px;
  border-radius: 999px;
  background: #eef5ff;
  color: #26446f;
  font-size: 13px;
  font-weight: 700;
}

.teacher-ai-agent-chip.error {
  background: rgba(178,58,72,.1);
  color: #a92f42;
}

.teacher-ai-agent-chip.success {
  background: rgba(22,163,74,.12);
  color: #11753a;
}

.teacher-ai-agent-raw {
  margin: 0;
  min-height: 220px;
  max-height: 420px;
  overflow: auto;
  padding: 14px 18px 14px 14px;
  border-radius: 18px;
  background: #132238;
  color: #d9e8ff;
  font: 13px/1.6 "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  white-space: pre-wrap;
  word-break: break-word;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
}

.teacher-ai-agent-preview {
  display: grid;
  gap: 12px;
}

.teacher-ai-agent-card {
  border: 1px solid rgba(111, 138, 173, 0.16);
  border-radius: 18px;
  padding: 14px 16px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.teacher-ai-agent-card h4,
.teacher-ai-agent-card h5,
.teacher-ai-agent-card p {
  margin: 0;
}

.teacher-ai-agent-card h4 + p,
.teacher-ai-agent-card h5 + p {
  margin-top: 6px;
}

.teacher-ai-agent-card ul,
.teacher-ai-agent-card ol {
  margin: 10px 0 0;
  padding-left: 20px;
  color: var(--muted);
}

.teacher-ai-agent-card li + li {
  margin-top: 6px;
}

.teacher-ai-agent-preview-html {
  max-height: 420px;
  overflow: auto;
  border-radius: 16px;
  padding: 16px 18px 16px 16px;
  background: #fff;
  border: 1px solid rgba(111, 138, 173, 0.16);
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
}

.teacher-ai-agent-raw::-webkit-scrollbar,
.teacher-ai-agent-preview-html::-webkit-scrollbar {
  width: 12px;
}

.teacher-ai-agent-raw::-webkit-scrollbar-thumb,
.teacher-ai-agent-preview-html::-webkit-scrollbar-thumb {
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: padding-box;
  background: rgba(131, 162, 210, 0.72);
}

.teacher-ai-agent-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 18px;
}

.teacher-ai-work-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-top: 6px;
}

.teacher-ai-work-head strong {
  display: block;
  font-size: 18px;
  color: #162544;
}

.teacher-ai-work-head p {
  margin: 6px 0 0;
}

.teacher-ai-work-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.teacher-ai-work-card {
  padding: 12px;
  border: 1px solid rgba(111, 138, 173, 0.18);
  border-radius: 14px;
  background: #fff;
}

.teacher-ai-work-card strong {
  display: block;
  font-size: 24px;
  color: #162544;
}

.teacher-ai-work-card span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.teacher-ai-work-card.loading { background: #fffbeb; border-color: rgba(202, 138, 4, .24); }
.teacher-ai-work-card.success { background: #f0fdf4; border-color: rgba(22, 163, 74, .22); }
.teacher-ai-work-card.error { background: #fff1f2; border-color: rgba(178, 58, 72, .24); }
.teacher-ai-work-card.muted { background: #f8fafc; border-color: rgba(100, 116, 139, .18); }

.teacher-ai-work-log-wrap {
  max-height: 360px;
  overflow: auto;
  border: 1px solid rgba(111, 138, 173, 0.18);
  border-radius: 16px;
  background: #fff;
}

.teacher-ai-work-log {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.teacher-ai-work-log th,
.teacher-ai-work-log td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(111, 138, 173, 0.14);
  text-align: left;
  font-size: 13px;
}

.teacher-ai-work-log th {
  background: #f3f7ff;
  color: #22406f;
}

.teacher-ai-work-badge {
  display: inline-flex;
  min-width: 58px;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef5ff;
  color: #26446f;
  font-weight: 800;
  font-size: 12px;
}

.teacher-ai-work-badge.loading { background: #fffbeb; color: #92400e; }
.teacher-ai-work-badge.success { background: #f0fdf4; color: #047857; }
.teacher-ai-work-badge.error { background: #fff1f2; color: #b91c1c; }
.teacher-ai-work-badge.muted { background: #f1f5f9; color: #64748b; }

.teacher-ai-work-data-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.teacher-ai-work-data {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef5ff;
  color: #244268;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.teacher-ai-work-data.empty {
  background: #f8fafc;
  color: #94a3b8;
}

.filter-grid {
  margin-top: 10px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.table-wrap {
  margin-top: 14px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}
.teacher-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}
.teacher-table th,
.teacher-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
}
.teacher-table th {
  background: #f3f7ff;
  color: #22406f;
  font-weight: 800;
}
.teacher-table td.done-cell { color: var(--success, #1a8a4a); font-weight: 600; }
.teacher-table td.miss-cell { color: var(--muted); }
.teacher-table td.review-pass { color: var(--success, #1a8a4a); font-weight: 600; }
.teacher-table td.review-need { color: var(--danger, #b23a48); font-weight: 600; }
.teacher-review-action-cell {
  min-width: 154px;
}
.teacher-review-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border: 1px solid rgba(37, 99, 235, .28);
  border-radius: 12px;
  background: #eff6ff;
}
.teacher-review-score {
  min-width: 78px;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
}
.teacher-total-score {
  display: inline-flex;
  justify-content: center;
  min-width: 36px;
  padding: 4px 6px;
  border-radius: 8px;
  color: #163766;
  font-weight: 800;
  cursor: help;
}
.teacher-total-score:hover {
  background: #eff6ff;
  color: #1d4ed8;
}
.teacher-review-action-cell.review-pass .teacher-review-inline {
  border-color: rgba(22, 163, 74, .24);
  background: #ecfdf5;
}
.teacher-review-action-cell.review-pass .teacher-review-score {
  color: #047857;
}
.teacher-review-action-cell.review-need .teacher-review-inline {
  border-color: rgba(220, 38, 38, .24);
  background: #fef2f2;
}
.teacher-review-action-cell.review-need .teacher-review-score {
  color: #b91c1c;
}
.teacher-review-adopt-btn,
.teacher-review-card-form .adopt-ai-btn,
.teacher-review-card-form .requeue-ai-btn {
  position: relative;
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.teacher-review-adopt-btn {
  background: #fff;
  color: var(--brand);
  border-color: rgba(37, 99, 235, .2);
}
.teacher-review-reviewed-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid rgba(22, 163, 74, .2);
  background: #fff;
  color: #047857;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.teacher-review-card-form .adopt-ai-btn::after {
  content: attr(data-ai-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%) translateY(4px);
  z-index: 30;
  width: min(420px, 72vw);
  max-height: 220px;
  overflow: auto;
  padding: 12px 14px;
  border: 1px solid rgba(37, 99, 235, .22);
  border-radius: 12px;
  background: #0f172a;
  color: #fff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, .28);
  white-space: pre-wrap;
  line-height: 1.55;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity .14s ease, transform .14s ease, visibility .14s ease;
}
.teacher-review-card-form .adopt-ai-btn::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  transform: translateX(-50%);
  z-index: 31;
  border: 6px solid transparent;
  border-top-color: #0f172a;
  opacity: 0;
  visibility: hidden;
  transition: opacity .14s ease, visibility .14s ease;
}
.teacher-review-card-form .adopt-ai-btn:hover::after,
.teacher-review-card-form .adopt-ai-btn:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.teacher-review-card-form .adopt-ai-btn:hover::before,
.teacher-review-card-form .adopt-ai-btn:focus-visible::before {
  opacity: 1;
  visibility: visible;
}
.teacher-review-floating-tooltip {
  position: fixed;
  z-index: 100000;
  width: min(420px, calc(100vw - 24px));
  max-height: min(260px, calc(100vh - 24px));
  overflow: auto;
  padding: 12px 14px;
  border: 1px solid rgba(37, 99, 235, .22);
  border-radius: 12px;
  background: #0f172a;
  color: #fff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, .32);
  white-space: pre-wrap;
  line-height: 1.55;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .14s ease, transform .14s ease;
}
.teacher-review-floating-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.teacher-review-adopt-btn:disabled,
.teacher-review-card-form button:disabled {
  opacity: .55;
  cursor: wait;
}
.teacher-review-card.focus-flash {
  outline: 3px solid rgba(37, 99, 235, .32);
  box-shadow: 0 0 0 8px rgba(37, 99, 235, .12);
}
.section-count-pill {
  display: inline-flex;
  align-items: center;
  margin-left: 10px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #ecfdf3;
  color: var(--success, #1a8a4a);
  font-size: 13px;
  font-weight: 800;
  vertical-align: middle;
}
.table-link-btn {
  display: inline-block;
  max-width: 4.6em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
  border: 0;
  background: transparent;
  color: #2563eb;
  cursor: pointer;
  padding: 0;
  font: inherit;
  text-decoration: underline;
}
.table-link-btn.logged-in-student {
  color: var(--success, #1a8a4a);
  font-weight: 700;
}
.table-image-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 46px;
  border: 1px solid #bfd2f1;
  background: #f6f9ff;
  border-radius: 999px;
  padding: 3px 7px;
  cursor: pointer;
  color: #1d4ed8;
  font: inherit;
}
.table-image-btn:hover {
  background: #eaf2ff;
  border-color: #8fb4ec;
}
.table-image-icon {
  position: relative;
  width: 16px;
  height: 14px;
  border: 1.8px solid currentColor;
  border-radius: 3px;
  flex: 0 0 auto;
}
.table-image-icon::before {
  content: "";
  position: absolute;
  top: 2px;
  right: 2px;
  width: 3px;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
}
.table-image-icon::after {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 2px;
  height: 5px;
  background: currentColor;
  clip-path: polygon(0 100%, 34% 35%, 54% 70%, 72% 28%, 100% 100%);
  opacity: .86;
}
.table-image-count {
  font-size: 11px;
  font-weight: 700;
}
.teacher-like-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #fed7aa;
  background: #fff7ed;
  color: #9a3412;
  border-radius: 999px;
  padding: 3px 7px;
  font: inherit;
  cursor: pointer;
}
.teacher-like-btn strong {
  font-size: 12px;
}
.teacher-like-btn em {
  font-style: normal;
  font-size: 11px;
}
.teacher-like-btn.liked {
  background: #ffedd5;
  border-color: #fb923c;
}
.teacher-like-btn:disabled {
  cursor: wait;
  opacity: .75;
}

.teacher-overview-student-table th,
.teacher-overview-student-table td {
  padding: 4px 6px;
  font-size: 13px;
  white-space: nowrap;
}
.teacher-overview-student-table th:nth-child(1),
.teacher-overview-student-table td:nth-child(1) { width: 56px; }
.teacher-overview-student-table th:nth-child(2),
.teacher-overview-student-table td:nth-child(2) { width: 44px; }
.teacher-overview-student-table th:nth-child(3),
.teacher-overview-student-table td:nth-child(3) { width: 60px; }
.teacher-overview-student-table th:nth-child(4),
.teacher-overview-student-table td:nth-child(4) { width: 52px; max-width: 52px; }
.teacher-overview-student-table th:nth-child(6),
.teacher-overview-student-table td:nth-child(6),
.teacher-overview-student-table th:nth-child(7),
.teacher-overview-student-table td:nth-child(7) { width: 40px; text-align: center; }
.teacher-overview-student-table th:nth-child(5),
.teacher-overview-student-table td:nth-child(5) { width: 56px; text-align: center; }
.teacher-overview-student-table th:nth-child(n+8):nth-child(-n+14),
.teacher-overview-student-table td:nth-child(n+8):nth-child(-n+14) { width: 40px; text-align: center; }
.teacher-overview-student-table th:nth-child(15),
.teacher-overview-student-table td:nth-child(15) { width: 52px; text-align: center; }
.teacher-overview-student-table th:nth-child(16),
.teacher-overview-student-table td:nth-child(16) { width: 40px; text-align: center; }

/* 教学分析 metric 卡片网格 */
.teacher-analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  margin: 12px 0;
}
.teacher-analytics-card {
  background: var(--canvas-alt, #f5f8ff);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}
.teacher-analytics-card strong {
  font-size: 24px;
  font-weight: 800;
  color: var(--brand, #1d6fe8);
  line-height: 1;
}
.teacher-analytics-card span {
  font-size: 12px;
  color: var(--muted);
}

/* 课中审查卡片列表 */
.teacher-review-card-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}
.teacher-review-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--canvas-alt, #f5f8ff);
}
.teacher-review-card.has-content {
  border-color: #a8c3ee;
  background: #f5f9ff;
}
.teacher-review-card.review-pass { border-left: 4px solid var(--success, #1a8a4a); }
.teacher-review-card.review-need { border-left: 4px solid var(--danger, #b23a48); }
.teacher-review-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.teacher-review-card-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}
.teacher-review-card-meta {
  font-size: 12px;
  color: var(--muted);
}
.teacher-review-card-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  margin-bottom: 10px;
  font-size: 13px;
}
.teacher-review-card-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.teacher-review-card-field label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.teacher-review-card-field p {
  margin: 0;
  color: var(--text);
  line-height: 1.5;
  word-break: break-all;
}
.teacher-review-card-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0;
}
.teacher-review-card-img {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform .15s;
}
.teacher-review-card-img:hover { transform: scale(1.05); }
.teacher-review-card-form {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: end;
  margin-top: 8px;
}
.teacher-review-card-form select,
.teacher-review-card-form textarea { font-size: 13px; }
.teacher-review-card-form textarea { grid-column: 1 / -1; }
.teacher-review-card-form .save-btn { white-space: nowrap; }
.teacher-review-card-save-status {
  font-size: 12px;
  color: var(--success, #1a8a4a);
  grid-column: 1 / -1;
  min-height: 16px;
}
/* 对老师评价统计 */
.teacher-eval-stats-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.teacher-eval-stats-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 4px;
}
.teacher-eval-stats-summary div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}
.teacher-eval-stats-summary strong {
  display: block;
  font-size: 20px;
  line-height: 1.2;
  color: var(--brand);
}
.teacher-eval-stats-summary span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}
.teacher-eval-stat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
.teacher-eval-stat-label {
  flex: 0 0 220px;
  min-width: 0;
  font-size: 13px;
  color: var(--text);
}
.teacher-eval-stat-label em {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 6px;
  background: #eef2ff;
  color: #4353b8;
  font-style: normal;
  font-size: 11px;
}
.teacher-eval-stat-bar-wrap {
  flex: 1;
  background: var(--line);
  border-radius: 99px;
  height: 8px;
  overflow: hidden;
}
.teacher-eval-stat-bar {
  height: 100%;
  border-radius: 99px;
  background: var(--brand, #1d6fe8);
  transition: width .4s;
}
.teacher-eval-stat-count {
  font-weight: 700;
  color: var(--brand);
  min-width: 28px;
  text-align: right;
}
.teacher-eval-stat-percent {
  min-width: 48px;
  text-align: right;
  color: var(--muted);
  font-size: 12px;
}
@media (max-width: 600px) {
  .teacher-review-card-body { grid-template-columns: 1fr; }
  .teacher-analytics-grid { grid-template-columns: repeat(3, 1fr); }
  .teacher-review-card-form { grid-template-columns: 1fr; }
  .teacher-eval-stats-summary div { padding: 8px; }
  .teacher-eval-stat-row { align-items: flex-start; flex-wrap: wrap; }
  .teacher-eval-stat-label { flex: 1 0 100%; }
  .teacher-eval-stat-count { min-width: 24px; }
}

.teacher-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.teacher-layout-side,
.teacher-layout-main {
  display: grid;
  gap: 16px;
}

.teacher-layout-side {
  position: sticky;
  top: 96px;
}

.teacher-layout-main .panel {
  min-height: 120px;
}

#teacherQuestionJSON,
#teacherAIModels,
#teacherImportStudentsText {
  font-family: "JetBrains Mono", "Consolas", "SFMono-Regular", monospace;
  font-size: 13px;
}

.teacher-layout-main .filter-grid label input[type="checkbox"] {
  margin-right: 8px;
}

.teacher-readonly-input {
  background: #f7faff;
  color: #23467b;
  font-weight: 700;
  cursor: default;
}

.teacher-readonly-input:focus {
  outline: none;
  border-color: var(--line);
  box-shadow: none;
}

.teacher-login-panel {
  display: grid;
  gap: 12px;
}

.teacher-login-head {
  display: grid;
  gap: 6px;
}

.teacher-login-head h2 {
  margin: 0;
}

.teacher-login-head .muted {
  margin: 0;
}

.teacher-login-course {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid #d8e2f2;
  border-radius: 12px;
  background: #f8fbff;
}

.teacher-login-course-label {
  font-size: 12px;
  color: #56719d;
}

.teacher-login-course strong {
  color: #19355d;
  line-height: 1.5;
}

.teacher-login-field {
  display: grid;
  gap: 8px;
  color: #35517a;
  font-size: 15px;
  font-weight: 700;
}

.teacher-login-field input {
  min-height: 48px;
  border-radius: 12px;
}

.teacher-login-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.teacher-login-actions button {
  min-height: 46px;
  border-radius: 12px;
  min-width: 132px;
}

.teacher-document-meta {
  margin-top: 14px;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.teacher-document-entry-panel {
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(246, 250, 255, 0.96) 0%, rgba(255, 255, 255, 0.96) 100%);
}

.teacher-document-entry-panel strong {
  display: block;
  margin-bottom: 6px;
  color: var(--primary);
  font-size: 18px;
}

.teacher-document-entry-panel p {
  margin: 0;
}

.teacher-document-full-editor {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: #eef3f8;
}

.teacher-document-full-shell {
  height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.teacher-document-full-topbar {
  min-height: 78px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 16px 24px;
  border-bottom: 1px solid #d3e0f2;
  background: #fff;
}

.teacher-document-full-topbar h2 {
  margin: 4px 0 0;
  color: #102647;
  font-size: 22px;
}

.teacher-document-full-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.teacher-document-full-actions button {
  min-height: 40px;
  border-radius: 10px;
}

.teacher-document-full-body {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  overflow: hidden;
}

.teacher-document-version-panel {
  min-height: 0;
  overflow: auto;
  padding: 18px;
  border-right: 1px solid #d3e0f2;
  background: #f8fbff;
}

.teacher-document-page-panel {
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid #dbe7f6;
}

.teacher-document-version-head {
  margin-top: 4px;
}

.teacher-document-page-list {
  display: grid;
  gap: 8px;
  max-height: 42vh;
  overflow: auto;
  padding-right: 4px;
}

.teacher-document-page-item {
  width: 100%;
  min-height: 54px;
  justify-content: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #d5e2f6;
  border-radius: 12px;
  background: #fff;
  color: #244878;
  box-shadow: none;
}

.teacher-document-page-item:hover,
.teacher-document-page-item.active {
  border-color: #76a8ee;
  background: #edf5ff;
  color: #0b4db8;
}

.teacher-document-page-thumb {
  flex: 0 0 28px;
  width: 28px;
  height: 38px;
  border: 1px solid #bdd3ef;
  border-radius: 4px;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(180deg, #eef6ff 0%, #fff 100%) border-box;
}

.teacher-document-page-text {
  display: grid;
  gap: 2px;
  text-align: left;
  line-height: 1.25;
}

.teacher-document-page-text strong {
  color: inherit;
  font-size: 13px;
}

.teacher-document-page-text span {
  color: var(--muted);
  font-size: 12px;
}

.teacher-document-revision-list {
  display: grid;
  gap: 10px;
}

.teacher-document-revision-item {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #d5e2f6;
  border-radius: 12px;
  background: #fff;
}

.teacher-document-revision-item strong {
  display: block;
  color: #102647;
  line-height: 1.35;
}

.teacher-document-revision-item span,
.teacher-document-revision-preview-head span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.teacher-document-revision-actions {
  display: flex;
  gap: 8px;
}

.teacher-document-revision-actions button {
  min-height: 32px;
  border-radius: 9px;
  font-size: 12px;
}

.teacher-document-revision-preview {
  margin-top: 14px;
  border: 1px solid #c7daf4;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.teacher-document-revision-preview-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid #e0e9f8;
}

.teacher-document-revision-preview-body {
  max-height: 320px;
  overflow: auto;
  padding: 12px;
  color: #102647;
  font-size: 12px;
  line-height: 1.65;
}

.teacher-document-revision-preview-body table {
  width: 100%;
  border-collapse: collapse;
}

.teacher-document-revision-preview-body td,
.teacher-document-revision-preview-body th {
  border: 1px solid #d4e0f2;
  padding: 4px 5px;
}

.teacher-document-full-canvas {
  min-height: 0;
  overflow: hidden;
  padding: 18px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
}

.teacher-document-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #d3e0f2;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 24px rgba(20, 45, 92, 0.08);
}

.teacher-document-toolbar-group {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-right: 10px;
  border-right: 1px solid #dce7f6;
}

.teacher-document-toolbar-group:last-child {
  border-right: 0;
  padding-right: 0;
}

.teacher-document-toolbar select,
.teacher-document-toolbar input {
  min-height: 36px;
  border-radius: 9px;
  border: 1px solid #d0deef;
  background: #fff;
  color: #102647;
}

.teacher-document-toolbar select {
  min-width: 104px;
  padding: 0 10px;
}

.teacher-document-toolbar input {
  width: min(420px, 32vw);
  padding: 0 12px;
}

.teacher-document-toolbar .secondary {
  min-height: 36px;
  border-radius: 9px;
  padding: 0 12px;
}

.teacher-document-toolbar .icon-like {
  min-width: 36px;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  font-weight: 900;
}

.teacher-document-word-tools {
  flex: 0 0 auto;
}

.teacher-document-editor-note {
  color: #17345c;
  font-size: 13px;
}

.teacher-document-editor-note strong {
  color: #0b4db8;
}

.teacher-document-editor-note span {
  color: var(--muted);
}

.teacher-document-ai-tools {
  flex: 1 1 420px;
  justify-content: flex-end;
}

.teacher-document-full-canvas .teacher-document-paper-shell {
  height: 100%;
  min-height: 0;
  max-height: none;
}

.teacher-document-assist-panel {
  margin-top: 14px;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr);
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(246, 250, 255, 0.96) 0%, rgba(255, 255, 255, 0.96) 100%);
}

.teacher-document-assist-panel textarea {
  margin-top: 8px;
  min-height: 92px;
}

.teacher-document-assist-notes {
  display: grid;
  gap: 12px;
  align-content: start;
}

.teacher-document-assist-notes p {
  margin: 0;
}

.doc-command-row {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.doc-command-row .ghost {
  min-height: 38px;
  border-radius: 10px;
}

.teacher-document-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.teacher-document-outline {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255,255,255,0.92);
}

.teacher-document-outline-head {
  margin-bottom: 12px;
}

.teacher-document-outline h4 {
  margin: 0 0 4px;
}

.teacher-document-outline-head p {
  margin: 0;
  font-size: 12px;
}

.teacher-document-outline-list {
  display: grid;
  gap: 8px;
}

.teacher-document-outline-item {
  border: 1px solid #d5e2f6;
  border-radius: 16px;
  padding: 12px;
  background: #f8fbff;
  color: #23467b;
  font-size: 13px;
  box-shadow: 0 8px 18px rgba(25, 68, 138, 0.06);
}

.teacher-document-outline-item.active {
  border-color: #7ea5e7;
  background: #eef5ff;
}

.teacher-document-outline-title {
  font-weight: 700;
  line-height: 1.5;
}

.teacher-document-outline-excerpt {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.teacher-document-outline-actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.teacher-document-outline-actions .ghost {
  min-height: 34px;
  border-radius: 10px;
  font-size: 12px;
}

.teacher-document-outline-item.level-2 {
  margin-left: 14px;
}

.teacher-document-outline-item.level-3,
.teacher-document-outline-item.level-4 {
  margin-left: 28px;
}

.teacher-document-paper-shell {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(236, 243, 252, 0.92), rgba(248, 251, 255, 0.92));
}

.teacher-document-paged-editor {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow: auto;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 28px;
  padding: 28px 18px 42px;
  border: 1px solid #cbd9ee;
  border-radius: 14px;
  background:
    linear-gradient(90deg, rgba(15, 38, 72, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(15, 38, 72, 0.035) 1px, transparent 1px),
    #e8eef6;
  background-size: 28px 28px, 28px 28px, auto;
}

.teacher-document-a4-page {
  width: 210mm;
  min-height: 297mm;
  position: relative;
  overflow: visible;
  padding: 22mm 18mm 20mm;
  border: 1px solid #d7e2ef;
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.20);
  color: #172b4d;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif;
}

.teacher-document-a4-page::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 10mm;
  background: linear-gradient(90deg, #0b4db8 0%, #078b7b 72%, #f4a000 100%);
}

.teacher-document-page-content {
  min-height: 247mm;
  outline: none;
  color: #102647;
  font-size: 15px;
  line-height: 1.78;
}

.teacher-document-page-content:focus {
  box-shadow: inset 0 0 0 2px rgba(11, 77, 184, 0.18);
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.76), #fff 18%);
}

.teacher-document-page-content h1,
.teacher-document-page-content h2,
.teacher-document-page-content h3,
.teacher-document-page-content p {
  margin-top: 0;
}

.teacher-document-page-content h1 {
  margin-bottom: 18px;
  color: #0b4db8;
  text-align: center;
  font-size: 28px;
  line-height: 1.35;
}

.teacher-document-page-content h2 {
  margin: 22px 0 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid #dbe8f7;
  color: #0b4db8;
  font-size: 21px;
  line-height: 1.35;
}

.teacher-document-page-content h3 {
  margin: 16px 0 8px;
  color: #078b7b;
  font-size: 17px;
  line-height: 1.4;
}

.teacher-document-page-content table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  margin: 12px 0;
}

.teacher-document-page-content td,
.teacher-document-page-content th {
  border: 1px solid #b8c9df;
  padding: 7px 8px;
  vertical-align: top;
  word-break: break-word;
}

.teacher-document-page-content th {
  background: #f0f6ff;
  color: #0b4db8;
}

.teacher-document-page-number {
  position: absolute;
  left: 18mm;
  right: 18mm;
  bottom: 9mm;
  display: flex;
  justify-content: center;
  border-top: 1px solid #e3ebf5;
  padding-top: 5mm;
  color: #6b7d98;
  font-size: 12px;
}

.teacher-document-a4-page.active {
  outline: 3px solid rgba(11, 77, 184, 0.22);
  outline-offset: 8px;
}

.teacher-document-paper-shell .sun-editor {
  display: none !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0;
  max-height: 100%;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  border-color: #cddbf0;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 16px 42px rgba(20, 45, 92, 0.13);
}

.teacher-document-paper-shell .sun-editor .se-container {
  height: 100% !important;
  min-height: 0 !important;
  display: flex;
  flex-direction: column;
}

.teacher-document-paper-shell .se-toolbar {
  flex: 0 0 auto;
  border-bottom-color: #d7e4f5;
  background: #f8fbff;
}

.teacher-document-paper-shell .se-wrapper {
  flex: 1 1 auto;
  height: auto !important;
  min-height: 0;
  max-height: 100%;
  overflow: auto !important;
  background: #edf3fa;
}

.teacher-document-paper-shell .se-wrapper-inner,
.teacher-document-paper-shell .sun-editor-editable {
  width: min(100%, 210mm);
  min-height: 297mm;
  box-sizing: border-box;
  margin: 24px auto;
  border: 1px solid #d5e2f6;
  border-radius: 3px;
  padding: 18mm 16mm !important;
  background: #fff;
  box-shadow: 0 16px 42px rgba(20, 45, 92, 0.14);
  color: #102647;
  font-size: 15px;
  line-height: 1.75;
}

.teacher-document-paper-shell .se-resizing-bar {
  flex: 0 0 auto;
}

.teacher-document-editor {
  display: none;
  width: min(100%, 210mm);
  min-height: 297mm;
  margin: 0 auto;
  border: 1px solid #d5e2f6;
  border-radius: 3px;
  padding: 18mm 16mm;
  background: #fff;
  box-shadow: 0 16px 42px rgba(20, 45, 92, 0.16);
  overflow: auto;
  color: #102647;
  font-size: 15px;
  line-height: 1.75;
}

.teacher-document-editor:focus {
  outline: 2px solid rgba(42, 99, 191, 0.18);
  border-color: #84a9e6;
}

.teacher-document-editor h1,
.teacher-document-editor h2,
.teacher-document-editor h3,
.teacher-document-editor p {
  margin-top: 0;
}

.teacher-document-editor h1 {
  text-align: center;
  font-size: 26px;
  line-height: 1.35;
  margin-bottom: 18px;
}

.teacher-document-editor h2 {
  color: #0b4db8;
  font-size: 20px;
  margin: 22px 0 10px;
}

.teacher-document-editor h3 {
  color: #17345c;
  font-size: 17px;
  margin: 16px 0 8px;
}

.teacher-document-editor table,
.teacher-document-editor .doc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  table-layout: auto;
}

.teacher-document-editor td,
.teacher-document-editor th {
  border: 1px solid #b8c9df;
  padding: 7px 8px;
  vertical-align: top;
}

.teacher-document-editor th {
  background: #f0f6ff;
}

.teacher-document-section-target {
  outline: 2px solid rgba(42, 99, 191, 0.22);
  outline-offset: 6px;
  border-radius: 10px;
}

.board-metric-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.board-teacher-gate {
  margin-top: 14px;
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid rgba(37, 99, 201, 0.14);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(230, 239, 255, 0.96), rgba(244, 248, 255, 0.96));
}
.board-teacher-gate strong {
  color: #18335c;
  font-size: 15px;
}
.board-teacher-gate span {
  color: #5f718e;
  font-size: 13px;
  line-height: 1.55;
}
.board-filter-toolbar {
  margin-top: 14px;
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 14px 16px;
  border: 1px solid rgba(37, 99, 201, 0.12);
  border-radius: 16px;
  background: rgba(255,255,255,0.78);
}
.board-filter-field {
  display: grid;
  gap: 8px;
  color: #55709c;
  font-size: 13px;
  font-weight: 700;
}
.board-filter-field select {
  margin: 0;
  min-height: 44px;
  border-radius: 12px;
}
#boardRefreshBtn {
  min-height: 44px;
  border-radius: 12px;
  min-width: 120px;
}
.board-showcase-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.board-showcase-grid-wide {
  grid-template-columns: 1.08fr 1fr;
}
.board-surface-card {
  border: 1px solid rgba(37, 99, 201, 0.12);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255,255,255,0.88);
  display: grid;
  gap: 10px;
}
.board-immersive-card {
  background:
    radial-gradient(circle at top right, rgba(106, 160, 255, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(241,246,255,0.95));
}
.board-surface-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.board-surface-head > div {
  display: grid;
  gap: 4px;
}
.board-surface-head h3 {
  margin: 0;
  font-size: 18px;
  color: #1d2f52;
}
.board-surface-copy {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: #60738f;
}
.board-wordcloud-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 14px;
}
.board-wordcloud-cloud,
.board-wordcloud-side,
.board-ai-summary,
.board-ai-bullets,
.board-ai-showcase {
  min-height: 0;
}
.board-wordcloud-cloud {
  border-radius: 18px;
  border: 1px solid rgba(37, 99, 201, 0.12);
  background: rgba(255,255,255,0.72);
  padding: 18px;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 10px;
}
.board-wordcloud-side {
  display: grid;
  gap: 12px;
}
.board-wordcloud-prompt {
  border-radius: 18px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(37, 99, 201, 0.12), rgba(37, 99, 201, 0.04));
  color: #18335c;
  font-size: 15px;
  line-height: 1.65;
  font-weight: 700;
}
.board-wordcloud-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.board-wordcloud-stat,
.board-ai-stat {
  border-radius: 16px;
  border: 1px solid rgba(37, 99, 201, 0.12);
  background: rgba(255,255,255,0.84);
  padding: 12px;
  display: grid;
  gap: 4px;
}
.board-wordcloud-stat span,
.board-ai-stat span {
  color: #60738f;
  font-size: 12px;
  font-weight: 700;
}
.board-wordcloud-stat strong,
.board-ai-stat strong {
  color: #15345f;
  font-size: 24px;
  line-height: 1;
  letter-spacing: -0.03em;
}
.board-ai-stat small {
  color: #60738f;
  font-size: 12px;
}
.board-wordcloud-word {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(37, 99, 201, 0.1);
  border: 1px solid rgba(37, 99, 201, 0.16);
  color: #14345d;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.board-wordcloud-recent {
  display: grid;
  gap: 10px;
}
.board-wordcloud-recent-item {
  border-radius: 16px;
  border: 1px solid rgba(37, 99, 201, 0.1);
  background: rgba(255,255,255,0.72);
  padding: 12px 14px;
}
.board-wordcloud-recent-item strong {
  display: block;
  color: #17355f;
  font-size: 14px;
}
.board-wordcloud-recent-item span {
  display: block;
  margin-top: 5px;
  color: #5f718e;
  font-size: 13px;
  line-height: 1.5;
}
.teacher-wordcloud-panel {
  min-height: calc(100vh - 170px);
}

.teacher-wordcloud-panel-head {
  margin-bottom: 16px;
}

.teacher-wordcloud-screen-grid {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.teacher-wordcloud-screen-side,
.teacher-wordcloud-screen-main,
.teacher-wordcloud-screen-shell {
  min-height: 0;
}

.teacher-wordcloud-screen-main:fullscreen {
  width: 100vw;
  height: 100vh;
  padding: 28px;
  border: 0;
  border-radius: 0;
  background: #f8fbff;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.teacher-wordcloud-screen-main:fullscreen .teacher-wordcloud-screen-shell {
  min-height: 0;
}

.teacher-wordcloud-screen-main:fullscreen .teacher-wordcloud-screen-cloud {
  min-height: 0;
}

.teacher-wordcloud-screen-side {
  display: grid;
  gap: 14px;
}

.teacher-wordcloud-screen-card {
  align-content: start;
}

.teacher-wordcloud-screen-meta {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.teacher-wordcloud-screen-shell {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 14px;
  min-height: 520px;
}

.teacher-wordcloud-screen-cloud {
  min-height: 420px;
  align-content: center;
  justify-content: center;
}

.board-ai-shell {
  display: grid;
  gap: 12px;
}
.board-ai-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.board-ai-bullets {
  border-radius: 18px;
  border: 1px solid rgba(37, 99, 201, 0.12);
  background: rgba(255,255,255,0.76);
  padding: 14px 16px;
}
.board-ai-bullets ol {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
}
.board-ai-bullets li {
  color: #243c63;
  line-height: 1.55;
}
.board-ai-showcase {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.board-ai-showcase-card {
  border-radius: 18px;
  border: 1px solid rgba(37, 99, 201, 0.12);
  background: rgba(255,255,255,0.82);
  padding: 12px;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.board-ai-showcase-media,
.board-ai-showcase-empty {
  width: 112px;
  height: 112px;
  border-radius: 14px;
}
.board-ai-showcase-media {
  object-fit: cover;
  display: block;
  border: 1px solid rgba(37, 99, 201, 0.1);
  background: #eef4ff;
}
.board-ai-showcase-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.board-ai-showcase-copy strong {
  color: #17355f;
  font-size: 16px;
}
.board-ai-showcase-copy p {
  margin: 0;
  color: #425a7b;
  font-size: 13px;
  line-height: 1.55;
}
.board-ai-showcase-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.board-podium-shell,
.board-attention-shell,
.board-class-shell {
  display: grid;
  gap: 10px;
}
.board-podium-card {
  display: grid;
  gap: 4px;
  border-radius: 14px;
  padding: 12px;
  border: 1px solid rgba(37, 99, 201, 0.12);
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(240,246,255,0.94));
}
.board-podium-card strong {
  font-size: 18px;
  color: #16345f;
}
.board-podium-card.rank-1 {
  background: linear-gradient(180deg, #fff8e7, #fff2c7);
}
.board-podium-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(31, 78, 163, 0.1);
  color: #1f4ea3;
  font-size: 12px;
  font-weight: 800;
}
.board-podium-meta {
  color: var(--muted);
  font-size: 13px;
}
.board-podium-score {
  color: #1f4ea3;
  font-weight: 800;
}
.board-attention-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(185, 28, 28, 0.12);
  border-radius: 14px;
  padding: 10px 12px;
  background: #fff8f7;
}
.board-attention-item strong {
  color: #5b1b18;
}
.board-attention-reason {
  font-size: 12px;
  font-weight: 700;
  color: #b42318;
  background: rgba(185, 28, 28, 0.08);
  border-radius: 999px;
  padding: 4px 8px;
}
.board-ranking-shell {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}
.board-ranking-item {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(37, 99, 201, 0.16);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.92);
}
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  min-height: 32px;
  min-width: 32px;
  background: #e7f0ff;
  color: #1f4ea3;
  font-weight: 800;
}
.rank-score {
  font-weight: 800;
  color: #1f4ea3;
}
.board-class-card {
  border: 1px solid rgba(37, 99, 201, 0.14);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255,255,255,0.94);
  display: grid;
  gap: 10px;
}
.board-class-card h4 {
  margin: 0;
  color: #1d2f52;
  font-size: 16px;
}
.board-class-list {
  display: grid;
  gap: 8px;
}
.board-class-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border-radius: 12px;
  background: #f8fbff;
  padding: 8px 10px;
}
.board-class-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.board-class-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #e7f0ff;
  color: #1f4ea3;
  font-size: 12px;
  font-weight: 800;
}
.board-class-score {
  font-weight: 700;
  color: #1f4ea3;
}

@media (max-width: 1180px) {
  .board-filter-toolbar,
  .board-showcase-grid-wide,
  .board-wordcloud-shell,
  .board-ai-summary,
  .board-ai-showcase {
    grid-template-columns: 1fr;
  }
  .board-ai-showcase-card {
    grid-template-columns: 88px minmax(0, 1fr);
  }
  .board-ai-showcase-media,
  .board-ai-showcase-empty {
    width: 88px;
    height: 88px;
  }
}

/* Teacher panel new layout */
.teacher-admin-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.teacher-admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: linear-gradient(135deg, #1a3a73 0%, #2563c9 100%);
  border-radius: 16px;
  color: #fff;
  flex-wrap: wrap;
}

.teacher-admin-toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.teacher-admin-toolbar-left h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

.teacher-admin-course {
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
}

.teacher-admin-toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.teacher-admin-filters {
  display: flex;
  gap: 10px;
  align-items: center;
}

.teacher-admin-filters select {
  margin-top: 0;
  padding: 8px 12px;
  font-size: 13px;
  min-width: 120px;
  background: rgba(255, 255, 255, 0.95);
  border: none;
}

.teacher-admin-toolbar button {
  min-height: 38px;
  padding: 8px 16px;
  font-size: 13px;
  box-shadow: none;
}

.teacher-admin-toolbar button:hover {
  background: rgba(255, 255, 255, 0.2);
}

.teacher-login-container {
  padding: 20px;
}

.teacher-login-header {
  text-align: center;
  margin-bottom: 20px;
}

.teacher-login-header h2 {
  margin: 0 0 8px;
  font-size: 24px;
  color: var(--text);
}

.teacher-login-header .muted {
  margin: 0;
  font-size: 14px;
}

.teacher-login-course {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #f7faff;
  border: 1px solid #d8e3f3;
  border-radius: 12px;
  margin-bottom: 16px;
}

.teacher-login-course span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.teacher-login-course strong {
  color: var(--text);
  font-size: 15px;
}

.teacher-login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.teacher-content-area {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.teacher-content-area > section[data-teacher-tab-panel].hidden {
  display: none;
}

.teacher-content-area > section[data-teacher-tab-panel]:not(.hidden) {
  display: block;
}

@media (max-width: 980px) {
  .topbar { padding: 18px 14px; }
  .topbar h1 { font-size: 24px; }
  .topbar-actions a {
    width: 100%;
    display: inline-flex;
    justify-content: center;
  }
  .page-shell { padding: 16px; }
  .hero-grid,
  .detail-grid,
  .dashboard-hero,
  .hero-stat-grid,
  .task-roadmap-grid,
  .teacher-layout,
  .filter-grid,
  .board-metric-grid,
  .teacher-document-meta,
  .teacher-document-grid {
    grid-template-columns: 1fr;
  }
  .teacher-document-entry-panel,
  .teacher-document-full-topbar {
    align-items: stretch;
    flex-direction: column;
  }
  .teacher-document-full-body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(180px, 34vh) minmax(0, 1fr);
  }
  .teacher-document-version-panel {
    border-right: 0;
    border-bottom: 1px solid #d3e0f2;
  }
  .teacher-document-toolbar-group {
    border-right: 0;
    padding-right: 0;
  }
  .teacher-document-toolbar input {
    width: 100%;
  }
  .teacher-document-ai-tools {
    flex-basis: 100%;
    justify-content: flex-start;
  }
  .teacher-layout-side {
    position: static;
    top: auto;
  }
  .course-library-row { gap: 18px; }
  .book-volume { width: min(92vw, 330px); height: 380px; }

  .teacher-admin-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .teacher-admin-toolbar-left,
  .teacher-admin-toolbar-right {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .teacher-admin-filters {
    flex-direction: column;
    width: 100%;
  }

  .teacher-admin-filters select {
    width: 100%;
  }
}

/* Layout refresh: make information hierarchy predictable and reduce visual noise */
body {
  background:
    radial-gradient(circle at 0 0, rgba(37, 99, 201, 0.08), transparent 34%),
    linear-gradient(180deg, #f7f9fc 0%, #eef2f7 100%);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 14px 24px;
  background: linear-gradient(120deg, #143a75 0%, #1f5ba8 100%);
  backdrop-filter: blur(6px);
}

.topbar h1 { font-size: 26px; margin-bottom: 2px; }
.topbar-subtitle { font-size: 14px; }

.topbar-actions a {
  padding: 8px 12px;
  font-size: 13px;
}

.page-shell {
  width: min(1240px, 100%);
  padding: 20px 24px 40px;
}

.panel {
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 8px 22px rgba(15, 44, 88, 0.08);
}

.hero-grid {
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr);
  gap: 16px;
}

.landing-hero { margin-bottom: 16px; }

.landing-register {
  align-self: start;
  position: sticky;
  top: 98px;
  border-color: #cfdcf0;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.landing-register h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #1d2f52;
}

.student-entry-card {
  display: grid;
  gap: 12px;
}

.student-login-head {
  display: grid;
  gap: 8px;
}

.student-login-copy {
  margin: 0;
  font-size: 15px;
}

.landing-register .status {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.3;
  display: block;
  width: 100%;
}

.student-entry-status {
  border-color: #d8e5f8;
  background: #f8fbff;
  color: #4b6388;
}

.student-login-form {
  margin-top: 12px;
  gap: 12px;
}

.landing-register label {
  display: grid;
  gap: 8px;
  color: #35517a;
  font-size: 15px;
  font-weight: 700;
}

.landing-register input {
  margin-top: 0;
  min-height: 48px;
  border-radius: 12px;
  border-color: #c8d8ef;
  background: #fff;
}

.student-login-actions {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.logged-in-info {
  display: grid;
  gap: 8px;
}

.student-welcome {
  margin: 0;
  font-size: 18px;
  color: #1d2f52;
}

.logged-in-info .muted {
  margin: 0;
}

.student-current-actions {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.student-login-primary,
.student-login-actions button,
.student-current-actions button {
  min-height: 48px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 132px;
}

.student-login-primary {
  min-width: 180px;
}

.training-grid {
  gap: 14px;
}

.training-card {
  border-radius: 14px;
  padding: 16px;
  gap: 10px;
}

.training-card h3,
.training-card h4 {
  font-size: 18px;
}

.training-card-head {
  display: grid;
  gap: 8px;
}

.board-grid {
  margin-top: 6px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}

.board-card {
  border: 1px solid #dbe5f1;
  border-radius: 14px;
  background: #fff;
  padding: 12px;
}

.empty-state {
  border: 1px dashed #b8c8df;
  border-radius: 14px;
  background: #f9fbff;
  color: #5e6f8a;
  padding: 16px;
  text-align: center;
}

.leaderboard-card {
  display: grid;
  gap: 8px;
  align-content: start;
}

.commendation-card {
  position: relative;
  overflow: visible;
  border: 1px solid rgba(76, 130, 98, 0.18);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.94) 0%, rgba(231, 246, 238, 0.92) 54%, rgba(214, 235, 222, 0.9) 100%);
  padding: 10px 10px 8px;
  box-shadow: 0 12px 22px rgba(16, 58, 37, 0.1);
}

.commendation-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 72% 16%, rgba(82, 190, 255, 0.18) 0%, rgba(82, 190, 255, 0) 56%);
  pointer-events: none;
}

.compact-card {
  min-height: 0;
}

.title-row.compact-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6px;
}

.title-row.compact-title-row .badge {
  align-self: flex-start;
  background: rgba(32, 105, 54, 0.12);
  color: #225b35;
  border: 1px solid rgba(34, 91, 53, 0.12);
  padding: 4px 8px;
  font-size: 11px;
}

.leaderboard-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  border-bottom: 1px solid #e8edf6;
  padding-bottom: 4px;
}

.leaderboard-head h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.2;
}

.leaderboard-head p {
  margin: 0;
  font-size: 11px;
  line-height: 1.2;
}

.leaderboard-list {
  display: grid;
  gap: 5px;
}

.commendation-podium.compact-podium {
  gap: 5px;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 8px;
  align-items: center;
  border: 1px solid #e6ecf5;
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
}

.leaderboard-row.rank-1 { background: #fff8e7; border-color: #f3dfaa; }
.leaderboard-row.rank-2 { background: #f3f7fc; border-color: #d7e0ec; }
.leaderboard-row.rank-3 { background: #fff2ea; border-color: #f0d5c3; }

.compact-rank-row {
  grid-template-columns: 34px 1fr auto;
  min-height: 0;
  border-radius: 14px;
  background: rgba(255,255,255,0.84);
  padding: 5px 7px;
}

.leaderboard-rank {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: #294a78;
  background: #e1ecfb;
}

.medal-badge {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.02em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.28);
}

.medal-1 {
  background: linear-gradient(135deg, #ffdf72 0%, #f7b733 100%);
  color: #754b00;
}

.medal-2 {
  background: linear-gradient(135deg, #e9eff8 0%, #b8c5d8 100%);
  color: #516071;
}

.medal-3 {
  background: linear-gradient(135deg, #ffd1b7 0%, #f29d67 100%);
  color: #7a3f11;
}

.leaderboard-name {
  font-weight: 700;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #17372b;
  line-height: 1.25;
}

.leaderboard-group {
  font-size: 11px;
  color: #556682;
  background: #f1f4f9;
  border-radius: 999px;
  padding: 2px 6px;
}

.group-chip {
  background: rgba(25, 89, 52, 0.08);
  color: #225b35;
  font-weight: 700;
}

.winner-name {
  font-size: 13px;
}

@media (max-width: 980px) {
  .topbar {
    position: static;
    padding: 14px 12px;
  }
  .page-shell {
    padding: 12px 12px 24px;
  }
  .landing-register {
    position: static;
    top: auto;
  }
  .landing-register h2 {
    font-size: 26px;
  }
  .landing-register .action-row {
    grid-template-columns: 1fr;
  }
  .board-grid {
    grid-template-columns: 1fr;
  }
  .board-showcase-grid {
    grid-template-columns: 1fr;
  }
  .teacher-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .teacher-layout-side,
  .teacher-layout-main {
    gap: 12px;
  }
}

/* Learning panel and teacher workbench refresh */
.learning-workbench-head {
  margin-bottom: 14px;
  border-color: #d3e0f2;
  padding: 10px 16px;
}

.learning-workbench-meta {
  margin-top: 10px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(260px, 1.15fr) minmax(0, 1fr);
}

.preclass-inline-status {
  display: grid;
  gap: 4px;
}

.preclass-inline-status strong {
  font-size: 20px;
  color: #1f3f76;
}

.learning-stage-board {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.stage-panel {
  margin-top: 0;
  border-radius: 16px;
  border-color: #d8e2f1;
}

.stage-panel-head h3 {
  margin: 0 0 8px;
}

.stage-panel-preclass {
  grid-column: 1 / -1;
}

.preclass-resource-grid {
  margin: 8px 0 12px;
}

.stage-panel-postclass .chips {
  margin-top: 10px;
}

.teacher-workbench-head {
  border-color: #d4e0f0;
  background: linear-gradient(180deg, #ffffff 0%, #f6faff 100%);
}

.teacher-tabbar {
  margin-top: 10px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.teacher-tabbar button {
  min-height: 44px;
  border-radius: 12px;
  background: #edf3ff;
  color: #23467b;
  border: 1px solid #d2e0f6;
  box-shadow: none;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.teacher-tabbar button:hover {
  background: #e4eeff;
}

.teacher-tabbar button.active {
  background: linear-gradient(120deg, #2a63bf 0%, #1f4f9c 100%);
  border-color: #214f98;
  color: #fff;
  box-shadow: 0 8px 18px rgba(32, 83, 163, 0.2);
}

.teacher-preview-quickbar {
  margin-top: 14px;
  padding: 18px 20px;
  border-radius: 18px;
  border: 1px solid rgba(42, 99, 191, 0.14);
  background:
    radial-gradient(circle at top right, rgba(96, 165, 250, 0.18), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(241, 247, 255, 0.96));
  box-shadow: 0 14px 32px rgba(35, 70, 123, 0.08);
  display: grid;
  gap: 14px;
}
.teacher-preview-quickbar.collapsed {
  padding-bottom: 14px;
}
.teacher-preview-quickbar-body.hidden {
  display: none;
}

.teacher-preview-quickbar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.teacher-preview-quickbar-head h3 {
  margin: 0;
  color: #17355f;
  font-size: 18px;
}

.teacher-preview-quickbar-head p {
  margin: 4px 0 0;
  color: #60738f;
  font-size: 13px;
  line-height: 1.6;
  max-width: 680px;
}

@media (max-width: 980px) {
  .learning-workbench-meta,
  .learning-stage-board {
    grid-template-columns: 1fr;
  }
  .teacher-tabbar {
    grid-template-columns: repeat(5, minmax(120px, 1fr));
    gap: 6px;
  }
  .teacher-tabbar button {
    font-size: 13px;
    min-height: 40px;
  }
  .teacher-preview-quickbar {
    padding: 16px;
  }
  .teacher-preview-quickbar-head {
    flex-direction: column;
  }
}

/* ========================================================
   教学文档标签页（Teacher Documents Tabs）
   ======================================================== */
.teacher-documents-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.doc-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 60px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f0f5ff;
  color: #2a63bf;
  border: 1px solid #d2e0f6;
  transition: all 0.2s ease;
  cursor: pointer;
}

.doc-tab:hover {
  background: #e4eeff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(42, 99, 191, 0.15);
}

.doc-tab.active {
  background: linear-gradient(135deg, #2a63bf 0%, #1f4f9c 100%);
  border-color: #214f98;
  color: #fff;
  box-shadow: 0 4px 16px rgba(32, 83, 163, 0.3);
}

.doc-tab-icon {
  font-size: 22px;
  line-height: 1;
}

.doc-tab-title {
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

@media (max-width: 980px) {
  .teacher-documents-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
  .doc-tab {
    min-height: 50px;
    padding: 8px 10px;
  }
  .doc-tab-icon {
    font-size: 18px;
  }
  .doc-tab-title {
    font-size: 12px;
  }
}

/* ========================================================
   按钮状态显示（Button Status）
   ======================================================== */
.btn-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 10px;
  background: rgba(42, 99, 191, 0.1);
  color: #2a63bf;
  white-space: nowrap;
}

.btn-status.error {
  background: rgba(220, 53, 69, 0.1);
  color: #dc3545;
}

.btn-status.success {
  background: rgba(25, 135, 84, 0.1);
  color: #198754;
}

.btn-status.loading {
  background: rgba(255, 193, 7, 0.1);
  color: #ffc107;
}

.btn-status::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.btn-status.loading::before {
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ========================================================
   Word模板上传区（Word Template Upload）
   ======================================================== */
.teacher-documents-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.doc-template-upload {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin-top: 12px;
  background: #f8fbff;
  border: 1px dashed #d2e0f6;
  border-radius: 8px;
}

.doc-template-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #2a63bf 0%, #1f4f9c 100%);
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
  font-size: 13px;
}

.doc-template-label:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(42, 99, 191, 0.25);
}

.doc-template-icon {
  font-size: 18px;
}

.doc-template-text {
  white-space: nowrap;
}

.doc-template-import-btn {
  padding: 8px 16px;
  font-size: 13px;
}

.doc-template-status {
  flex: 1 1 0;
  font-size: 12px;
}

.inline-action-status {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid #d5e2f6;
  background: #f8fbff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.inline-action-status.loading {
  color: #b7791f;
  border-color: rgba(183, 121, 31, 0.25);
  background: rgba(255, 193, 7, 0.12);
}

.inline-action-status.success {
  color: #1c7c54;
  border-color: rgba(28, 124, 84, 0.25);
  background: rgba(25, 135, 84, 0.12);
}

.inline-action-status.error {
  color: #b23a48;
  border-color: rgba(178, 58, 72, 0.22);
  background: rgba(220, 53, 69, 0.12);
}

@media (max-width: 980px) {
  .teacher-document-assist-panel {
    grid-template-columns: 1fr;
  }
  .doc-template-upload {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .btn-status {
    display: none; /* 移动端隐藏状态，保持按钮简洁 */
  }
  .inline-action-status {
    width: 100%;
    justify-content: center;
  }
}

/* ========================================================
   紧凑学时学习面板（Compact Detail Panel）
   ======================================================== */

/* 头部：导航条 + 标题行紧凑布局 */
.detail-nav-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.detail-nav-side {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 12px;
  padding: 2px 8px;
  line-height: 1.2;
}
.detail-nav-center {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;
}
.detail-nav-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted, #8a9bbd);
}
.detail-nav-status strong {
  font-size: 13px;
  color: var(--accent, #4a7fd4);
}
.detail-head-identity {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
}
.detail-head-identity .training-identity-item {
  padding: 2px 8px;
  font-size: 12px;
}
.detail-head-title {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 12px;
  margin-bottom: 10px;
  text-align: center;
}
.detail-head-title h2 {
  margin: 2px 0 0;
  font-size: 20px;
  text-align: center;
}
.detail-meta-chips {
  margin-top: 8px;
}
.compact-roadmap {
  margin-top: 8px;
}
.compact-roadmap .task-roadmap-item {
  font-size: 13px;
}

@media (max-width: 640px) {
  .task-roadmap-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .task-roadmap-main,
  .task-roadmap-item:first-child .task-roadmap-main,
  .task-roadmap-item:last-child .task-roadmap-main {
    clip-path: none;
    border-radius: 16px;
    min-height: 52px;
    padding: 0 16px;
  }
  .task-roadmap-label {
    font-size: 14px;
  }
  .task-roadmap-state {
    margin-top: 6px;
    font-size: 11px;
  }
  .metro-progress-map.single-line {
    min-width: 980px;
  }
  .metro-track-row,
  .metro-text-row {
    grid-template-columns: repeat(9, minmax(110px, 1fr));
  }
  .metro-track-row::before {
    left: 54px;
    right: 54px;
  }
  .metro-track-row::after {
    left: 76px;
    right: 76px;
    letter-spacing: 4px;
  }
}

@media (max-width: 768px) {
  .metro-stage-row,
  .metro-track-row,
  .metro-text-row {
    display: none;
  }
  .metro-progress-map.single-line {
    min-width: 100%;
    width: 100%;
    margin: 0;
  }
  .metro-mobile-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px 10px;
    position: relative;
  }
  .metro-mobile-grid::before,
  .metro-mobile-grid::after {
    content: "";
    position: absolute;
    width: 3px;
    background: #d7deea;
    left: calc(100% - (100% / 6));
    height: 24px;
  }
  .metro-mobile-grid::before {
    top: 31px;
  }
  .metro-mobile-grid::after {
    top: 173px;
    left: calc(100% / 6 - 2px);
  }
  .metro-mobile-stop {
    position: relative;
    text-align: center;
    min-height: 128px;
  }
  .metro-mobile-stop::before {
    content: "";
    position: absolute;
    top: 31px;
    left: calc(50% + 16px);
    width: calc(100% - 8px);
    height: 3px;
    background: #d7deea;
    z-index: 0;
  }
  .metro-mobile-stop.reverse-row::before {
    left: auto;
    right: calc(50% + 16px);
  }
  .metro-mobile-stop:nth-child(3)::before,
  .metro-mobile-stop:nth-child(6)::before,
  .metro-mobile-stop:nth-child(9)::before {
    display: none;
  }
  .metro-mobile-stage {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 6px;
  }
  .metro-mobile-dot-wrap {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
  }
  .metro-mobile-name .zh,
  .metro-mobile-status .zh {
    display: block;
  }
  .metro-mobile-name .en,
  .metro-mobile-status .en {
    display: block;
    margin-top: 2px;
    font-size: 10px;
    color: #94a3b8;
    line-height: 1.2;
  }
  .metro-mobile-name {
    font-size: 12px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.25;
  }
  .metro-mobile-status {
    margin-top: 6px;
    font-size: 11px;
  }
  .metro-mobile-stop.is-done .metro-stop-dot { background: #22c55e; }
  .metro-mobile-stop.is-current .metro-stop-dot {
    background: #f59e0b;
    box-shadow: 0 0 0 6px #fff, 0 0 0 10px rgba(245, 158, 11, 0.18);
  }
  .metro-mobile-stop.is-pending .metro-stop-dot { background: #94a3b8; }
  .learning-reminder-top {
    top: 84px;
    left: 12px;
    right: auto;
    bottom: auto;
  }
  .learning-reminder-fab-btn {
    width: auto;
    min-width: 112px;
    padding: 8px 12px 8px 10px;
    border-radius: 14px;
  }
  .wordcloud-fab-title { font-size: 13px; }
  .wordcloud-fab-subtitle { font-size: 10px; }
}

/* 三阶段卡片列表 */
.stage-card-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

/* 单张折叠卡片 */
.stage-card {
  padding: 0;
  border-radius: 14px;
  overflow: hidden;
  transition: box-shadow 0.15s;
}
.stage-card.open {
  box-shadow: 0 4px 20px rgba(37, 99, 201, 0.10);
}

/* 卡片头（可点击区域） */
.stage-card-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: none;
  border: none;
  border-radius: 0;
  cursor: pointer;
  text-align: left;
  color: var(--text);
  box-shadow: none;
  min-height: 52px;
  transition: background 0.12s;
}
.stage-card-head:hover {
  background: rgba(37, 99, 201, 0.04);
  box-shadow: none;
}

/* 阶段标签 */
.stage-card-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.stage-badge-preclass,
.stage-badge-inclass,
.stage-badge-postclass {
  background: #f3f6fb;
  color: #334155;
  border: 1px solid #d7e0ec;
}

/* 当前阶段卡片头背景微调 */
.stage-card.current > .stage-card-head { background: transparent; }
.stage-card.done > .stage-card-head {
  background: #f0fdf4;
}

/* 已完成/未完成统一标题颜色，图标保留即可 */
.stage-card.done .stage-badge-preclass,
.stage-card.done .stage-badge-inclass,
.stage-card.done .stage-badge-postclass,
.stage-card.current .stage-badge-preclass,
.stage-card.current .stage-badge-inclass,
.stage-card.current .stage-badge-postclass {
  background: #f3f6fb;
  color: #334155;
  border: 1px solid #d7e0ec;
}

/* 卡片标题文字 */
.stage-card-title {
  flex-shrink: 0;
  font-weight: 700;
  font-size: 14px;
}

/* 状态摘要区（右侧 chip 区域） */
.stage-card-summary {
  display: none;
}
.stage-card-summary .chip {
  font-size: 12px;
  padding: 2px 8px;
  white-space: nowrap;
}
.chip.done   { background: #e6f4ea; color: #166534; border-color: rgba(34,197,94,0.25); }
.chip.pending { background: #fef9c3; color: #713f12; border-color: rgba(234,179,8,0.25); }

/* 折叠箭头 */
.stage-card-toggle-text {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  white-space: nowrap;
}
.stage-card.open .stage-card-toggle-text {
  color: #64748b;
}
.stage-card-arrow {
  flex-shrink: 0;
  font-size: 14px;
  color: var(--muted);
  transition: transform 0.2s;
  line-height: 1;
}
.stage-card.open .stage-card-arrow {
  transform: rotate(180deg);
}

/* 卡片内容体 */
.stage-card-body {
  display: none;
  padding: 0 16px 16px;
  border-top: 1px solid var(--line);
}
.stage-card.open .stage-card-body {
  display: block;
}

/* 课中分区块 */
.inclass-section {
  display: grid;
  gap: 10px;
  padding: 14px 0 16px;
  border-bottom: 1px solid var(--line);
}
.inclass-section:last-of-type {
  border-bottom: none;
}

.practice-material-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  margin-bottom: 14px;
  border: 1px solid #a7c7ff;
  border-radius: 14px;
  background: linear-gradient(135deg, #eef6ff 0%, #fffdf5 100%);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.12);
}

.practice-material-banner.hidden { display: none; }

.practice-material-banner strong {
  display: block;
  margin-top: 5px;
  color: #082858;
  font-size: 18px;
}

.practice-material-banner p {
  margin: 5px 0 0;
  color: #526b93;
}

.practice-material-kicker {
  display: inline-flex;
  align-items: center;
  color: #1d5fc1;
  font-size: 13px;
  font-weight: 800;
}

.inclass-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.inclass-section-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 700;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid rgba(37,99,201,0.18);
  border-radius: 20px;
  padding: 3px 12px 3px 10px;
  letter-spacing: 0.02em;
}
.inclass-badge-share {
  color: #6d28d9;
  background: #f5f3ff;
  border-color: rgba(109,40,217,0.18);
}
.inclass-badge-optional {
  font-size: 11px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1px 7px;
}
.inclass-save-status {
  font-size: 12px;
  color: var(--muted);
  margin-left: auto;
  transition: color 0.2s;
}
.inclass-save-status.saving  { color: #2563c9; }
.inclass-save-status.saved   { color: #16a34a; }
.inclass-save-status.error   { color: #dc2626; }
.inclass-section textarea {
  width: 100%;
  box-sizing: border-box;
}

/* 教师评价标签网格 */
.teacher-eval-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 6px;
}
.teacher-eval-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s, background 0.15s, color 0.15s, transform 0.1s;
  line-height: 1.3;
}
.teacher-eval-tag:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
}
.teacher-eval-tag.selected {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
  font-weight: 600;
}
/* 知识点证书内嵌面板 */
.cert-panel {
  margin-top: 20px;
  animation: certFadeIn .5s ease;
}
@keyframes certFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
.cert-panel-inner {
  background: linear-gradient(145deg, #f8fbff 0%, #eef4ff 100%);
  border: 2px solid #c6d7ef;
  border-radius: 20px;
  padding: 36px 40px 30px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cert-panel-inner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 18px,
    rgba(198,215,239,.18) 18px,
    rgba(198,215,239,.18) 19px
  );
  pointer-events: none;
}
.cert-seal {
  font-size: 52px;
  line-height: 1;
  margin-bottom: 8px;
}
.teacher-praise-badge,
.cert-like-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #9a3412;
  background: #fff7ed;
  border: 1px solid #fdba74;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(251, 146, 60, .14);
}
.teacher-praise-badge {
  margin: 10px 0 4px;
}
.teacher-praise-badge strong,
.cert-like-badge strong {
  color: #c2410c;
  font-size: 18px;
}
.teacher-praise-icon {
  font-size: 18px;
}
.cert-like-badge {
  margin: 0 0 12px;
}
.cert-kicker {
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted, #7a8ca0);
  margin: 0 0 6px;
}
.cert-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--brand, #1d6fe8);
  margin: 0 0 24px;
}
.cert-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 24px;
  max-width: 480px;
  margin: 0 auto 20px;
  text-align: left;
}
.cert-info-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cert-label {
  font-size: 11px;
  color: var(--muted, #7a8ca0);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.cert-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--text, #12284a);
}
.cert-code-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(29,111,232,.06);
  border: 1px dashed #a8c3ee;
  border-radius: 10px;
  padding: 8px 20px;
  margin-top: 4px;
}
.cert-code-val {
  font-size: 14px;
  font-weight: 700;
  font-family: monospace;
  color: var(--brand, #1d6fe8);
  letter-spacing: .08em;
}
@media (max-width: 600px) {
  .cert-panel-inner { padding: 24px 18px 20px; }
  .cert-info-grid { grid-template-columns: 1fr; }
  .cert-title { font-size: 20px; }
}

.teacher-eval-tag:active { transform: scale(0.97); }
.teacher-eval-tag.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}
@media (max-width: 600px) {
  .teacher-eval-tag { font-size: 12px; padding: 6px 12px; }
}

/* 课前题目折叠区 */
.question-toggle-wrap {
  margin-top: 14px;
}
.question-toggle-alert {
  margin-bottom: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(239, 68, 68, 0.2);
  background: #fef2f2;
  color: #b91c1c;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}
.question-toggle-alert.hidden {
  display: none;
}
.question-toggle-btn {
  width: 100%;
  font-size: 14px;
  min-height: 44px;
  border-radius: 10px;
  font-weight: 700;
}
.question-toggle-btn.attention {
  border-color: rgba(239, 68, 68, 0.35);
  background: #fff1f2;
  color: #b91c1c;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.08);
}
.question-toggle-body {
  margin-top: 10px;
}
.question-toggle-body.hidden {
  display: none;
}

/* 图片灯箱 */
.img-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(5, 10, 28, 0.88);
  z-index: 9500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  cursor: zoom-out;
}
.img-lightbox.hidden { display: none; }
.img-lightbox-img {
  max-width: min(96vw, 1200px);
  max-height: 90vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 8px 48px rgba(0,0,0,0.6);
  cursor: default;
}
.img-lightbox-close {
  position: fixed;
  top: 18px;
  right: 22px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 9501;
}
.img-lightbox-close:hover { background: rgba(255,255,255,0.28); }
.img-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(0,0,0,0.45);
  color: #fff;
  font-size: 28px;
  cursor: pointer;
}
.img-lightbox-prev { left: 18px; }
.img-lightbox-next { right: 18px; }
.img-lightbox-counter {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  background: rgba(0,0,0,0.45);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
}

/* 已完成状态下卡片头分隔线微弱 */
.stage-card.done > .stage-card-head {
  opacity: 0.85;
}

/* 头部中 section-kicker 缩小 */
.learning-workbench-head .section-kicker {
  margin-bottom: 2px;
  font-size: 11px;
}

/* 响应式 */
@media (max-width: 640px) {
  .stage-card-title { font-size: 13px; }
  .stage-card-summary { display: none; }
  .detail-head-identity { gap: 4px; }
  .compact-roadmap { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── 课件预览区 ─────────────────────────────────────────────── */
.courseware-box-wide {
  flex: 1 1 100%;
  max-width: 100%;
}
.courseware-preview-wrap {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: #1a1a2e;
}
/* 全屏模式 */
.courseware-preview-wrap:fullscreen {
  display: flex;
  flex-direction: column;
  background: #1a1a2e;
  border-radius: 0;
  width: 100vw;
  height: 100vh;
}
.courseware-preview-wrap:fullscreen .courseware-preview-canvas {
  flex: 1;
  max-height: none;
}
.courseware-preview-wrap.is-markdown-preview .courseware-preview-canvas {
  height: clamp(560px, 72vh, 780px);
  max-height: none;
  overflow: hidden;
  align-items: stretch;
}
.courseware-preview-wrap.is-markdown-preview:fullscreen .courseware-preview-canvas {
  height: auto;
}
.preview-loading {
  padding: 24px;
  text-align: center;
  color: #aaa;
  font-size: 14px;
}
.preview-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 8px 12px;
  background: #12122a;
  border-bottom: 1px solid #333;
}
.preview-nav .page-info {
  font-size: 13px;
  color: #ccc;
  min-width: 60px;
  text-align: center;
}
.preview-fullscreen-btn {
  margin-left: auto;
}
.courseware-preview-canvas {
  display: flex;
  justify-content: center;
  padding: 16px;
  max-height: 72vh;
  overflow-y: auto;
  background: #1a1a2e;
  cursor: pointer;
  user-select: none;
}
.pdf-page-canvas {
  max-width: 100%;
  box-shadow: 0 2px 16px rgba(0,0,0,0.5);
  border-radius: 2px;
}

.courseware-preview-slide-card {
  width: min(920px, 100%);
  background: linear-gradient(180deg, #ffffff, #f7faff);
  border: 1px solid #d7e5fb;
  border-radius: 22px;
  padding: 28px 30px;
  box-shadow: 0 18px 36px rgba(7, 28, 76, 0.22);
  color: #17325f;
}

.courseware-preview-slide-kicker {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  background: #e9f1ff;
  color: #2555a6;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.courseware-preview-slide-card h4 {
  margin: 14px 0 12px;
  font-size: 28px;
  line-height: 1.35;
  color: #16345f;
}

.courseware-preview-slide-lines {
  margin: 0;
  padding-left: 22px;
}

.courseware-preview-slide-lines li {
  color: #415b82;
  line-height: 1.8;
}

.courseware-preview-slide-lines li + li {
  margin-top: 8px;
}

.courseware-preview-slide-text {
  margin: 0;
  color: #415b82;
  line-height: 1.9;
  white-space: pre-wrap;
}

.markdown-preview-card {
  background: linear-gradient(180deg, #fffef8, #f7fbff);
}
.courseware-preview-wrap.is-markdown-preview .markdown-preview-card {
  height: 100%;
  box-sizing: border-box;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.markdown-preview-body {
  color: #334e78;
  line-height: 1.9;
}

.markdown-preview-body h1,
.markdown-preview-body h2,
.markdown-preview-body h3,
.markdown-preview-body h4 {
  color: #16345f;
  line-height: 1.4;
  margin: 1.1em 0 0.5em;
}

.markdown-preview-body h1:first-child,
.markdown-preview-body h2:first-child,
.markdown-preview-body h3:first-child {
  margin-top: 0;
}

.markdown-preview-body p,
.markdown-preview-body ul,
.markdown-preview-body ol,
.markdown-preview-body blockquote,
.markdown-preview-body pre {
  margin: 0 0 14px;
}

.markdown-preview-body ul,
.markdown-preview-body ol {
  padding-left: 22px;
}

.markdown-preview-body li + li {
  margin-top: 6px;
}

.markdown-preview-body blockquote {
  border-left: 4px solid #b8cff4;
  padding: 4px 0 4px 14px;
  color: #4d6892;
  background: rgba(233, 241, 255, 0.5);
  border-radius: 0 12px 12px 0;
}

.markdown-preview-body code {
  background: rgba(37, 85, 166, 0.08);
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 0.95em;
}

.markdown-preview-body pre {
  background: #12233f;
  color: #eef4ff;
  border-radius: 14px;
  padding: 16px;
  overflow: auto;
}

.markdown-preview-body pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.markdown-table-line {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
}

/* Teacher event log styles */
.teacher-event-log {
  background: #0f0f23;
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  padding: 16px;
  max-height: 420px;
  overflow-y: auto;
}

.teacher-event-item {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 14px;
  padding: 12px;
  border-bottom: 1px solid #2a2a4a;
  align-items: flex-start;
}

.teacher-event-item:last-child {
  border-bottom: none;
}

.teacher-event-time {
  color: #889;
  font-size: 12px;
  text-align: right;
  line-height: 1.5;
}

.teacher-event-content {
  flex: 1;
}

.teacher-event-type {
  color: #64b5f6;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 6px;
}

.teacher-event-detail {
  color: #cdd6f4;
  font-size: 13px;
  line-height: 1.5;
}

.teacher-event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12px;
  color: #94a3b8;
}

.teacher-event-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.teacher-event-badge.student {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.28);
}

.teacher-event-badge.teacher {
  background: rgba(59, 130, 246, 0.16);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.28);
}

.teacher-activity-section {
  margin-top: 16px;
}

.section-subtitle {
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
}

.teacher-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.36);
  backdrop-filter: blur(4px);
}

.teacher-loading-overlay.hidden {
  display: none;
}

.teacher-loading-box {
  min-width: 280px;
  max-width: 92vw;
  padding: 22px 26px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.18);
  display: flex;
  align-items: center;
  gap: 14px;
}

.teacher-loading-spinner {
  width: 22px;
  height: 22px;
  border: 3px solid rgba(37, 99, 235, 0.18);
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: teacher-loading-spin 0.75s linear infinite;
  flex: 0 0 auto;
}

.teacher-loading-text {
  color: #0f172a;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}

@keyframes teacher-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Data quality styles */
.data-quality-result {
  margin-top: 16px;
  padding: 16px;
  background: #1a1a2e;
  border-radius: 8px;
  border: 1px solid #2a2a4a;
}

.data-quality-summary {
  margin-bottom: 16px;
}

.data-quality-summary strong {
  color: #64b5f6;
}

.data-quality-rows {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  margin-top: 12px;
}

.data-quality-row {
  background: #0f0f23;
  padding: 12px;
  border-radius: 6px;
  border-left: 3px solid #f59e0b;
}

.data-quality-row .muted {
  font-size: 12px;
  margin-bottom: 4px;
}

.data-quality-row strong {
  display: block;
  margin-bottom: 4px;
  color: #fbbf24;
}

/* ========================================================
   商用级教师工作台样式
   ======================================================== */

/* 隐藏默认显示，通过JS控制显示 */
.teacher-dashboard-view,
.teacher-analytics-view,
.teacher-resources-view,
.teacher-students-view,
.teacher-interaction-view {
  display: none;
}

.teacher-dashboard-view.active,
.teacher-analytics-view.active,
.teacher-resources-view.active,
.teacher-students-view.active,
.teacher-interaction-view.active {
  display: block;
}

/* ========== 总览 - 教学驾驶舱 ========== */
.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.kpi-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid #d8e3f3;
  border-radius: 16px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 2px 12px rgba(37, 99, 201, 0.08);
  transition: transform 0.2s, box-shadow 0.2s;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(37, 99, 201, 0.12);
}

.kpi-icon {
  font-size: 36px;
  line-height: 1;
}

.kpi-content {
  flex: 1;
}

.kpi-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--brand, #2563c9);
  line-height: 1.2;
}

.kpi-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  margin-top: 4px;
}

.dashboard-main-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.dashboard-section {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

/* ========== 二级标签页 ========== */
.sub-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--line);
  padding-bottom: 0;
}

.sub-tab {
  padding: 10px 20px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.sub-tab:hover {
  color: var(--brand);
}

.sub-tab.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

.sub-tab-content {
  display: none;
}

.sub-tab-content.active {
  display: block;
}

.analytics-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 16px;
  background: #f8fbff;
  border-radius: 12px;
  border: 1px solid #d8e3f3;
}

/* ========== 课程资源 - 侧边栏布局 ========== */
.resources-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 20px;
  min-height: 600px;
}

.resources-sidebar {
  background: #f8fbff;
  border-radius: 16px;
  padding: 16px;
  border: 1px solid #d8e3f3;
}

.resources-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.resource-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  transition: all 0.2s;
  cursor: pointer;
}

.resource-nav-item:hover {
  background: #edf3ff;
  color: var(--brand);
}

.resource-nav-item.active {
  background: var(--brand);
  color: #fff;
}

.nav-icon {
  font-size: 20px;
}

.nav-text {
  font-size: 14px;
}

.resources-main {
  background: #ffffff;
  border-radius: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.resource-content {
  display: none;
}

.resource-content.active {
  display: block;
}

.resource-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.resource-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.resource-subpanel {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid #d8e6fb;
  border-radius: 10px;
  background: #f8fbff;
}

.resource-subpanel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.resource-subpanel-head h3 {
  margin: 0;
  font-size: 16px;
}

.resource-subpanel-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.teaching-design-header {
  align-items: flex-start;
  gap: 18px;
}

.teaching-design-header .section-kicker {
  margin: 0 0 5px;
}

.teaching-design-header h2 {
  margin-bottom: 6px;
}

.teaching-design-header p {
  margin: 0;
}

.teaching-design-workbench {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.teaching-design-form {
  position: sticky;
  top: 88px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  background: #ffffff;
  border: 1px solid #dbe5f4;
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(23, 48, 86, 0.08);
}

.teaching-design-form-head {
  display: grid;
  gap: 4px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e4ebf6;
}

.teaching-design-form-head strong {
  color: #10294a;
  font-size: 17px;
}

.teaching-design-form-head span {
  color: #64758f;
  font-size: 12px;
}

.teaching-design-form label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0;
  color: #233a59;
  font-size: 13px;
  font-weight: 700;
}

.teaching-design-form input,
.teaching-design-form select,
.teaching-design-form textarea {
  width: 100%;
  margin: 0;
  border-color: #d4deed;
  background: #fbfdff;
  font-weight: 500;
}

.teaching-design-form textarea {
  min-height: 78px;
  resize: vertical;
  line-height: 1.65;
}

.teaching-design-upload {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #d4deed;
  border-radius: 8px;
  background: #fbfdff;
}

.teaching-design-upload-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.teaching-design-upload-head div {
  display: grid;
  gap: 3px;
}

.teaching-design-upload-head strong {
  color: #233a59;
  font-size: 13px;
}

.teaching-design-upload-head span {
  color: #64758f;
  font-size: 12px;
  line-height: 1.45;
}

.teaching-design-upload-head button {
  padding: 6px 10px;
  font-size: 12px;
}

.teaching-design-upload input[type="file"] {
  padding: 9px;
  border: 1px dashed #b8c8df;
  border-radius: 8px;
  background: #ffffff;
  font-size: 12px;
}

.teaching-design-upload-preview {
  display: grid;
  gap: 7px;
  min-height: 62px;
  place-items: center;
  padding: 10px;
  border: 1px solid #e0e8f3;
  border-radius: 8px;
  background: #ffffff;
  color: #64758f;
  font-size: 12px;
  text-align: center;
}

.teaching-design-upload-preview img {
  display: block;
  max-width: 100%;
  max-height: 150px;
  object-fit: contain;
  border-radius: 6px;
}

.teaching-design-preview-shell {
  min-width: 0;
  overflow: auto;
  max-height: calc(100vh - 178px);
  padding: 22px;
  background: #e9eef5;
  border: 1px solid #d5dfec;
  border-radius: 8px;
}

.teaching-design-preview {
  min-height: 560px;
}

.teaching-design-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  min-height: 520px;
  text-align: center;
  color: #64758f;
  background:
    linear-gradient(#fff, #fff) padding-box,
    repeating-linear-gradient(135deg, #d9e4f2 0 8px, #eef4fb 8px 16px) border-box;
  border: 1px solid transparent;
  border-radius: 8px;
  box-shadow: 0 14px 36px rgba(23, 48, 86, 0.08);
}

.teaching-design-empty h3 {
  margin: 0;
  color: #10294a;
  font-size: 20px;
}

.teaching-design-empty p {
  margin: 0;
}

.teaching-design-doc {
  counter-reset: tdpage;
  display: grid;
  gap: 18px;
}

.td-page {
  counter-increment: tdpage;
  position: relative;
  box-sizing: border-box;
  width: 210mm;
  min-height: 297mm;
  max-width: 100%;
  margin: 0 auto;
  padding: 20mm 18mm 18mm;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #d5dfec;
  color: #172a45;
  box-shadow: 0 18px 44px rgba(23, 48, 86, 0.16);
}

.td-page::before {
  content: "教学设计 · " counter(tdpage, decimal-leading-zero);
  position: absolute;
  top: 10mm;
  left: 18mm;
  right: 18mm;
  padding-bottom: 7px;
  border-bottom: 2px solid #1f5e8c;
  color: #5f718a;
  font-size: 10px;
  letter-spacing: 0.08em;
}

.td-page::after {
  content: counter(tdpage);
  position: absolute;
  right: 18mm;
  bottom: 10mm;
  color: #8a9ab0;
  font-size: 11px;
}

.td-page.cover {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
  padding: 24mm 22mm;
  background:
    linear-gradient(90deg, #1f5e8c 0 8px, transparent 8px),
    linear-gradient(180deg, #fbfdff 0%, #ffffff 46%, #f7fbf9 100%);
}

.td-page.cover::before {
  content: "";
  top: 22mm;
  left: 22mm;
  right: 22mm;
  border-bottom-color: #1f5e8c;
}

.td-kicker {
  width: fit-content;
  padding: 6px 12px;
  border: 1px solid #b9d7ce;
  border-radius: 999px;
  color: #17634f;
  background: #f2fbf8;
  font-size: 12px;
  font-weight: 800;
}

.td-page h1 {
  max-width: 16em;
  margin: 0;
  color: #10294a;
  font-size: 32px;
  line-height: 1.32;
}

.td-page h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  color: #10294a;
  font-size: 21px;
  line-height: 1.35;
}

.td-page h2::before {
  content: "";
  width: 5px;
  height: 20px;
  border-radius: 999px;
  background: #1f5e8c;
}

.td-page h3 {
  margin: 14px 0 8px;
  color: #235a82;
  font-size: 15px;
}

.td-page p,
.td-page li {
  color: #2d405a;
  font-size: 13px;
  line-height: 1.78;
}

.td-page ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.td-page table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 8px 0 14px;
  overflow: hidden;
  border: 1px solid #cfdae9;
  border-radius: 8px;
  font-size: 12px;
}

.td-page th,
.td-page td {
  padding: 9px 10px;
  border-right: 1px solid #d9e2ef;
  border-bottom: 1px solid #d9e2ef;
  vertical-align: top;
  line-height: 1.62;
}

.td-page th:last-child,
.td-page td:last-child {
  border-right: 0;
}

.td-page tbody tr:last-child td {
  border-bottom: 0;
}

.td-page th {
  color: #17385b;
  background: #eef5f8;
  font-weight: 800;
}

.td-page td {
  background: #ffffff;
}

.td-page tbody tr:nth-child(even) td {
  background: #fafcff;
}

.td-mindmap {
  margin: 12px 0 0;
  padding: 10px;
  border: 1px solid #d7e3ee;
  border-radius: 8px;
  background: #f8fbfd;
  text-align: center;
}

.td-mindmap img {
  display: block;
  max-width: 100%;
  max-height: 128mm;
  margin: 0 auto;
  object-fit: contain;
  border-radius: 6px;
}

.td-mindmap figcaption {
  margin-top: 8px;
  color: #5f718a;
  font-size: 11px;
}

.td-cover-grid,
.td-timeline,
.td-board,
.td-figure {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.td-cover-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.td-cover-grid span,
.td-timeline div,
.td-board span,
.td-figure span,
.td-callout {
  padding: 11px 12px;
  border: 1px solid #d7e3ee;
  border-radius: 8px;
  background: #f8fbfd;
}

.td-cover-grid span {
  min-height: 46px;
  display: flex;
  align-items: center;
  color: #233a59;
  font-weight: 700;
}

.td-timeline {
  border-left: 3px solid #1f5e8c;
  padding-left: 12px;
}

.td-timeline div {
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: start;
  background: #fbfdff;
}

.td-timeline b,
.td-board b {
  color: #1f5e8c;
}

.td-board b {
  font-size: 18px;
}

.td-figure {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  text-align: center;
  font-weight: 800;
}

.td-figure span {
  border-color: #cddfd8;
  background: #f6fbf8;
  color: #17634f;
}

.td-figure b {
  color: #1f5e8c;
  font-size: 20px;
}

.figure-system {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.td-callout {
  color: #31547e;
  line-height: 1.7;
  background: #f5f9fb;
  border-left: 4px solid #2d7a67;
}

.td-theme-classic .td-page {
  box-shadow: 0 12px 28px rgba(16, 41, 74, 0.12);
  border-color: #bfcbd9;
  color: #1c2737;
}

.td-theme-classic .td-page.cover {
  background: #ffffff;
  border-top: 8px solid #26384f;
}

.td-theme-classic .td-kicker {
  color: #26384f;
  border-color: #c8d0dc;
  background: #f7f9fc;
}

.td-theme-classic .td-page::before,
.td-theme-classic .td-page h2::before {
  border-bottom-color: #26384f;
  background: #26384f;
}

.td-theme-classic .td-page h1,
.td-theme-classic .td-page h2 {
  color: #1c2737;
}

.td-theme-classic .td-page th {
  color: #1c2737;
  background: #f1f4f8;
}

.td-theme-vivid .td-page {
  border-color: #cfe0dc;
  box-shadow: 0 18px 44px rgba(25, 88, 98, 0.18);
}

.td-theme-vivid .td-page.cover {
  background:
    linear-gradient(90deg, #e07a3f 0 8px, transparent 8px),
    linear-gradient(180deg, #fffdf8 0%, #ffffff 52%, #f3fbf8 100%);
}

.td-theme-vivid .td-kicker {
  color: #8f461d;
  border-color: #f0c7a4;
  background: #fff7ed;
}

.td-theme-vivid .td-page::before {
  border-bottom-color: #e07a3f;
}

.td-theme-vivid .td-page h2::before {
  background: #e07a3f;
}

.td-theme-vivid .td-page th {
  color: #174b42;
  background: #eef8f5;
}

.td-theme-vivid .td-callout {
  border-left-color: #e07a3f;
  background: #fffaf3;
}

.td-density-compact .td-page {
  padding: 18mm 15mm 16mm;
}

.td-density-compact .td-page h1 {
  font-size: 28px;
}

.td-density-compact .td-page h2 {
  margin-bottom: 10px;
  font-size: 18px;
}

.td-density-compact .td-page h3 {
  margin: 10px 0 6px;
}

.td-density-compact .td-page p,
.td-density-compact .td-page li,
.td-density-compact .td-page table {
  font-size: 11px;
  line-height: 1.55;
}

.td-density-compact .td-page th,
.td-density-compact .td-page td {
  padding: 6px 7px;
}

#teacherTextbookEditor {
  min-height: 360px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  line-height: 1.7;
}

/* ========== 班级管理 - 工具栏 ========== */
.students-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 16px;
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.students-actions {
  display: flex;
  gap: 10px;
}

.students-search input {
  width: 250px;
  padding: 8px 12px;
  margin-top: 0;
}

/* ========== 课堂互动 - 单列功能布局 ========== */
.interaction-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.interaction-tools {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tool-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.interaction-feature-card {
  width: 100%;
}

.interaction-card {
  display: grid;
  gap: 16px;
  padding: 20px 22px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid rgba(216, 227, 243, 0.96);
  box-shadow: 0 10px 28px rgba(34, 74, 128, 0.08);
}

.interaction-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(216, 227, 243, 0.82);
}

.interaction-card-title {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.interaction-card-kicker {
  width: fit-content;
  padding: 4px 9px;
  border-radius: 999px;
  background: #edf4ff;
  color: #1d5fbf;
  font-size: 11px;
  font-weight: 800;
}

.interaction-card-title h3 {
  margin: 0;
  color: #14294a;
  font-size: 20px;
  line-height: 1.3;
}

.interaction-card-title .muted {
  margin: 0;
  max-width: 680px;
}

.interaction-card-actions {
  margin-top: 0;
  justify-content: flex-end;
  align-items: center;
}

.interaction-card-actions button {
  min-width: 78px;
}

.tool-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.tool-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.tool-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wordcloud-tool-body {
  display: grid;
  grid-template-columns: 160px minmax(360px, 1fr) minmax(280px, 0.75fr);
  gap: 14px;
  align-items: start;
}

.wordcloud-tool-body label {
  display: grid;
  gap: 7px;
  margin: 0;
}

.wordcloud-tool-body .chips,
.wordcloud-tool-body .status {
  grid-column: 1 / -1;
}

.interaction-data {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.data-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.data-card h3 {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 700;
}

.competition-card {
  display: grid;
  gap: 16px;
  padding: 20px 22px;
}

.competition-title-row {
  align-items: flex-start;
}

.competition-title-row h3 {
  margin-bottom: 6px;
}

.competition-top-actions,
.competition-action-row {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.competition-hint {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.competition-form-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) 140px 180px;
  gap: 14px;
  align-items: start;
}

.competition-form-grid label,
.competition-desc-field {
  display: grid;
  gap: 7px;
  margin: 0;
}

.competition-desc-field {
  max-width: 980px;
}

.competition-action-row input {
  width: 140px;
  flex: 0 0 140px;
}

.competition-empty-state {
  grid-column: 1 / -1;
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px dashed #b9cbe6;
  border-radius: 8px;
  background: #f7fbff;
  color: #567092;
}

.participation-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.stat-item {
  display: grid;
  gap: 6px;
  text-align: left;
  padding: 16px 18px;
  background: #f8fbff;
  border-radius: 10px;
  border: 1px solid #d8e3f3;
}

.stat-value {
  display: block;
  font-size: 28px;
  font-weight: 800;
  color: var(--brand);
  line-height: 1.2;
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.activity-list {
  max-height: 240px;
  overflow-y: auto;
}

.activity-item {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.activity-item:last-child {
  border-bottom: none;
}

/* ========== 响应式设计 ========== */
@media (max-width: 1024px) {
  .teacher-ai-quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .teacher-ai-agent-box {
    padding: 18px;
  }

  .teacher-ai-agent-body {
    grid-template-columns: 1fr;
  }

  .teacher-ai-work-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .teacher-ai-work-head {
    flex-direction: column;
  }

  .dashboard-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-main-grid {
    grid-template-columns: 1fr;
  }

  .resources-layout {
    grid-template-columns: 1fr;
  }

  .teaching-design-workbench {
    grid-template-columns: 1fr;
  }

  .teaching-design-form {
    position: static;
  }

  .resources-sidebar {
    display: flex;
    overflow-x: auto;
    padding: 12px;
  }

  .resources-nav {
    flex-direction: row;
    width: 100%;
  }

  .resource-nav-item {
    flex-shrink: 0;
  }

  .interaction-layout {
    grid-template-columns: 1fr;
  }

  .interaction-card-head {
    grid-template-columns: 1fr;
  }

  .interaction-card-actions {
    justify-content: flex-start;
  }

  .wordcloud-tool-body,
  .competition-form-grid {
    grid-template-columns: 1fr;
  }

  .teacher-wordcloud-screen-grid {
    grid-template-columns: 1fr;
  }

  .teacher-wordcloud-screen-shell {
    min-height: 420px;
  }

  .participation-stats {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .teacher-ai-quick-overlay {
    padding: 0;
    align-items: stretch;
  }

  .teacher-ai-quick-box {
    border-radius: 0;
    min-height: 100vh;
  }

  .teacher-ai-quick-grid {
    grid-template-columns: 1fr;
  }

  .teacher-ai-agent-overlay {
    padding: 0;
    align-items: stretch;
  }

  .teacher-ai-agent-box {
    max-height: 100vh;
    border-radius: 0;
  }

  .teacher-ai-agent-actions {
    flex-wrap: wrap;
  }

  .teacher-ai-agent-actions button {
    flex: 1 1 180px;
  }

  .dashboard-kpi-grid {
    grid-template-columns: 1fr;
  }

  .sub-tabs {
    overflow-x: auto;
    white-space: nowrap;
  }

  .students-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .students-actions {
    flex-wrap: wrap;
  }

  .students-search input {
    width: 100%;
  }

  .teacher-wordcloud-panel-head {
    align-items: start;
  }

  .teacher-wordcloud-panel-head .action-row {
    width: 100%;
    justify-content: stretch;
  }

  .teacher-wordcloud-panel-head .action-row button {
    flex: 1 1 0;
  }

  .teacher-wordcloud-screen-cloud {
    min-height: 300px;
  }
}

/* ============================================================
   Student Mobile Responsive — mobile-first for student pages
   ============================================================ */

/* --- Tablet portrait & small laptops --- */
@media (max-width: 768px) {
  /* Topbar */
  .topbar {
    padding: 10px 12px;
  }
  .topbar-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .topbar h1 {
    font-size: 20px;
  }
  .topbar-kicker {
    font-size: 10px;
  }
  .topbar-subtitle {
    font-size: 12px;
  }
  .topbar-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .topbar-actions a {
    padding: 8px 10px;
    font-size: 12px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Page shell */
  .page-shell {
    padding: 12px 10px 32px;
  }

  /* Panels */
  .panel {
    padding: 14px;
    border-radius: 12px;
  }

  /* Hero grids → single column */
  .hero-grid,
  .landing-hero .hero-grid {
    grid-template-columns: 1fr;
  }
  .landing-register {
    position: static;
  }

  /* Training grid → single column */
  .training-grid {
    grid-template-columns: 1fr;
  }
  .training-card {
    padding: 14px;
  }
  .training-card h3,
  .training-card h4 {
    font-size: 16px;
  }
  .training-card-actions {
    flex-direction: column;
    gap: 8px;
    justify-content: stretch;
  }
  .training-card-actions button,
  .training-card-actions a,
  .training-card-actions .btn {
    width: 100%;
    min-height: 44px;
  }

  /* Course library */
  .course-library-stage {
    padding: 12px 0 20px;
  }
  .course-library-row {
    width: 100%;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding-bottom: 12px;
  }
  .course-library-shelf {
    width: calc(100% - 24px);
    height: 16px;
    justify-content: center;
  }
  .book-volume {
    width: min(72vw, 300px);
    max-width: none;
    height: auto;
    aspect-ratio: 246 / 418;
  }

  /* Training identity bar */
  .training-identity-bar {
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px;
  }
  .training-identity-item {
    font-size: 12px;
  }

  /* Training hero / detail grids */
  .training-hero {
    grid-template-columns: 1fr;
  }
  .detail-grid,
  .hero-stat-grid {
    grid-template-columns: 1fr;
  }

  /* Preclass panel */
  .preclass-status-panel {
    padding: 12px;
  }

  /* Video */
  .video-wrap {
    margin: 0 -10px;
    border-radius: 0;
  }
  .video-resource-list {
    flex-direction: column;
    gap: 8px;
  }
  .video-resource-item {
    padding: 10px;
  }

  /* Courseware / PDF preview */
  .courseware-viewport,
  .courseware-preview-container,
  .courseware-canvas-wrap {
    min-height: 260px;
  }

  /* Image grids */
  .training-image-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .training-image-item img {
    max-height: 180px;
  }

  /* Forms & inputs */
  input[type="text"],
  input[type="password"],
  input[type="number"],
  input[type="email"],
  input[type="tel"],
  select,
  textarea {
    font-size: 16px !important; /* prevent iOS zoom */
    min-height: 44px;
  }

  /* Login / register cards */
  .landing-register {
    padding: 16px;
  }
  .landing-register h2 {
    font-size: 22px;
  }
  .student-login-form {
    gap: 10px;
  }
  .student-login-actions {
    flex-direction: column;
  }
  .student-login-actions button,
  .student-current-actions button {
    width: 100%;
    min-height: 44px;
  }

  /* Dashboard hero → single column */
  .dashboard-hero {
    grid-template-columns: 1fr;
  }

  /* Buttons — ensure 44px touch target */
  button,
  .btn,
  a.btn {
    min-height: 44px;
    padding: 10px 16px;
  }

  /* Tabs */
  .tabs,
  .sub-tabs {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 4px;
  }
  .tab-bar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Modals / overlays */
  .modal-overlay {
    padding: 0;
  }
  .modal-box {
    border-radius: 0;
    min-height: 100vh;
    max-height: 100vh;
    width: 100%;
    max-width: 100%;
  }

  /* Tables → scrollable */
  .panel table,
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Word cloud */
  .wordcloud-canvas-wrap {
    min-height: 220px;
  }
}

/* --- Phone (narrow) --- */
@media (max-width: 480px) {
  html {
    font-size: 14px;
  }
  .topbar {
    padding: 10px 10px 12px;
  }
  .topbar h1 {
    font-size: 18px;
    line-height: 1.2;
  }
  .topbar-subtitle {
    font-size: 12px;
    line-height: 1.5;
  }
  .topbar-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }
  .topbar-actions a {
    width: 100%;
    font-size: 13px;
    padding: 10px 12px;
    border-radius: 999px;
  }
  .page-shell {
    padding: 10px 8px 24px;
  }
  .panel {
    padding: 10px;
    border-radius: 10px;
  }
  .landing-hero {
    gap: 12px;
    margin-bottom: 12px;
  }
  .training-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 12px;
  }
  .training-card {
    padding: 10px;
  }
  .training-card h3,
  .training-card h4 {
    font-size: 15px;
  }
  .landing-register {
    padding: 12px;
  }
  .landing-register h2 {
    font-size: 18px;
  }
  .course-library-stage {
    padding: 10px 0 18px;
  }
  .course-library-row {
    width: 100%;
    gap: 14px;
    padding-bottom: 12px;
  }
  .course-library-shelf {
    width: calc(100% - 16px);
    height: 14px;
  }
  .book-volume {
    width: min(78vw, 260px);
    height: auto;
    aspect-ratio: 246 / 418;
    max-width: none;
  }
  .book-pages {
    inset: 12px -8px 8px auto;
    width: 14px;
  }
  .book-spine {
    width: 26px;
  }
  .book-badges {
    gap: 6px;
  }
  .book-badge {
    font-size: 11px;
    padding: 5px 8px;
  }
  .book-title {
    font-size: 18px;
    line-height: 1.2;
  }
  .book-subtitle {
    font-size: 12px;
  }
  .training-image-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .training-image-item img {
    max-height: 150px;
  }
  .video-resource-head {
    flex-direction: column;
    gap: 4px;
  }
  .hero-stat-grid .stat-value {
    font-size: 22px;
  }
  /* Checklist / preclass */
  .preclass-checklist,
  .checkin-form {
    padding: 10px;
  }
  /* General spacing reduction */
  .page-shell > * + * {
    margin-top: 10px;
  }
}

/* ============================================================
   Markdown Textbook Preview Enhancement
   ============================================================ */
.markdown-preview-body {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text);
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.markdown-preview-body h1,
.markdown-preview-body h2,
.markdown-preview-body h3,
.markdown-preview-body h4,
.markdown-preview-body h5,
.markdown-preview-body h6 {
  margin: 1.2em 0 0.6em;
  line-height: 1.3;
  color: #1a2744;
}

.markdown-preview-body h1 { font-size: 1.6em; border-bottom: 2px solid var(--line); padding-bottom: 6px; }
.markdown-preview-body h2 { font-size: 1.35em; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.markdown-preview-body h3 { font-size: 1.15em; }
.markdown-preview-body h4 { font-size: 1.05em; }

.markdown-preview-body p {
  margin: 0.6em 0;
}

.markdown-preview-body ul,
.markdown-preview-body ol {
  margin: 0.6em 0;
  padding-left: 1.8em;
}

.markdown-preview-body li {
  margin: 0.3em 0;
}

.markdown-preview-body blockquote {
  margin: 0.8em 0;
  padding: 10px 16px;
  border-left: 4px solid var(--brand);
  background: var(--brand-soft);
  border-radius: 0 8px 8px 0;
  color: #2c4a6e;
}

.markdown-preview-body blockquote p {
  margin: 0.3em 0;
}

.markdown-preview-body pre {
  background: #1e293b;
  color: #e2e8f0;
  border-radius: 10px;
  padding: 14px 16px;
  margin: 0.8em 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  font-size: 13px;
  line-height: 1.5;
}

.markdown-preview-body code {
  font-family: "JetBrains Mono", "Fira Code", "Consolas", monospace;
  font-size: 0.9em;
}

.markdown-preview-body :not(pre) > code {
  background: #f0f4ff;
  color: #4a3f8a;
  padding: 2px 6px;
  border-radius: 4px;
}

.markdown-preview-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.8em 0;
  font-size: 14px;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.markdown-preview-body thead {
  background: #f0f5ff;
}

.markdown-preview-body th,
.markdown-preview-body td {
  border: 1px solid var(--line);
  padding: 8px 12px;
  text-align: left;
}

.markdown-preview-body th {
  font-weight: 700;
  color: #1a2744;
}

.markdown-preview-body tr:nth-child(even) {
  background: #fafcff;
}

.markdown-preview-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 0.6em 0;
}

.markdown-preview-body a {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.markdown-preview-body a:hover {
  color: #1d4ed8;
}

.markdown-preview-body hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 1.2em 0;
}

.markdown-preview-body .math-block {
  background: #fafcff;
  padding: 12px;
  border-radius: 8px;
  margin: 0.8em 0;
  text-align: center;
  font-family: "Times New Roman", serif;
  font-size: 1.1em;
}

/* Mobile adjustments for markdown preview */
@media (max-width: 768px) {
  .markdown-preview-body {
    font-size: 14px;
  }
  .markdown-preview-body h1 { font-size: 1.35em; }
  .markdown-preview-body h2 { font-size: 1.2em; }
  .markdown-preview-body h3 { font-size: 1.05em; }
  .markdown-preview-body pre {
    font-size: 12px;
    padding: 10px 12px;
    margin: 0.6em -10px;
    border-radius: 0;
  }
  .markdown-preview-body table {
    font-size: 12px;
  }
  .markdown-preview-body th,
  .markdown-preview-body td {
    padding: 6px 8px;
  }
  .markdown-preview-body blockquote {
    padding: 8px 12px;
    margin: 0.6em 0;
  }
}

/* Board Student Task List */
.board-student-list-card { margin-top: 12px; }
.board-student-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 860px; }
.board-student-table th { position: sticky; top: 0; background: var(--bg, #f8f9fa); font-weight: 600; padding: 8px 6px; text-align: center; border-bottom: 2px solid #e0e0e0; white-space: nowrap; }
.board-student-table td { padding: 6px; text-align: center; border-bottom: 1px solid #f0f0f0; white-space: nowrap; }
.board-student-table tr:hover { background: rgba(0,0,0,0.02); }
.board-student-table tr.row-completed { background: #e8f5e9; }
.board-student-table tr.row-notstarted { background: #fff3e0; }
.board-student-table tfoot td { font-weight: 600; background: #f5f5f5; border-top: 2px solid #e0e0e0; padding: 8px 6px; }
.task-done { color: #43a047; font-weight: 600; }
.task-pending { color: #bdbdbd; }
.task-partial { color: #f9a825; }
.board-student-table-wrap { max-height: 60vh; overflow-y: auto; }

/* Teaching design structured editor and multimodal resources */
.teaching-design-media-list {
  display: grid;
  gap: 8px;
  min-height: 42px;
  padding: 8px;
  border: 1px solid #e0e8f3;
  border-radius: 8px;
  background: #ffffff;
  color: #64758f;
  font-size: 12px;
}

.teaching-design-media-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 7px;
  border: 1px solid #edf2f8;
  border-radius: 8px;
  background: #fbfdff;
}

.teaching-design-media-item img,
.teaching-design-media-item b {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #eef6ff;
  object-fit: cover;
  font-size: 18px;
}

.teaching-design-media-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #233a59;
}

.teaching-design-media-item button {
  padding: 5px 8px;
  font-size: 12px;
}

.teaching-design-section-editor {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid #ccd9ea;
  border-radius: 12px;
  background: linear-gradient(135deg, #ffffff, #f6fbff);
  box-shadow: 0 12px 28px rgba(23, 48, 86, 0.08);
}

.teaching-design-section-editor[hidden] {
  display: none;
}

.teaching-design-section-list {
  display: grid;
  gap: 7px;
  max-height: 360px;
  overflow: auto;
}

.teaching-design-section-tab {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 9px;
  border: 1px solid #dce6f3;
  border-radius: 10px;
  background: #fff;
  color: #284362;
  text-align: left;
}

.teaching-design-section-tab.active {
  border-color: #2d7a67;
  background: #f0fbf7;
  box-shadow: 0 8px 18px rgba(45, 122, 103, 0.12);
}

.teaching-design-section-tab b {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #eaf3ff;
  color: #1f5e8c;
  font-size: 12px;
}

.teaching-design-section-tab span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.teaching-design-section-card {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.teaching-design-section-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.teaching-design-section-toolbar div {
  display: grid;
  gap: 3px;
}

.teaching-design-section-toolbar span {
  color: #64758f;
  font-size: 12px;
}

.teaching-design-section-body {
  min-height: 210px;
  max-height: 430px;
  overflow: auto;
  padding: 14px;
  border: 1px solid #d4deed;
  border-radius: 10px;
  background: #fff;
  color: #172a45;
  line-height: 1.7;
}

.teaching-design-section-body:focus {
  outline: 2px solid rgba(45, 122, 103, 0.2);
  border-color: #2d7a67;
}

.td-media-thumb {
  margin: 0;
  display: grid;
  gap: 6px;
  text-align: center;
}

.td-media-thumb img {
  max-width: 150px;
  max-height: 90px;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid #d7e3ee;
}

.td-media-thumb figcaption {
  color: #5f718a;
  font-size: 11px;
}

.teacher-group-list,
.competition-entry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.teacher-group-card,
.competition-entry-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #d7e4f5;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(34, 74, 128, 0.07);
}

.teacher-group-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.competition-panel {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid #cfe0f6;
  border-radius: 8px;
  background: #f8fbff;
}

.competition-panel-head,
.competition-entry-head,
.competition-score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.competition-panel-head h3,
.competition-entry-card h4 {
  margin: 2px 0 0;
}

.competition-entry-card label {
  display: grid;
  gap: 6px;
}

.competition-entry-card input,
.competition-entry-card textarea {
  width: 100%;
}

.competition-score-row {
  padding: 8px 10px;
  border-radius: 8px;
  background: #edf5ff;
  color: #17345c;
}

.competition-score-row strong {
  font-size: 22px;
}

.competition-certificate {
  margin-top: 14px;
  padding: 22px;
  border: 2px solid #d5ad4c;
  border-radius: 8px;
  background: linear-gradient(135deg, #fffaf0, #ffffff);
  text-align: center;
  color: #5b3a00;
}

.competition-certificate .certificate-title {
  font-size: 22px;
  font-weight: 800;
}

.competition-certificate .certificate-group {
  margin: 10px 0;
  font-size: 28px;
  font-weight: 900;
}

.chip.danger {
  background: #fff1f2;
  color: #b42318;
  border-color: #fecdd3;
}

.teaching-design-editor-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.teaching-design-editor-embed {
  border: 1px solid #d8e5f8;
  border-radius: 8px;
  overflow: hidden;
  background: #f7fbff;
  min-height: 900px;
}

.teaching-design-editor-embed iframe {
  display: block;
  width: 100%;
  min-height: 900px;
  height: calc(100vh - 180px);
  border: 0;
  background: #f7fbff;
}

.learning-survey-card {
  max-width: 1160px;
  margin: 0 auto;
  display: grid;
  gap: 20px;
  padding: 0;
  overflow: hidden;
  border-color: #c9ddf5;
  background: #ffffff;
}

.learning-survey-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 28px 30px 22px;
  border-bottom: 1px solid #dbe8f6;
  background:
    linear-gradient(135deg, rgba(235, 246, 255, 0.96), rgba(241, 252, 248, 0.96)),
    linear-gradient(90deg, rgba(31, 94, 140, 0.08), rgba(45, 122, 103, 0.08));
}

.learning-survey-hero h2 {
  margin: 4px 0 8px;
  color: #0f2b52;
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.18;
}

.learning-survey-hero .muted {
  max-width: 760px;
  line-height: 1.7;
  color: #425c7d;
}

.learning-survey-time {
  display: grid;
  place-items: center;
  min-width: 118px;
  min-height: 118px;
  border: 1px solid #bcd3ef;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 34px rgba(23, 58, 105, 0.12);
  color: #12305a;
}

.learning-survey-time strong {
  font-size: 34px;
  line-height: 1;
}

.learning-survey-time span {
  color: #64758f;
  font-weight: 800;
}

.learning-survey-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 0 30px;
}

.learning-survey-steps span {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #d6e4f5;
  border-radius: 8px;
  background: #f8fbff;
  color: #17345c;
  font-weight: 900;
  min-width: 0;
}

.learning-survey-steps b {
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #205fa8;
  color: #fff;
}

.learning-survey-card > .chips,
.learning-survey-card > .status,
.learning-survey-card > .learning-survey-form,
.learning-survey-card > .learning-survey-actions {
  margin-left: 30px;
  margin-right: 30px;
}

.learning-survey-card > .chips {
  gap: 10px;
}

.learning-survey-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.survey-section-title {
  grid-column: 1 / -1;
  padding: 18px 20px;
  border: 1px solid #cfe0f5;
  border-radius: 8px;
  background: linear-gradient(135deg, #f8fbff, #f2fbf8);
  box-shadow: inset 4px 0 0 #2d7a67;
}

.survey-section-title h3 {
  margin: 0 0 6px;
  color: #12305a;
  font-size: 18px;
}

.survey-section-title p {
  margin: 0;
  color: #64758f;
  line-height: 1.6;
}

.survey-field {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid #d7e4f5;
  border-radius: 8px;
  background: #fff;
  min-width: 0;
  box-shadow: 0 10px 24px rgba(34, 74, 128, 0.06);
}

.survey-field.survey-field-missing {
  border-color: #f59e0b;
  background: #fffbeb;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18), 0 14px 28px rgba(146, 64, 14, 0.1);
}

.survey-field > span {
  color: #17345c;
  font-weight: 800;
  line-height: 1.5;
}

.survey-field em {
  color: #dc2626;
  font-style: normal;
}

.survey-field input,
.survey-field select,
.survey-field textarea {
  width: 100%;
  border-radius: 8px;
  border-color: #cfdff2;
  background-color: #fbfdff;
}

.survey-field input:focus,
.survey-field select:focus,
.survey-field textarea:focus {
  border-color: #2563b8;
  box-shadow: 0 0 0 3px rgba(37, 99, 184, 0.12);
}

.survey-field-error {
  margin: 0;
  padding: 9px 11px;
  border: 1px solid #fbbf24;
  border-radius: 8px;
  background: #fff7d6;
  color: #92400e;
  font-weight: 800;
  line-height: 1.5;
}

.survey-status-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin-left: 10px;
  padding: 6px 12px;
  border: 1px solid #bcd3ef;
  border-radius: 8px;
  background: #fff;
  color: #205fa8;
  font-weight: 900;
  box-shadow: none;
}

.survey-status-link:hover {
  border-color: #2563b8;
  background: #f4f8ff;
}

.survey-field-textarea,
.survey-field-checkbox,
.survey-field-score-grid {
  grid-column: 1 / -1;
}

.survey-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.survey-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #dbe7f5;
  border-radius: 8px;
  background: #f9fcff;
  color: #233c5e;
  line-height: 1.5;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.survey-check:hover {
  border-color: #9fc3ee;
  box-shadow: 0 8px 18px rgba(34, 74, 128, 0.08);
  transform: translateY(-1px);
}

.survey-check input {
  width: auto;
  margin-top: 4px;
}

.survey-score-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.survey-score-grid label {
  display: grid;
  gap: 6px;
}

.learning-survey-actions {
  justify-content: flex-end;
  padding: 2px 0 28px;
}

.learning-survey-actions button {
  min-width: 230px;
  min-height: 52px;
  border-radius: 8px;
  font-size: 16px;
  box-shadow: 0 14px 28px rgba(29, 91, 181, 0.22);
}

@media (max-width: 900px) {
  .learning-survey-hero {
    grid-template-columns: 1fr;
    padding: 22px 18px;
  }

  .learning-survey-time {
    min-width: 100%;
    min-height: 78px;
    grid-template-columns: auto auto;
    justify-content: center;
    gap: 8px;
  }

  .learning-survey-steps {
    grid-template-columns: 1fr 1fr;
    padding: 0 18px;
  }

  .learning-survey-card > .chips,
  .learning-survey-card > .status,
  .learning-survey-card > .learning-survey-form,
  .learning-survey-card > .learning-survey-actions {
    margin-left: 18px;
    margin-right: 18px;
  }

  .learning-survey-form {
    grid-template-columns: 1fr;
  }

  .learning-survey-actions button {
    width: 100%;
  }

  .competition-form-grid {
    grid-template-columns: 1fr;
  }

  .competition-top-actions,
  .competition-action-row {
    justify-content: flex-start;
  }
}
