:root {
  --bg: #f5f6fb;
  --card: #ffffff;
  --ink: #1e2333;
  --muted: #7b8296;
  --line: #e7e9f2;
  --indigo: #4f46e5;
  --indigo-soft: #eef0ff;
  --cyan: #0891b2;
  --green: #10a37f;
  --orange: #f59e0b;
  --red: #ef4444;
  --shadow: 0 8px 30px rgba(36, 40, 80, 0.06);
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.app { max-width: 1400px; margin: 0 auto; padding: 28px 24px 40px; }

/* ---------- two-column layout ---------- */
.main-split { display: grid; grid-template-columns: minmax(400px, 1.2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.split-left, .split-right { min-width: 0; }
.split-left .card, .split-right .card { margin-bottom: 0; }
.split-right .card + .card { margin-top: 18px; }
@media (max-width: 1024px) {
  .main-split { grid-template-columns: 1fr; }
  .split-right .card + .card { margin-top: 0; }
  .split-right .card { margin-bottom: 18px; }
}

/* ---------- topbar ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 48px; height: 48px; border-radius: 14px;
  background: linear-gradient(145deg, #6366f1, #4338ca);
  color: #fff; font-size: 26px; font-weight: 700;
  display: grid; place-items: center;
  box-shadow: 0 8px 18px rgba(79, 70, 229, 0.28);
}
.brand h1 { margin: 0; font-size: 22px; letter-spacing: .5px; }
.brand-en { font-size: 12px; color: var(--muted); font-weight: 500; letter-spacing: 1px; margin-left: 4px; }
.brand p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.top-actions { display: flex; gap: 8px; }
.ghost-btn {
  background: #fff; border: 1px solid var(--line); color: #52596c;
  padding: 8px 14px; border-radius: 9px; font-size: 13px;
  transition: .18s;
}
.ghost-btn:hover { border-color: #c7c9e6; color: var(--indigo); background: #fafaff; }

/* ---------- cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px 24px; margin-bottom: 18px;
}
.step-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.step-num {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 8px;
  background: var(--indigo-soft); color: var(--indigo);
  display: grid; place-items: center; font-weight: 700; font-size: 13px; margin-top: 2px;
}
.step-head h2 { margin: 0; font-size: 16.5px; }
.step-head p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }

/* ---------- score upload ---------- */
.score-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.dropzone {
  border: 1.5px dashed #cbd0e6; border-radius: 13px; background: #fbfbff;
  min-height: 148px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; text-align: center; color: var(--muted); transition: .2s; outline: none;
}
.dropzone:hover, .dropzone.dragover, .dropzone:focus-visible {
  border-color: var(--indigo); background: var(--indigo-soft); color: var(--indigo);
}
.drop-icon { font-size: 30px; color: var(--indigo); line-height: 1; margin-bottom: 4px; }
.dropzone strong { color: var(--ink); font-size: 14px; }
.dropzone span { font-size: 12px; }
.score-info {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border-top: 1px solid var(--line); margin-top: 16px; padding-top: 14px; flex-wrap: wrap;
}
.score-info-main { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { background: #f3f4f8; color: #5b6172; border-radius: 20px; padding: 4px 11px; font-size: 12px; }
.pill-blue { background: var(--indigo-soft); color: var(--indigo); font-weight: 600; }

/* ---------- sheet music ---------- */
.sheet-section { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 14px; }
.sheet-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.sheet-head b { font-size: 13.5px; }
.sheet-head span { color: var(--muted); font-size: 11.5px; }
.sheet-scroll {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  max-height: 460px; overflow: auto; padding: 12px 8px;
  box-shadow: inset 0 1px 3px rgba(20,24,50,.03);
}
.sheet-scroll svg { display: block; max-width: none; }
.sheet-loading { color: #a0a6b7; font-size: 12.5px; padding: 26px; text-align: center; }
.sheet-error { color: #b91c1c; font-size: 12.5px; padding: 20px; text-align: center; }

/* ---------- toolbar ---------- */
.inline-field, .checkbox-field {
  display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px;
}
.inline-field b { color: var(--ink); min-width: 38px; font-size: 12px; }
.inline-field input[type="range"] { width: 96px; accent-color: var(--indigo); }
.checkbox-field input { accent-color: var(--indigo); }
.toolbar { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .primary-btn { margin-left: auto; }
.primary-btn {
  border: none; border-radius: 10px; padding: 10px 20px; font-weight: 600; font-size: 13.5px;
  color: #fff; background: linear-gradient(135deg, #5b54f0, #4338ca);
  box-shadow: 0 6px 16px rgba(79, 70, 229, .25); transition: .18s;
}
.primary-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 9px 22px rgba(79, 70, 229, .32); }
.primary-btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.primary-btn.recording { background: linear-gradient(135deg, #f87171, #dc2626); box-shadow: 0 6px 16px rgba(239,68,68,.25); }
.soft-btn {
  border: 1px solid var(--line); background: #fff; color: #4a5063;
  padding: 9px 16px; border-radius: 10px; font-size: 13px; transition: .18s;
}
.soft-btn:hover:not(:disabled) { border-color: #a5a8ef; color: var(--indigo); background: #fafaff; }
.soft-btn:disabled { opacity: .45; cursor: not-allowed; }
.soft-btn.active { border-color: var(--indigo); color: var(--indigo); background: #eef0ff; }

/* ---------- beat indicator ---------- */
.beat-bar {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, #fbfbff, #f5f7ff);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 6px 12px; margin-bottom: 12px;
  transition: border-color .2s, box-shadow .2s;
}
.beat-bar.live { border-color: #c7c9e6; box-shadow: 0 0 0 2px rgba(79,70,229,.05); }
.beat-bar-label { display: flex; flex-direction: column; min-width: 62px; line-height: 1.25; }
.beat-bar-label b { font-size: 11.5px; color: var(--ink); }
.beat-bar-label span { font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.beat-bar.live .beat-bar-label span { color: var(--indigo); }
.beat-dots { flex: 1; display: flex; align-items: center; justify-content: center; gap: 13px; min-height: 24px; }
.beat-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #dfe2ee;
  transition: transform .09s ease-out, background .09s ease-out, box-shadow .09s ease-out;
}
.beat-dot.strong-pos { background: #f4d9a8; }
.beat-dot.current {
  background: var(--indigo);
  transform: scale(1.55);
  box-shadow: 0 0 0 4px rgba(79,70,229,.14), 0 0 12px rgba(79,70,229,.5);
}
.beat-dot.current.strong-pos {
  background: var(--orange);
  box-shadow: 0 0 0 4px rgba(245,158,11,.18), 0 0 12px rgba(245,158,11,.6);
}
@keyframes beat-pop { from { transform: scale(1.95); } to { transform: scale(1.55); } }
.beat-dot.pulse { animation: beat-pop .16s ease-out; }
.beat-bar-meta { color: var(--muted); font-size: 10.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- live ---------- */
.live-row { display: grid; grid-template-columns: 1fr 1fr 1.5fr; gap: 12px; margin-bottom: 18px; }
.live-card {
  background: #fafbfe; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 16px; min-height: 92px;
}
.live-label { color: var(--muted); font-size: 11.5px; letter-spacing: .3px; }
.live-note { font-size: 27px; font-weight: 700; line-height: 1.35; color: #3f45a8; font-variant-numeric: tabular-nums; }
.live-note.accent { color: var(--cyan); }
.live-sub { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.gauge-card { padding-top: 14px; }
.gauge { margin: 12px 0 6px; }
.gauge-track {
  position: relative; height: 9px; border-radius: 6px;
  background: linear-gradient(90deg, #fca5a5 0%, #fed7aa 22%, #d1fae5 45%, #d1fae5 55%, #fed7aa 78%, #fca5a5 100%);
}
.gauge-zone { position: absolute; left: 46%; width: 8%; top: -3px; bottom: -3px; border: 2px solid var(--green); border-radius: 4px; }
.gauge-needle {
  position: absolute; left: 50%; top: -6px; width: 3px; height: 21px;
  background: #1e2333; border-radius: 3px; transform: translateX(-50%);
  box-shadow: 0 1px 4px rgba(0,0,0,.25); transition: left .08s linear;
}
.gauge-scale { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; margin-top: 5px; }

/* ---------- chart ---------- */
.chart-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; flex-wrap: wrap; }
.chart-head b { font-size: 13.5px; }
.chart-head span { color: var(--muted); font-size: 11.5px; margin-left: 8px; }
.legend { display: flex; gap: 14px; color: var(--muted); font-size: 11px; align-items: center; }
.legend > span { display: inline-flex; align-items: center; gap: 5px; }
.dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.dot-blue { background: #a5b4fc; }
.dot-green { background: var(--green); }
.dot-orange { background: var(--orange); }
.line { width: 15px; height: 2px; display: inline-block; }
.line-red { background: var(--red); }

.chart-wrap {
  position: relative; height: 330px; border: 1px solid var(--line);
  border-radius: 12px; background: linear-gradient(180deg, #fdfdff, #f9faff); overflow: hidden;
}
#pitchChart { width: 100%; height: 100%; display: block; }
.chart-empty {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: #a2a8ba; font-size: 13px; pointer-events: none;
}
.chart-tooltip {
  position: absolute; z-index: 5; pointer-events: none;
  background: rgba(30,35,51,.92); color: #fff; border-radius: 8px;
  padding: 7px 10px; font-size: 11.5px; line-height: 1.55; white-space: nowrap;
  box-shadow: 0 5px 16px rgba(0,0,0,.18);
}
.countdown {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(255,255,255,.62); backdrop-filter: blur(2px);
  font-size: 78px; font-weight: 800; color: var(--indigo); text-shadow: 0 6px 24px rgba(79,70,229,.2);
}
.note-strip { display: flex; gap: 2px; flex-wrap: wrap; margin-top: 10px; min-height: 24px; }
.note-cell {
  min-width: 22px; height: 22px; padding: 0 4px; border-radius: 5px;
  background: #f0f1fa; color: #8b90a3; font-size: 9.5px;
  display: grid; place-items: center; border: 1px solid transparent; cursor: default;
}
.note-cell.sung { color: #fff; }
.note-cell.hover { outline: 2px solid var(--ink); outline-offset: 1px; }

/* ---------- result ---------- */
.result-top { display: grid; grid-template-columns: 200px minmax(180px, 1fr) minmax(320px, 1.5fr); gap: 22px; align-items: stretch; }
.score-panel { text-align: center; border-right: 1px solid var(--line); padding-right: 18px; }
.score-ring { position: relative; width: 160px; height: 160px; margin: 0 auto; }
.score-ring svg { transform: rotate(-90deg); }
.score-ring circle { fill: none; stroke-width: 12; }
.ring-bg { stroke: #eef0f7; }
.ring-fg {
  stroke: var(--indigo); stroke-linecap: round;
  stroke-dasharray: 414.7; stroke-dashoffset: 414.7;
  transition: stroke-dashoffset 1s cubic-bezier(.2,.8,.2,1);
}
.score-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.score-center b { font-size: 46px; line-height: 1; font-variant-numeric: tabular-nums; }
.score-center span { color: var(--muted); font-size: 11.5px; margin-top: 5px; }
.grade { margin-top: 10px; font-size: 15px; font-weight: 700; color: var(--indigo); }

.metrics { display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.metric-row { display: grid; grid-template-columns: 62px 1fr 40px; align-items: center; gap: 10px; }
.metric-name { font-size: 12.5px; color: #4c5264; }
.metric-bar { height: 8px; background: #f0f1f7; border-radius: 5px; overflow: hidden; }
.metric-fill { height: 100%; width: 0; border-radius: 5px; transition: width .9s cubic-bezier(.2,.8,.2,1); }
.metric-val { font-size: 12.5px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

.ai-panel { background: #f8f8ff; border: 1px solid #e6e6ff; border-radius: 13px; padding: 14px 16px; }
.ai-panel-head { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; }
.ai-panel-head b { font-size: 13.5px; }
.ai-icon { color: var(--indigo); font-size: 16px; }
.ai-tag { margin-left: auto; font-size: 10px; color: var(--indigo); background: #e9e9ff; padding: 2px 7px; border-radius: 10px; }
.ai-summary { font-size: 13px; line-height: 1.85; color: #3f4557; margin-bottom: 8px; }
.ai-panel:has(.ai-list:empty) .ai-summary { margin-bottom: 0; }
.ai-list { display: flex; flex-direction: column; gap: 8px; }
.ai-item { display: flex; gap: 9px; font-size: 12px; }
.ai-item .ai-bullet { flex: 0 0 auto; width: 19px; height: 19px; border-radius: 6px; display: grid; place-items: center; font-size: 10px; font-weight: 700; color: #fff; background: var(--indigo); }
.ai-item.warn .ai-bullet { background: var(--orange); }
.ai-item.good .ai-bullet { background: var(--green); }
.ai-item b { display: block; font-size: 12px; }
.ai-item span { color: #666c7e; }
.ai-enhance { margin-top: 11px; width: 100%; font-size: 11.5px; padding: 7px; }
.ai-deep { margin-top: 10px; padding: 10px 12px; border-radius: 9px; background: #fff; border: 1px solid var(--line); font-size: 12px; white-space: pre-wrap; color: #4b5064; }
.result-actions { display: flex; gap: 10px; margin-top: 16px; }

footer { text-align: center; color: #a0a5b5; font-size: 11.5px; padding: 8px 0 0; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 12px);
  background: rgba(30,35,51,.94); color: #fff; padding: 10px 18px; border-radius: 10px;
  font-size: 13px; z-index: 100; opacity: 0; transition: .25s; pointer-events: none;
  box-shadow: 0 10px 30px rgba(0,0,0,.18); max-width: 88vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #b91c1c; }

/* ---------- dialogs ---------- */
.modal { border: none; border-radius: 16px; padding: 0; width: min(560px, 92vw); box-shadow: 0 24px 70px rgba(20,24,50,.22); color: var(--ink); }
.modal::backdrop { background: rgba(24,28,48,.42); backdrop-filter: blur(2px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 16px; }
.close-btn { border: none; background: #f3f4f8; color: #777d8e; width: 28px; height: 28px; border-radius: 8px; font-size: 18px; line-height: 1; }
.modal-body { padding: 18px 20px 22px; }
.guide-list { margin: 0; padding-left: 20px; }
.guide-list li { margin-bottom: 12px; font-size: 13px; color: #4e5466; }
.guide-list b { color: var(--ink); }
.tip-box { background: var(--indigo-soft); color: #4a4899; border-radius: 10px; padding: 11px 13px; font-size: 12px; margin-top: 14px; }
.settings-note { color: var(--muted); font-size: 12.5px; margin-top: 0; }
.field { display: block; font-size: 12.5px; color: #4e5466; margin-bottom: 12px; }

/* ---------- 学生个人中心 ---------- */
.stats-modal { width: min(720px, 94vw); max-height: 88vh; overflow-y: auto; }
.stats-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 20px; }
.stat-tile { background: linear-gradient(135deg, #f8f9ff, #f1f3ff); border: 1px solid var(--line); border-radius: 12px; padding: 12px 10px; text-align: center; }
.stat-tile b { display: block; font-size: 22px; line-height: 1.2; color: var(--indigo); font-variant-numeric: tabular-nums; }
.stat-tile span { font-size: 11.5px; color: var(--muted); }
.stat-tile.hl b { color: var(--green); }
.stat-tile.empty b { color: var(--muted); }
.stats-section-title { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.stats-section-title b { font-size: 14px; }
.stats-section-title span { font-size: 11.5px; color: var(--muted); }
.stats-chart-box { background: #fbfbff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 14px 8px; margin-bottom: 18px; }
.stats-chart svg { width: 100%; height: 170px; display: block; }
.stats-chart .grid-line { stroke: #e7e9f2; stroke-width: 1; }
.stats-chart .grid-text { fill: #a0a6b7; font-size: 10px; }
.stats-chart .trend-line { fill: none; stroke: var(--indigo); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.stats-chart .trend-area { fill: url(#statsGrad); }
.stats-chart .trend-dot { fill: #fff; stroke: var(--indigo); stroke-width: 2; cursor: pointer; }
.stats-chart .trend-dot:hover { fill: var(--indigo); }
.stats-chart .x-label { fill: #a0a6b7; font-size: 9.5px; }
.stats-chart .chart-empty { fill: var(--muted); font-size: 12px; }
.stats-history { max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; }
.history-row { display: flex; align-items: center; gap: 12px; padding: 10px 13px; border-bottom: 1px solid var(--line); }
.history-row:last-child { border-bottom: none; }
.history-rank { width: 26px; height: 26px; flex: 0 0 26px; border-radius: 8px; background: var(--indigo-soft); color: var(--indigo); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.history-main { flex: 1; min-width: 0; }
.history-main b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-main span { font-size: 11px; color: var(--muted); }
.history-score { font-size: 19px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.history-score.good { color: var(--green); }
.history-score.mid { color: var(--orange); }
.history-score.low { color: var(--red); }
.history-empty { padding: 24px; text-align: center; color: var(--muted); font-size: 12.5px; }
@media (max-width: 620px) { .stats-summary { grid-template-columns: repeat(2, 1fr); } }
.field input { display: block; width: 100%; margin-top: 5px; border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; background: #fff; color: var(--ink); outline: none; }
.field input:focus { border-color: var(--indigo); }
.field textarea { display: block; width: 100%; margin-top: 5px; border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; background: #fff; color: var(--ink); outline: none; font: inherit; line-height: 1.5; resize: vertical; min-height: 64px; }
.field textarea:focus { border-color: var(--indigo); }

/* ---------- auth ---------- */
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 30px 16px; background: radial-gradient(circle at top left, #eef0ff, #f5f6fb 55%); }
.auth-card { width: 100%; max-width: 430px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 18px 50px rgba(36,40,80,.10); padding: 28px 30px 22px; text-align: center; }
.auth-mark { width: 52px; height: 52px; border-radius: 15px; background: linear-gradient(145deg, #6366f1, #4338ca); color: #fff; font-size: 28px; display: grid; place-items: center; margin: 0 auto 10px; box-shadow: 0 8px 18px rgba(79,70,229,.28); }
.auth-card h1 { margin: 0; font-size: 20px; }
.auth-sub { color: var(--muted); font-size: 12.5px; margin: 4px 0 18px; }
.auth-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.auth-tabs button { border: none; background: none; padding: 9px 2px; font-size: 12px; color: var(--muted); border-bottom: 2px solid transparent; }
.auth-tabs button.active { color: var(--indigo); border-bottom-color: var(--indigo); font-weight: 600; }
.auth-form .field { text-align: left; }
.auth-hint { text-align: left; color: var(--muted); font-size: 11px; line-height: 1.5; margin: -4px 0 12px; }
.auth-form .field select { display: block; width: 100%; margin-top: 5px; border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; background: #fff; color: var(--ink); }
.auth-send, .auth-submit { width: 100%; margin-bottom: 12px; }
.auth-submit { margin-top: 2px; }
.auth-msg { background: var(--indigo-soft); color: #4a4899; border-radius: 9px; padding: 9px 12px; font-size: 12px; margin-bottom: 14px; text-align: left; }
.auth-msg.error { background: #fee2e2; color: #b91c1c; }
.sheet-bad { color: #ef4444; font-style: normal; }
.demo-accounts { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); text-align: left; }
.demo-accounts-title { color: var(--muted); font-size: 11.5px; margin-bottom: 9px; }
.demo-accounts-title b { color: var(--indigo); font-variant-numeric: tabular-nums; }
.demo-account {
  width: 100%; display: flex; align-items: center; gap: 9px;
  background: #f7f8fc; border: 1px solid var(--line); border-radius: 9px;
  padding: 8px 10px; margin-bottom: 7px; cursor: pointer;
  font-size: 12px; color: var(--ink); font-variant-numeric: tabular-nums;
  transition: border-color .15s, background .15s;
}
.demo-account:hover { border-color: var(--indigo); background: #eef0ff; }
.demo-role {
  flex: none; font-size: 11px; color: #fff; background: var(--indigo);
  border-radius: 5px; padding: 2px 7px;
}
.demo-account[data-role="学生"] .demo-role { background: var(--orange, #f59e0b); }
.auth-foot { color: #a0a6b7; font-size: 11px; margin: 14px 0 0; }

/* ---------- 用户条 / 老师布置 ---------- */
.user-chip { font-size: 12px; color: var(--muted); background: #f3f4f8; border-radius: 16px; padding: 5px 11px; }
.assignment-card { margin-bottom: 18px; }
.assignment-list { display: flex; flex-wrap: wrap; gap: 10px; }
.assignment-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; background: #fafbff; cursor: pointer; transition: .18s; }
.assignment-item:hover { border-color: var(--indigo); background: var(--indigo-soft); }
.assignment-item b { display: block; font-size: 13px; }
.assignment-item span { font-size: 11px; color: var(--muted); }

/* ---------- 学生四板块 ---------- */
.student-tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.student-tab { border: 1px solid var(--line); background: #fff; color: var(--muted); border-radius: 10px; padding: 9px 16px; font-size: 13px; font-weight: 600; transition: .18s; }
.student-tab:hover { border-color: #c7c9e6; color: var(--indigo); }
.student-tab.active { background: var(--indigo); border-color: var(--indigo); color: #fff; box-shadow: 0 4px 14px rgba(79,70,229,.22); }
.task-panel { margin-bottom: 18px; }
.task-item { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; background: #fafbff; }
.task-item.exam { background: #fffaf3; border-color: #f6dfb8; }
.task-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.task-top b { font-size: 14px; }
.task-badge { font-size: 10.5px; padding: 2px 9px; border-radius: 10px; background: var(--indigo-soft); color: var(--indigo); white-space: nowrap; }
.task-badge.exam { background: #fff0d8; color: #b26a00; }
.task-badge.expired { background: #f3f4f8; color: var(--muted); }
.task-meta { font-size: 11.5px; color: var(--muted); margin: 6px 0 10px; }
.task-meta .urgent { color: var(--red); font-weight: 600; }
.task-note { font-size: 12px; line-height: 1.6; color: var(--ink); background: #f0f2ff; border-left: 3px solid var(--indigo); border-radius: 6px; padding: 7px 10px; margin: 0 0 10px; white-space: pre-wrap; word-break: break-word; }
.task-note b { color: var(--indigo); }
.task-item.exam .task-note { background: #fff2e2; border-left-color: #e39a3c; }
.task-item.exam .task-note b { color: #b26a00; }
.task-actions { display: flex; gap: 8px; }
.mini-btn { border: 1px solid var(--indigo); background: var(--indigo); color: #fff; border-radius: 8px; padding: 6px 14px; font-size: 12px; }
.mini-btn:disabled { border-color: var(--line); background: #f3f4f8; color: var(--muted); cursor: not-allowed; }
.task-banner { background: linear-gradient(135deg, #eef0ff, #e8f4ff); border: 1px solid #cfd5f5; border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; font-size: 13px; display: flex; align-items: center; justify-content: space-between; }
.task-banner b { color: var(--indigo); }
.task-banner-main { min-width: 0; }
.banner-note { margin-top: 5px; font-size: 11.5px; line-height: 1.5; color: var(--muted); white-space: pre-wrap; word-break: break-word; }
.proctor-panel { display: flex; align-items: center; gap: 14px; border: 1px solid #f3c9c9; background: #fff6f6; border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; }
.proctor-view { position: relative; flex: 0 0 auto; }
.proctor-view video { width: 132px; height: 96px; object-fit: cover; border-radius: 8px; background: #222; transform: scaleX(-1); }
.proctor-badge { position: absolute; left: 5px; top: 5px; background: #dc2626; color: #fff; font-size: 10px; padding: 2px 7px; border-radius: 8px; }
.proctor-info { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.proctor-info b { color: #b91c1c; }
.proctor-info span { color: var(--muted); line-height: 1.5; }
.proctor-open { font-size: 11px; padding: 4px 9px; }
.no-video { color: var(--muted); font-size: 11px; }
.done-item { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; background: #fafbff; }
.done-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.done-top b { font-size: 14px; }
.done-score { font-size: 20px; font-weight: 700; }
.done-score.good { color: var(--green); }
.done-score.mid { color: var(--orange); }
.done-score.low { color: var(--red); }
.done-lower { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.done-lower audio { height: 34px; max-width: 320px; flex: 1; min-width: 220px; }
.done-meta { font-size: 11.5px; color: var(--muted); }
.no-audio { font-size: 11.5px; color: var(--muted); font-style: italic; }
.empty-hint { padding: 18px; text-align: center; color: var(--muted); font-size: 12.5px; }

/* ---------- 老师端 ---------- */
.teacher-card { min-height: 60vh; }
.teacher-head h2 { margin: 0; font-size: 18px; }
.teacher-head p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 18px 0; }
.stat-card { background: #fafbff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; text-align: center; }
.stat-card b { display: block; font-size: 24px; color: var(--indigo); }
.stat-card span { font-size: 11.5px; color: var(--muted); }
.teacher-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.teacher-tab { border: none; background: none; padding: 10px 14px; font-size: 13px; color: var(--muted); border-bottom: 2px solid transparent; }
.teacher-tab.active { color: var(--indigo); border-bottom-color: var(--indigo); font-weight: 600; }
.teacher-note { background: var(--indigo-soft); color: #4a4899; border-radius: 9px; padding: 9px 12px; font-size: 12px; margin-bottom: 14px; }
.teacher-note.error { background: #fee2e2; color: #b91c1c; }
.panel-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.panel-bar select, .text-input { border: 1px solid var(--line); border-radius: 9px; padding: 8px 11px; font-size: 12.5px; background: #fff; color: var(--ink); }
.text-input { flex: 1; min-width: 180px; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 680px; }
.data-table th, .data-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.data-table th { background: #fafbff; color: var(--muted); font-weight: 600; white-space: nowrap; }
.data-table tr:last-child td { border-bottom: none; }
.data-table b.good { color: var(--green); }
.data-table b.mid { color: var(--orange); }
.data-table b.bad { color: var(--red); }
.empty-cell { color: #a0a6b7; text-align: center; padding: 26px !important; }
.manage-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.manage-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; background: #fafbff; }
.manage-main b { font-size: 13px; }
.manage-main span { display: block; font-size: 11px; color: var(--muted); }
.manage-actions { display: flex; gap: 6px; }
.mini-btn { border: 1px solid var(--line); background: #fff; border-radius: 7px; padding: 5px 10px; font-size: 11.5px; color: #4a5063; }
.mini-btn:hover { border-color: var(--indigo); color: var(--indigo); }
.mini-btn.danger:hover { border-color: var(--red); color: var(--red); }
.manage-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; max-width: 760px; }
.manage-form .field { margin-bottom: 10px; }
.manage-form .primary-btn { grid-column: 1 / -1; justify-self: start; margin-top: 4px; }
.manage-form.inline { grid-template-columns: 1fr auto; align-items: end; }
.manage-form.inline .primary-btn { grid-column: auto; }
.manage-form .field select { display: block; width: 100%; margin-top: 5px; border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; background: #fff; color: var(--ink); }
.file-label { display: inline-flex; align-items: center; cursor: pointer; }
.muted-note { color: var(--muted); font-size: 12px; margin: 4px 0 8px; }
.save-hint { font-size: 11.5px; color: var(--green); margin-bottom: 10px; }

/* 考试分批配置 */
.assign-extra { grid-column: 1 / -1; }
.batch-config { grid-column: 1 / -1; border: 1px dashed #c7d0e0; border-radius: 10px; padding: 12px 14px; margin: 8px 0 12px; background: #f7f9ff; }
.batch-config-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.batch-config-head b { font-size: 13px; color: var(--ink); }
.batch-row { position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) auto; gap: 8px; align-items: end; border-top: 1px solid #e3e8f2; padding-top: 10px; margin-top: 8px; }
.batch-row .field { margin-bottom: 0; min-width: 0; }
.batch-row .field input { display: block; width: 100%; box-sizing: border-box; margin-top: 4px; border: 1px solid var(--line); border-radius: 8px; padding: 7px 8px; font-size: 12px; background: #fff; color: var(--ink); }
.batch-del { background: none; border: none; color: #e05252; font-size: 20px; line-height: 1; cursor: pointer; padding: 0 4px 8px; }
.batch-del:hover { color: #c62828; }
.student-no-block { margin-top: 18px; border-top: 1px dashed var(--line); padding-top: 14px; }
.student-no-block .batch-config-head { margin-bottom: 10px; }
.student-no-row .manage-actions { display: flex; align-items: center; gap: 8px; }
.student-no-row .inline-field { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.student-no-row .inline-field input { width: 110px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font-size: 12px; }
.no-saved { color: var(--green); font-size: 13px; min-width: 14px; }
.batch-coverage { margin-top: 10px; padding: 9px 12px; border-radius: 8px; background: #eef3ff; font-size: 12px; line-height: 1.8; color: var(--ink); }
.cov-warn { color: #c2410c; }
.cov-ok { color: var(--green); }

@media (max-width: 960px) {
  .score-grid, .result-top { grid-template-columns: 1fr; }
  .live-row { grid-template-columns: 1fr 1fr; }
  .gauge-card { grid-column: 1 / -1; }
  .score-panel { border-right: none; border-bottom: 1px solid var(--line); padding: 0 0 16px; }
}
@media (max-width: 640px) {
  .app { padding: 18px 12px 30px; }
  .card { padding: 17px 15px; }
  .topbar { flex-direction: column; align-items: flex-start; }
  .live-row { grid-template-columns: 1fr; }
  .chart-wrap { height: 280px; }
  .toolbar { gap: 12px; }
}
