/* app.css — AI 作业批改 H5 设计系统 */
:root {
  --primary: #4f8ef7;
  --primary-dark: #3a74d0;
  --primary-light: #eaf2ff;
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #1f2733;
  --text-sub: #6b7686;
  --text-muted: #9aa5b5;
  --border: #eef1f6;
  --green: #27ae60;
  --green-bg: #f0faf3;
  --orange: #f39c12;
  --orange-bg: #fff7e6;
  --red: #e74c3c;
  --red-bg: #fff1f0;
  --gray: #95a5a6;
  --gray-bg: #f2f4f7;
  --purple: #8e6fd8;
  --purple-bg: #f4f0ff;
  --shadow: 0 4px 20px rgba(31, 50, 90, 0.06);
  --radius: 16px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(160deg, #eef3fc 0%, var(--bg) 32%, #f7f9fc 100%);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font-family: inherit; font-size: inherit; }

/* 应用容器：移动端满宽，桌面居中显示为手机卡片 */
#app { min-height: 100vh; }

.app-shell { max-width: 560px; margin: 0 auto; min-height: 100vh; }

/* 顶部导航 */
.topbar {
  position: sticky; top: 0; z-index: 500;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  display: flex; align-items: center; height: 52px; padding: 0 12px;
}
.topbar-back {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: none; background: transparent;
  color: var(--text); font-size: 22px; cursor: pointer; border-radius: 10px;
}
.topbar-back:hover { background: var(--gray-bg); }
.topbar-title {
  flex: 1; text-align: center; font-size: 17px; font-weight: 700; letter-spacing: .3px;
}
.topbar-spacer { width: 36px; }

/* 页面内容 */
.page { padding: 14px 14px 40px; }

/* 卡片 */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.card-title { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.section-title { font-size: 15px; font-weight: 700; margin-bottom: 12px; color: var(--text); }
.title { font-size: 17px; font-weight: 700; line-height: 1.4; }
.subtitle { font-size: 13px; color: var(--text-sub); }
.muted { color: var(--text-muted); font-size: 13px; }
.small { font-size: 12px; }

/* 间距 */
.mt4 { margin-top: 4px; } .mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; }
.mt16 { margin-top: 16px; } .mt20 { margin-top: 20px; } .mt24 { margin-top: 24px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; } .mb16 { margin-bottom: 16px; }

/* 布局 */
.row { display: flex; align-items: center; }
.col { display: flex; flex-direction: column; }
.flex-1 { flex: 1; min-width: 0; }
.space-between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.gap8 { gap: 8px; } .gap12 { gap: 12px; } .gap16 { gap: 16px; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: 12px; padding: 11px 18px;
  font-size: 15px; font-weight: 600; cursor: pointer; transition: all .18s;
  line-height: 1.3; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff; box-shadow: 0 6px 16px rgba(79, 142, 247, 0.28);
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn-ghost:hover { background: var(--primary-light); }
.btn-link { background: transparent; color: var(--primary); padding: 4px 8px; font-weight: 500; }
.btn-danger { background: #fff; color: var(--red); border: 1px solid var(--red); }
.btn-disabled { opacity: .55; pointer-events: none; }
.btn-row { display: flex; gap: 12px; }
.btn-row .btn { flex: 1; }

/* 标签 */
.tag {
  display: inline-flex; align-items: center; padding: 3px 10px;
  border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.4;
}
.tag-green { background: var(--green-bg); color: var(--green); }
.tag-red { background: var(--red-bg); color: var(--red); }
.tag-orange { background: var(--orange-bg); color: #d46b08; }
.tag-blue { background: var(--primary-light); color: var(--primary-dark); }
.tag-purple { background: var(--purple-bg); color: var(--purple); }
.tag-gray { background: var(--gray-bg); color: #6b7686; }

/* 表单 */
.form-row {
  display: flex; align-items: center; padding: 12px 0;
  border-bottom: 1px solid var(--border); gap: 12px;
}
.form-row:last-child { border-bottom: none; }
.form-label { width: 84px; flex-shrink: 0; color: var(--text-sub); font-size: 14px; }
.input, .textarea, .select {
  flex: 1; min-width: 0; background: #f8fafc; border: 1px solid #e3e8f0;
  border-radius: 10px; padding: 10px 12px; font-size: 14px; color: var(--text);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 142, 247, .12); background: #fff;
}
.textarea { resize: vertical; min-height: 84px; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #9aa5b5 50%), linear-gradient(135deg, #9aa5b5 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.picker-value { color: var(--text); font-size: 14px; padding: 10px 0; }
.help-text { font-size: 12px; color: var(--text-muted); line-height: 1.6; }

/* 班级多选 */
.class-check-list { flex: 1; display: flex; flex-wrap: wrap; gap: 8px; }
.class-check {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px;
  border: 1px solid #e3e8f0; border-radius: 10px; background: #f8fafc;
  font-size: 14px; color: var(--text); cursor: pointer; user-select: none;
  transition: border-color .15s, background .15s, color .15s;
}
.class-check input { display: none; }
.class-check-active { border-color: var(--primary); background: var(--primary-light); color: var(--primary-dark); }

/* 模式切换 */
.mode-tabs { display: flex; background: var(--gray-bg); border-radius: 12px; padding: 4px; gap: 4px; }
.mode-tab {
  flex: 1; text-align: center; padding: 9px 0; border-radius: 9px;
  color: var(--text-sub); font-size: 14px; font-weight: 600; cursor: pointer; transition: all .18s;
}
.mode-tab-active { background: #fff; color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,.06); }

/* 列表 */
.list { display: flex; flex-direction: column; }
.list-item {
  display: flex; align-items: center; gap: 12px; padding: 14px 0;
  border-bottom: 1px solid var(--border); cursor: pointer;
}
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: #fafbfe; }
.file-row {
  display: flex; align-items: center; gap: 10px; padding: 12px 0;
  border-bottom: 1px solid var(--border); font-size: 13px;
}
.file-row:last-child { border-bottom: none; }
.group-card {
  border: 1px solid #e3ecff; background: #fafcff; border-radius: 12px;
  padding: 14px; margin-bottom: 12px;
}
.task-title { font-size: 15px; font-weight: 700; }
.empty {
  text-align: center; color: var(--text-muted); padding: 40px 16px; font-size: 14px;
}
.empty-icon { font-size: 40px; margin-bottom: 8px; opacity: .5; }

/* 底部操作栏 */
.bottom-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 400;
  max-width: 560px; margin: 0 auto;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(10px);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  box-shadow: 0 -2px 16px rgba(0,0,0,.06);
}
.bottom-bar .btn { width: 100%; }

/* 底部 Tab */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 400;
  max-width: 560px; margin: 0 auto;
  display: flex; background: rgba(255,255,255,.96);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 0 7px; cursor: pointer; color: var(--text-muted); font-size: 11px; border: none; background: none;
}
.tab-item .tab-icon { font-size: 20px; line-height: 1; }
.tab-item.active { color: var(--primary); font-weight: 700; }

/* 首页 / 工作台 */
.home-hero {
  background: linear-gradient(135deg, #4f8ef7 0%, #6aa4f8 55%, #8db9ff 100%);
  color: #fff; border-radius: 20px; padding: 22px 20px; margin-bottom: 14px;
  box-shadow: 0 10px 26px rgba(79, 142, 247, .35);
}
.home-hero .hero-name { font-size: 20px; font-weight: 800; }
.home-hero .hero-name-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.home-hero .hero-grade {
  font-size: 12px; font-weight: 600; background: rgba(255,255,255,.22);
  padding: 2px 10px; border-radius: 999px; line-height: 1.5;
}
.home-hero .hero-sub { font-size: 13px; opacity: .92; margin-top: 4px; }
.hero-stats { display: flex; gap: 10px; margin-top: 16px; }
.hero-stat {
  flex: 1; background: rgba(255,255,255,.18); border-radius: 12px; padding: 10px;
  text-align: center;
}
.hero-stat .num { font-size: 22px; font-weight: 800; }
.hero-stat .label { font-size: 12px; opacity: .92; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.menu-item {
  background: #fff; border: 1px solid var(--border); border-radius: 16px;
  padding: 16px; cursor: pointer; transition: all .18s; box-shadow: var(--shadow);
}
.menu-item:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(31,50,90,.1); }
.menu-item .menu-icon { font-size: 26px; }
.menu-item .menu-title { font-weight: 700; margin-top: 8px; font-size: 15px; }
.menu-item .menu-desc { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

/* 统计 */
.stat-card { text-align: center; }
.stat-number { font-size: 30px; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 12px; color: var(--text-muted); }
.bar-track { height: 10px; background: var(--gray-bg); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), var(--primary-dark)); }

/* 批改页 */
.header-card { border-left: 4px solid var(--primary); }
.total-row { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.total-score { font-size: 26px; font-weight: 800; color: var(--primary); }
.import-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.import-action-btn { flex: 1; min-width: 0; }
.q-index {
  width: 30px; height: 30px; line-height: 30px; background: var(--primary-light);
  color: var(--primary-dark); border-radius: 50%; text-align: center;
  margin-right: 10px; font-size: 14px; font-weight: 700; flex-shrink: 0;
}
.q-title { font-size: 14px; line-height: 1.6; }
.answer-line { margin-top: 8px; font-size: 14px; }
.answer-correct { color: var(--green); font-weight: 700; }
.answer-wrong { color: var(--red); font-weight: 700; }
.answer-edit-row { display: flex; align-items: center; margin-top: 10px; font-size: 14px; gap: 10px; }
.answer-input { flex: 1; min-width: 0; }
.verify-row { display: flex; align-items: center; gap: 8px; }
.confirm-btn { margin-top: 14px; }
.feedback { background: var(--orange-bg); color: #d46b08; padding: 9px 12px; border-radius: 8px; font-size: 13px; margin-top: 8px; }
.ai-box { background: var(--green-bg); border: 1px solid #b7eb8f; border-radius: 12px; padding: 14px; margin-top: 12px; }
.ai-title { color: #52c41a; font-weight: 700; margin-bottom: 6px; }
.ai-feedback { font-size: 13px; color: var(--text-sub); line-height: 1.6; }
.step-title { font-weight: 700; color: var(--text); margin-top: 12px; }
.step-row { display: flex; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); gap: 10px; }
.score-input { width: 64px; text-align: center; }
.comment-row { display: flex; align-items: center; margin-top: 12px; gap: 10px; }
.comment-input { flex: 1; min-width: 0; }
.annotate-btn { margin-top: 12px; }

/* 作业原图 */
.homework-swiper {
  width: 100%; height: 320px; background: #f5f7fa; border-radius: 12px;
  overflow: hidden; position: relative;
}
.homework-image { width: 100%; height: 100%; object-fit: contain; cursor: zoom-in; background: #f5f7fa; }
.homework-scroll { display: flex; overflow-x: auto; gap: 10px; scroll-snap-type: x mandatory; }
.homework-scroll .homework-image { scroll-snap-align: center; width: 100%; flex: 0 0 100%; }

/* AI 结果 */
.ai-summary { background: var(--primary-light); border-radius: 12px; padding: 14px; margin-top: 12px; }
.ai-summary-title { font-weight: 700; color: var(--primary-dark); margin-bottom: 6px; }
.ai-summary-text { font-size: 13px; color: var(--text-sub); line-height: 1.6; }
.ai-summary-score { margin-top: 8px; font-size: 14px; font-weight: 700; color: var(--primary); }
.ai-result-item { padding: 16px 0; border-bottom: 1px solid var(--border); }
.ai-result-item:last-child { border-bottom: none; }
.ai-answer-row { margin-top: 8px; font-size: 14px; line-height: 1.5; }
.ai-step-row { display: flex; justify-content: space-between; font-size: 13px; padding: 5px 0; }
.ai-error { color: #d4380d; font-size: 13px; line-height: 1.5; background: var(--red-bg); padding: 10px 14px; border-radius: 8px; margin-top: 8px; }

/* 作答批注色块 */
.anno-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.anno-chip {
  min-width: 28px; height: 28px; line-height: 28px; padding: 0 8px;
  border-radius: 14px; color: #fff; font-size: 13px; text-align: center; font-weight: 700;
}
.anno-correct { background: var(--green); }
.anno-partial { background: var(--orange); }
.anno-wrong { background: var(--red); }
.anno-unanswered { background: var(--gray); }
.anno-legend { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 12px; color: var(--text-sub); flex-wrap: wrap; }
.anno-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }

/* OCR */
.ocr-box { background: #fafafa; border: 1px solid #e5e5e5; border-radius: 10px; padding: 12px; }
.ocr-text { display: block; margin-top: 8px; font-size: 13px; color: #333; line-height: 1.7; white-space: pre-wrap; }

/* 批注弹层 */
.annotate-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.8); z-index: 999;
  display: flex; flex-direction: column;
}
.annotate-toolbar { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 12px; background: #fff; }
.annotate-done { background: var(--primary); color: #fff; }
.annotate-pager { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 8px 12px; background: #fff; border-top: 1px solid var(--border); }
.annotate-pager-info { font-size: 13px; color: #333; }
.annotate-colors { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 8px 12px; background: #fff; border-top: 1px solid var(--border); }
.annotate-color { width: 26px; height: 26px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; box-shadow: 0 0 0 1px rgba(0,0,0,.15); }
.annotate-color-active { border-color: #fff; box-shadow: 0 0 0 3px var(--primary); }
.annotate-scroll { flex: 1; min-height: 0; overflow: auto; padding: 12px; }
.annotate-canvas { display: block; margin: 0 auto; background: #fff; touch-action: none; max-width: 100%; height: auto; }
.long-canvas { position: fixed; left: -2000px; top: 0; pointer-events: none; }

/* UI 浮层 */
.ui-toast {
  position: fixed; left: 50%; top: 20%; transform: translateX(-50%) translateY(-10px);
  background: rgba(20, 26, 36, .92); color: #fff; padding: 11px 18px; border-radius: 10px;
  font-size: 14px; z-index: 10000; opacity: 0; pointer-events: none; transition: all .25s;
  max-width: 80vw; text-align: center;
}
.ui-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

#loading {
  position: fixed; inset: 0; z-index: 9999; display: none; align-items: center; justify-content: center; flex-direction: column; gap: 12px;
  background: rgba(255,255,255,.6);
}
#loading.show { display: flex; }
.spinner {
  width: 36px; height: 36px; border: 3px solid var(--primary-light); border-top-color: var(--primary);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { color: var(--text-sub); font-size: 14px; }

.ui-modal-mask, .ui-sheet-mask, .ui-preview-mask {
  position: fixed; inset: 0; z-index: 10001; display: flex; align-items: center; justify-content: center;
  background: rgba(15, 20, 30, .5); animation: fade .2s;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.ui-modal {
  width: 82vw; max-width: 340px; background: #fff; border-radius: 16px; padding: 22px 20px 18px; animation: pop .22s;
}
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.ui-modal-title { font-size: 16px; font-weight: 700; text-align: center; }
.ui-modal-content { font-size: 14px; color: var(--text-sub); text-align: center; margin-top: 12px; line-height: 1.6; white-space: pre-wrap; }
.ui-modal-actions { display: flex; gap: 12px; margin-top: 20px; }
.ui-modal-actions .btn { flex: 1; }

.ui-sheet-mask { align-items: flex-end; }
.ui-sheet { width: 100%; max-width: 560px; background: #f4f6fb; border-radius: 20px 20px 0 0; padding: 12px; }
.ui-sheet-item, .ui-sheet-cancel {
  width: 100%; background: #fff; border: none; border-radius: 14px; padding: 15px;
  font-size: 16px; cursor: pointer; margin-bottom: 10px;
}
.ui-sheet-cancel { color: var(--red); }

.ui-preview-mask { flex-direction: column; background: rgba(0,0,0,.9); }
.ui-preview-head { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 12px 16px; color: #fff; gap: 10px; }
.ui-preview-close { background: none; border: none; color: #fff; font-size: 28px; cursor: pointer; line-height: 1; }
.ui-preview-zoom { display: inline-flex; align-items: center; gap: 6px; }
.ui-preview-zoom-btn {
  min-width: 30px; height: 30px; padding: 0 8px; border: 1px solid rgba(255,255,255,.5);
  background: rgba(255,255,255,.12); color: #fff; border-radius: 999px; font-size: 16px;
  cursor: pointer; line-height: 1;
}
.ui-preview-zoom-btn:active { background: rgba(255,255,255,.3); }
.ui-preview-zoom-reset { font-size: 12px; }
.ui-preview-zoom-pct { min-width: 44px; text-align: center; font-size: 13px; opacity: .92; }
.ui-preview-body { flex: 1; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ui-preview-img { max-width: 100%; max-height: 100%; transition: transform .15s ease; transform-origin: center center; }

/* ===== 通用强调色 ===== */
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-orange { color: var(--orange); }
.text-blue { color: var(--primary); }

/* ===== 登录页 ===== */
.login-page { padding-top: 26px; }
.login-hero {
  background: linear-gradient(135deg, #4f8ef7 0%, #6aa4f8 55%, #8db9ff 100%);
  color: #fff; border-radius: 20px; padding: 26px 20px; margin-bottom: 16px;
  box-shadow: 0 10px 26px rgba(79, 142, 247, .35); text-align: center;
}
.login-hero .hero-name { font-size: 22px; font-weight: 800; letter-spacing: .5px; }
.login-hero .hero-sub { font-size: 13px; opacity: .92; margin-top: 6px; }
.captcha-box { margin-top: 16px; background: var(--gray-bg); border-radius: 12px; padding: 14px; }
.range-input { width: 100%; margin-top: 12px; accent-color: var(--primary); }
.captcha-refresh { color: var(--primary); font-size: 13px; cursor: pointer; }
.captcha-question { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.captcha-formula { flex-shrink: 0; font-size: 16px; font-weight: 600; color: var(--text); }
.captcha-input { max-width: 110px; text-align: center; }

/* ===== 全局底部 footer ===== */
.global-footer {
  text-align: center;
  padding: 10px 16px calc(72px + env(safe-area-inset-bottom));
}
.global-footer .footer-line { font-size: 12px; color: var(--text-muted); line-height: 1.8; }
.global-footer .footer-icp { color: #b6bec9; }

/* ===== 个人中心 ===== */
.avatar {
  width: 54px; height: 54px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; font-size: 24px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.profile-name { font-size: 17px; font-weight: 700; }

/* ===== 成绩列表 ===== */
.grade-score { font-size: 26px; font-weight: 800; }
.grade-score.good { color: var(--green); }
.grade-score.bad { color: var(--red); }
.grade-total { font-size: 14px; font-weight: 600; color: var(--text-muted); }

/* ===== 列表工具条 / 任务卡 ===== */
.toolbar { padding: 4px 2px 12px; }
.task-card { cursor: pointer; }
.meta-row { flex-wrap: wrap; }

/* ===== 统计：条形图 / 分布 ===== */
.bar-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; }
.bar-label { width: 92px; flex-shrink: 0; font-size: 13px; color: var(--text-sub); }
.bar-value { width: 46px; text-align: right; font-size: 13px; font-weight: 700; color: var(--text-sub); flex-shrink: 0; }
.freq-item {
  background: var(--gray-bg); border-radius: 10px; padding: 11px 14px;
  font-size: 13px; color: var(--text-sub); margin-top: 8px;
}
.stat-item { flex: 1; text-align: center; }

/* ===== 作答页：选项 ===== */
.options { display: flex; flex-direction: column; gap: 10px; }
.option {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 12px; cursor: pointer;
  background: #fff; transition: all .15s;
}
.option:hover { border-color: var(--primary); background: var(--primary-light); }
.option-selected { border-color: var(--primary); background: var(--primary-light); box-shadow: 0 0 0 2px rgba(79,142,247,.14); }
.option-letter {
  width: 28px; height: 28px; line-height: 28px; text-align: center; flex-shrink: 0;
  border-radius: 50%; background: var(--gray-bg); color: var(--text-sub); font-weight: 700; font-size: 13px;
}
.option-selected .option-letter { background: var(--primary); color: #fff; }
.option-text { font-size: 14px; line-height: 1.5; padding: 6px 0; color: var(--text-sub); }

/* ===== 图片列表 / 上传 ===== */
.image-list { display: flex; flex-wrap: wrap; gap: 8px; }
.image-item { position: relative; }
.upload-img {
  width: 84px; height: 84px; object-fit: cover; border-radius: 10px;
  background: #f5f7fa; border: 1px solid var(--border); cursor: zoom-in;
}
.image-item .btn-link { display: block; margin-top: 4px; font-size: 12px; }

/* ===== 合并长图预览 ===== */
.long-image-wrap { max-height: 320px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; background: #f5f7fa; }
.long-image-preview { width: 100%; display: block; cursor: zoom-in; }

/* ===== 作答结果 / 错题 ===== */
.result-box { background: var(--gray-bg); border-radius: 12px; padding: 12px 14px; }
.wrong-answer {
  background: var(--red-bg); color: var(--red); border-radius: 10px; padding: 12px 14px;
  font-size: 14px; line-height: 1.6; white-space: pre-wrap; word-break: break-word;
}
.correct-answer {
  background: var(--green-bg); color: var(--green); border-radius: 10px; padding: 12px 14px;
  font-size: 14px; line-height: 1.6; white-space: pre-wrap; word-break: break-word;
}
.error-detail { font-size: 14px; color: var(--text-sub); line-height: 1.7; }

/* ===== 录题草稿 ===== */
.draft-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.draft-item:last-child { border-bottom: none; }
.draft-meta { font-size: 13px; color: var(--text-sub); margin-left: 8px; }
.draft-content { font-size: 13px; color: var(--text-sub); line-height: 1.6; }

/* ===== 发布：小节标题 / 识别结果 ===== */
.sub-title { font-size: 14px; font-weight: 700; color: var(--text); margin-top: 8px; }
.recognition-box { background: var(--green-bg); border: 1px solid #b7eb8f; border-radius: 12px; padding: 14px; }
.recognition-title { color: var(--green); font-weight: 700; margin-bottom: 8px; }
.recognition-row { display: flex; justify-content: space-between; font-size: 13px; padding: 4px 0; color: var(--text-sub); }
.area-tag { display: inline-block; margin-top: 6px; margin-right: 6px; }

/* ===== 批改：学生答案原样展示 ===== */
.formula {
  background: #fafafa; border: 1px solid #ececec; border-radius: 10px; padding: 12px 14px;
  font-size: 14px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; color: var(--text);
}

/* ===== 卡片子项光标 ===== */
.student-row, .question-card { cursor: pointer; }

/* ===== 桌面摄像头拍照 ===== */
.ui-camera-mask {
  position: fixed; inset: 0; z-index: 10002; display: flex; align-items: center; justify-content: center;
  background: rgba(15, 20, 30, .85); animation: fade .2s;
}
.ui-camera {
  width: 92vw; max-width: 420px; background: #fff; border-radius: 16px; overflow: hidden;
  animation: pop .22s;
}
.ui-camera-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; }
.ui-camera-title { font-size: 16px; font-weight: 700; }
.ui-camera-close { background: none; border: none; font-size: 26px; cursor: pointer; color: var(--text-sub); line-height: 1; padding: 0 4px; }
.ui-camera-stage { background: #000; display: flex; align-items: center; justify-content: center; min-height: 240px; }
.ui-camera-video { width: 100%; max-height: 340px; object-fit: contain; background: #000; display: block; }
.ui-camera-count { padding: 10px 16px 0; font-size: 13px; color: var(--text-sub); }
.ui-camera-thumbs { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 16px; max-height: 88px; overflow-y: auto; }
.ui-camera-thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.ui-camera-actions { display: flex; gap: 10px; padding: 12px 16px 16px; }
.ui-camera-actions .btn { flex: 1; }
.ui-camera-actions .btn:disabled { opacity: .5; cursor: not-allowed; }

/* 响应式：桌面端微调 */
@media (min-width: 640px) {
  .topbar-inner { max-width: 560px; margin: 0 auto; }
}
