﻿:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f8fafb;
  --ink: #17212b;
  --muted: #667380;
  --line: #e4e9ed;
  --primary: #175cd3;
  --primary-dark: #12449b;
  --primary-soft: #eaf1ff;
  --green: #168a59;
  --green-soft: #e8f8f0;
  --orange: #d56b1f;
  --orange-soft: #fff2e8;
  --red: #c93636;
  --red-soft: #fff0f0;
  --shadow: 0 12px 32px rgba(22, 38, 54, 0.07);
  --radius: 18px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 9% 2%, rgba(23, 92, 211, 0.09), transparent 25rem),
    radial-gradient(circle at 95% 4%, rgba(22, 138, 89, 0.08), transparent 22rem),
    var(--bg);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto minmax(220px, 1fr);
  align-items: center;
  gap: 24px;
  padding: 14px 28px;
  border-bottom: 1px solid rgba(228, 233, 237, 0.9);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  color: white;
  background: linear-gradient(145deg, #1c69ea, #10489e);
  box-shadow: 0 8px 18px rgba(23, 92, 211, 0.23);
  font-weight: 800;
  letter-spacing: -0.5px;
}
.brand strong { display: block; font-size: 15px; letter-spacing: 0.2px; }
.brand span { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }

.role-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7f9fb;
}
.role-tab {
  padding: 9px 16px;
  border: 0;
  border-radius: 999px;
  color: #596673;
  background: transparent;
  font-size: 13px;
  font-weight: 650;
  transition: 160ms ease;
}
.role-tab:hover { color: var(--ink); }
.role-tab.active {
  color: var(--primary);
  background: white;
  box-shadow: 0 3px 10px rgba(28, 48, 72, 0.09);
}

