:root {
  --primary: #1a56a8;
  --primary-dark: #123f7d;
  --primary-light: #e8f0fb;
  --accent: #c9a227;
  --bg: #f4f6fa;
  --card: #ffffff;
  --text: #1f2937;
  --text-sub: #6b7280;
  --border: #e5e7eb;
  --green: #16a34a;
  --red: #dc2626;
  --orange: #ea580c;
  --blue: #2563eb;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "PingFang SC", "Microsoft YaHei", -apple-system, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }

/* 顶部 */
.topbar { background: linear-gradient(135deg, var(--primary-dark), var(--primary)); color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.12); position: sticky; top: 0; z-index: 50; }
.topbar-inner { max-width: 1080px; margin: 0 auto; padding: 12px 20px; display: flex; justify-content: space-between; align-items: center; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { width: 42px; height: 42px; border-radius: 12px; object-fit: contain; background: #fff; padding: 2px; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: 1px; }
.brand-sub { font-size: 12px; opacity: .85; }
.admin-brand { display: flex; align-items: center; gap: 10px; }
.admin-logo { width: 38px; height: 38px; border-radius: 10px; object-fit: contain; background: #fff; padding: 2px; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
nav { display: flex; align-items: center; gap: 8px; }
.nav-btn { background: rgba(255,255,255,.12); color: #fff; border: none; padding: 7px 16px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.nav-btn:hover { background: rgba(255,255,255,.25); }
.nav-btn.active { background: #fff; color: var(--primary-dark); font-weight: 600; }
.nav-logout { background: transparent; border: 1px solid rgba(255,255,255,.4); }
.welcome { font-size: 13px; opacity: .9; margin: 0 4px; }

/* 布局 */
.container { max-width: 1080px; margin: 24px auto; padding: 0 16px; }
.layout { display: flex; gap: 20px; }
.main-col { flex: 1; }

/* 卡片 */
.card { background: var(--card); border-radius: 12px; padding: 20px 22px; margin-bottom: 18px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.card-title { font-size: 16px; font-weight: 700; margin-bottom: 14px; color: var(--primary-dark); display: flex; justify-content: space-between; align-items: center; }

/* 题型选择 */
.type-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.type-item { border: 2px solid var(--border); border-radius: 10px; padding: 14px 6px; text-align: center; cursor: pointer; transition: all .15s; background: #fafbfc; }
.type-item:hover { border-color: var(--primary); }
.type-item.active { border-color: var(--primary); background: var(--primary-light); }
.type-item .t-icon { font-size: 24px; margin-bottom: 6px; }
.type-item .t-name { font-size: 14px; font-weight: 600; }
.type-item .t-dim { font-size: 11px; color: var(--text-sub); margin-top: 4px; }

/* 输入 */
.input { width: 100%; border: 1.5px solid var(--border); border-radius: 8px; padding: 10px 12px; font-size: 14px; font-family: inherit; resize: vertical; margin-bottom: 10px; line-height: 1.6; }
.input:focus { outline: none; border-color: var(--primary); }
select.input { height: 42px; background: #fff; }
.answer-area { min-height: 220px; font-size: 15px; }
.count-hint { font-size: 12px; color: var(--text-sub); font-weight: 400; }
.q-preview { background: #f8f9fb; border: 1px solid var(--border); border-radius: 8px; padding: 14px; font-size: 14px; line-height: 1.7; white-space: pre-wrap; color: var(--text); }
.q-preview .q-src { display: block; margin-top: 8px; font-size: 12px; color: var(--text-sub); }
.q-preview .qd-label { font-size: 13px; font-weight: 700; color: var(--primary-dark); margin: 12px 0 6px; }
.q-preview .qd-label:first-child { margin-top: 0; }
.q-preview .qd-text { font-size: 14px; line-height: 1.9; white-space: pre-wrap; color: #333; }
.q-preview .qd-material-preview { max-height: 260px; overflow-y: auto; background: #fff; border-left: 3px solid var(--accent); padding: 12px 14px; border-radius: 0 8px 8px 0; margin-bottom: 8px; color: #444; }
.q-preview .qd-material-preview.collapsed { display: none; }
.q-preview .q-material-len { font-weight: 400; color: var(--text-sub); margin-left: 4px; }
.q-preview .btn-material-toggle { font-size: 12px; padding: 4px 10px; margin-bottom: 10px; }

/* v5.0 三级联动选题（②区：目录 → 套卷 → 题目） */
.cascade-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.cascade-item { display: flex; flex-direction: column; }
.cascade-label { font-size: 12px; font-weight: 600; color: var(--text-sub); margin-bottom: 5px; }
.cascade-item .input { margin-bottom: 0; }
@media (max-width: 720px) { .cascade-grid { grid-template-columns: 1fr; } }

/* v5.0.1 ③区双选项卡（输入答案 / 批量批改）— 标题独占一行，按钮下放独立成行 */
.at-title { margin-bottom: 10px; }
.answer-tabs { display: inline-flex; gap: 4px; background: #f1f4f9; border-radius: 12px; padding: 4px; margin-bottom: 16px; }
.answer-tab { background: none; border: none; padding: 9px 24px; font-size: 14px; font-weight: 600; cursor: pointer; color: var(--text-sub); border-radius: 9px; transition: all .18s; white-space: nowrap; }
.answer-tab.active { color: var(--primary); background: #fff; box-shadow: 0 2px 8px rgba(15,42,86,.10); }

/* v5.0 批量批改选项卡（批次选择 + 题目绑定提示） */
.batch-pick { margin-bottom: 14px; }
.batch-q-hint { margin-top: 6px; font-size: 13px; color: var(--text); line-height: 1.7; background: #f8f9fb; border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; }
.batch-q-hint.batch-q-warn { border-color: #f3c88a; background: #fdf6ec; color: #8a5a00; }
.batch-q-warn-text { color: #c07800; font-weight: 600; }

/* v5.0 预检确认弹层（作业与题目是否对应） */
.cc-box { width: 560px; }
.cc-head { background: #fff7ed; color: #b45309; border-bottom: 1px solid #fde4c3; }
.cc-body { padding: 18px 22px; overflow-y: auto; }
.cc-desc { font-size: 14px; color: var(--text); line-height: 1.7; }
.cc-question { margin-top: 8px; font-size: 13px; color: var(--text-sub); }
.cc-list { margin: 12px 0 0; padding: 0; list-style: none; }
.cc-list li { background: #fdf6ec; border: 1px solid #fde4c3; border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; font-size: 14px; }
.cc-list li b { color: var(--primary-dark); }
.cc-reason { display: block; margin-top: 4px; font-size: 12px; color: #8a5a00; line-height: 1.6; }
.cc-tip { margin-top: 12px; font-size: 12.5px; color: var(--text-sub); line-height: 1.7; background: #f8f9fb; border-radius: 8px; padding: 10px 12px; }
.cc-actions { display: flex; gap: 12px; justify-content: center; padding: 16px 20px; border-top: 1px solid #eef0f4; }
@media (max-width: 640px) { .cc-box { width: 96vw; } .cc-actions { flex-direction: column; } }

/* 按钮 */
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; border: none; border-radius: 8px; padding: 11px 28px; font-size: 15px; font-weight: 600; cursor: pointer; letter-spacing: 2px; }
.btn-primary:hover { opacity: .92; }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-lg { padding: 13px 46px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-ghost { background: #fff; border: 1.5px solid var(--border); border-radius: 8px; padding: 8px 18px; cursor: pointer; font-size: 13px; color: var(--text-sub); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.grade-action { display: flex; align-items: center; gap: 14px; margin-top: 6px; }
.grade-tip { font-size: 12px; color: var(--text-sub); }
/* v5.0.6 上传作业图片识别行 */
.ocr-upload-row { display: flex; align-items: center; gap: 10px; margin: 10px 0 2px; flex-wrap: wrap; }
.ocr-tip { font-size: 12px; color: var(--text-sub); }

/* 登录 */
.auth-card { position: relative; max-width: 420px; margin: 44px auto; background: var(--card); border-radius: 16px; padding: 40px 34px 34px; box-shadow: 0 12px 40px rgba(15,42,86,.10); overflow: hidden; }
.auth-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, var(--primary), #3b82f6, #7fb0f0); }
.auth-brand { text-align: center; margin-bottom: 4px; }
.auth-brand-icon { display: inline-flex; width: 56px; height: 56px; border-radius: 16px; background: linear-gradient(135deg, var(--primary), #3b82f6); color: #fff; font-size: 26px; align-items: center; justify-content: center; box-shadow: 0 6px 16px rgba(26,86,168,.25); }
.auth-card h2 { text-align: center; color: var(--primary-dark); margin: 12px 0 4px; font-size: 22px; letter-spacing: 1px; }
.auth-sub { text-align: center; font-size: 12px; color: var(--text-sub); margin-bottom: 22px; }
.auth-tabs { display: flex; background: #f1f4f9; border-radius: 12px; padding: 4px; margin-bottom: 24px; }
.auth-tab { flex: 1; background: none; border: none; padding: 9px 0; font-size: 14px; font-weight: 600; cursor: pointer; color: var(--text-sub); border-radius: 9px; transition: all .18s; }
.auth-tab.active { color: var(--primary); background: #fff; box-shadow: 0 2px 8px rgba(15,42,86,.10); }
.auth-card .form-group { margin-bottom: 16px; }
.auth-card .form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 7px; }
.input-wrap { position: relative; }
.input-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); font-size: 15px; opacity: .6; pointer-events: none; transition: opacity .18s; }
.auth-card .form-group input { width: 100%; height: 44px; border: 1.5px solid var(--border); border-radius: 10px; padding: 0 14px 0 38px; font-size: 14px; font-family: inherit; color: var(--text); background: #f8fafc; transition: border-color .18s, box-shadow .18s, background .18s; box-sizing: border-box; }
.auth-card .form-group input::placeholder { color: #9ca3af; }
.auth-card .form-group input:hover { border-color: #c9d4e3; }
.auth-card .form-group input:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(26,86,168,.12); }
.auth-card .form-group input:focus ~ .input-icon, .input-wrap:focus-within .input-icon { opacity: 1; }
.auth-card .form-error { background: #fdf2f2; border: 1px solid #fecaca; color: var(--red); font-size: 13px; border-radius: 8px; padding: 8px 12px; margin-bottom: 14px; line-height: 1.5; }
.auth-card .form-error:empty { display: none; }
.btn-auth { height: 46px; border-radius: 10px; font-size: 16px; letter-spacing: 6px; box-shadow: 0 4px 14px rgba(26,86,168,.22); transition: all .18s; }
.btn-auth:hover { box-shadow: 0 6px 20px rgba(26,86,168,.32); transform: translateY(-1px); }
.btn-auth:active { transform: translateY(0); }
.auth-tip { text-align: center; font-size: 12px; color: var(--text-sub); margin-top: 16px; }

/* v5.1：登录方式切换 + 验证码 + 校区下拉 */
.login-mode-tabs { display: flex; gap: 6px; margin: -8px 0 18px; }
.lm-tab { flex: 1; padding: 8px 0; font-size: 13px; font-weight: 600; color: var(--text-sub); background: #f1f4f9; border: 1.5px solid transparent; border-radius: 9px; cursor: pointer; transition: all .18s; }
.lm-tab.active { color: var(--primary); background: #eef4fc; border-color: var(--primary); }
.code-row { display: flex; gap: 8px; }
.code-row .code-input { flex: 1; }
.btn-code { width: 112px; height: 44px; flex-shrink: 0; border: 1.5px solid var(--primary); color: var(--primary); background: #fff; border-radius: 10px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all .18s; }
.btn-code:hover { background: #eef4fc; }
.btn-code:disabled { border-color: #c9d4e3; color: #9ca3af; background: #f1f4f9; cursor: not-allowed; }
.sel-auth { width: 100%; height: 44px; border: 1.5px solid var(--border); border-radius: 10px; padding: 0 14px 0 38px; font-size: 14px; font-family: inherit; color: var(--text); background: #f8fafc; transition: border-color .18s, box-shadow .18s, background .18s; box-sizing: border-box; cursor: pointer; appearance: auto; }
.sel-auth:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(26,86,168,.12); }
.auth-card .req { color: var(--red); }
.auth-foot { text-align: center; font-size: 12px; color: var(--text-sub); margin-top: 16px; line-height: 1.7; }

/* 结果页 */
.result-card { animation: fadeIn .4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; } }
.result-head { display: flex; gap: 26px; align-items: center; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
/* 得分卡片：圆角矩形 + 横向进度填充（v3.2.2 由圆形改为圆角矩形） */
.score-ring { width: 200px; height: 92px; border-radius: 16px; background: #eef2f8; display: flex; align-items: center; justify-content: center; flex-shrink: 0; position: relative; overflow: hidden; }
.score-ring::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--p, 0) * 1%); background: linear-gradient(90deg, var(--primary), #3b82f6); opacity: .14; border-radius: 16px 0 0 16px; }
.score-ring span, .score-ring small { position: relative; z-index: 1; }
.score-ring span { font-size: 30px; font-weight: 800; color: var(--primary-dark); }
.score-ring small { font-size: 13px; color: var(--text-sub); position: relative; z-index: 1; }
.result-meta { flex: 1; }
.grade-badge { display: inline-block; padding: 4px 18px; border-radius: 20px; color: #fff; font-size: 15px; font-weight: 700; margin-bottom: 10px; }
.grade-优秀 { background: var(--green); } .grade-良好 { background: var(--blue); }
.grade-合格 { background: var(--orange); } .grade-不合格 { background: var(--red); }
.result-title { font-size: 14px; color: var(--text-sub); margin-bottom: 14px; }
.overall-comment { background: #f8f9fb; border-left: 4px solid var(--primary); padding: 14px 16px; border-radius: 0 8px 8px 0; font-size: 14.5px; line-height: 1.8; margin-top: 16px; }
.question-detail { background: #f8f9fb; border: 1px solid #e6e9f0; border-radius: 10px; padding: 16px 18px; margin-top: 4px; }
.question-detail .qd-label { font-size: 13px; font-weight: 700; color: var(--primary-dark); margin: 10px 0 4px; }
.question-detail .qd-label:first-child { margin-top: 0; }
.question-detail .qd-text { font-size: 14px; line-height: 1.9; white-space: pre-wrap; color: #333; }
.question-detail .qd-material { color: #555; border-left: 3px solid #d8dee9; padding-left: 12px; }
/* 答案原文：浅黄底与题目详情区分 */
.answer-original { background: #fffdf5; border-color: #f0e6c8; line-height: 2.0; }

/* 三列 */
.result-cols { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; margin-top: 18px; }
.result-col { border-radius: 10px; padding: 14px; font-size: 13.5px; line-height: 1.7; }
.result-col li { margin-bottom: 8px; list-style: none; padding-left: 4px; }
.strengths { background: #f0faf3; } .strengths .col-title { color: var(--green); }
.weaknesses { background: #fdf2f2; } .weaknesses .col-title { color: var(--red); }
.suggestions { background: #f0f6ff; } .suggestions .col-title { color: var(--blue); }
.col-title { font-weight: 700; margin-bottom: 10px; font-size: 14px; }

/* 采分点 */
.point-item { display: flex; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; font-size: 13.5px; line-height: 1.6; }
.point-tag { flex-shrink: 0; padding: 1px 10px; border-radius: 12px; font-size: 12px; color: #fff; height: 22px; }
.pt-full { background: var(--green); } .pt-half { background: #2f6fd6; } .pt-partial { background: var(--orange); } .pt-miss { background: var(--red); }
.pa-row-half { background: #f3f7fe; }
.point-comment { color: var(--text-sub); }

/* 题目详情材料折叠 */
.qd-material-len { font-size: 12px; font-weight: 400; color: var(--text-sub); }
.qd-material-collapse { max-height: 200px; overflow-y: auto; transition: max-height .3s ease; }
.qd-material-expanded { max-height: none; }
.qd-material-toggle { display: inline-block; margin: 6px 0 0; padding: 3px 14px; font-size: 12px; color: var(--primary); background: #eef4ff; border: 1px solid #c6ddf7; border-radius: 12px; cursor: pointer; transition: all .2s; }
.qd-material-toggle:hover { background: #d8e8ff; }

/* 采分点对照表 */
.pa-table { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-top: 4px; }
.pa-row { display: flex; border-bottom: 1px solid var(--border); }
.pa-row:last-child { border-bottom: none; }
.pa-row.pa-head { background: #f0f4f8; font-weight: 700; font-size: 12.5px; color: var(--text-sub); }
.pa-cell { padding: 8px 10px; font-size: 13px; line-height: 1.6; }
.pa-col-id { flex: 0 0 70px; font-weight: 600; color: var(--primary-dark); }
.pa-col-keyword { flex: 1; }
.pa-col-score { flex: 0 0 70px; text-align: center; font-weight: 600; }
.pa-col-status { flex: 0 0 90px; text-align: center; }
.pa-col-comment { flex: 1.2; color: var(--text-sub); word-break: break-word; }
.pa-kw-hint { font-size: 12px; color: var(--text-sub); }
.pa-source { font-size: 11px; color: #999; }
.pa-mark-miss { color: var(--red); font-weight: 600; font-size: 12px; }
.pa-mark-partial { color: var(--orange); font-weight: 600; font-size: 12px; }
.pa-row-miss { background: #fff5f5; }
.pa-row-partial { background: #fff8f0; }

/* 逐句批改采分点标注（v3.5：句末一体化标注「要点① +3分」） */
.s-tags { display: flex; flex-shrink: 0; align-items: center; gap: 6px; flex-wrap: wrap; }
.s-mark { font-size: 12px; padding: 2px 10px; border-radius: 10px; white-space: nowrap; font-weight: 600; }
.sm-pos { background: #d4f0dd; color: #2a7d3f; }
.sm-zero { background: #f8d8d8; color: #c0392b; }

/* 评分说明 */
.scoring-note { background: #f8f9fb; border: 1px solid #e6e9f0; border-left: 4px solid var(--primary); border-radius: 0 8px 8px 0; padding: 14px 16px; margin-top: 4px; font-size: 14px; line-height: 1.9; white-space: pre-wrap; color: #333; }

/* 历史 */
.history-item { display: flex; justify-content: space-between; align-items: center; padding: 14px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; cursor: pointer; }
.history-item:hover { border-color: var(--primary); background: #fafcff; }
.h-left { flex: 1; }
.h-title { font-size: 14.5px; font-weight: 600; margin-bottom: 4px; }
.h-meta { font-size: 12px; color: var(--text-sub); }
.h-score { text-align: right; margin-left: 14px; }
.h-score b { font-size: 20px; color: var(--primary-dark); }
.h-score div { font-size: 12px; color: var(--text-sub); }
.empty-tip { text-align: center; color: var(--text-sub); padding: 40px 0; font-size: 14px; }

/* 遮罩 */
#gradingMask { position: fixed; inset: 0; background: rgba(15,23,42,.55); z-index: 100; display: flex; align-items: center; justify-content: center; }
.grading-box { background: #fff; border-radius: 16px; padding: 40px 56px; text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,.2); }
.spinner { width: 48px; height: 48px; border: 4px solid var(--primary-light); border-top-color: var(--primary); border-radius: 50%; margin: 0 auto 18px; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.grading-text { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.grading-sub { font-size: 13px; color: var(--text-sub); }

/* v3.10 采分点理解确认弹窗 */
.pt-modal { position: fixed; inset: 0; background: rgba(15,23,42,.55); z-index: 110; display: flex; align-items: center; justify-content: center; padding: 24px; }
.pt-modal-box { background: #fff; border-radius: 16px; width: 620px; max-width: 100%; max-height: 86vh; display: flex; flex-direction: column; box-shadow: 0 14px 50px rgba(0,0,0,.22); overflow: hidden; }
.pt-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; border-bottom: 1px solid var(--border); }
.pt-modal-title { font-size: 16px; font-weight: 700; color: #d97706; }
.pt-modal-close { border: none; background: transparent; font-size: 16px; color: var(--text-sub); cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.pt-modal-close:hover { background: var(--border); color: var(--text-main); }
.pt-modal-body { padding: 18px 22px; overflow-y: auto; }
.pt-modal-desc { font-size: 13px; color: var(--text-sub); line-height: 1.7; margin: 0 0 14px; }
.pt-modal-ref { background: #f8fafc; border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; }
.pt-modal-ref-label { font-size: 12px; font-weight: 700; color: var(--text-sub); margin-bottom: 6px; }
.pt-modal-ref-text { font-size: 13px; color: var(--text-main); line-height: 1.7; white-space: pre-wrap; word-break: break-word; max-height: 140px; overflow-y: auto; }
.pt-modal-interp { background: #fff7ed; border: 1px solid #fed7aa; border-radius: 10px; padding: 12px 14px; }
.pt-modal-interp-label { font-size: 12px; font-weight: 700; color: #b45309; margin-bottom: 6px; }
.pt-modal-interp-text { font-size: 13px; color: #7c3a12; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.pt-modal-foot { display: flex; justify-content: flex-end; gap: 12px; padding: 14px 22px; border-top: 1px solid var(--border); background: #fafbfc; }

.footer { text-align: center; padding: 30px 0; color: var(--text-sub); font-size: 12px; }

@media (max-width: 760px) {
  .type-grid { grid-template-columns: repeat(2, 1fr); }
  .layout { flex-direction: column; }
  .result-cols { grid-template-columns: 1fr; }
  .result-head { flex-direction: column; text-align: center; }
  .topbar-inner { flex-direction: column; gap: 10px; }
  .result-actions { justify-content: center; flex-wrap: wrap; }
  .grade-action { flex-wrap: wrap; }
  .card { padding: 16px 14px; }
  nav { flex-wrap: wrap; justify-content: center; }
  .brand-sub { display: none; }
}

/* 结果页操作按钮组 */
.result-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* 范文页 */
.essay-meta { font-size: 12px; color: var(--text-sub); margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px dashed var(--border); }
.essay-body { background: #fdfcf7; border: 1px solid #f0ead6; border-radius: 10px; padding: 22px 24px; font-size: 15px; line-height: 2; white-space: pre-wrap; }
.essay-hl-box .essay-hl { list-style: none; }
.essay-hl li { padding: 8px 12px; background: #f0faf3; border-radius: 8px; margin-bottom: 8px; font-size: 13.5px; }
.essay-actions { margin-top: 16px; display: flex; gap: 10px; }

/* 老师复核卡片 */
.annotation-card { background: #fffbf0; border: 1px solid #f3e3bd; border-left: 4px solid var(--accent); border-radius: 0 10px 10px 0; padding: 16px 18px; }
.ann-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.ann-name { font-weight: 700; color: #8a6d1a; font-size: 14px; }
.ann-score { font-size: 14px; color: var(--text); }
.ann-score b { font-size: 22px; color: #8a6d1a; }
.ann-diff { font-style: normal; font-size: 12px; margin-left: 6px; }
.ann-diff.up { color: var(--red); }
.ann-diff.down { color: var(--green); }
.ann-comment { font-size: 14px; line-height: 1.8; color: var(--text); }

/* 打印导出 */
@media print {
  .topbar, .footer, #gradingMask, .no-print, .result-actions, nav { display: none !important; }
  body { background: #fff; }
  .container { max-width: 100%; margin: 0; padding: 0; }
  .card { box-shadow: none; border: none; padding: 0; }
}

/* 历史记录 tab：批改/范文（1.2） */
.h-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.h-tab { padding: 7px 20px; border-radius: 20px; border: 1.5px solid var(--border); background: #fff; cursor: pointer; font-size: 13px; color: var(--text-sub); }
.h-tab.active { border-color: var(--primary); color: var(--primary); background: var(--primary-light); font-weight: 600; }

/* 逐句批改（v3.5：句级标注兜底） */
.sentence-analysis { border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-top: 4px; background: #fff; }
.sentence-item { padding: 7px 10px; border-radius: 8px; font-size: 14px; line-height: 1.9; margin-bottom: 6px; border: 1px solid transparent; }
.sentence-item.s-hit { background: #f0faf3; border-color: #bbe7c8; }
.sentence-item.s-miss { background: #fdf2f2; border-color: #f3c4c4; }
.s-line { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.s-text { flex: 1; }

/* 逐句点评（v3.6：原文内联括号标注） */
.sentence-analysis.annotated-mode { padding: 16px 18px; line-height: 2.1; font-size: 14.5px; white-space: pre-wrap; }
.sm-inline { display: inline; background: #e6f4ea; color: #1e7d34; border-radius: 4px; padding: 1px 6px; font-size: 13px; font-weight: 600; white-space: normal; }
.sm-inline.sm-zero { background: #fdecec; color: #c0392b; }
/* v5.3.3 逐句批改·按行批注式：完整答案按行展示，每行答案下方紧跟批注（采分点+得分+点评） */
.sentence-line-layout { margin-top: 4px; }
.sl-wrap { border: 1px solid var(--border); border-radius: 10px; padding: 8px 0; background: #fff; overflow: hidden; }
.sl-row { display: flex; flex-wrap: wrap; gap: 10px; padding: 10px 14px 8px; line-height: 1.9; }
.sl-row + .sl-row { border-top: 1px solid var(--border); }
.sl-row.has-cmt { padding-bottom: 4px; }
.sl-line-no { flex: none; font-size: 12px; font-weight: 700; color: var(--text-sub); width: 20px; text-align: right; padding-top: 2px; user-select: none; }
.sl-answer { flex: 1; min-width: 0; font-size: 14px; color: var(--text); }
/* 命中句高亮：绿色下划线 */
.sl-answer .kw-sent { background: #e6f4ea; color: #14532d; border-bottom: 2px solid #16a34a; border-radius: 3px; padding: 0 2px; font-style: normal; }
/* 批注行：紧跟答案行下方，浅灰背景，左对齐答案文字 */
.sl-comment-row { width: 100%; margin-left: 30px; padding: 8px 12px; background: #f7f9fc; border-left: 3px solid var(--primary); border-radius: 0 6px 6px 0; font-size: 13px; color: #444; line-height: 1.8; }
.sl-cmt-item + .sl-cmt-item { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--border); }
.sl-tag { display: inline-block; font-size: 11px; font-weight: 700; border-radius: 4px; padding: 0 7px; color: #fff; margin-right: 6px; vertical-align: 1px; }
.sl-tag-good { background: #1e7d34; }
.sl-tag-half { background: #2f6fd6; }
.sl-tag-low { background: #e67e22; }
.sl-tag-none { background: #c0392b; }
.sl-tag-loss { background: #c0392b; }  /* 归类错误（位置放错） */
.sl-tag-miss { background: #e67e22; }  /* 表达要打磨（无采分点兜底） */
.sl-cmt-point { font-weight: 600; color: var(--text); margin-right: 6px; }
.sl-cmt-txt { color: #444; }
.sl-missing { color: #b55400; margin-left: 8px; }
.sl-missing b { font-weight: 700; }
.sl-sug { color: #185fa5; margin-left: 8px; display: block; margin-top: 3px; }

/* —— v5.3.16 老师批改式逐句批改：原文连续 + 批语卡插句下 —— */
.fb-wrap { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; background: #fff; overflow: hidden; }
.fb-text { font-size: 15px; color: #1f2937; line-height: 2.0; font-weight: 500; }
.fb-text .kw-sent { background: #e6f4ea; color: #14532d; border-bottom: 2px solid #16a34a; border-radius: 3px; padding: 0 2px; font-style: normal; }
/* v5.3.18 短语级标注：答对关键词绿下划线、问题短语红波浪、缺漏补充符蓝▲（克制使用，保持界面干净） */
.fb-text .kw-good { font-style: normal; color: #0f7b3e; font-weight: 700; border-bottom: 2px solid #22a45d; padding: 0 1px; }
.fb-text .kw-bad { font-style: normal; color: #b91c1c; text-decoration: underline wavy #e05252 1.5px; text-underline-offset: 4px; padding: 0 1px; }
.fb-text .ins-mark { color: #2f6fe0; font-weight: 700; cursor: help; padding: 0 2px; font-size: 13px; }
.fb-ins-tip { margin-top: 5px; color: #2f6fe0; background: #eef4ff; border-radius: 6px; padding: 4px 8px; font-size: 12.5px; }
.fb-card { margin: 8px 0 12px 24px; border: 1px solid var(--border); border-left: 3px solid var(--primary); border-radius: 0 8px 8px 0; background: #f7f9fc; padding: 8px 12px; font-size: 13px; }
.fb-card-full { border-left-color: #1e7d34; }
.fb-card-partial { border-left-color: #e67e22; }
.fb-card-miss { border-left-color: #c0392b; }
.fb-card-misplaced { border-left-color: #d35400; }
.fb-card-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; }
.fb-card-point { font-weight: 700; color: var(--text); }
.fb-card-score { color: #444; }
.fb-card-score b { font-size: 15px; color: var(--primary); }
.fb-lost { color: #c0392b; margin-left: 4px; }
.fb-card-body { margin-top: 5px; line-height: 1.8; }
.fb-cmt { color: #444; }
.fb-cmt + .fb-cmt { margin-top: 5px; padding-top: 5px; border-top: 1px dashed var(--border); }

/* 范文历史（1.3） */
.essay-history { margin-top: 6px; }
.essay-hist-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; cursor: pointer; font-size: 13px; }
.essay-hist-item:hover { border-color: var(--primary); background: #fafcff; }
.eh-tag { flex-shrink: 0; font-size: 11px; padding: 2px 10px; border-radius: 12px; background: var(--primary-light); color: var(--primary); }
.eh-meta { color: var(--text-sub); font-size: 12px; flex: 1; }
.eh-current { flex-shrink: 0; font-size: 11px; color: var(--green); font-weight: 600; }

/* ========== v3.1.3 结果页 & 范文页布局优化 ========== */
/* 板块标题统一：左侧主色竖条（间距统一挂在容器上，见下方 v3.2.1） */
#view-result .card-title,
#view-essay .card-title {
  margin-top: 0;
  padding-left: 10px;
  border-left: 3px solid var(--primary);
  border-radius: 2px;
  line-height: 1.3;
}

/* ========== v3.2.1 板块间距修复 ========== */
/* 标题包在容器里的板块，间距挂到容器上（v3.5：去掉维度评分，新增评分说明） */
#resultQuestionBox, #resultAnswerBox, #sentenceBox, #pointAnalysisBox, #scoringNoteBox, #annotationBox,
#essayQuestionBox, #essayHighlightsBox, #essayIdeasBox, #essayHistoryBox {
  margin-top: 40px;
}

/* 结果页头部与总评留白 */
.result-head { padding-bottom: 26px; }
#overallComment { margin-top: 32px; }

/* 题目详情 / 答案原文 / 逐句批改 / 老师复核：标题与内容留白 */
.question-detail { margin-top: 10px; }
.sentence-analysis { margin-top: 10px; }
.annotation-card { margin-top: 10px; }

/* 三列：更精致的卡片感 */
.result-cols { gap: 16px; margin-top: 34px; }
.result-col { padding: 16px 18px; border: 1px solid transparent; }
.strengths { border-color: #c6e8d2; }
.weaknesses { border-color: #f2c9c9; }
.suggestions { border-color: #c6ddf7; }

/* 分数环质感 */
.score-ring { box-shadow: 0 4px 16px rgba(26,86,168,.14); }

/* 范文页留白 */
.essay-meta { margin-bottom: 16px; }
.essay-body { margin-top: 16px; }
.essay-hl li { padding: 10px 14px; margin-bottom: 10px; }
.essay-actions { margin-top: 32px; }

/* 打印时去掉装饰背景，保持干净 */
@media print {
  .sentence-analysis { background: none; }
}

/* 移动端：板块间距适度收紧 */
@media (max-width: 760px) {
  #resultQuestionBox, #resultAnswerBox, #sentenceBox, #pointAnalysisBox, #scoringNoteBox, #annotationBox,
  #essayQuestionBox, #essayHighlightsBox, #essayIdeasBox, #essayHistoryBox { margin-top: 26px; }
  #overallComment { margin-top: 24px; }
  .result-cols { margin-top: 24px; }
  .pa-table { overflow-x: auto; }
  .pa-cell { font-size: 12px; padding: 6px 8px; }
  .pa-col-id { flex: 0 0 55px; }
  .pa-col-score { flex: 0 0 55px; }
  .pa-col-status { flex: 0 0 70px; }
}

/* ============ v3.9 固定采分点对照表 ============ */
.pt-config { margin-top: 14px; border: 1px dashed var(--border); border-radius: 10px; padding: 14px; background: #fbfcfe; }
.pt-config-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.pt-config-title { font-weight: 700; font-size: 14px; color: var(--primary-dark); }
.pt-config-status { font-size: 12px; }
.pt-status-ok { color: #1a8f4e; font-weight: 600; }
.pt-status-tip { color: var(--text-sub); }
.pt-status-warn { display: inline-block; background: #fff5e6; border: 1px solid #ffb74d; color: #c2570a; font-weight: 600; padding: 8px 12px; border-radius: 8px; line-height: 1.7; }
.pt-status-gen { color: var(--primary); font-weight: 600; }
.pt-ref-row textarea.input { margin-bottom: 8px; }
.pt-btn-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.btn-sm { padding: 7px 16px; font-size: 13px; letter-spacing: 1px; }
.pt-preview-title { font-weight: 700; font-size: 13px; color: var(--text); margin: 14px 0 8px; }
.pt-preview-table { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.ptp-row { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-bottom: 1px solid var(--border); font-size: 13px; line-height: 1.5; }
.ptp-row:last-child { border-bottom: none; }
.ptp-row:nth-child(even) { background: #f8fafc; }
.ptp-id { flex: 0 0 52px; font-weight: 600; color: var(--primary-dark); }
.ptp-name { flex: 0 0 110px; font-weight: 500; }
.ptp-kw { flex: 1; color: var(--text-sub); font-size: 12.5px; }
.ptp-kw .ptp-src { display: inline-block; margin-left: 6px; font-style: normal; color: var(--accent); font-size: 11.5px; }
.ptp-score { flex: 0 0 52px; text-align: right; font-weight: 700; color: var(--primary); }
.ptp-band .ptp-id { flex: 0 0 52px; }
.ptp-band .ptp-score { color: var(--primary-dark); }
.ptp-logic { margin-top: 10px; font-size: 13px; background: #f0f7ff; border: 1px solid #d6e8fb; border-radius: 8px; padding: 10px 12px; line-height: 1.7; color: var(--text); }
.ptp-logic b { color: var(--primary-dark); }
.ptp-logic-rules { font-size: 12.5px; color: var(--text-sub); margin-top: 4px; }
.ptp-band-title { font-weight: 700; font-size: 13px; color: var(--primary-dark); margin: 14px 0 8px; }
.ptp-identity { margin-top: 10px; font-size: 13px; font-weight: 600; padding: 8px 12px; border-radius: 8px; }
.ptp-identity.ok { background: #edf9f0; color: #1a8f4e; border: 1px solid #c6e8d2; }
.ptp-identity.bad { background: #fdf2f2; color: var(--red); border: 1px solid #fecaca; }
.ptp-actions { margin-top: 12px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ptp-tip { font-size: 12px; color: var(--text-sub); }

/* 结果页：配分明细汇总行 */
.pa-summary { margin-top: 10px; border: 1.5px solid var(--primary); border-radius: 10px; overflow: hidden; }
.pa-sum-line { display: flex; align-items: center; gap: 8px; padding: 8px 14px; font-size: 13px; background: #fff; border-bottom: 1px solid #eef2f7; }
.pa-sum-line:last-child { border-bottom: none; }
.pa-sum-label { flex: 0 0 72px; color: var(--text-sub); }
.pa-sum-line b { font-size: 15px; color: var(--primary-dark); }
.pa-sum-unit { color: var(--text-sub); font-size: 12px; }
.pa-sum-total { background: #f0f7ff; }
.pa-sum-total b { color: var(--primary); font-size: 17px; }

/* 结果页：大作文分档表 */
.band-table-box { margin-top: 12px; }
.band-current { color: var(--primary); }
.ptp-band.band-active { background: #f0f7ff; outline: 1.5px solid var(--primary); outline-offset: -1px; }

@media (max-width: 760px) {
  .ptp-name { flex: 0 0 88px; }
  .ptp-id { flex: 0 0 44px; }
  .ptp-score { flex: 0 0 46px; }
  .pt-config-head { flex-direction: column; align-items: flex-start; }
}

/* ================================================================
 * v4.0 学生作业批量批改
 * ================================================================ */

/* ---------- 批次列表 ---------- */
.hw-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.hw-new-form { margin-bottom: 14px; padding: 16px; }
.hw-form-row { display: flex; gap: 10px; flex-wrap: wrap; }
.hw-form-row .input { flex: 1 1 200px; }
.hw-form-row .hw-input-sm { flex: 0 0 120px; }
.hw-form-actions { margin-top: 12px; display: flex; gap: 10px; }
.hw-empty { text-align: center; color: #999; padding: 40px 20px; font-size: 14px; }
.hw-empty-inline { text-align: center; color: #aaa; padding: 24px; font-size: 13px; }

.hw-batch-item { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; margin-bottom: 10px; cursor: pointer; transition: box-shadow .15s, transform .15s; }
.hw-batch-item:hover { box-shadow: 0 4px 16px rgba(24,94,224,.15); transform: translateY(-1px); }
.hw-batch-main { flex: 1; min-width: 0; }
.hw-batch-name { font-size: 16px; font-weight: 600; color: #222; }
.hw-batch-class { font-size: 12px; color: #666; background: #f0f3f8; border-radius: 4px; padding: 2px 8px; margin-left: 8px; vertical-align: middle; }
.hw-batch-meta { margin-top: 6px; display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: #888; }
.hw-batch-q { margin-top: 4px; font-size: 12px; color: #4a7bd4; }
.hw-fail-num { color: #d64545; font-weight: 600; }
.hw-batch-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.hw-batch-sttxt { font-size: 12px; color: #999; }

/* ---------- 状态徽章 ---------- */
.hw-badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 20px; white-space: nowrap; }
.hw-st-pending { background: #f0f1f3; color: #888; }
.hw-st-ocr { background: #fff7e6; color: #c77b00; }
.hw-st-ocrdone { background: #e8f1ff; color: #2563c9; }
.hw-st-grading { background: #f3e8ff; color: #8b3fd6; }
.hw-st-done { background: #e6f8ee; color: #1c8a4e; }
.hw-st-failed { background: #fdeaea; color: #d64545; }

/* ---------- 批次详情 ---------- */
.hw-detail-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.hw-detail-info { flex: 1; min-width: 200px; }
.hw-detail-name { font-size: 19px; font-weight: 700; color: #222; }
.hw-detail-meta { margin-top: 4px; font-size: 12.5px; color: #888; }
.hw-detail-status { margin-left: auto; }
.hw-status-badge { display: inline-block; padding: 4px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.hw-status-badge.st-uploading { background: #f0f3f8; color: #666; }
.hw-status-badge.st-ocr { background: #e6f1fb; color: #185fa5; }
.hw-status-badge.st-review { background: #faeeda; color: #854f0b; }
.hw-status-badge.st-grading { background: #eaf3de; color: #3b6d11; }
.hw-status-badge.st-done { background: #e1f5ee; color: #0f6e56; }
/* v5.0.4 分区步骤 */
.hw-step { border: 1px solid #e8ecf3; border-radius: 12px; padding: 14px 16px 16px; margin-top: 14px; }
.hw-step-head { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 600; color: #1c5fd6; margin-bottom: 12px; }
.hw-step-no { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: #1c5fd6; color: #fff; font-size: 12.5px; font-weight: 600; flex: none; }
.hw-ocr-options { display: flex; align-items: center; gap: 18px; margin-bottom: 10px; }
.hw-ocr-actions { display: flex; align-items: center; gap: 10px; }
.hw-grade-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hw-sublist-head { margin: 18px 0 10px; font-size: 14.5px; font-weight: 600; color: #333; }
.hw-danger-zone { margin-top: 16px; padding-top: 12px; border-top: 1px dashed #e5e8ee; display: flex; justify-content: flex-end; }
.hw-check { display: flex; align-items: center; gap: 5px; font-size: 13px; color: #555; cursor: pointer; user-select: none; }
.hw-check input { accent-color: #1c5fd6; width: 15px; height: 15px; }
.hw-btn-del { color: #d64545; }

/* ---------- 进度条 ---------- */
.hw-progress { margin: 12px 0 0; }
.hw-progress-bar { height: 8px; background: #eef1f6; border-radius: 6px; overflow: hidden; }
.hw-progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, #1c5fd6, #4a8bff); border-radius: 6px; transition: width .5s; }
.hw-progress-text { margin-top: 6px; font-size: 13px; color: #555; }

/* ---------- 上传区 ---------- */
.hw-upload-area { border: 2px dashed #c6d2e4; border-radius: 10px; padding: 22px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.hw-upload-area:hover, .hw-upload-area.hw-drop { border-color: #1c5fd6; background: #f2f7ff; }
.hw-upload-hint { font-size: 14px; color: #555; line-height: 1.7; }
.hw-upload-sub { font-size: 12px; color: #999; }
.hw-upload-progress { font-size: 13px; color: #1c5fd6; padding: 6px 0; }

/* ---------- 合并日志 ---------- */
.hw-merge-log { background: #f8faff; border: 1px solid #e2eaf7; border-radius: 8px; padding: 10px 14px; margin-bottom: 12px; }

/* ---------- 条目列表 ---------- */
.hw-sub-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid #edf0f5; border-radius: 10px; margin-bottom: 8px; background: #fff; }
.hw-sub-item:hover { border-color: #d4dcea; }
.hw-sub-failed { background: #fff8f8; border-color: #f3d9d9; }
.hw-sub-idx { flex: 0 0 24px; font-size: 13px; color: #aaa; text-align: center; }
.hw-sub-thumb { flex: 0 0 64px; height: 64px; border-radius: 8px; overflow: hidden; background: #f2f4f8; display: flex; align-items: center; justify-content: center; }
.hw-sub-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hw-thumb-empty { font-size: 22px; }
.hw-sub-main { flex: 1; min-width: 0; }
.hw-sub-name { border: 1px solid transparent; background: transparent; font-size: 15px; font-weight: 600; color: #222; padding: 3px 6px; border-radius: 6px; width: 200px; max-width: 100%; }
.hw-sub-name:hover:not(:disabled) { border-color: #dde3ec; }
.hw-sub-name:focus { border-color: #1c5fd6; outline: none; background: #fff; }
.hw-sub-name:disabled { color: #666; }
.hw-name-tag { font-size: 11px; color: #b06a00; background: #fff4e0; padding: 1px 7px; border-radius: 10px; margin-left: 6px; vertical-align: middle; }
.hw-sub-meta { margin-top: 4px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 12px; color: #999; }
.hw-score { font-size: 16px; font-weight: 700; color: #1c8a4e; }
.hw-band { font-size: 12px; color: #8b3fd6; background: #f3e8ff; padding: 2px 8px; border-radius: 10px; }
.hw-name-warn { color: #c77b00; background: #fff7e6; padding: 1px 7px; border-radius: 10px; }
.hw-err { color: #d64545; }
.hw-sub-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.hw-sub-btns { display: flex; gap: 6px; }

/* ---------- 弹层通用 ---------- */
.hw-modal { position: fixed; inset: 0; background: rgba(15, 23, 42, .55); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.hw-modal-box { background: #fff; border-radius: 14px; width: 520px; max-width: 96vw; max-height: 92vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.hw-modal-wide { width: 1080px; }
.hw-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid #eef0f4; font-size: 16px; font-weight: 700; color: #222; }
.hw-modal-close { border: none; background: none; font-size: 18px; color: #999; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.hw-modal-close:hover { background: #f2f4f8; color: #333; }

/* ---------- 校对弹层（左图右文） ---------- */
.hw-review-body { display: flex; gap: 16px; padding: 16px 20px; overflow: auto; }
.hw-review-left { flex: 0 0 46%; display: flex; flex-direction: column; gap: 8px; }
.hw-photo-nav { display: flex; align-items: center; gap: 8px; }
.hw-nav-btn { border: 1px solid #dde3ec; background: #fff; border-radius: 8px; min-width: 34px; height: 32px; font-size: 15px; color: #444; cursor: pointer; }
.hw-nav-btn:hover:not(:disabled) { border-color: #1c5fd6; color: #1c5fd6; }
.hw-nav-btn:disabled { opacity: .35; cursor: not-allowed; }
.hw-nav-right { margin-left: auto; }
.hw-nav-danger:hover { border-color: #d64545; color: #d64545; }
.hw-photo-idx { font-size: 13px; color: #666; }
.hw-photo-box { background: #f2f4f8; border-radius: 10px; min-height: 380px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.hw-photo-box img { max-width: 100%; max-height: 480px; object-fit: contain; cursor: zoom-in; display: block; }
.hw-photo-tip { font-size: 12px; color: #aaa; text-align: center; }
.hw-review-right { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.hw-rev-row { display: flex; gap: 8px; align-items: center; }
.hw-rev-row .input { flex: 1; }
.hw-rev-row .hw-input-sm { flex: 0 0 130px; }
.hw-rev-label { font-size: 13px; font-weight: 600; color: #555; }
.hw-removed-box { background: #f8faff; border: 1px solid #e2eaf7; border-radius: 8px; padding: 8px 12px; }
.hw-removed-title { font-size: 12.5px; font-weight: 600; color: #4a6a9f; margin-bottom: 4px; }
.hw-removed-list { margin: 0; padding-left: 18px; font-size: 12px; color: #7d8ba3; line-height: 1.8; }
.hw-rev-text { font-size: 13.5px; line-height: 1.8; resize: vertical; min-height: 300px; font-family: inherit; }
.hw-rev-actions { display: flex; align-items: center; gap: 10px; }
.hw-rev-status { font-size: 13px; color: #1c8a4e; }

/* ---------- 灯箱 ---------- */
.hw-lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.82); z-index: 1100; display: flex; align-items: center; justify-content: center; padding: 24px; cursor: zoom-out; }
.hw-lightbox img { max-width: 96vw; max-height: 94vh; object-fit: contain; }

/* ---------- 结果查看（灯箱内卡片） ---------- */
.hw-result-card { background: #fff; border-radius: 14px; width: 640px; max-width: 94vw; max-height: 90vh; overflow: auto; padding: 20px 24px; cursor: auto; }
/* v5.0.9 批量报告完整化：与单篇批改报告对齐（题目详情/我的作答/逐句批改/采分点/三列） */
.hw-result-card.hw-full-report { width: 760px; }
.hw-report-sec { margin-top: 16px; }
.hw-report-sec .card-title { font-size: 14px; font-weight: 700; color: #222; margin-bottom: 6px; }
.hw-result-card .question-detail { max-height: 260px; overflow: auto; }
.hw-result-card .result-cols { grid-template-columns: 1fr; gap: 10px; margin-top: 0; }
.hw-result-card .result-cols .result-col { padding: 12px 14px; }
@media (max-width: 800px) {
  .hw-result-card.hw-full-report { width: 94vw; }
}
.hw-result-head { display: flex; align-items: center; gap: 16px; padding-bottom: 12px; border-bottom: 1px solid #eef0f4; }
.hw-result-score { font-size: 44px; font-weight: 800; color: #1c5fd6; line-height: 1; }
.hw-result-score small { font-size: 14px; color: #999; font-weight: 400; }
.hw-result-name { font-size: 18px; font-weight: 700; color: #222; }
.hw-result-sub { font-size: 12.5px; color: #888; margin: 3px 0 6px; }
.hw-result-head .hw-modal-close { margin-left: auto; }
.hw-pt-table { width: 100%; border-collapse: collapse; margin: 14px 0 8px; font-size: 13px; }
.hw-pt-table th { text-align: left; background: #f5f7fa; color: #666; font-weight: 600; padding: 7px 10px; }
.hw-pt-table td { padding: 7px 10px; border-bottom: 1px solid #f0f2f6; color: #444; }
.hw-pt-table .hw-td-num { text-align: right; font-weight: 600; white-space: nowrap; }
.hw-pt-hit td { background: #f4fbf7; }
.hw-pt-part td { background: #fffdf4; }
.hw-pt-miss td { background: #fdf6f6; }
.hw-result-sum { font-size: 14px; color: #444; background: #f5f8ff; border-radius: 8px; padding: 10px 14px; margin: 8px 0; }
.hw-result-sum b { color: #1c5fd6; }
.hw-result-comment { margin-top: 10px; }
.hw-comment-body { font-size: 13.5px; color: #555; line-height: 1.9; white-space: pre-wrap; }

/* ---------- 批量批改弹层 ---------- */
.hw-grade-wizard { padding: 18px 22px; display: flex; flex-direction: column; gap: 14px; overflow: auto; }
.hw-wizard-step { display: flex; flex-direction: column; gap: 6px; }
.hw-grade-summary { font-size: 13px; color: #555; background: #f5f8ff; border-radius: 8px; padding: 9px 12px; line-height: 1.7; }
.hw-pt-hint { font-size: 12.5px; color: #c77b00; background: #fff7e6; border-radius: 6px; padding: 7px 10px; }
.hw-grade-tip { font-size: 12px; color: #999; }

/* ---------- PDF 模板（离屏渲染，A4 794px 宽） ---------- */
.pdf-report { width: 794px; padding: 40px 44px; font-family: "Microsoft YaHei", "PingFang SC", sans-serif; color: #333; background: #fff; box-sizing: border-box; }
.pdf-head { text-align: center; border-bottom: 3px solid #1c5fd6; padding-bottom: 14px; }
.pdf-brand { font-size: 14px; color: #1c5fd6; letter-spacing: 2px; }
.pdf-title { font-size: 24px; font-weight: 800; color: #222; margin-top: 6px; }
.pdf-stu { display: flex; align-items: baseline; gap: 18px; margin: 18px 0 12px; font-size: 14px; color: #666; }
.pdf-name { font-size: 20px; font-weight: 700; color: #222; }
.pdf-score-row { display: flex; align-items: center; gap: 16px; background: #f5f8ff; border-radius: 10px; padding: 16px 22px; }
.pdf-score b { font-size: 46px; color: #1c5fd6; font-weight: 800; }
.pdf-score span { font-size: 14px; color: #999; margin-left: 4px; }
.pdf-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.pdf-tag { font-size: 14px; font-weight: 600; color: #1c8a4e; background: #e6f8ee; padding: 4px 14px; border-radius: 16px; }
.pdf-tag-band { color: #8b3fd6; background: #f3e8ff; }
.pdf-q { margin: 12px 0; font-size: 14px; color: #555; }
.pdf-pt { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 13.5px; }
.pdf-pt th { background: #eef3fb; color: #446; padding: 8px 12px; text-align: left; font-weight: 600; }
.pdf-pt td { padding: 8px 12px; border-bottom: 1px solid #edf0f5; }
.pdf-pt td.n { text-align: right; font-weight: 600; white-space: nowrap; }
.pdf-pt td.ok { color: #1c8a4e; }
.pdf-pt td.mid { color: #c77b00; }
.pdf-pt td.bad { color: #d64545; }
.pdf-sum { font-size: 15px; color: #444; background: #f5f8ff; border-radius: 8px; padding: 12px 16px; margin: 10px 0 16px; }
.pdf-sum b { color: #1c5fd6; font-size: 18px; }
.pdf-block { margin-top: 16px; }
.pdf-block-title { font-size: 15px; font-weight: 700; color: #222; border-left: 4px solid #1c5fd6; padding-left: 10px; margin-bottom: 10px; }
.pdf-comment { font-size: 13.5px; color: #555; line-height: 2; }
.pdf-photos img { width: 100%; display: block; margin-bottom: 12px; border: 1px solid #e5e8ee; border-radius: 6px; }

/* ---------- 移动端适配 ---------- */
@media (max-width: 760px) {
  .hw-ocr-actions, .hw-grade-actions { flex-direction: column; align-items: stretch; }
  .hw-ocr-actions .btn-primary, .hw-ocr-actions .btn-ghost, .hw-grade-actions .btn-primary, .hw-grade-actions .btn-ghost { width: 100%; }
  .hw-ocr-options { flex-wrap: wrap; gap: 8px 14px; }
  .hw-detail-status { margin-left: 0; }
  .hw-review-body { flex-direction: column; }
  .hw-review-left { flex: none; }
  .hw-photo-box { min-height: 220px; }
  .hw-rev-text { min-height: 180px; }
  .hw-sub-item { flex-wrap: wrap; }
  .hw-sub-name { width: 100%; }
  .hw-modal-wide { width: 96vw; }
  .hw-result-card { width: 94vw; }
}

/* ============ v5.0 题库管理页 ============ */
.bank-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.bank-layout { display: flex; gap: 16px; align-items: flex-start; }
.bank-side { width: 230px; flex-shrink: 0; padding: 16px; position: sticky; top: 70px; }
.bank-side-title { font-size: 14px; font-weight: 700; color: var(--primary-dark); margin-bottom: 10px; }
.bank-cat { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 10px 12px; border: 1.5px solid transparent; border-radius: 8px; background: transparent; cursor: pointer; font-size: 14px; color: var(--dark); margin-bottom: 6px; text-align: left; }
.bank-cat:hover { background: var(--primary-light); }
.bank-cat.active { background: var(--primary-light); border-color: var(--primary); color: var(--primary-dark); font-weight: 600; }
.bank-cat-badge { font-size: 12px; background: #fff; border: 1px solid var(--border); color: var(--text-sub); border-radius: 10px; padding: 1px 8px; }
.bank-cat.active .bank-cat-badge { border-color: var(--primary); color: var(--primary); }
.bank-mine-tip { margin-top: 10px; padding: 8px 10px; font-size: 12px; color: var(--text-sub); background: #f7f8fa; border-radius: 8px; line-height: 1.5; }
.bank-main { flex: 1; min-width: 0; }
.bank-section-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.bank-section-title { font-size: 17px; font-weight: 700; color: var(--primary-dark); }
.bank-section-sub { font-size: 13px; color: var(--text-sub); }
.bank-empty { padding: 26px 0; text-align: center; color: var(--text-sub); font-size: 14px; background: #fafbfc; border: 1.5px dashed var(--border); border-radius: 10px; }
.bank-paper-card { background: #fff; border: 1.5px solid var(--border); border-radius: 10px; padding: 14px 18px; margin-bottom: 10px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.bank-paper-card:hover { border-color: var(--primary); box-shadow: 0 3px 10px rgba(26,86,168,.10); }
.bank-paper-name { font-size: 15px; font-weight: 600; color: var(--dark); }
.bank-paper-meta { font-size: 12.5px; color: var(--text-sub); margin: 6px 0 10px; }
.bank-paper-foot { display: flex; justify-content: space-between; align-items: center; }
.bank-paper-open { font-size: 13px; color: var(--primary); font-weight: 600; }
.bank-pt-tag { font-size: 12px; padding: 3px 10px; border-radius: 10px; }
.bank-pt-tag.ok { background: #e7f6ec; color: #1a7f37; }
.bank-pt-tag.warn { background: #fff5e6; color: #b45309; }
.bank-detail-card { padding: 18px 22px; }
.bank-detail-name { font-size: 18px; font-weight: 700; color: var(--primary-dark); margin-bottom: 4px; }
.bank-detail-meta { font-size: 13px; color: var(--text-sub); margin-bottom: 4px; }
.bank-detail-sec { margin-top: 18px; }
.bank-sec-title { font-size: 14.5px; font-weight: 700; color: var(--primary-dark); margin-bottom: 10px; }
.bank-mat { margin-bottom: 10px; border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; }
.bank-mat-label { font-size: 12.5px; font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.bank-mat-content { font-size: 13.5px; line-height: 1.75; color: var(--dark); white-space: pre-wrap; max-height: 180px; overflow: auto; }
.bank-q-card { border: 1.5px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-bottom: 12px; }
.bank-q-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.bank-q-no { font-size: 13px; font-weight: 700; color: var(--primary-dark); }
.bank-q-type { font-size: 12px; background: var(--primary-light); color: var(--primary-dark); padding: 2px 8px; border-radius: 8px; }
.bank-q-score { font-size: 12px; background: #fef3c7; color: #92400e; padding: 2px 8px; border-radius: 8px; }
.bank-q-words { font-size: 12px; color: var(--text-sub); }
.bank-q-question { font-size: 14px; line-height: 1.7; color: var(--dark); }
.bank-q-meta { font-size: 12.5px; color: var(--text-sub); margin: 6px 0; }
.bank-q-pt { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.bank-pt-detail { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.bank-pt-title { font-size: 13px; font-weight: 700; color: var(--primary-dark); margin-bottom: 6px; }
.bank-pt-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.bank-pt-table th, .bank-pt-table td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; }
.bank-pt-table th { background: var(--primary-light); color: var(--primary-dark); }

/* v5.0 上传套卷向导 */
.up-box { max-width: 660px; width: 92%; max-height: 86vh; overflow: auto; }
.up-box .up-steps,
.up-box .up-pane,
.up-box .up-actions { padding-left: 20px; padding-right: 20px; }
.up-box .up-actions { padding-bottom: 18px; }
.up-steps { display: flex; gap: 8px; margin: 14px 0 16px; }
.up-step { flex: 1; text-align: center; font-size: 13px; padding: 8px 0; border-radius: 8px; background: #f2f4f7; color: var(--text-sub); }
.up-step.active { background: var(--primary-light); color: var(--primary-dark); font-weight: 700; border: 1px solid var(--primary); }
.up-pane-tip { font-size: 12.5px; color: var(--text-sub); background: #f7f8fa; border-radius: 8px; padding: 8px 12px; margin-bottom: 14px; line-height: 1.6; }
.up-cat-opt { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 8px; margin-bottom: 8px; cursor: pointer; font-size: 14px; }
.up-cat-opt.disabled { opacity: .55; cursor: not-allowed; background: #f7f8fa; }
.up-cat-opt em { font-style: normal; font-size: 12px; color: var(--text-sub); margin-left: auto; }
.up-year-row { display: flex; gap: 12px; }
.up-year-row .form-group { flex: 1; }
.req { color: #dc2626; }
.up-mat { border: 1.5px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
.up-mat-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.up-mat-label { font-size: 13.5px; font-weight: 700; color: var(--primary-dark); }
.up-mat-input { width: 100%; resize: vertical; font-size: 14px; line-height: 1.7; }
.up-q { border: 1.5px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; }
.up-q-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.up-q-no { font-size: 14px; font-weight: 700; color: var(--primary-dark); }
.up-q-grid { display: flex; gap: 10px; flex-wrap: wrap; }
.up-q-grid .form-group { flex: 1; min-width: 120px; }
.up-q-mats { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.up-q-mats-label { font-size: 12.5px; color: var(--text-sub); }
.up-q-mat { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; cursor: pointer; }
.up-actions { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.up-error { flex: 1; color: #dc2626; font-size: 13px; }

/* 移动端题库页适配 */
@media (max-width: 768px) {
  .bank-layout { flex-direction: column; }
  .bank-side { width: 100%; position: static; }
  .up-q-grid { flex-direction: column; }
  .up-q-grid .form-group { width: 100%; }
}

/* ================================================================
 * v5.3.8 用户中心
 * ================================================================ */
.uc-box { width: 560px; }
.uc-body { padding: 20px 24px 24px; }
.uc-profile { display: flex; align-items: center; gap: 20px; padding: 16px 18px; background: linear-gradient(135deg, #f0f4ff, #f8fafc); border: 1px solid #e2e8f0; border-radius: 14px; margin-bottom: 18px; }
.uc-avatar-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; flex-shrink: 0; }
.uc-avatar-circle { width: 72px; height: 72px; border-radius: 50%; background: #dbe4ff; color: #3b5bdb; font-size: 32px; display: flex; align-items: center; justify-content: center; }
.uc-avatar-img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.uc-avatar-btn { font-size: 12px; color: #1e6fff; background: #fff; border: 1px solid #c7d6ff; border-radius: 8px; padding: 4px 10px; cursor: pointer; }
.uc-avatar-btn:hover { background: #eef4ff; }
.uc-info { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.uc-info-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.uc-label { color: var(--text-sub); min-width: 64px; }
.uc-value { color: var(--text-main); font-weight: 600; }
.uc-sec { background: #fafbfc; border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; }
.uc-sec-title { font-size: 14px; font-weight: 700; color: #222; margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.uc-form-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.uc-form-row label { width: 88px; font-size: 13px; color: var(--text-sub); flex-shrink: 0; }
.uc-form-row input, .uc-form-row select {
  flex: 1; height: 36px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; color: var(--text-main); background: #fff; outline: none; box-sizing: border-box;
}
.uc-form-row input:focus, .uc-form-row select:focus { border-color: #1e6fff; box-shadow: 0 0 0 3px rgba(30,111,255,.12); }
.uc-form-row input:disabled, .uc-form-row select:disabled { background: #f1f3f5; color: #9aa3b2; cursor: not-allowed; }
.uc-actions { margin-top: 6px; }
.uc-err { flex: 1; color: #dc2626; font-size: 12px; }
.uc-code-wrap { flex: 1; display: flex; gap: 8px; }
.uc-code-wrap input { flex: 1; min-width: 0; }
.uc-btn-ghost { height: 36px; padding: 0 14px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: #1e6fff; font-size: 13px; cursor: pointer; white-space: nowrap; }
.uc-btn-ghost:disabled { color: #9aa3b2; cursor: not-allowed; background: #f1f3f5; }
@media (max-width: 520px) {
  .uc-box { width: 96vw; }
  .uc-profile { flex-direction: column; text-align: center; }
  .uc-info { width: 100%; }
  .uc-form-row { flex-direction: column; align-items: stretch; gap: 6px; }
  .uc-form-row label { width: auto; }
  .uc-code-wrap { flex-direction: column; }
}
