:root {
  color-scheme: dark;
  --bg: #080b12;
  --panel: rgba(18, 24, 38, .86);
  --panel-2: rgba(255,255,255,.06);
  --line: rgba(255,255,255,.12);
  --text: #eef4ff;
  --muted: #94a3b8;
  --cyan: #33d7ff;
  --green: #63f0a7;
  --gold: #ffd36a;
  --red: #ff6f91;
  --blue: #7492ff;
  --shadow: 0 24px 80px rgba(0,0,0,.42);
  font-family: Inter, "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 0%, rgba(51, 215, 255, .16), transparent 32%),
    radial-gradient(circle at 88% 8%, rgba(99, 240, 167, .10), transparent 30%),
    linear-gradient(145deg, #070a10 0%, #0f1522 55%, #080b12 100%);
  color: var(--text);
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea {
  font: inherit;
}

.shell { min-height: 100vh; padding: 24px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 18px; border: 1px solid var(--line); background: rgba(8, 12, 20, .72);
  backdrop-filter: blur(18px); position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; letter-spacing: .02em; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; background: linear-gradient(135deg, var(--cyan), var(--green)); color: #031018; font-weight: 900; }
.nav { display: flex; gap: 10px; flex-wrap: wrap; }
.nav a, .btn {
  border: 1px solid var(--line); color: var(--text); background: rgba(255,255,255,.07);
  padding: 10px 14px; cursor: pointer; min-height: 40px;
}
.btn.primary { border-color: rgba(51,215,255,.5); background: linear-gradient(135deg, rgba(51,215,255,.24), rgba(99,240,167,.16)); }
.btn.warn { border-color: rgba(255,111,145,.55); color: #ffd8e1; }
.btn.ghost { background: transparent; }
.btn.icon { width: 42px; padding: 0; display: inline-grid; place-items: center; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.panel {
  border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow);
  padding: 18px; border-radius: 8px;
}
.section { max-width: 1440px; margin: 20px auto 0; }
.headline { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
h1, h2, h3 { margin: 0; letter-spacing: 0; }
h1 { font-size: clamp(34px, 6vw, 76px); line-height: .98; }
h2 { font-size: 22px; }
h3 { font-size: 16px; color: #dce8ff; }
p { color: var(--muted); line-height: 1.7; }
.muted { color: var(--muted); }
.metric { display: grid; gap: 6px; padding: 14px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; }
.metric b { font-size: 28px; color: var(--cyan); }
.field { display: grid; gap: 7px; margin: 10px 0; }
label { color: #b9c6dc; font-size: 13px; }
input, select, textarea {
  width: 100%; color: var(--text); background: rgba(5, 8, 14, .72); border: 1px solid var(--line);
  padding: 11px 12px; outline: none; border-radius: 6px;
}
textarea { min-height: 92px; resize: vertical; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.table { width: 100%; border-collapse: collapse; overflow: hidden; }
.table th, .table td { border-bottom: 1px solid var(--line); padding: 10px; text-align: left; color: #dbe7fa; vertical-align: top; }
.table th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border: 1px solid var(--line); background: rgba(255,255,255,.06); border-radius: 999px; color: #dce8ff; font-size: 12px; }
.pill.ok { border-color: rgba(99,240,167,.5); color: #b9ffd8; }
.pill.pending { border-color: rgba(255,211,106,.5); color: #ffe5a0; }
.split { display: grid; grid-template-columns: 1fr 360px; gap: 16px; }
.hero { min-height: calc(100vh - 88px); display: grid; place-items: center; overflow: hidden; }
.hero-inner { width: min(1160px, 100%); display: grid; grid-template-columns: 1.15fr .85fr; gap: 28px; align-items: center; }
.hero-visual { min-height: 480px; border: 1px solid var(--line); background: linear-gradient(155deg, rgba(51,215,255,.18), rgba(255,255,255,.04)), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='650'%3E%3Cg fill='none' stroke='rgba(255,255,255,.16)'%3E%3Cpath d='M80 120h740M80 220h740M80 320h740M80 420h740M80 520h740M160 60v540M320 60v540M480 60v540M640 60v540'/%3E%3C/g%3E%3Cg fill='rgba(51,215,255,.35)'%3E%3Ccircle cx='210' cy='170' r='7'/%3E%3Ccircle cx='580' cy='260' r='10'/%3E%3Ccircle cx='390' cy='430' r='8'/%3E%3C/g%3E%3C/svg%3E") center/cover; border-radius: 8px; box-shadow: var(--shadow); }
.screen { height: 100vh; overflow: hidden; position: relative; background: #03060b; }
.screen.presentation-live { background: #000; }
.stage { position: absolute; inset: 0; background: #03060b; }
.stage iframe { width: 100%; height: 100%; border: 0; background: #111827; }
.stage-fallback { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 40px; }
.toolbox {
  position: absolute;
  top: 22px;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  width: min(360px, calc(100vw - 34px));
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(8,12,20,.68);
  box-shadow: 0 24px 70px rgba(0,0,0,.42);
  backdrop-filter: blur(22px) saturate(1.2);
  border-radius: 28px 0 0 28px;
  transition: transform .24s ease, background .24s ease;
}
.toolbox.collapsed {
  transform: translateX(calc(100% + 34px));
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  backdrop-filter: none;
}
.toolbox-toggle {
  position: absolute;
  left: -62px;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 50%;
  color: #eaf4ff;
  background: rgba(8,12,20,.72);
  backdrop-filter: blur(18px);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 16px 40px rgba(0,0,0,.38);
}
.toolbox-toggle svg { width: 20px; height: 20px; transition: transform .24s ease; }
.toolbox.collapsed .toolbox-toggle svg { transform: rotate(180deg); }
.toolbox-content {
  height: 100%;
  overflow: auto;
  padding: 14px;
  transition: opacity .16s ease;
}
.toolbox.collapsed .toolbox-content { opacity: 0; pointer-events: none; }
.toolbox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.toolbox-title b { display: block; }
.toolbox-title span { color: var(--muted); font-size: 12px; }
.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.tool-btn {
  min-height: 72px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: var(--text);
  border-radius: 12px;
  display: grid;
  place-items: center;
  gap: 6px;
  cursor: pointer;
}
.tool-btn svg { width: 22px; height: 22px; }
.tool-btn span { font-size: 12px; color: #dbeafe; }
.courseware-notice {
  width: min(720px, calc(100vw - 48px));
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(12,18,30,.78);
  backdrop-filter: blur(18px);
  border-radius: 16px;
  padding: 26px;
  box-shadow: var(--shadow);
}
.courseware-notice h1 { font-size: clamp(28px, 4vw, 48px); }
.courseware-notice code { color: var(--green); }
.ppt-host {
  position: absolute;
  inset: 0;
  background: #f2f4f8;
  z-index: 1;
}
.ppt-status {
  position: absolute;
  left: 24px;
  bottom: 24px;
  z-index: 4;
  max-width: min(680px, calc(100vw - 48px));
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(8,12,20,.76);
  color: #dce8ff;
  backdrop-filter: blur(16px);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.screen.presentation-live .ppt-status {
  opacity: 0;
  pointer-events: none;
}
.screen.presentation-live .stage {
  background: #000;
}
.screen.presentation-live .ppt-host {
  background: #000;
}
.screen.presentation-live .toolbox {
  z-index: 120;
}
.screen.presentation-live .toolbox:not(.collapsed) {
  background: rgba(8,12,20,.62);
}
.ppt-status code {
  color: var(--green);
  word-break: break-all;
}
.collect-overlay {
  position: absolute; inset: 0; background: linear-gradient(145deg, rgba(4,9,18,.96), rgba(8,20,32,.97));
  display: none; padding: 28px; overflow: auto; z-index: 5;
}
.collect-overlay.active { display: block; }
.bars { display: grid; gap: 10px; }
.bar { display: grid; grid-template-columns: 70px 1fr 54px; gap: 10px; align-items: center; }
.bar span:nth-child(2) { height: 14px; background: rgba(255,255,255,.08); overflow: hidden; border-radius: 999px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--green)); }
.wordcloud { min-height: 190px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.toast { position: fixed; right: 18px; bottom: 18px; background: #101827; border: 1px solid var(--line); padding: 14px 16px; box-shadow: var(--shadow); z-index: 30; max-width: 360px; }
.modal { position: fixed; inset: 0; display: none; place-items: center; background: rgba(0,0,0,.55); z-index: 240; padding: 18px; }
.modal.active { display: grid; }
.mobile-answer { display: grid; gap: 14px; }
.choice { display: flex; gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.05); border-radius: 8px; }
.choice input { width: auto; }
.empty { padding: 24px; border: 1px dashed var(--line); color: var(--muted); text-align: center; }

.classroom-home {
  min-height: 100vh;
  padding: 34px;
  display: grid;
  align-content: center;
  gap: 26px;
  background:
    radial-gradient(circle at 10% 0%, rgba(51,215,255,.18), transparent 28%),
    linear-gradient(145deg, #070a10 0%, #101724 100%);
}
.classroom-welcome {
  max-width: 1120px;
  margin: 0 auto;
  width: 100%;
}
.classroom-welcome h1 {
  font-size: clamp(38px, 6vw, 72px);
  margin-bottom: 12px;
}
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.course-tile {
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.07);
  color: var(--text);
  border-radius: 12px;
  padding: 18px;
  text-align: left;
  cursor: pointer;
  min-height: 136px;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.course-tile:hover {
  transform: translateY(-2px);
  border-color: rgba(51,215,255,.5);
  background: rgba(51,215,255,.10);
}
.course-tile b { display: block; font-size: 20px; margin-bottom: 10px; }
.ware-picker {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(3,6,11,.72);
  backdrop-filter: blur(18px);
}
.ware-picker.active { display: grid; }
.ware-panel {
  width: min(760px, 100%);
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(12,18,30,.92);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 22px;
}
.ware-list { display: grid; gap: 12px; margin-top: 16px; }
.ware-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  border-radius: 10px;
  padding: 14px;
}
.classroom-stage-ready {
  animation: stageFade .28s ease both;
}
@keyframes stageFade {
  from { opacity: 0; transform: scale(.985); }
  to { opacity: 1; transform: scale(1); }
}

body.teacher-light {
  color-scheme: light;
  --teacher-bg: #f5f7fb;
  --teacher-surface: #ffffff;
  --teacher-soft: #f0f4f9;
  --teacher-line: #e3e8f0;
  --teacher-text: #172033;
  --teacher-muted: #667085;
  --teacher-blue: #2457e6;
  --teacher-cyan: #0ea5c6;
  --teacher-green: #159566;
  --teacher-red: #d83b5b;
  background:
    radial-gradient(circle at 12% -10%, rgba(36, 87, 230, .10), transparent 30%),
    linear-gradient(180deg, #fbfcff 0%, var(--teacher-bg) 100%);
  color: var(--teacher-text);
}

.teacher-app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.teacher-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 18px;
  background: rgba(255,255,255,.88);
  border-right: 1px solid var(--teacher-line);
  backdrop-filter: blur(22px);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.teacher-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 18px;
  border-bottom: 1px solid var(--teacher-line);
}

.teacher-brand .brand-mark {
  border-radius: 10px;
  background: linear-gradient(135deg, #2457e6, #12b7d5);
  color: #fff;
}

.teacher-brand strong { display: block; font-size: 16px; }
.teacher-brand span:last-child { color: var(--teacher-muted); font-size: 12px; }

.side-group { display: grid; gap: 8px; }
.side-title {
  padding: 0 10px;
  color: #98a2b3;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.side-item {
  border: 0;
  width: 100%;
  text-align: left;
  border-radius: 8px;
  padding: 12px 12px;
  background: transparent;
  color: var(--teacher-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
}

.side-item svg { width: 18px; height: 18px; }
.side-item.active {
  background: #eef4ff;
  color: var(--teacher-blue);
  font-weight: 700;
}

.teacher-main {
  min-width: 0;
  padding: 26px 30px 42px;
}

.teacher-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.teacher-title h1 {
  font-size: 30px;
  line-height: 1.15;
  color: var(--teacher-text);
  margin-bottom: 6px;
}

.teacher-title p { margin: 0; color: var(--teacher-muted); }

.teacher-card {
  background: var(--teacher-surface);
  border: 1px solid var(--teacher-line);
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(16, 24, 40, .07);
  padding: 18px;
}

.teacher-grid { display: grid; gap: 16px; }
.teacher-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.teacher-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.teacher-card h2, .teacher-card h3 {
  color: var(--teacher-text);
}

.teacher-card p, .teacher-muted { color: var(--teacher-muted); }

.teacher-app input,
.teacher-app select,
.teacher-app textarea {
  color: var(--teacher-text);
  background: #fff;
  border-color: var(--teacher-line);
  border-radius: 8px;
}

.teacher-app label { color: #475467; }

.teacher-app .btn {
  border-radius: 8px;
  border-color: var(--teacher-line);
  color: var(--teacher-text);
  background: #fff;
}

.teacher-app .btn.primary {
  border-color: var(--teacher-blue);
  color: #fff;
  background: linear-gradient(135deg, #2457e6, #147fc6);
}

.teacher-app .btn.warn {
  border-color: #ffd6df;
  color: var(--teacher-red);
  background: #fff5f7;
}

.teacher-stat {
  background: linear-gradient(180deg, #fff, #f8fbff);
  border: 1px solid var(--teacher-line);
  border-radius: 12px;
  padding: 18px;
}

.teacher-stat span { color: var(--teacher-muted); font-size: 13px; }
.teacher-stat b { display: block; margin-top: 8px; color: var(--teacher-blue); font-size: 32px; }

.teacher-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
}

.teacher-table th,
.teacher-table td {
  padding: 12px;
  border-bottom: 1px solid var(--teacher-line);
  text-align: left;
  color: var(--teacher-text);
  vertical-align: middle;
}

.teacher-table th {
  color: var(--teacher-muted);
  background: #f8fafc;
  font-size: 12px;
}

.teacher-pill {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef4ff;
  color: var(--teacher-blue);
  font-size: 12px;
  font-weight: 700;
}

.teacher-pill.ok { background: #eafaf3; color: var(--teacher-green); }
.teacher-pill.pending { background: #fff7e6; color: #b76e00; }
.teacher-pill.bad { background: #fff0f3; color: var(--teacher-red); }

.teacher-empty {
  padding: 30px;
  text-align: center;
  color: var(--teacher-muted);
  border: 1px dashed var(--teacher-line);
  border-radius: 12px;
  background: #fbfcff;
}

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

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

.teacher-step {
  position: relative;
  display: grid;
  gap: 14px;
}

.teacher-step-number {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--teacher-blue), var(--teacher-cyan));
  font-weight: 800;
}

.option-list {
  display: grid;
  gap: 10px;
}

.option-row {
  display: grid;
  grid-template-columns: 34px 1fr 96px 42px;
  gap: 10px;
  align-items: center;
}

.option-index {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #eef4ff;
  color: var(--teacher-blue);
  font-weight: 800;
}

.answer-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--teacher-muted);
  font-size: 12px;
}

.question-preview {
  display: grid;
  gap: 10px;
}

.question-item {
  border: 1px solid var(--teacher-line);
  border-radius: 10px;
  padding: 14px;
  background: #fbfcff;
}

@media (max-width: 900px) {
  .teacher-app { grid-template-columns: 1fr; }
  .teacher-sidebar {
    position: static;
    height: auto;
    padding: 14px;
  }
  .teacher-main { padding: 16px; }
  .teacher-grid.two, .teacher-grid.three, .teacher-steps { grid-template-columns: 1fr; }
  .option-row { grid-template-columns: 34px 1fr; }
  .answer-cell { justify-content: flex-start; }
}

@media (max-width: 900px) {
  .shell { padding: 12px; }
  .topbar { position: static; align-items: flex-start; }
  .grid.two, .grid.three, .split, .hero-inner { grid-template-columns: 1fr; }
  .hero { min-height: auto; padding: 18px 0; }
  .hero-visual { min-height: 260px; }
  .screen { height: 100vh; min-height: 100vh; }
  .stage { min-height: 100vh; }
  .toolbox { top: 12px; right: 12px; bottom: 12px; width: min(320px, calc(100vw - 28px)); }
  .tool-grid { grid-template-columns: repeat(2, 1fr); }
  .classroom-home { padding: 18px; }
  .table { display: block; overflow-x: auto; }
}
