/* ============================================================
   智育启航 · 温暖教育风（Claymorphism 黏土拟态）
   设计令牌：珊瑚橙主调 / 暖奶油底 / 厚描边+双层阴影 / 大圆角
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

:root {
  --primary: #F97316;
  --primary-dark: #EA580C;
  --primary-soft: #FFEDD5;
  --accent: #FBBF24;
  --accent-soft: #FEF3C7;
  --bg: #FFFBEB;
  --card: #FFFFFF;
  --ink: #431407;
  --muted: #9A7360;
  --border: #FDE3C8;
  --student-blue: #38BDF8;
  --danger: #DC2626;
  --shadow-hard: 0 6px 0 rgba(249, 115, 22, .16);
  --shadow-soft: 0 12px 28px rgba(249, 115, 22, .12);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
}

/* 背景光斑 */
.bg-glow { position: fixed; border-radius: 50%; filter: blur(90px); opacity: .5; pointer-events: none; z-index: 0; }
.glow-1 { width: 420px; height: 420px; background: #FFE4C8; top: -120px; right: -100px; }
.glow-2 { width: 360px; height: 360px; background: #FFF1CC; bottom: -120px; left: -100px; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
  background: rgba(255, 251, 235, .85);
  backdrop-filter: blur(12px);
  border-bottom: 3px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo {
  width: 38px; height: 38px; border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), #FB923C);
  color: #fff; font-size: 20px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 0 var(--primary-dark), 0 6px 12px rgba(249,115,22,.25);
}
.brand-name { font-size: 18px; font-weight: 800; letter-spacing: .04em; }
.brand-sub { font-size: 12px; color: var(--muted); margin-left: 4px; }
.user-tag {
  font-size: 13px; font-weight: 600; color: var(--primary-dark);
  background: var(--primary-soft); border: 2px solid var(--border);
  padding: 4px 14px; border-radius: 999px;
}

/* ---------- 布局 ---------- */
main { position: relative; z-index: 1; max-width: 880px; margin: 0 auto; padding: 24px 16px; }
.view { animation: viewIn .28s ease-out; }
@keyframes viewIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- 按钮（黏土） ---------- */
.btn {
  border: 3px solid transparent; border-radius: 999px; padding: 12px 26px;
  font-size: 15px; font-weight: 700; cursor: pointer;
  transition: transform .2s var(--ease-spring), box-shadow .2s ease, background .2s ease;
  font-family: inherit; letter-spacing: .02em;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-lg { padding: 14px 40px; font-size: 17px; }
.btn-mini { padding: 6px 14px; font-size: 13px; border-width: 2px; }
.btn-primary {
  background: var(--primary); color: #fff; border-color: var(--primary-dark);
  box-shadow: 0 4px 0 var(--primary-dark), var(--shadow-soft);
}
.btn-primary:hover:not(:disabled) { background: #FB7B25; transform: translateY(-2px); box-shadow: 0 6px 0 var(--primary-dark), 0 16px 32px rgba(249,115,22,.2); }
.btn-ghost {
  background: var(--card); color: var(--primary-dark); border-color: var(--primary-soft);
  box-shadow: 0 3px 0 var(--primary-soft);
}
.btn-ghost:hover { background: var(--primary-soft); }
.btn-accent {
  background: var(--accent); color: #713F12; border-color: #D97706;
  box-shadow: 0 4px 0 #D97706, 0 10px 20px rgba(217,119,6,.18);
}
.btn-accent:hover { transform: translateY(-2px); }
.btn-end { background: var(--danger); color: #fff; border-color: #991B1B; box-shadow: 0 4px 0 #991B1B; }
.btn-end:hover { transform: translateY(-2px); }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card); border-radius: 22px; padding: 32px 28px;
  border: 3px solid var(--border);
  box-shadow: var(--shadow-hard), var(--shadow-soft);
}
.card-center { text-align: center; }
.card h1 { font-size: 24px; font-weight: 800; color: var(--ink); margin-bottom: 10px; letter-spacing: .02em; }
.hero-icon {
  width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 20px;
  background: var(--primary-soft); border: 3px solid #FFD9B0;
  display: flex; align-items: center; justify-content: center; font-size: 30px;
  box-shadow: 0 4px 0 #FFD9B0;
  animation: floaty 3.5s ease-in-out infinite;
}
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.hint { color: var(--muted); font-size: 14px; margin-bottom: 20px; line-height: 1.7; }

/* ---------- 表单 ---------- */
.form-row { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.form-row .form-label {
  display: flex; align-items: center; font-size: 14px; font-weight: 700; color: var(--muted);
}
.form-row select {
  padding: 10px 14px; border: 3px solid var(--border); border-radius: 14px;
  font-size: 15px; font-weight: 700; color: var(--ink); background: #fff; cursor: pointer;
}
.form-row select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(249,115,22,.15); }
.form-row input {
  flex: 1; min-width: 160px; padding: 13px 18px; font-size: 15px;
  border: 3px solid var(--border); border-radius: 999px; outline: none;
  background: #fff; font-family: inherit; color: var(--ink);
  transition: box-shadow .2s ease, border-color .2s ease;
}
.form-row input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(249,115,22,.15);
}

/* ---------- 抽题卡片 ---------- */
.lesson-card {
  margin-top: 22px; padding: 22px; border: 3px dashed #F7C98F;
  border-radius: 18px; text-align: left; background: #FFFDF6;
  animation: popIn .45s var(--ease-spring);
}
@keyframes popIn { from { opacity: 0; transform: scale(.95) translateY(16px); } to { opacity: 1; transform: none; } }
.lesson-head { display: flex; gap: 8px; margin-bottom: 10px; }
.lesson-grade, .lesson-cat {
  font-size: 12px; font-weight: 700; padding: 4px 14px; border-radius: 999px;
  border: 2px solid;
}
.lesson-grade { background: var(--primary-soft); color: var(--primary-dark); border-color: #FFD9B0; }
.lesson-cat { background: var(--accent-soft); color: #92400E; border-color: #FDE68A; }
.lesson-title { font-size: 22px; font-weight: 800; margin-bottom: 10px; }
.lesson-text summary { cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 600; }
.lesson-text pre {
  white-space: pre-wrap; font-family: inherit; font-size: 14px;
  background: #fff; border: 2px solid var(--border); padding: 14px;
  border-radius: 12px; margin: 8px 0 14px; line-height: 1.8;
  color: #6B4A35; max-height: 260px; overflow-y: auto;
}
.lesson-card .btn { display: block; width: 100%; text-align: center; }

/* ============ 课堂模式 ============ */
.class-head {
  display: flex; justify-content: space-between; align-items: center;
  background: rgba(255,255,255,.9); backdrop-filter: blur(10px);
  border-radius: 20px 20px 0 0; padding: 14px 20px;
  border: 3px solid var(--border); border-bottom: none;
}
.class-title { font-size: 18px; font-weight: 800; }
.class-sub { font-size: 12px; color: var(--muted); margin-top: 3px; font-weight: 600; }
.timer {
  font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums;
  color: var(--primary-dark); background: var(--primary-soft);
  border: 3px solid #FFD9B0; border-radius: 999px; padding: 6px 20px;
}
.timer.warn { color: #fff; background: var(--danger); border-color: #991B1B; animation: pulse 1s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(220,38,38,.18); } }

.classroom {
  display: flex; gap: 16px; align-items: stretch;
  background: linear-gradient(160deg, #FFF3DC, #FFE9C9);
  padding: 20px; min-height: 46vh;
  border-left: 3px solid var(--border); border-right: 3px solid var(--border);
}
.avatar-panel {
  flex: 1; border-radius: 20px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; position: relative;
  padding: 24px 20px; min-height: 340px;
  background: #FFFDF9; /* 近白：AI 生图白底+投影在其上无接缝 */
  border: 3px solid #FBE3BE;
  box-shadow: inset 0 3px 8px rgba(249,115,22,.06);
}

/* ---------- 学生形象（AI 生图 + 状态换图） ---------- */
.avatar { position: relative; width: 250px; max-width: 100%; }
.av-img {
  width: 100%; height: auto; display: block;
  mix-blend-mode: multiply; /* 白底融进面板底色 */
}

/* 状态：听讲（呼吸浮动） */
.avatar.listening .av-img { animation: breathe 3s ease-in-out infinite; }
@keyframes breathe { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

/* 状态：思考（问号气泡覆盖层） */
.av-think {
  display: none; position: absolute; top: 1%; right: 2%;
  min-width: 48px; height: 48px; padding: 0 8px;
  background: #fff; border: 3px solid #4A2B2B; border-radius: 999px;
  color: #EA580C; font-size: 26px; font-weight: 800;
  align-items: center; justify-content: center;
  box-shadow: 0 4px 0 rgba(74,43,43,.15);
}
.av-think::after {
  content: ""; position: absolute; bottom: -13px; right: 22px;
  border: 7px solid transparent; border-top: 12px solid #4A2B2B;
}
.avatar.thinking .av-think { display: flex; animation: thinkPop .35s cubic-bezier(.34,1.56,.64,1); }
@keyframes thinkPop { from { transform: scale(.4) translateY(8px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }

.avatar-state {
  margin-top: 14px; font-size: 14px; font-weight: 800; color: var(--primary-dark);
  background: #fff; border: 3px solid #FFD9B0; padding: 5px 20px; border-radius: 999px;
  box-shadow: 0 3px 0 #FFD9B0;
}
.avatar-speech {
  margin-top: 12px; max-width: 92%; background: #fff; border-radius: 16px;
  padding: 12px 16px; font-size: 15px; line-height: 1.6;
  border: 3px solid var(--border); text-align: center;
  animation: popIn .3s var(--ease-spring);
}
.avatar-speech::before { content: "学生说："; font-size: 12px; font-weight: 700; color: var(--muted); display: block; margin-bottom: 3px; }

.camera-box {
  width: 180px; border-radius: 20px; overflow: hidden; position: relative;
  display: flex; flex-direction: column; align-self: stretch; min-height: 340px;
  background: #2D1A0C; border: 3px solid #EA580C;
  box-shadow: 0 4px 0 #EA580C;
}
.camera-box video { flex: 1; width: 100%; object-fit: cover; }
.camera-box .cam-label {
  position: absolute; bottom: 10px; left: 10px; color: #fff; font-size: 12px;
  background: rgba(67,20,7,.65); padding: 3px 12px; border-radius: 999px;
}

/* 日志（气泡） */
.log-panel {
  background: #FFFDF6; border-left: 3px solid var(--border); border-right: 3px solid var(--border);
  padding: 10px 16px; max-height: 150px; overflow-y: auto; font-size: 13px;
}
.log-panel .log-line { padding: 4px 0; color: #6B4A35; line-height: 1.55; animation: viewIn .2s ease-out; }
.log-panel .log-line b { color: var(--primary-dark); }
.log-panel .log-line .t { color: #C4A48E; font-size: 11px; margin-right: 6px; font-variant-numeric: tabular-nums; }
.log-panel .log-silent { color: #C4A48E; }

/* 状态条 / 确认条 */
.stt-status {
  background: var(--accent-soft); border: 3px solid #FDE68A; border-top: none;
  padding: 8px 16px; font-size: 13px; color: #92400E; font-weight: 700;
  animation: viewIn .25s ease-out;
}
.confirm-bar {
  background: #FFFDF6; border: 3px solid #FDE68A; border-top: none;
  padding: 12px 16px 14px; animation: viewIn .25s ease-out;
}
.confirm-title { font-weight: 800; color: #92400E; margin-bottom: 8px; font-size: 13px; }
.confirm-bar textarea {
  width: 100%; min-height: 60px; max-height: 130px; border: 3px solid var(--border);
  border-radius: 12px; padding: 10px 12px; font-size: 14px; line-height: 1.6;
  font-family: inherit; resize: vertical; outline: none; color: var(--ink); background: #fff;
}
.confirm-bar textarea[readonly] { background: #FFFDF6; color: #6B4A35; }
.confirm-bar textarea:not([readonly]):focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(251,191,36,.15); }
.confirm-btns { display: flex; gap: 8px; margin-top: 10px; justify-content: flex-end; }
.confirm-btns .btn { padding: 8px 18px; font-size: 14px; }

/* 输入区 */
.input-bar {
  display: flex; gap: 10px; align-items: center;
  background: #fff; padding: 12px 14px; flex-wrap: wrap;
  border-left: 3px solid var(--border); border-right: 3px solid var(--border);
  border-bottom: 3px solid var(--border); border-radius: 0 0 20px 20px;
}
.input-bar textarea {
  flex: 1; resize: none; border: 3px solid var(--border); border-radius: 16px;
  padding: 11px 14px; font-size: 15px; font-family: inherit; outline: none;
  max-height: 120px; min-width: 130px; background: #FFFDF6; color: var(--ink);
}
.input-bar textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(249,115,22,.12); }
.btn-mic { background: var(--primary-soft); color: var(--primary-dark); border-color: #FFD9B0; box-shadow: 0 3px 0 #FFD9B0; white-space: nowrap; }
.btn-mic.recording { background: var(--danger); color: #fff; border-color: #991B1B; box-shadow: 0 3px 0 #991B1B; animation: pulse 1.2s infinite; }
.btn-call { background: var(--accent-soft); color: #92400E; border-color: #FDE68A; box-shadow: 0 3px 0 #FDE68A; white-space: nowrap; }
.btn-call:hover:not(:disabled) { transform: translateY(-2px); }

.evaluating { text-align: center; padding: 30px 0 14px; color: var(--muted); font-weight: 600; }
.spinner {
  width: 38px; height: 38px; margin: 0 auto 12px;
  border: 5px solid var(--primary-soft); border-top-color: var(--primary);
  border-radius: 50%; animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ 报告页 ============ */
.score-banner {
  display: flex; align-items: center; gap: 20px; padding: 18px 26px;
  background: linear-gradient(120deg, #FB923C, #F97316);
  border-radius: 20px; border: 3px solid #EA580C;
  box-shadow: 0 5px 0 #EA580C, 0 14px 28px rgba(249,115,22,.25);
  color: #fff; margin-bottom: 18px;
  animation: popIn .45s var(--ease-spring);
}
.sb-score { display: flex; flex-direction: column; align-items: center; }
.sb-score span { font-size: 40px; font-weight: 800; line-height: 1; }
.sb-score small { font-size: 12px; opacity: .9; margin-top: 4px; }
.sb-lesson { font-size: 18px; font-weight: 800; }

/* 教研员 */
.evaluator-box {
  display: flex; align-items: center; gap: 22px;
  background: #F1F6FA; border: 3px solid #D6E4F0; border-radius: 20px;
  padding: 18px 24px; margin-bottom: 18px;
  box-shadow: 0 4px 0 #D6E4F0;
  animation: popIn .45s var(--ease-spring);
}
.ev-avatar { width: 280px; flex-shrink: 0; }
.ev-img {
  width: 100%; height: auto; display: block;
  mix-blend-mode: multiply; /* 白底融进面板底色 */
}
.ev-avatar.speaking .ev-img { animation: breathe 1.1s ease-in-out infinite; }
.ev-title { font-size: 15px; font-weight: 800; color: #355173; margin-bottom: 8px; }

/* 教研员语音播放器 */
.ev-side { flex: 1; min-width: 0; }
.ev-player { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.ev-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.ev-progress { display: flex; align-items: center; gap: 10px; width: 100%; }
#ev-seek { flex: 1; min-width: 0; accent-color: #F26D50; cursor: pointer; }
.ev-time { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }

/* 底线否决横幅（不合格警示） */
.veto-banner {
  background: #FEF2F2; border: 2px solid #DC2626; border-radius: 16px;
  padding: 14px 20px; margin-bottom: 18px; color: #991B1B;
  animation: popIn .3s var(--ease-spring);
}
.veto-banner .veto-title { font-weight: 800; font-size: 18px; }
.veto-banner ul { margin: 8px 0 0; padding-left: 20px; font-size: 14px; line-height: 1.7; }
#sb-avg.veto { color: #DC2626; font-size: 1.1em; }

/* 雷达 + 分数 */
.report-body { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; justify-content: center; margin-bottom: 18px; }
.report-chart { width: 320px; max-width: 100%; }
.report-scores { text-align: left; min-width: 210px; }
.report-scores .dim {
  display: flex; justify-content: space-between; gap: 24px;
  padding: 8px 0; border-bottom: 2px dashed var(--border); font-size: 14px; font-weight: 600;
}
.report-scores .dim b { color: var(--primary-dark); font-size: 17px; }

/* 维度深入点评卡 */
.dim-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-bottom: 18px; }
.dim-card {
  background: #fff; border: 3px solid var(--border); border-radius: 16px;
  padding: 16px; box-shadow: 0 3px 0 var(--border);
  animation: popIn .4s var(--ease-spring);
}
.dim-card .dc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.dim-card .dc-name { font-weight: 800; font-size: 14px; }
.dim-card .dc-score {
  background: var(--primary-soft); color: var(--primary-dark); font-weight: 800;
  border-radius: 999px; padding: 2px 12px; border: 2px solid #FFD9B0;
}
.dim-card .dc-comment { font-size: 13px; line-height: 1.7; color: #6B4A35; margin-bottom: 8px; }
.dim-card .dc-fix { font-size: 12.5px; background: #FFFDF6; border: 2px dashed #F7C98F; border-radius: 10px; padding: 8px 10px; }
.dim-card .dc-fix b { color: #92400E; display: block; margin-bottom: 3px; font-size: 12px; }
.dim-card .dc-quote { color: #B45309; background: #FFF7E8; border-radius: 8px; padding: 6px 10px; font-size: 12.5px; margin-bottom: 6px; border-left: 3px solid var(--accent); }

.report-metrics { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 18px; }
.report-metrics .metric {
  background: #fff; border: 3px solid var(--border); border-radius: 999px;
  padding: 7px 16px; font-size: 13px; font-weight: 600; color: #6B4A35;
  box-shadow: 0 2px 0 var(--border);
}
.report-metrics .metric b { color: var(--primary-dark); font-size: 15px; }

.report-comment, .report-suggestions {
  background: #fff; border: 3px solid var(--border); border-radius: 16px;
  padding: 18px 20px; margin-bottom: 16px; text-align: left;
  box-shadow: 0 3px 0 var(--border);
}
.report-comment h3, .report-suggestions h3, .ts-head {
  font-size: 15px; font-weight: 800; color: var(--primary-dark); margin-bottom: 8px;
}
.report-comment p { line-height: 1.8; font-size: 14.5px; }
.report-suggestions ol { padding-left: 22px; line-height: 1.9; font-size: 14.5px; }
.report-suggestions li::marker { color: var(--primary); font-weight: 800; }

/* 课堂纪要 */
.transcript-box {
  background: #fff; border: 3px solid var(--border); border-radius: 16px;
  padding: 16px 20px; margin-bottom: 18px; text-align: left;
  box-shadow: 0 3px 0 var(--border);
}
.ts-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0; }
.ts-actions { display: flex; gap: 8px; }
.ts-body {
  margin-top: 12px; max-height: 320px; overflow-y: auto;
  background: #FFFDF6; border: 2px solid var(--border); border-radius: 12px;
  padding: 12px 14px; font-size: 13.5px; line-height: 1.8;
}
.ts-body .ts-line { padding: 3px 0; color: #6B4A35; }
.ts-body .ts-line b { color: var(--primary-dark); }
.ts-body .ts-line.student b { color: #0284C7; }
.ts-body .ts-line .ts-t { color: #C4A48E; font-size: 11px; margin-right: 6px; font-variant-numeric: tabular-nums; }
.ts-body .ts-line .ts-v { color: #92400E; font-size: 11px; margin-left: 4px; }

#btn-again { display: block; margin: 0 auto; }

.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
  background: #431407; color: #fff; padding: 12px 24px; border-radius: 999px;
  font-size: 14px; font-weight: 600; z-index: 99;
  box-shadow: 0 8px 24px rgba(67,20,7,.35); max-width: 90%;
  animation: viewIn .25s ease-out;
}
.toast.error { background: var(--danger); }

/* ---------- 备案页脚 ---------- */
.icp-foot {
  position: relative; z-index: 1; text-align: center;
  padding: 14px 0 18px; margin-top: 8px;
  font-size: 12px; color: var(--muted);
}
.icp-foot a { color: var(--muted); text-decoration: none; }
.icp-foot a:hover { color: var(--ink); text-decoration: underline; }

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .classroom { flex-direction: column-reverse; }
  .camera-box { width: 100%; min-height: 150px; max-height: 190px; }
  .report-body { flex-direction: column; }
  .brand-sub { display: none; }
  .score-banner { flex-direction: column; gap: 8px; text-align: center; }
  .evaluator-box { flex-wrap: wrap; justify-content: center; text-align: center; }
  .ev-avatar { width: 65%; max-width: 280px; }
}

/* ---------- 减少动态 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