.live-status {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #3c4956;
  font-size: 12px;
  font-weight: 650;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: #a8b0b8; }
.dot.online { background: #22a06b; box-shadow: 0 0 0 4px rgba(34, 160, 107, 0.12); }

main { padding: 28px; }
.view { display: none; animation: fadeIn 220ms ease; }
.view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.view-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}
.view-heading h1 { margin: 3px 0 8px; font-size: 28px; line-height: 1.2; letter-spacing: -0.5px; }
.eyebrow {
  margin: 0;
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}
.muted { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.heading-actions { display: flex; gap: 10px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 700;
  transition: 160ms ease;
}
.button:hover { transform: translateY(-1px); }
.button.primary { color: white; background: var(--primary); box-shadow: 0 8px 18px rgba(23, 92, 211, 0.2); }
.button.primary:hover { background: var(--primary-dark); }
.button.secondary { color: #31404f; border-color: var(--line); background: white; }
.button.full { width: 100%; min-height: 46px; margin-top: 14px; }
.text-button { padding: 0; border: 0; color: var(--primary); background: none; font-size: 12px; font-weight: 750; }
.icon-button {
  width: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #5a6774;
  background: white;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.metric-card {
  position: relative;
  min-height: 108px;
  padding: 18px 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 24px rgba(22, 38, 54, 0.04);
}
.metric-card::after {
  position: absolute;
  right: -20px;
  bottom: -30px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--primary-soft);
  content: "";
}
.metric-card.accent::after { background: var(--orange-soft); }
.metric-card span { display: block; color: var(--muted); font-size: 12px; font-weight: 650; }
.metric-card strong { display: block; margin: 7px 0 4px; font-size: 27px; letter-spacing: -0.7px; }
.metric-card small { color: #85909b; font-size: 11px; }
.success-text { color: var(--green); }

.teacher-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(360px, 1.15fr) minmax(300px, 0.9fr);
  gap: 16px;
  align-items: start;
}
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}
.roster-panel, .evaluation-panel, .qr-panel, .review-panel { padding: 18px; }
.right-stack { display: grid; gap: 16px; }
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}
.panel-head.compact { margin-bottom: 14px; }
.panel-head h2 { margin: 0 0 5px; font-size: 16px; letter-spacing: -0.2px; }
.panel-head p { margin: 0; color: var(--muted); font-size: 11px; }
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 9px;
  border-radius: 999px;
  color: #596673;
  background: #f0f3f6;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}
.status-pill.green { color: var(--green); background: var(--green-soft); }
.segmented {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 9px;
  background: #f1f4f7;
}
.segmented button { padding: 5px 9px; border: 0; border-radius: 7px; color: #75818c; background: transparent; font-size: 11px; font-weight: 700; }
.segmented button.active { color: var(--ink); background: white; box-shadow: 0 2px 6px rgba(22, 38, 54, 0.08); }

.search-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-bottom: 12px; }
.search-row input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  color: var(--ink);
  background: var(--surface-2);
  transition: 150ms ease;
}
.search-row input { height: 40px; padding: 0 12px; font-size: 12px; }
textarea { padding: 11px 12px; resize: vertical; font-size: 12px; line-height: 1.6; }
.search-row input:focus, textarea:focus { border-color: #9bbcf3; box-shadow: 0 0 0 3px rgba(23, 92, 211, 0.08); background: white; }

.student-list { display: grid; gap: 8px; max-height: 470px; overflow: auto; padding-right: 3px; }
.student-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  text-align: left;
  background: #f8fafb;
  transition: 150ms ease;
}
.student-card:hover { border-color: #cad8ea; background: #f5f8fc; }
.student-card.selected { border-color: #90b4ef; background: var(--primary-soft); box-shadow: 0 0 0 3px rgba(23, 92, 211, 0.06); }
.avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  color: white;
  background: linear-gradient(145deg, #6a8fc8, #3e6ca9);
  font-size: 13px;
  font-weight: 800;
}
.student-card:nth-child(3n + 2) .avatar { background: linear-gradient(145deg, #67b493, #348262); }
.student-card:nth-child(3n + 3) .avatar { background: linear-gradient(145deg, #d79664, #ad6535); }
.student-meta { min-width: 0; }
.student-meta strong { display: block; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.student-meta small { display: block; margin-top: 3px; color: #8b96a1; font-size: 10px; }
.student-score { min-width: 34px; color: var(--primary); font-size: 15px; font-weight: 850; text-align: right; }
.student-score.zero { color: #9aa4ae; }

.evaluation-target {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid #dbe5f1;
  border-radius: 14px;
  background: linear-gradient(135deg, #f7faff, #f3f7fc);
}
.evaluation-target .avatar { width: 46px; height: 46px; border-radius: 15px; }
.evaluation-target strong { display: block; font-size: 15px; }
.evaluation-target p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }

.quick-score { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.score-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-height: 68px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: #52606d;
  background: #f8fafb;
  font-size: 18px;
  font-weight: 850;
  transition: 150ms ease;
}
.score-button span { color: #7f8a95; font-size: 9px; font-weight: 650; }
.score-button.plus:hover { color: var(--green); border-color: #a9ddc6; background: var(--green-soft); }
.score-button.minus:hover { color: var(--red); border-color: #efbcbc; background: var(--red-soft); }
.tag-row { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0; }
.tag {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #5b6875;
  background: white;
  font-size: 10px;
  font-weight: 680;
}
.tag:hover { color: var(--primary); border-color: #b6cdf1; background: var(--primary-soft); }
.publish-row { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 10px; color: #596673; font-size: 11px; }
.publish-row label { display: flex; align-items: center; gap: 6px; }
.publish-row input { accent-color: var(--primary); }

.qr-layout { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: 14px; }
.fake-qr {
  position: relative;
  display: grid;
  width: 96px;
  height: 96px;
  place-items: center;
  border: 7px solid white;
  outline: 1px solid var(--line);
  border-radius: 12px;
  background:
    repeating-linear-gradient(90deg, #1e2b38 0 6px, transparent 6px 11px),
    repeating-linear-gradient(0deg, #1e2b38 0 6px, transparent 6px 11px),
    #fff;
  background-blend-mode: multiply;
  box-shadow: 0 6px 16px rgba(22, 38, 54, 0.08);
}
.fake-qr::before {
  position: absolute;
  inset: 8px;
  border: 8px solid white;
  border-radius: 5px;
  box-shadow: 0 0 0 6px #1e2b38 inset;
  content: "";
}
.fake-qr span { position: relative; z-index: 2; width: 24px; height: 24px; border: 5px solid #1e2b38; background: white; }
.qr-layout strong { display: block; font-size: 13px; }
.qr-layout p { margin: 6px 0 8px; color: var(--muted); font-size: 10px; line-height: 1.5; }

.review-queue { display: grid; gap: 9px; max-height: 340px; overflow: auto; }
.review-item {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfd;
}
.review-item-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.review-item strong { font-size: 12px; }
.review-item p { margin: 7px 0 9px; color: #5f6c78; font-size: 10px; line-height: 1.5; }
.review-item-actions { display: flex; gap: 6px; }
.mini-button { padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; color: #586572; background: white; font-size: 9px; font-weight: 750; }
.mini-button.accept { color: var(--green); border-color: #b7e3ce; background: var(--green-soft); }
.mini-button.reject { color: var(--red); border-color: #f0c3c3; background: var(--red-soft); }

.activity-panel { margin-top: 16px; padding: 18px; }
.activity-feed { display: grid; gap: 8px; }
.activity-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: 1px solid #edf0f3;
  border-radius: 12px;
  background: #fbfcfd;
}
.activity-dot { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; background: var(--primary-soft); color: var(--primary); font-size: 12px; font-weight: 850; }
.activity-dot.observer { color: var(--orange); background: var(--orange-soft); }
.activity-main strong { display: block; font-size: 12px; }
.activity-main p { margin: 3px 0 0; color: #71808d; font-size: 10px; }
.activity-tag { padding: 5px 8px; border-radius: 999px; color: #667380; background: #f0f3f6; font-size: 9px; font-weight: 750; white-space: nowrap; }
.observer-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  padding: 15px 18px;
  border: 1px solid #bfe4d2;
  border-radius: 15px;
  background: linear-gradient(135deg, #edfaf4, #f7fffb);
}
.verified-icon { display: grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: white; background: var(--green); font-weight: 900; }
.observer-banner strong { display: block; font-size: 13px; }
.observer-banner p { margin: 4px 0 0; color: #5d7469; font-size: 11px; }
.observer-banner .button { margin-left: auto; }
.observer-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(320px, 1fr) minmax(320px, 1fr);
  gap: 16px;
  align-items: start;
}
.resource-column { display: grid; gap: 14px; }
.resource-list { display: grid; gap: 9px; }
.resource-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  text-align: left;
  background: white;
  box-shadow: 0 7px 18px rgba(22, 38, 54, 0.04);
}
.resource-card:hover { border-color: #b6cdf1; }
.resource-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 12px; font-size: 13px; font-weight: 850; }
.resource-icon.coral { color: #b5502f; background: #fff0eb; }
.resource-icon.blue { color: #265ca7; background: #eaf2ff; }
.resource-icon.green { color: #277657; background: #e9f8f1; }
.resource-card strong { display: block; font-size: 11px; }
.resource-card small { display: block; margin-top: 4px; color: #89949f; font-size: 9px; }
.resource-card b { color: var(--primary); font-size: 10px; }
.observation-note { padding: 16px; }
.bullet-list { margin: 0; padding-left: 18px; color: #5d6975; font-size: 11px; line-height: 1.9; }
.observer-students, .observer-evaluation { padding: 18px; }
.observer-list { max-height: 420px; }
.observer-scores { grid-template-columns: repeat(3, 1fr); }
.review-note { margin-top: 10px; color: #7a8793; font-size: 10px; line-height: 1.5; text-align: center; }

.student-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.student-score-card { display: flex; align-items: center; gap: 22px; padding: 24px; }
.student-score-card h2 { margin: 10px 0 5px; font-size: 20px; }
.student-score-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.score-orb { display: grid; width: 110px; height: 110px; flex: 0 0 auto; place-items: center; border: 9px solid #dbe8ff; border-radius: 50%; background: white; box-shadow: inset 0 0 0 1px #c7d9f7; }
.score-orb span { margin-top: 18px; color: var(--primary); font-size: 34px; font-weight: 900; line-height: 1; }
.score-orb small { align-self: start; margin-top: -17px; color: var(--muted); font-size: 10px; }
.feedback-panel, .upload-panel { padding: 20px; }
.feedback-panel { grid-row: auto; padding: 14px 16px; }
.feedback-list { display: grid; gap: 6px; max-height: 124px; overflow-y: auto; padding-right: 4px; }
.feedback-card { padding: 14px; border: 1px solid var(--line); border-left: 4px solid var(--primary); border-radius: 12px; background: #fbfcfd; }
.feedback-card.observer { border-left-color: var(--orange); }
.feedback-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.feedback-card strong { font-size: 13px; }
.feedback-card p { margin: 8px 0 0; color: #63717e; font-size: 11px; line-height: 1.6; }
.feedback-time { color: #929da7; font-size: 9px; }
.unread-dot { color: var(--red); font-size: 10px; font-weight: 750; }
.upload-zone {
  display: grid;
  min-height: 145px;
  place-items: center;
  align-content: center;
  padding: 20px;
  border: 1.5px dashed #b9c8d8;
  border-radius: 15px;
  text-align: center;
  background: #fafcfe;
  cursor: pointer;
}
.upload-zone:hover { border-color: var(--primary); background: var(--primary-soft); }
.upload-icon { display: grid; width: 42px; height: 42px; margin-bottom: 10px; place-items: center; border-radius: 13px; color: var(--primary); background: #e5efff; font-size: 24px; }
.upload-zone strong { font-size: 13px; }
.upload-zone p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.projection-status { margin-top: 12px; padding: 11px 12px; border-radius: 11px; font-size: 11px; line-height: 1.5; }
.projection-status.empty { color: #7d8893; background: #f4f6f8; }
.projection-status.pending { color: #a45b1e; background: var(--orange-soft); }
.projection-status.approved { color: #207354; background: var(--green-soft); }
.display-view { padding: 4px; color: white; }
.display-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 4px 22px; }
.display-header .eyebrow { color: #80b3ff; }
.display-header h1 { margin: 5px 0 0; font-size: 25px; }
.display-clock { font-size: 24px; font-variant-numeric: tabular-nums; font-weight: 800; }
.display-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(310px, 0.75fr); gap: 18px; }
.display-stage, .display-panel {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(16px);
}
.display-stage { position: relative; min-height: 590px; padding: 24px; }
.stage-label { color: #9fc0ec; font-size: 11px; font-weight: 800; letter-spacing: 1.2px; }
.projection-card { display: grid; min-height: 470px; margin-top: 12px; place-items: center; border-radius: 18px; background: rgba(255, 255, 255, 0.96); color: #202a34; }
.poem-sheet { width: min(520px, 90%); padding: 40px 50px; border: 1px solid #e6e6e6; border-radius: 12px; background: #fffdf7; box-shadow: 0 18px 38px rgba(28, 39, 50, 0.12); text-align: center; }
.poem-title { display: block; margin-bottom: 26px; font-family: serif; font-size: 32px; font-weight: 800; letter-spacing: 8px; }
.poem-sheet p { margin: 12px 0; font-family: "KaiTi", "STKaiti", serif; font-size: 24px; letter-spacing: 3px; }
.student-sign { margin-top: 28px; color: #7e8790; font-size: 11px; }
.display-hint { margin-top: 14px; color: #9fb0c5; font-size: 10px; text-align: center; }
.display-side { display: grid; gap: 18px; }
.display-panel { padding: 20px; }
.display-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; }
.display-panel-head h2 { margin: 0; font-size: 14px; }
.display-panel-head span { color: #8fb4e7; font-size: 10px; }
.leaderboard { display: grid; gap: 8px; }
.leader-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 11px; background: rgba(255, 255, 255, 0.07); }
.rank { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 8px; color: #bdd4f4; background: rgba(255, 255, 255, 0.08); font-size: 11px; font-weight: 850; }
.leader-row:first-child .rank { color: #402c00; background: #ffd76a; }
.leader-name { font-size: 11px; font-weight: 700; }
.leader-score { color: #82b4ff; font-size: 12px; font-weight: 850; }
.display-feedback { display: grid; gap: 8px; }
.public-feedback { padding: 11px; border-radius: 11px; background: rgba(255, 255, 255, 0.07); color: #d6e4f7; font-size: 10px; line-height: 1.55; }
.public-feedback strong { color: white; }
.empty-state { padding: 20px 10px; color: #8ca1bb; font-size: 11px; text-align: center; }

body:has(#displayView.active) { background: #0b1421; }
body:has(#displayView.active) .topbar { border-color: rgba(255,255,255,0.08); background: rgba(10, 19, 31, 0.9); }
body:has(#displayView.active) .brand strong { color: white; }
body:has(#displayView.active) .brand span, body:has(#displayView.active) .live-status { color: #9eb0c7; }
body:has(#displayView.active) .role-tabs { border-color: rgba(255,255,255,0.1); background: rgba(255,255,255,0.05); }
body:has(#displayView.active) .role-tab { color: #a9b9cc; }
body:has(#displayView.active) .role-tab.active { color: #8ab7ff; background: rgba(255,255,255,0.1); box-shadow: none; }
body:has(#displayView.active) main { background: linear-gradient(135deg, #0b1421, #101d2e); }

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  max-width: 360px;
  padding: 13px 16px;
  border-radius: 12px;
  color: white;
  background: #1a2735;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: 180ms ease;
}
.toast.show { opacity: 1; transform: none; }

@media (max-width: 1180px) {
  .topbar { grid-template-columns: 1fr auto; }
  .role-tabs { order: 3; grid-column: 1 / -1; justify-content: center; }
  .teacher-grid, .observer-grid { grid-template-columns: 1fr 1fr; }
  .right-stack, .observer-evaluation { grid-column: 1 / -1; }
  .right-stack { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 820px) {
  main { padding: 18px; }
  .topbar { position: static; display: flex; flex-wrap: wrap; padding: 12px 16px; }
  .live-status { margin-left: auto; }
  .role-tabs { width: 100%; overflow-x: auto; justify-content: flex-start; }
  .role-tab { flex: 0 0 auto; }
  .view-heading { align-items: flex-start; flex-direction: column; }
  .metric-row, .teacher-grid, .observer-grid, .student-grid, .display-grid { grid-template-columns: 1fr; }
  .right-stack { grid-template-columns: 1fr; }
  .display-view { padding: 0; }
  .display-stage { min-height: 480px; }
  .feedback-panel { grid-row: auto; }
}

@media (max-width: 520px) {
  .brand span, .live-status { display: none; }
  .topbar { gap: 10px; }
  .role-tab { padding: 8px 11px; font-size: 11px; }
  .view-heading h1 { font-size: 23px; }
  .quick-score { grid-template-columns: 1fr 1fr; }
  .qr-layout { grid-template-columns: 1fr; }
  .fake-qr { display: none; }
  .activity-row { grid-template-columns: 34px minmax(0, 1fr); }
  .activity-tag { grid-column: 2; justify-self: start; }
}
.tag.selected,
.score-button.selected {
  color: var(--primary);
  border-color: #8fb4ef;
  background: var(--primary-soft);
  box-shadow: 0 0 0 3px rgba(23, 92, 211, 0.07);
}
.display-bind-panel .pair-code {
  padding: 14px;
  border: 1px dashed #a9c3e9;
  border-radius: 13px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 25px;
  font-weight: 900;
  letter-spacing: 7px;
  text-align: center;
}

.display-binding {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 11px 14px;
  border: 1px solid rgba(128, 179, 255, 0.22);
  border-radius: 12px;
  color: #bcd3f2;
  background: rgba(42, 96, 170, 0.2);
  font-size: 11px;
}
.display-binding strong { color: white; }
.display-binding.bound { border-color: rgba(74, 222, 155, 0.32); background: rgba(28, 133, 91, 0.2); }
.display-binding .dot { flex: 0 0 auto; }
/* 童趣卡通主题 */
body:not(:has(#displayView.active)) {
  color: #3b2a52;
  background:
    radial-gradient(circle at 8% 2%, rgba(255, 220, 128, .45), transparent 24rem),
    radial-gradient(circle at 92% 6%, rgba(255, 130, 190, .2), transparent 22rem),
    linear-gradient(180deg, #dff5ff 0%, #fff8df 100%);
}
body:not(:has(#displayView.active)) .topbar {
  margin: 12px 18px 0;
  border: 3px solid rgba(255,255,255,.88);
  border-radius: 24px;
  background: rgba(255,255,255,.83);
  box-shadow: 0 16px 35px rgba(74,102,145,.12);
}
body:not(:has(#displayView.active)) .panel,
body:not(:has(#displayView.active)) .metric-card {
  border: 2px solid rgba(255,255,255,.88);
  border-radius: 26px;
  box-shadow: 0 18px 40px rgba(74,102,145,.11);
}
body:not(:has(#displayView.active)) .button.primary {
  background: linear-gradient(135deg, #789cff, #5b8cff);
  box-shadow: 0 10px 22px rgba(91,140,255,.25);
}
body:not(:has(#displayView.active)) .score-button,
body:not(:has(#displayView.active)) .tag,
body:not(:has(#displayView.active)) .student-card {
  border-radius: 16px;
}
body:not(:has(#displayView.active)) #toggleDisplayPolicy {
  color: #c46912;
  background: #fff0c6;
  border-color: #ffd98a;
}
.student-score-card {
  background: linear-gradient(150deg, #fff, #fff0f8);
  border-color: #ffd3eb !important;
}
.feedback-panel { background: linear-gradient(150deg, #fff, #f4f0ff); }
.upload-panel { background: linear-gradient(150deg, #fff, #eef9ff); }
.libai-panel {
  grid-column: 1 / -1;
  overflow: hidden;
  background: linear-gradient(145deg, #fff8e8, #f5eaff 58%, #e9f5ff) !important;
  border: 3px solid #fff !important;
}
.libai-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.libai-avatar { display: grid; width: 58px; height: 58px; flex: 0 0 auto; place-items: center; border: 4px solid white; border-radius: 20px; color: white; background: linear-gradient(145deg, #ff9f43, #ff7b5f); box-shadow: 0 12px 24px rgba(255,139,66,.28); font-family: serif; font-size: 25px; font-weight: 900; transform: rotate(-4deg); }
.libai-head h2 { margin: 0 0 4px; font-size: 19px; }
.libai-head p { margin: 0; color: #7c708b; font-size: 12px; }
.libai-head .status-pill { margin-left: auto; color: #168a59; background: #e8f8f0; }
.libai-chat { display: flex; min-height: 190px; max-height: 310px; flex-direction: column; gap: 12px; overflow: auto; padding: 18px; border: 2px dashed #e0cef3; border-radius: 20px; background: rgba(255,255,255,.72); }
.chat-bubble { max-width: 78%; padding: 12px 15px; border-radius: 18px; font-size: 13px; line-height: 1.7; }
.chat-bubble.agent { align-self: flex-start; border-bottom-left-radius: 5px; background: white; box-shadow: 0 8px 18px rgba(94,78,128,.09); }
.chat-bubble.student { align-self: flex-end; border-bottom-right-radius: 5px; color: white; background: linear-gradient(135deg, #789cff, #5b8cff); }
.chat-bubble.typing { color: #9589a4; font-style: italic; }
.libai-suggestions { display: flex; flex-wrap: wrap; gap: 9px; margin: 15px 0; }
.libai-suggestions button { padding: 8px 12px; border: 2px solid #eadff5; border-radius: 999px; color: #725f8d; background: white; font-size: 11px; font-weight: 750; cursor: pointer; }
.libai-suggestions button:hover { border-color: #bca8e3; transform: translateY(-1px); }
.libai-input-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.libai-input-row input { width: 100%; height: 48px; padding: 0 16px; border: 2px solid #e4d7f2; border-radius: 16px; outline: none; color: #3b2a52; background: white; }
.libai-input-row button { padding: 0 20px; border: 0; border-radius: 16px; color: white; background: linear-gradient(135deg, #ff9f43, #ff7b5f); font-weight: 850; cursor: pointer; }
.web-user-badge { display: flex; align-items: center; gap: 8px; padding: 7px 9px 7px 12px; border-radius: 999px; background: #f3effa; color: #5b4b72; font-size: 11px; }
.web-user-badge button { padding: 5px 8px; border: 0; border-radius: 999px; color: #7c6d8d; background: white; font-size: 10px; cursor: pointer; }
@media (max-width: 820px) { .libai-panel { grid-column: auto; } .libai-head .status-pill { display: none; } .chat-bubble { max-width: 92%; } }
.completion-panel { margin-top: 16px; padding: 18px; }
.completion-actions { display:flex; align-items:center; gap:10px; }
.completion-overview { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin-bottom:18px; }
.completion-overview > div { display:flex; flex-direction:column; gap:7px; padding:15px; border-radius:16px; background:#f6f9ff; }
.completion-overview span { color:#758193; font-size:11px; }.completion-overview strong { color:#175cd3; font-size:25px; }.completion-overview .warning { background:#fff1ed; }.completion-overview .warning strong { color:#d65d3a; }
.assignment-list { display:grid; gap:10px; }
.assignment-row { display:grid; grid-template-columns:minmax(260px,1fr) minmax(180px,.8fr) 50px; align-items:center; gap:16px; padding:14px; border:1px solid #e7edf4; border-radius:15px; background:#fbfcfe; }
.assignment-copy strong,.assignment-copy span { display:block; }.assignment-copy strong { font-size:13px; }.assignment-copy span { margin-top:5px; color:#7a8794; font-size:10px; }
.progress-wrap { height:10px; overflow:hidden; border-radius:999px; background:#e7edf5; }.progress-bar { height:100%; border-radius:inherit; background:linear-gradient(90deg,#66c58f,#2ea96c); }
.assignment-row > b { color:#2d9b65; font-size:12px; text-align:right; }
.completion-students { display:flex; flex-wrap:wrap; gap:10px; margin-top:16px; }
.student-completion { display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:9px; min-width:300px; padding:11px 13px; border-radius:14px; background:#f4f7fb; font-size:11px; }
.student-completion b { font-size:12px; }.student-completion em { color:#5e6d7d; font-size:10px; font-style:normal; }
@media (max-width:800px) { .completion-overview { grid-template-columns:1fr 1fr; }.assignment-row { grid-template-columns:1fr; }.assignment-row > b { text-align:left; }.student-completion { min-width:100%; } }
.libai-stage { display:grid; grid-template-columns:minmax(180px,280px) 1fr; gap:18px; align-items:center; margin-bottom:18px; padding:16px; border-radius:22px; background:linear-gradient(135deg,rgba(255,255,255,.8),rgba(255,240,190,.55)); }
.libai-portrait-wrap { position:relative; display:grid; min-height:230px; place-items:center; }
.libai-avatar-image { position:relative; z-index:2; width:min(100%,220px); max-height:260px; object-fit:contain; border-radius:30px; filter:drop-shadow(0 18px 22px rgba(109,75,25,.2)); transform-origin:50% 82%; transition:transform 180ms ease; }
.libai-avatar-image.speaking { animation:libaiSpeak 420ms ease-in-out infinite alternate; }
.speech-aura { position:absolute; width:190px; height:190px; border:3px solid rgba(255,159,67,.25); border-radius:50%; opacity:0; }
.libai-portrait-wrap.speaking .speech-aura { opacity:1; animation:auraPulse 1.15s ease-out infinite; }
@keyframes libaiSpeak { from { transform:translateY(0) scale(1); } to { transform:translateY(-3px) scale(1.015) rotate(.5deg); } }
@keyframes auraPulse { from { transform:scale(.8); opacity:.75; } to { transform:scale(1.2); opacity:0; } }
.libai-voice-controls { display:flex; flex-wrap:wrap; gap:10px; align-content:center; margin:0; padding:0; }
.libai-voice-controls button { padding:10px 14px; border:0; border-radius:999px; color:#6c548b; background:white; box-shadow:0 8px 18px rgba(86,72,120,.12); font-size:12px; font-weight:800; cursor:pointer; }
.libai-voice-controls button:hover { color:#ff7b4d; transform:translateY(-1px); }
@media (max-width:700px) { .libai-stage { grid-template-columns:1fr; }.libai-portrait-wrap { min-height:210px; } }
.student-tasks-panel { grid-column:1/-1; background:linear-gradient(145deg,#fff,#edf8ff); }
.student-task-list { display:grid; gap:12px; }
.student-task-row { display:grid; grid-template-columns:minmax(240px,1fr) auto auto auto; gap:10px; align-items:center; padding:15px; border:2px solid #e4eef8; border-radius:18px; background:white; }
.student-task-row strong,.student-task-row span { display:block; }.student-task-row strong { font-size:14px; }.student-task-row span { margin-top:5px; color:#778697; font-size:10px; }
.student-task-row > b { padding:6px 10px; border-radius:999px; color:#5d6c7b; background:#eef3f7; font-size:10px; }
.student-task-row.status-in_progress > b { color:#c26c13; background:#fff0d7; }.student-task-row.status-completed > b { color:#168a59; background:#e8f8f0; }
.student-task-row button { padding:9px 12px; border:0; border-radius:12px; color:white; background:#5b8cff; font-size:11px; font-weight:800; cursor:pointer; }
.student-task-row button[data-task-action=complete] { background:#45c78b; }.student-task-row button:disabled { color:#a5afb9; background:#edf0f3; cursor:not-allowed; }
@media (max-width:760px){ .student-task-row { grid-template-columns:1fr 1fr; }.student-task-row > div { grid-column:1/-1; } }
.task-create-form { margin:0 0 18px; padding:18px; border:2px dashed #cbddf7; border-radius:18px; background:#f7fbff; }
.task-form-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.task-form-grid label { display:flex; flex-direction:column; gap:7px; color:#66758a; font-size:11px; font-weight:750; }
.task-form-grid .wide { grid-column:1/-1; }
.task-form-grid input,.task-form-grid textarea { width:100%; padding:11px 12px; border:1px solid #d8e3f0; border-radius:12px; outline:none; background:white; font:inherit; }
.task-check { display:flex; align-items:center; gap:8px; margin-top:12px; color:#66758a; font-size:11px; }
.task-form-actions { display:flex; justify-content:flex-end; gap:10px; margin-top:14px; }
.task-external-link { display:inline-flex; align-items:center; padding:9px 12px; border-radius:12px; color:#c46912; background:#fff0c6; font-size:11px; font-weight:850; text-decoration:none; }
@media (max-width:760px){ .task-form-grid { grid-template-columns:1fr; }.task-form-grid .wide { grid-column:auto; } }
.libai-3d-canvas { position:relative; z-index:2; width:min(100%,300px); height:280px; overflow:hidden; border-radius:28px; cursor:grab; touch-action:none; }
.libai-3d-canvas:active { cursor:grabbing; }
.libai-3d-canvas canvas { width:100%; height:100%; display:block; }
/* 学生端参考图水墨月夜背景 */
body:has(#studentView.active) { background:#1d1613; }
body:has(#studentView.active) .app-shell {
  background:
    linear-gradient(180deg, rgba(29,22,19,.55), rgba(47,37,29,.9)),
    radial-gradient(circle at 82% 15%, rgba(218,164,74,.34), transparent 17rem),
    url('./assets/libai.png') center/cover no-repeat;
  background-blend-mode:multiply, screen, normal;
}
body:has(#studentView.active) .topbar { border-color:rgba(218,164,74,.18); background:rgba(29,22,19,.82); }
body:has(#studentView.active) .brand strong { color:#fff8e5; }
body:has(#studentView.active) .brand span, body:has(#studentView.active) .live-status { color:#d8c7aa; }
body:has(#studentView.active) .role-tabs { border-color:rgba(218,164,74,.2); background:rgba(255,255,255,.07); }
body:has(#studentView.active) .role-tab { color:#d8c7aa; }
body:has(#studentView.active) .role-tab.active { color:#ffe3a1; background:rgba(218,164,74,.18); }
#studentView.active { position:relative; isolation:isolate; padding:24px; overflow:hidden; border-radius:34px; }
#studentView.active::before { position:absolute; z-index:-1; right:-4%; bottom:-2%; left:-4%; height:42%; background:linear-gradient(165deg,transparent 18%,rgba(16,12,10,.58) 19% 44%,transparent 45%),linear-gradient(150deg,transparent 25%,rgba(73,57,40,.62) 26% 56%,transparent 57%); clip-path:polygon(0 62%,12% 34%,24% 58%,38% 18%,52% 60%,68% 28%,82% 57%,100% 35%,100% 100%,0 100%); content:""; }
#studentView.active::after { position:absolute; z-index:-1; top:7%; right:8%; width:130px; height:130px; border-radius:50%; background:radial-gradient(circle,#ffe6a4 0 28%,#daa44a 29% 31%,rgba(218,164,74,.12) 32% 58%,transparent 59%); box-shadow:0 0 60px rgba(218,164,74,.18); content:""; }
body:has(#studentView.active) #studentView > .view-heading h1 { color:#fff8e5; }
body:has(#studentView.active) #studentView > .view-heading .muted { color:#d8c7aa; }
body:has(#studentView.active) #studentView > .view-heading .eyebrow { color:#ffd779; }
body:has(#studentView.active) .libai-panel { border-color:rgba(218,164,74,.48) !important; background:linear-gradient(145deg,rgba(47,37,29,.94),rgba(73,57,40,.92) 55%,rgba(29,22,19,.96)) !important; color:#fff7df; }
body:has(#studentView.active) .libai-panel h2, body:has(#studentView.active) .libai-panel p { color:#fff7df; }
body:has(#studentView.active) .libai-chat { border-color:rgba(218,164,74,.3); background:rgba(18,14,12,.48); }
body:has(#studentView.active) .chat-bubble.agent { color:#fff3d2; background:rgba(73,57,40,.92); }
body:has(#studentView.active) .libai-suggestions button { color:#ffe2a1; border-color:rgba(218,164,74,.28); background:rgba(255,255,255,.08); }
body:has(#studentView.active) .libai-input-row input { color:#fff8e5; border-color:rgba(218,164,74,.32); background:rgba(255,255,255,.1); }
body:has(#studentView.active) .libai-input-row input::placeholder { color:#bfae91; }
body:has(#studentView.active) .libai-voice-controls button { color:#ffe2a1; background:rgba(255,255,255,.1); }
.libai-portrait-column { display:flex; flex-direction:column; align-items:center; gap:10px; }
.libai-mic-button { position:relative; display:flex; width:132px; height:132px; flex-direction:column; align-items:center; justify-content:center; gap:5px; border:0; border-radius:50%; color:#fff; background:linear-gradient(145deg,#ff9f43,#e76565); box-shadow:0 14px 30px rgba(190,80,52,.32); cursor:pointer; transition:170ms ease; }
.libai-mic-button:hover { transform:translateY(-2px) scale(1.02); }
.libai-mic-button .mic-icon { font-size:36px; }
.libai-mic-button small { font-size:11px; font-weight:850; }
.libai-mic-button.listening { background:linear-gradient(145deg,#45c78b,#168a59); animation:micPulse 1.35s ease-in-out infinite; }
.libai-mic-button.speaking { background:linear-gradient(145deg,#daa44a,#9f723a); }
@keyframes micPulse { 0%,100% { box-shadow:0 0 0 0 rgba(69,199,139,.42),0 14px 30px rgba(40,130,90,.28); } 50% { box-shadow:0 0 0 18px rgba(69,199,139,0),0 14px 30px rgba(40,130,90,.28); } }
.libai-mic-status { max-width:230px; color:#806f59; font-size:11px; line-height:1.5; text-align:center; }
.voice-name { display:block; flex-basis:100%; margin-top:6px; color:#8f7b60; font-size:10px; }
body:has(#studentView.active) .libai-mic-status, body:has(#studentView.active) .voice-name { color:#e4d5ba; }
/* 大鱼卡通麦克风与温柔男声区域 */
.libai-stage { grid-template-columns:1fr; justify-items:center; gap:14px; }
.libai-portrait-column { width:100%; } .libai-portrait-wrap { width:min(100%,360px); }
.libai-voice-controls { justify-content:center; max-width:720px; }
.libai-mic-button { width:96px; height:96px; padding:0; border-radius:50%; background:transparent; box-shadow:none; overflow:visible; }
.libai-mic-button:hover { transform:translateY(-2px) scale(1.035); }
.libai-mic-button .mic-cartoon { width:84px; height:84px; filter:drop-shadow(0 16px 22px rgba(104,58,25,.28)); transition:160ms ease; }
.libai-mic-button.listening .mic-cartoon { animation:micCartoonPulse 850ms ease-in-out infinite alternate; }
.libai-mic-button.speaking .mic-cartoon { animation:micCartoonTalk 420ms ease-in-out infinite alternate; }
.libai-mic-button.listening::before, .libai-mic-button.speaking::before { position:absolute; inset:5px; border:5px solid rgba(69,199,139,.42); border-radius:50%; content:""; animation:micHalo 1.4s ease-out infinite; }
.libai-mic-button.speaking::before { border-color:rgba(218,164,74,.52); }
.libai-mic-button small { position:absolute; bottom:-4px; padding:4px 10px; border-radius:999px; color:#fff; background:#6b3b22; box-shadow:0 6px 14px rgba(83,47,25,.22); font-size:10px; }
.libai-mic-button.listening small { background:#168a59; }.libai-mic-button.speaking small { background:#9f723a; }
@keyframes micHalo { from { transform:scale(.82); opacity:.85; } to { transform:scale(1.28); opacity:0; } }
@keyframes micCartoonPulse { from { transform:scale(1); } to { transform:scale(1.06) rotate(1deg); } }
@keyframes micCartoonTalk { from { transform:scale(1); } to { transform:scale(1.03) rotate(-.8deg); } }
.libai-mic-status { max-width:300px; font-size:12px; }
.libai-video-wrap { position:relative; width:min(100%,360px); height:330px; overflow:hidden; border:4px solid rgba(218,164,74,.45); border-radius:30px; background:#1d1613; box-shadow:0 18px 38px rgba(12,8,6,.32); animation:videoSway 4.8s ease-in-out infinite; }
.libai-video { width:100%; height:100%; display:block; object-fit:cover; object-position:center; transform:perspective(1000px) rotateY(-1deg); }
.video-glow { position:absolute; inset:0; pointer-events:none; background:radial-gradient(circle at 50% 42%,transparent 45%,rgba(218,164,74,.14) 78%,rgba(29,22,19,.5)); }
@keyframes videoSway { 0%,100% { transform:translateY(0) rotate(-.25deg); } 50% { transform:translateY(-4px) rotate(.35deg); } }
body:has(#studentView.active) .libai-video-wrap { transform:perspective(1000px) rotateX(var(--video-tilt-x,0deg)) rotateY(var(--video-tilt-y,0deg)); transition:transform 160ms ease-out; will-change:transform; }
body:has(#studentView.active) .libai-video { transform-origin:50% 62%; animation:videoIdleFloat 4.2s ease-in-out infinite; will-change:transform; }
@keyframes videoIdleFloat { 0%,100% { transform:translate3d(0,0,0) scale(1.015) rotate(-.35deg); } 25% { transform:translate3d(-3px,-3px,0) scale(1.022) rotate(.25deg); } 50% { transform:translate3d(0,-6px,0) scale(1.03) rotate(.45deg); } 75% { transform:translate3d(3px,-2px,0) scale(1.022) rotate(-.2deg); } }

body:has(#studentView.active) .libai-video-wrap { animation:none !important; }
body:has(#studentView.active) .libai-video { animation:none !important; transition:none; }

body:has(#studentView.active) .libai-video { position:absolute; inset:0; opacity:0; transition:opacity 240ms ease; }
body:has(#studentView.active) .libai-video.active { opacity:1; z-index:1; }
body:has(#studentView.active) .libai-video { transition:opacity 140ms ease; }
body:has(#studentView.active) .libai-portrait-wrap:not(.speaking) .libai-video-wrap { filter:brightness(.93) saturate(.93); }
body:has(#studentView.active) .libai-portrait-wrap.speaking .libai-video-wrap { border-color:rgba(255,206,112,.95); box-shadow:0 0 0 6px rgba(255,193,84,.26), 0 18px 44px rgba(12,8,6,.42); filter:brightness(1.09) saturate(1.07); }
body:has(#studentView.active) .libai-portrait-wrap.speaking .libai-video-wrap::after { position:absolute; top:10px; left:50%; z-index:3; transform:translateX(-50%); padding:4px 14px; border-radius:999px; background:rgba(159,114,58,.92); color:#fff6e2; font-size:12px; font-weight:800; letter-spacing:1px; content:"正在说话"; }

/* 毛笔图标 */
.maobi-icon { width:1.05em; height:1.05em; vertical-align:-0.18em; }
.score-orb .maobi-icon { display:block; width:34px; height:34px; margin:0 auto 2px; }
.leader-score .maobi-icon { margin-right:2px; }
.student-completion em .maobi-icon { margin-right:2px; }

/* 我的课堂反馈：紧凑显示 */
.feedback-panel { padding: 14px 16px; }
.feedback-panel .panel-head { margin-bottom: 8px; align-items: center; }
.feedback-panel .panel-head h2 { font-size: 15px; margin: 0 0 2px; }
.feedback-panel .panel-head p { font-size: 10px; }
.feedback-panel .unread-dot { font-size: 10px; padding: 3px 8px; }
.feedback-panel .feedback-list { max-height: 124px; overflow-y: auto; }
.feedback-panel .feedback-list > * { padding: 9px 11px; }
.feedback-panel .feedback-list p { font-size: 12px; line-height: 1.45; margin: 4px 0 0; }
.feedback-panel .feedback-time { font-size: 10px; }
/* 教师端任务发布列表 */
.teacher-task-list { display: grid; gap: 10px; }
.teacher-task-row { display: grid; grid-template-columns: 1fr auto auto auto; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 16px; background: #fff; box-shadow: 0 6px 18px rgba(86,72,120,.08); }
.teacher-task-row strong { font-size: 14px; }
.teacher-task-row small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.teacher-task-row.finished strong { color: var(--muted); }
.teacher-task-state { font-size: 11px; font-weight: 800; color: var(--muted); white-space: nowrap; }
.teacher-task-row.finished .teacher-task-state { color: #2f9e6b; }
.teacher-task-row .button { padding: 9px 16px; font-size: 12px; }
@media (max-width: 700px) { .teacher-task-row { grid-template-columns: 1fr; justify-items: start; } }
/* ===== 教师端精简布局 ===== */
.teacher-grid { grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1.1fr); }
.teacher-bottom { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; margin-top: 16px; align-items: start; }
.teacher-bottom .completion-panel { margin-top: 0; }
.game-panel { padding: 18px; }
.game-card { display: grid; gap: 4px; margin: 12px 0 14px; padding: 14px 16px; border-radius: 14px; background: linear-gradient(135deg, #fff8e8, #fff1d6); border: 1px dashed rgba(218, 164, 74, 0.55); }
.game-card strong { font-size: 14px; }
.game-card small { color: var(--muted); font-size: 11px; line-height: 1.5; }

/* ===== 听课端动态区 ===== */
.observer-feeds { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.observer-feeds .activity-panel { margin-top: 16px; }

/* ===== 课堂设置页 ===== */
.setup-page { min-height: 100vh; background: linear-gradient(150deg, #f4f7ff, #eefaf3); }
.setup-wrap { max-width: 1040px; margin: 0 auto; padding: 32px 20px 60px; }
.setup-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.setup-head h1 { margin: 6px 0; font-size: 26px; }
.setup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.setup-grid .panel { padding: 20px; }
.setup-grid .panel:last-child { grid-column: 1 / -1; }
.setup-hint { font-size: 11px; margin: 8px 0 12px; }
.setup-policy-row { display: flex; flex-wrap: wrap; gap: 10px; }
.setup-policy-row .tag.active { color: #fff; background: var(--primary); }
.fake-qr.spin span { animation: qrSpin 600ms ease; }
@keyframes qrSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .teacher-grid, .teacher-bottom, .observer-feeds, .setup-grid { grid-template-columns: 1fr; }
  .setup-grid .panel:last-child { grid-column: auto; }
  .setup-head { flex-direction: column; }
}
/* 教师端：添加学生名册 */
.student-add-form { display: grid; gap: 8px; margin-bottom: 12px; padding: 12px; border-radius: 14px; background: #f2f6ff; border: 1px solid #dbe6fb; }
.student-add-form input { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; }
.student-add-actions { display: flex; gap: 8px; justify-content: flex-end; }
.student-add-actions .button { padding: 8px 16px; font-size: 12px; }
.roster-hint { margin: -2px 0 10px; font-size: 11px; color: var(--muted); }
/* 评价来源标签（主讲 / 听课） */
.feedback-source { display: inline-block; margin: 0 6px; padding: 2px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.feedback-source.main { background: #eaf1ff; color: #3b6ef0; }
.feedback-source.observer { background: #eefaf3; color: #12904f; }

/* 听课端右上角加入人数 */
.observer-count { display: grid; justify-items: center; gap: 1px; padding: 6px 16px; border-radius: 14px; background: rgba(255, 255, 255, .16); color: inherit; }
.observer-count b { font-size: 22px; line-height: 1.05; }
.observer-count small { font-size: 10px; opacity: .85; white-space: nowrap; }
/* ===== 评价体系：笔(1分) / 纸(2分) / 砚台(3分) ===== */
.eval-icon { width: 1.35em; height: 1.35em; object-fit: contain; vertical-align: -0.3em; }
.student-score-stack { display: grid; justify-items: center; gap: 8px; }
.eval-token-list { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.eval-token { display: inline-flex; align-items: center; gap: 3px; padding: 3px 9px 3px 4px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 12px; font-weight: 800; }
.eval-token .eval-icon { width: 24px; height: 24px; vertical-align: middle; }
.eval-token.zero { padding: 4px 12px; color: var(--muted); }
.score-button .eval-icon { width: 28px; height: 28px; margin: 0 3px 0 0; vertical-align: middle; }
.feedback-card strong { display: inline-flex; align-items: center; gap: 4px; }
.feedback-card strong .eval-icon { width: 26px; height: 26px; }
.leader-score { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.leader-score .eval-token { padding: 1px 6px 1px 2px; font-size: 11px; background: transparent; border: 0; }
.leader-score .eval-token .eval-icon { width: 20px; height: 20px; }
.display-feedback .eval-icon { width: 22px; height: 22px; vertical-align: -0.3em; }
/* 学生名次徽标 */
.student-card .avatar { position: relative; }
.rank-badge { position: absolute; top: -5px; left: -5px; display: inline-block; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: #8497b0; color: #fff; font-size: 10px; font-style: normal; font-weight: 800; line-height: 18px; text-align: center; box-shadow: 0 2px 6px rgba(30,50,90,.22); }
.rank-badge.top1 { background: linear-gradient(135deg, #f7cf55, #e29c12); }
.rank-badge.top2 { background: linear-gradient(135deg, #c3cedd, #8b9ab0); }
.rank-badge.top3 { background: linear-gradient(135deg, #dd9d68, #ab6231); }
/* 课堂设置页：学生名册管理 */
.setup-roster-add { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 10px; margin-bottom: 14px; }
.setup-roster-add input { padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; box-sizing: border-box; width: 100%; }
.setup-roster-list { display: grid; gap: 8px; max-height: 250px; overflow-y: auto; }
.setup-roster-row { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: #f5f8fd; }
.setup-roster-row b { color: var(--muted); font-size: 12px; }
.setup-roster-row em { color: var(--muted); font-size: 12px; font-style: normal; }
@media (max-width: 800px) { .setup-roster-add { grid-template-columns: 1fr; } }
/* 本节课最终排名 */
.final-ranking-panel { margin-top: 16px; padding: 18px; }
.final-ranking-list { display: grid; gap: 10px; }
.final-rank-row { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px; background: #f5f8fd; }
.final-rank-no { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #8497b0; color: #fff; font-size: 13px; font-weight: 800; }
.final-rank-no.r1 { background: linear-gradient(135deg, #f7cf55, #e29c12); }
.final-rank-no.r2 { background: linear-gradient(135deg, #c3cedd, #8b9ab0); }
.final-rank-no.r3 { background: linear-gradient(135deg, #dd9d68, #ab6231); }
.final-rank-score { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
/* 课堂信息条（授课班级/教师/科目/题目） */
.class-info-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; padding: 14px 18px; border-radius: 18px; background: #fff; border: 1px solid var(--line); box-shadow: 0 10px 28px rgba(40,70,130,.07); }
.class-info-bar > div { display: grid; gap: 3px; min-width: 0; }
.class-info-bar span { color: var(--muted); font-size: 11px; }
.class-info-bar strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.observer-banner + .class-info-bar { margin-top: -6px; }
.student-class-info { grid-column: 1 / -1; }
@media (max-width: 700px) { .class-info-bar { grid-template-columns: 1fr 1fr; } }
/* ===== 学生头像上传 ===== */
.student-heading { display: flex; align-items: center; gap: 20px; }
.student-avatar-wrap { position: relative; flex: 0 0 auto; }
.student-avatar { display: grid; place-items: center; width: 88px; height: 88px; overflow: hidden; border: 4px solid rgba(255,255,255,.85); border-radius: 50%; background: linear-gradient(145deg, #ffd08a, #ff9f43); color: #fff; font-size: 34px; font-weight: 900; box-shadow: 0 12px 26px rgba(40,70,130,.18); }
.student-avatar .avatar-img { width: 100%; height: 100%; object-fit: cover; }
.avatar-upload-btn { position: absolute; right: -2px; bottom: -2px; display: grid; place-items: center; width: 34px; height: 34px; border: 2px solid #fff; border-radius: 50%; background: #3b6ef0; color: #fff; font-size: 14px; cursor: pointer; box-shadow: 0 6px 14px rgba(40,70,130,.25); }
.avatar-upload-btn:hover { transform: scale(1.06); }
.student-card .avatar .avatar-img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }

/* 飞象游戏链接输入 */
.game-input { width: 100%; margin-bottom: 10px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px; font-size: 13px; box-sizing: border-box; }
.game-input:focus { outline: none; border-color: #3b6ef0; }

@media (max-width: 700px) { .student-heading { flex-direction: column; align-items: flex-start; } }
/* 飞象游戏链接库（教师端） */
.game-library { display: grid; gap: 8px; }
.game-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: #f5f8fd; }
.game-row-main { min-width: 0; }
.game-row-main strong { display: block; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.game-row-main small { display: block; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.game-row .button { padding: 8px 14px; font-size: 12px; white-space: nowrap; }
.game-row.live { background: #eafaf1; box-shadow: inset 0 0 0 1px rgba(47,158,107,.18); }
.game-row .live-tag { display: inline-block; margin-left: 7px; padding: 2px 7px; border-radius: 999px; color: #18764d; background: #d8f4e6; font-size: 10px; vertical-align: middle; }
/* 学生端任务（只读，由教师控制） */
.student-task-row.read-only { cursor: default; }
.student-task-row.read-only b { padding: 5px 12px; border-radius: 999px; font-size: 12px; }
.student-task-row.status-in_progress b { background: #fff3e2; color: #c47b16; }
.student-task-row.status-completed b { background: #e8f9f1; color: #12904f; }
.student-task-row.status-not_started b { background: #eef2f8; color: #8592a8; }

/* 听课教师对本节课的评价 */
.lesson-review-panel { margin-top: 16px; padding: 20px 22px; }
.lesson-review-panel textarea { width: 100%; padding: 13px 15px; border: 1px solid var(--line); border-radius: 13px; font-size: 13.5px; font-family: inherit; resize: vertical; box-sizing: border-box; }
.lesson-review-panel textarea:focus { outline: none; border-color: #3b6ef0; }
.anon-row { display: flex; align-items: center; gap: 8px; margin: 12px 0; color: #4a5b76; font-size: 13px; cursor: pointer; }
.lesson-review-list { display: grid; gap: 10px; margin-top: 14px; }
.lesson-review-card { padding: 13px 16px; border-radius: 14px; background: #f6f8fd; }
.lesson-review-card .who { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; font-size: 12px; color: #8592a8; }
.lesson-review-card .who b { color: #33415c; font-size: 13px; }
.lesson-review-card p { margin: 0; font-size: 13.5px; line-height: 1.7; }
.lesson-review-card.mine { background: #eef4ff; box-shadow: inset 0 0 0 2px #b9cdf3; }
