/* 主观题批阅系统 — 移动端优先样式 */
:root {
  --primary: #C41E3A;
  --primary-light: #FDE8EC;
  --primary-dark: #9B1A2E;
  --success: #2E7D32;
  --success-light: #E8F5E9;
  --warning: #F59E0B;
  --warning-light: #FFFBEB;
  --error: #D32F2F;
  --error-light: #FFEBEE;
  --info: #1A73E8;
  --info-light: #E8F0FE;
  --bg: #F5F3EE;
  --bg-warm: #FDFAF5;
  --card: #FFF;
  --text: #2C2416;
  --text2: #6B5E4E;
  --border: #D9D0C1;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 24px rgba(44,36,22,.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; touch-action: manipulation; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}

/* ====== 顶部导航 ====== */
.app-header {
  background: linear-gradient(135deg, #8B1A2B, #5C1A1A, #3D2B1A);
  color: #FAF6ED;
  text-align: center;
  padding: 20px 0 14px;
  box-shadow: 0 4px 24px rgba(44,36,22,.15);
}
.app-header h1 { font-size: 1.3rem; letter-spacing: 2px; font-weight: 700; }
.app-header .sub { font-size: 0.75rem; opacity: .7; letter-spacing: 3px; margin-top: 2px; }
.app-header .user-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 16px 0; font-size: 0.8rem; opacity: .85;
}
.app-header .user-bar a { color: #FAF6ED; text-decoration: none; }

/* ====== 容器 ====== */
.container { max-width: 720px; margin: 0 auto; padding: 16px 12px 60px; }

/* ====== 卡片 ====== */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.card-hd {
  font-size: 1.05rem; font-weight: 700; margin-bottom: 14px;
  padding-bottom: 10px; border-bottom: 2px solid var(--primary-light);
  color: var(--primary);
  display: flex; justify-content: space-between; align-items: center;
}
.card-sub { font-size: 0.85rem; color: var(--text2); margin-bottom: 16px; }

/* 截止时间提示 */
.deadline-active { background: #E8F5E9; color: #2E7D32; border: 1px solid #A5D6A7; }
.deadline-expired { background: #FFEBEE; color: #C62828; border: 1px solid #EF9A9A; }

/* ====== 表单 ====== */
.form-grp { margin-bottom: 14px; }
.form-grp label { display: block; font-size: 0.9rem; font-weight: 600; color: var(--text2); margin-bottom: 5px; }
.form-inp, .form-sel {
  width: 100%; padding: 11px 14px; border: 2px solid var(--border);
  border-radius: var(--radius-sm); font-size: 0.95rem; font-family: inherit;
  background: var(--bg-warm); color: var(--text); outline: none;
  transition: border-color 0.2s; -webkit-appearance: none;
}
.form-inp:focus, .form-sel:focus { border-color: var(--primary); background: var(--card); }
.form-ta {
  width: 100%; padding: 11px 14px; border: 2px solid var(--border);
  border-radius: var(--radius-sm); font-size: 0.95rem; font-family: inherit;
  background: var(--bg-warm); color: var(--text); outline: none; resize: vertical;
  min-height: 80px; line-height: 1.6; transition: border-color 0.2s;
}
.form-ta:focus { border-color: var(--primary); background: var(--card); }
.form-hint { font-size: 0.75rem; color: var(--text2); margin-top: 4px; }

/* ====== 按钮 ====== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 24px; border: none; border-radius: var(--radius-sm);
  font-size: 1rem; font-weight: 600; font-family: inherit; cursor: pointer;
  transition: all 0.2s; line-height: 1.4;
}
.btn-pri { background: var(--primary); color: #fff; width: 100%; padding: 14px; }
.btn-pri:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
.btn-pri:disabled { background: #C4B9AD; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-out { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-out:hover { background: var(--primary-light); }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-danger { background: var(--error); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.btn-row .btn { flex: 1; min-width: 0; }

/* ====== 选择列表（班级/学生） ====== */
.sel-list { display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow-y: auto; }
.sel-item {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border: 2px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; transition: all 0.2s; background: var(--card);
  font-size: 0.95rem; user-select: none;
}
.sel-item:hover { border-color: var(--primary-light); background: #FEFCFA; }
.sel-item.selected { border-color: var(--primary); background: var(--primary-light); font-weight: 600; }
.sel-badge {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid var(--border); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; color: transparent; transition: all 0.2s;
}
.sel-item.selected .sel-badge { background: var(--primary); border-color: var(--primary); color: #fff; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--text2); }
.empty-state .icon { font-size: 3rem; margin-bottom: 12px; }

/* ====== 题目卡片 ====== */
.q-card {
  background: var(--bg-warm); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px; margin-bottom: 12px;
}
.q-card .q-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.q-num {
  font-size: 0.8rem; color: var(--primary); font-weight: 700;
  background: var(--primary-light); padding: 3px 10px; border-radius: 12px;
}
.q-type-tag {
  font-size: 0.7rem; padding: 3px 8px; border-radius: 10px; font-weight: 600;
}
.q-type-choice { background: #E8F0FE; color: #1A73E8; }
.q-type-subjective { background: #FEF3C7; color: #92400E; }
.q-stem { font-size: 0.95rem; font-weight: 500; line-height: 1.7; margin: 8px 0; }
.q-score { font-size: 0.85rem; color: var(--text2); text-align: right; }
.q-score-tag {
  font-size: 0.8rem; font-weight: 700; color: var(--primary);
  background: var(--primary-light); padding: 2px 8px; border-radius: 10px;
  white-space: nowrap;
}
.q-answer-info { font-size: 0.85rem; color: var(--text2); margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); }

/* 选择题选项 */
.q-options {
  font-size: 0.9rem; line-height: 1.8; margin: 8px 0;
  padding: 10px 14px; background: var(--bg); border-radius: 8px;
  border: 1px solid var(--border);
}

/* 主观题 — 材料 */
.q-material {
  font-size: 0.9rem; line-height: 1.7; margin: 10px 0;
  padding: 10px 14px; background: #FFFBF0; border-left: 3px solid #F59E0B;
  border-radius: 0 8px 8px 0; color: #78350F;
}
.q-material-block { margin-bottom: 12px; }
.q-material-block:last-child { margin-bottom: 0; }

/* 主观题 — 小问列表 */
.q-sub-list { margin-top: 10px; }
.q-sub-item {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px 0; border-bottom: 1px solid #F0EDE4;
}
.q-sub-item:last-child { border-bottom: none; }
.q-sub-num {
  font-weight: 700; color: var(--primary); font-size: 0.9rem;
  white-space: nowrap; min-width: 28px;
}
.q-sub-text { flex: 1; font-size: 0.92rem; line-height: 1.6; color: var(--text); }
.q-sub-score {
  font-size: 0.78rem; color: var(--primary); font-weight: 600;
  white-space: nowrap; background: var(--primary-light);
  padding: 2px 8px; border-radius: 10px;
}

/* 主观题卡片 */
.q-card-subjective { border-left: 3px solid var(--primary); }

/* ====== 上传区域 ====== */
.upload-zone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 32px 20px; text-align: center; cursor: pointer;
  transition: all 0.2s; background: var(--bg-warm);
}
.upload-zone:hover { border-color: var(--primary); background: var(--primary-light); }
.upload-zone .icon { font-size: 3rem; margin-bottom: 8px; }
.upload-zone .text { font-size: 0.9rem; color: var(--text2); }
.upload-zone.has-image { border-style: solid; border-color: var(--success); background: var(--success-light); }
.preview-img { max-width: 100%; border-radius: var(--radius-sm); margin-top: 12px; box-shadow: var(--shadow); }

/* ====== 进度步骤 ====== */
.progress-steps { display: flex; justify-content: space-between; margin: 20px 0; position: relative; }
.progress-steps::before {
  content: ''; position: absolute; top: 18px; left: 12%; right: 12%; height: 3px;
  background: var(--border); z-index: 0;
}
.step {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  position: relative; z-index: 1; flex: 1;
}
.step-dot {
  width: 36px; height: 36px; border-radius: 50%; background: var(--card);
  border: 3px solid var(--border); display: flex; align-items: center;
  justify-content: center; font-size: 1rem; transition: all 0.3s;
}
.step.done .step-dot { border-color: var(--success); background: var(--success); color: #fff; }
.step.active .step-dot { border-color: var(--primary); background: var(--primary-light); animation: pulse 1.5s infinite; }
.step-label { font-size: 0.7rem; color: var(--text2); text-align: center; }
.step.done .step-label { color: var(--success); font-weight: 600; }
.step.active .step-label { color: var(--primary); font-weight: 600; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(196,30,58,.4) } 50% { box-shadow: 0 0 0 12px rgba(196,30,58,0) } }

/* ====== OCR确认区 ====== */
.ocr-review { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ocr-review .panel {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  overflow: hidden;
}
.ocr-review .panel-hd {
  font-size: 0.8rem; font-weight: 600; padding: 8px 12px;
  background: var(--bg-warm); border-bottom: 1px solid var(--border);
}
.ocr-review .panel-body { padding: 12px; }
.ocr-review .panel-body img { width: 100%; border-radius: 4px; }
.ocr-review .panel-body textarea {
  width: 100%; min-height: 200px; border: none; font-size: 0.9rem;
  line-height: 1.8; resize: vertical; font-family: inherit;
  background: transparent; color: var(--text); outline: none;
}
@media (max-width: 600px) { .ocr-review { grid-template-columns: 1fr; } }

/* ====== 逐题匹配卡片 ====== */
.q-match-card { transition: border-color 0.2s; }
.q-match-card:focus-within { border-color: var(--primary) !important; }
.choice-btn-group { display: flex; gap: 8px; flex-wrap: wrap; }
.choice-btn {
  width: 40px; height: 40px; border: 2px solid #ddd; border-radius: 8px;
  background: #fff; font-size: 18px; font-weight: 700; color: #333;
  cursor: pointer; transition: all 0.15s; display: flex;
  align-items: center; justify-content: center;
}
.choice-btn:hover { border-color: var(--primary); color: var(--primary); }
.choice-btn.active {
  background: var(--primary); color: #fff; border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(196, 30, 58, 0.3);
}
.subj-answer { transition: border-color 0.2s; }
.subj-answer:focus { border-color: var(--primary) !important; outline: none; }

/* ====== 结果展示 ====== */
.score-hero { text-align: center; padding: 24px 20px; }
.score-circle {
  display: inline-flex; flex-direction: column; align-items: center;
  justify-content: center; width: 140px; height: 140px; border-radius: 50%;
  border: 6px solid var(--primary); margin-bottom: 12px;
}
.score-circle.excellent { border-color: var(--success); background: var(--success-light); }
.score-circle.good { border-color: var(--info); background: var(--info-light); }
.score-circle.fair { border-color: var(--warning); background: var(--warning-light); }
.score-circle.poor { border-color: var(--error); background: var(--error-light); }
.score-num { font-size: 2.8rem; font-weight: 800; line-height: 1; }
.score-total { font-size: 0.85rem; color: var(--text2); margin-top: 2px; }

.result-item {
  border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 10px;
  border-left: 4px solid var(--border);
}
.result-item.correct { border-left-color: var(--success); background: var(--success-light); }
.result-item.incorrect { border-left-color: var(--error); background: var(--error-light); }
.result-item.partial { border-left-color: var(--warning); background: var(--warning-light); }
.result-item .r-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.result-item .r-score { font-weight: 700; font-size: 1.1rem; }
.result-feedback { font-size: 0.9rem; line-height: 1.7; }
.fb-correct { color: var(--success); margin: 4px 0; }
.fb-wrong { color: var(--error); margin: 4px 0; }
.fb-guide { color: var(--info); margin: 4px 0; }

/* 参考答案折叠 — 默认折叠，AI评语优先 */
.ref-answer-details { margin-top: 10px; }
.ref-answer-details summary {
  font-size: 0.82rem; color: var(--text2); cursor: pointer;
  padding: 5px 10px; background: #F5F5F5; border: 1px dashed var(--border);
  border-radius: 6px; font-weight: 500; user-select: none;
  transition: background 0.15s;
}
.ref-answer-details summary:hover { background: #EEEEEE; }
.ref-answer-hint {
  font-size: 0.78rem; color: var(--text2); margin: 6px 0;
  padding: 6px 10px; background: #FFFBF0; border-radius: 6px;
  line-height: 1.5;
}
.ref-answer-item {
  font-size: 0.85rem; line-height: 1.7; margin: 6px 0;
  padding: 8px 12px; background: #F0FDF4; border-left: 3px solid var(--success);
  border-radius: 0 6px 6px 0; color: #14532D;
}
.ref-answer-label {
  font-weight: 700; color: var(--success); margin-right: 6px;
}

/* ====== 统计仪表盘 ====== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat-box {
  background: var(--bg-warm); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px; text-align: center;
}
.stat-box .stat-val { font-size: 2rem; font-weight: 800; color: var(--primary); }
.stat-box .stat-lbl { font-size: 0.75rem; color: var(--text2); margin-top: 2px; }
.stat-box.good .stat-val { color: var(--success); }
.stat-box.warn .stat-val { color: var(--warning); }

.chart-bar-wrap { margin: 8px 0; }
.chart-bar-label { display: flex; justify-content: space-between; font-size: 0.8rem; margin-bottom: 4px; }
.chart-bar-track { height: 24px; background: #E0D8C8; border-radius: 12px; overflow: hidden; }
.chart-bar-fill { height: 100%; border-radius: 12px; display: flex; align-items: center; justify-content: flex-end; padding-right: 8px; font-size: 0.75rem; color: #fff; font-weight: 600; }
.chart-bar-fill.high { background: var(--success); }
.chart-bar-fill.mid { background: var(--warning); }
.chart-bar-fill.low { background: var(--error); }

/* ====== 表格 ====== */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
th { font-weight: 600; color: var(--text2); font-size: 0.8rem; text-transform: uppercase; background: var(--bg-warm); position: sticky; top: 0; }
tr:hover td { background: #FEFCFA; }

.tag {
  display: inline-block; padding: 3px 10px; border-radius: 12px;
  font-size: 0.75rem; font-weight: 600;
}
.tag-ok { background: var(--success-light); color: var(--success); }
.tag-pending { background: var(--warning-light); color: var(--warning); }
.tag-error { background: var(--error-light); color: var(--error); }
.tag-info { background: var(--info-light); color: var(--info); }

/* ====== 趋势图 ====== */
.trend-chart { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding: 16px 0; }
.trend-bar { flex: 1; background: var(--primary); border-radius: 4px 4px 0 0; min-width: 12px; transition: height 0.3s; position: relative; }
.trend-bar:hover { opacity: 0.8; }
.trend-bar-label { font-size: 0.6rem; color: var(--text2); text-align: center; margin-top: 4px; }

/* ====== 模态框 ====== */
.modal-overlay {
  display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); z-index: 100; align-items: center; justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal-box {
  background: var(--card); border-radius: var(--radius); padding: 24px;
  max-width: 500px; width: 90%; max-height: 80vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-box h3 { font-size: 1.1rem; margin-bottom: 16px; color: var(--primary); }

/* ====== 工具类 ====== */
.text-center { text-align: center; }
.text-muted { color: var(--text2); font-size: 0.85rem; }
.text-sm { font-size: 0.8rem; }
.text-right { text-align: right; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.hidden { display: none !important; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.loading-spinner {
  display: inline-block; width: 24px; height: 24px; border: 3px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ====== 选择题总览柱状图 ====== */
.overview-chart {
  display: flex; align-items: flex-end; gap: 8px;
  height: 200px; padding: 8px 0;
  border-bottom: 2px solid var(--border);
}
.overview-bar-col {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  min-width: 20px; height: 100%;
}
.overview-bar-val {
  font-size: 0.65rem; font-weight: 700; color: var(--text2);
  margin-bottom: 4px; min-height: 16px;
}
.overview-bar-wrap {
  flex: 1; width: 100%; display: flex; align-items: flex-end;
  background: #E8E4DC; border-radius: 4px 4px 0 0;
  position: relative;
}
.overview-bar-fill {
  width: 100%; border-radius: 4px 4px 0 0; min-height: 3px;
  transition: height 0.4s;
}
.overview-bar-fill.high { background: var(--success); }
.overview-bar-fill.mid { background: var(--warning); }
.overview-bar-fill.low { background: var(--error); }
.overview-bar-label {
  font-size: 0.6rem; color: var(--text2); margin-top: 6px;
  white-space: nowrap; text-align: center;
}

/* ====== 选择题分布表 ====== */
.choice-dist-wrap {
  margin: 8px 0 16px; padding: 12px;
  background: #FAFAF8; border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.choice-dist-title {
  font-size: 0.8rem; color: var(--text2); margin-bottom: 8px;
  font-weight: 600;
}
.choice-dist-table {
  width: 100%; border-collapse: collapse; font-size: 0.85rem;
  table-layout: fixed;
}
.choice-dist-table th, .choice-dist-table td {
  padding: 8px 4px; text-align: center; border: 1px solid var(--border);
}
.choice-dist-table th {
  background: var(--bg-warm); font-weight: 600; font-size: 0.9rem;
}
.choice-dist-table th.dist-correct-col {
  background: var(--success-light); color: var(--success);
}
.choice-dist-table td.dist-correct-cell {
  background: var(--success-light);
}
.dist-count {
  font-weight: 700; font-size: 1.1rem;
}
.dist-pct {
  font-size: 0.7rem; color: var(--text2); margin-left: 4px;
}

/* ====== 答题详情页 ====== */
.adjust-section {
  margin-top: 12px; padding-top: 12px;
  border-top: 1px dashed var(--border);
}
.adjust-title {
  font-size: 0.8rem; font-weight: 600; color: var(--primary);
  margin-bottom: 8px;
}
.adj-score-input {
  font-weight: 700;
}
.adj-score-input:focus {
  border-color: var(--primary);
}

/* ====== 主观题得分情况统计 ====== */
.subj-detail {
  margin-bottom: 16px; padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.subj-detail:last-child { border-bottom: none; margin-bottom: 0; }
.subj-detail-header {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 10px; flex-wrap: wrap;
}
.subj-stats-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
@media (max-width: 600px) {
  .subj-stats-grid { grid-template-columns: 1fr; }
}
.subj-stats-title {
  font-size: 0.8rem; font-weight: 700; color: var(--success);
  margin-bottom: 6px;
}
.subj-stat-row {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 0; font-size: 0.82rem;
}
.subj-stat-rank {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--success-light); color: var(--success);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700; flex-shrink: 0;
}
.subj-stat-rank.err {
  background: var(--error-light); color: var(--error);
}
.subj-stat-text {
  flex: 1; min-width: 0;
}
.subj-stat-count {
  font-weight: 600; color: var(--text2); white-space: nowrap;
  font-size: 0.78rem;
}

/* ====== 未提交名单 ====== */
.unsubmitted-box {
  margin-top: 12px; padding: 12px;
  background: #FEF9E7; border: 1px solid #F9E79F;
  border-radius: var(--radius-sm);
}
.unsubmitted-title {
  font-size: 0.85rem; font-weight: 700; color: #7D6608;
  margin-bottom: 8px;
}
.unsubmitted-list {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.unsubmitted-tag {
  display: inline-block; padding: 3px 10px;
  background: #fff; border: 1px solid #E0C860;
  border-radius: 12px; font-size: 0.75rem; color: #7D6608;
}

/* ====== 答题详情：图片+OCR左右布局 ====== */
.image-ocr-row {
  display: flex; gap: 16px; align-items: flex-start;
}
.image-ocr-left {
  flex: 1; min-width: 0;
}
.image-ocr-right {
  flex: 0 0 320px; max-width: 320px; min-width: 0;
}
.image-ocr-right .text-muted {
  color: var(--text2); font-size: 0.8rem;
}

/* ====== 学生答题区 ====== */
.answer-choice-item {
  padding: 14px 0; border-bottom: 1px solid #F0EDE4;
}
.answer-choice-item:last-child { border-bottom: none; }
.answer-choice-btn {
  min-width: 52px; padding: 10px 0; border: 2px solid #D9D0C1;
  border-radius: 10px; background: #FFF; font-size: 1.1rem;
  font-weight: 700; color: var(--text); cursor: pointer;
  text-align: center; transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.answer-choice-btn:hover { border-color: var(--primary); color: var(--primary); }
.answer-choice-btn.selected {
  background: var(--primary); color: #fff; border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(196, 30, 58, 0.3);
  transform: scale(1.05);
}
.answer-subj-item {
  padding: 14px 0; border-bottom: 1px solid #F0EDE4;
}
.answer-subj-item:last-child { border-bottom: none; }
.answer-textarea {
  width: 100%; min-height: 80px; padding: 10px 12px;
  border: 2px solid #D9D0C1; border-radius: 8px; font-size: 15px;
  font-family: inherit; line-height: 1.7; resize: vertical;
  background: var(--bg-warm); color: var(--text); outline: none;
  transition: border-color 0.2s;
}
.answer-textarea:focus {
  border-color: var(--primary); background: #FFF;
}

/* ====== 语音按钮 ====== */
.btn-speech {
  padding: 6px 14px; border: 2px solid var(--primary);
  border-radius: 16px; background: #FFF; color: var(--primary);
  font-size: 0.82rem; font-weight: 600; cursor: pointer;
  transition: all 0.2s; white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.btn-speech:hover { background: var(--primary-light); }
.btn-speech.recording {
  background: #FFEBEE; border-color: #E53935; color: #E53935;
  animation: pulse-speech 1.2s infinite;
}
@keyframes pulse-speech {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(229, 57, 53, 0.4); }
  50% { opacity: 0.85; box-shadow: 0 0 0 8px rgba(229, 57, 53, 0); }
}

/* ====== 语音状态浮层 ====== */
#voiceOverlay {
  position: fixed; bottom: 60px; left: 50%; transform: translateX(-50%);
  background: var(--primary); color: #FFF; padding: 14px 24px;
  border-radius: 32px; font-size: 1rem; z-index: 200;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  display: flex; align-items: center; gap: 10px;
  white-space: nowrap; max-width: 90vw;
}
#voiceOverlay.hidden { display: none; }

/* ====== 教师端：学生逐题答案展示 ====== */
.student-answer-row {
  padding: 8px 0; border-bottom: 1px solid #F5F3EE;
}
.student-answer-row:last-child { border-bottom: none; }
.sa-label {
  font-weight: 700; color: var(--primary); margin-right: 8px;
  font-size: 0.85rem; white-space: nowrap;
}
.sa-value {
  font-weight: 700; color: var(--primary); font-size: 1rem;
}
.sa-text {
  background: var(--bg-warm); padding: 10px 14px; border-radius: 8px;
  margin-top: 4px; font-size: 0.9rem; line-height: 1.7;
  white-space: pre-wrap; border: 1px solid #EDE9DF;
  word-break: break-word;
}

/* ====== 响应式 ====== */
@media (max-width: 480px) {
  .container { padding: 12px 8px 60px; }
  .card { padding: 16px 12px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .app-header h1 { font-size: 1.1rem; }
}
@media (max-width: 768px) {
  .image-ocr-row {
    flex-direction: column;
  }
  .image-ocr-right {
    flex: 1 1 auto; max-width: 100%;
  }
}
