/* ============================================================
   app.css — WritePolish PWA 前端样式（批次F 整页重写）
   按模块分区：基础 / 布局 / 登录 / 顶栏 / Tab导航 / 页面容器 /
   通用组件(toast/lightbox/modal/按钮) / 占位态
   ============================================================ */

/* ---------- 基础重置 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  background: #eef1f6; color: #222; font-size: 14px;
}
.hidden { display: none !important; }
img { max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* ---------- 视图布局 ---------- */
.view { position: fixed; inset: 0; display: flex; flex-direction: column; }
#home-view { max-width: 480px; margin: 0 auto; }

/* ---------- 登录 ---------- */
#login-view { align-items: center; justify-content: center; background: linear-gradient(160deg, #4a7dff, #3b62e0); }
.login-card { width: 86%; max-width: 340px; background: #fff; border-radius: 16px; padding: 28px 24px; box-shadow: 0 12px 30px rgba(0,0,0,.18); }
.login-logo { text-align: center; margin-bottom: 18px; }
.logo-avatar { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; }
.login-logo h1 { font-size: 22px; margin-top: 8px; }
.login-logo p { color: #888; font-size: 12px; margin-top: 2px; }
.login-card label { display: block; font-size: 13px; color: #555; margin: 12px 0 6px; }
.login-card input {
  width: 100%; padding: 10px 12px; border: 1px solid #d5dbea; border-radius: 9px; outline: none;
}
.login-card input:focus { border-color: #3b62e0; }
.login-error { color: #dc2626; font-size: 12px; margin: 8px 0; min-height: 16px; }

/* ---------- 顶栏 ---------- */
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; background: #fff; border-bottom: 1px solid #e5e7ef; flex: none;
}
.app-title { font-size: 17px; font-weight: bold; color: #1f2430; }
.icon-btn { font-size: 20px; padding: 4px; }

/* ---------- 底部 5 Tab 导航 ---------- */
.tabbar {
  display: flex; border-top: 1px solid #e5e7ef; background: #fff; flex: none;
  padding-bottom: env(safe-area-inset-bottom);
}
.tab { flex: 1; text-align: center; padding: 8px 0 10px; font-size: 11px; color: #9aa1b5; position: relative; }
.tab .tab-ico { font-size: 18px; display: block; margin-bottom: 2px; }
.tab-avatar { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; margin: 0 auto 2px; display: block; }
.tab.active { color: #3b62e0; font-weight: bold; }
.badge {
  position: absolute; top: 2px; left: 62%; background: #ef4444; color: #fff; font-size: 9px;
  border-radius: 8px; padding: 0 5px; font-weight: bold;
}

/* ---------- 页面容器 ---------- */
.home-pages { flex: 1; overflow: hidden; display: flex; flex-direction: column; }
.page { display: none; flex: 1; flex-direction: column; overflow: hidden; min-height: 0; }
.page.active { display: flex; }
.page-header {
  display: flex; align-items: center; gap: 8px; padding: 12px 14px; background: #fff;
  border-bottom: 1px solid #e5e7ef; flex: none;
}
.ph-title { font-size: 16px; font-weight: bold; }
.ph-sub { font-size: 12px; color: #8a93ad; }
.ph-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.tab-body { flex: 1; overflow-y: auto; padding: 12px; -webkit-overflow-scrolling: touch; }
.chat-body { flex: 1; overflow-y: auto; padding: 12px; -webkit-overflow-scrolling: touch; }

/* G2-7 小助气泡左右分：小助（ai）在左，老师（me）在右 */
.chat-messages { display: flex; flex-direction: column; gap: 10px; }
.chat-msg { display: flex; max-width: 78%; }
.chat-msg.ai { align-self: flex-start; }
.chat-msg.me { align-self: flex-end; }
.chat-bubble {
  padding: 8px 12px; border-radius: 12px; font-size: 14px; line-height: 1.5;
  white-space: pre-wrap; word-break: break-word;
}
.chat-msg.ai .chat-bubble { background: #f1f4f9; color: #1f2937; border-top-left-radius: 4px; }
.chat-msg.me .chat-bubble { background: #3b62e0; color: #fff; border-top-right-radius: 4px; }

/* ---------- 占位态（P3/P4 模块落成前） ---------- */
.placeholder {
  color: #9aa1b5; text-align: center; padding: 48px 16px; font-size: 13px;
}

/* ---------- 输入栏（小助） ---------- */
.input-bar {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #fff;
  border-top: 1px solid #e5e7ef; flex: none;
}
.input-bar .plus-btn { font-size: 22px; color: #3b62e0; flex: none; padding: 2px 6px; }
.input-bar input {
  flex: 1; border: 1px solid #e5e7ef; border-radius: 20px; padding: 9px 14px; outline: none; font-size: 13px;
}
.input-bar button[type="button"], .input-bar #send-btn {
  background: #3b62e0; color: #fff; border-radius: 20px; padding: 9px 16px; font-size: 13px; flex: none;
}
.input-bar #send-btn:disabled { opacity: .5; }

/* ---------- 按钮 ---------- */
.btn-primary, .btn-ghost { border-radius: 9px; padding: 8px 14px; font-size: 13px; text-align: center; }
.btn-primary { background: #3b62e0; color: #fff; }
.btn-ghost { background: #fff; color: #3b62e0; border: 1.5px solid #3b62e0; }
.btn-primary.block, .btn-ghost.block { display: block; width: 100%; padding: 11px; font-size: 14px; font-weight: bold; border-radius: 11px; }
.btn-primary:disabled, .btn-ghost:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 拍照/相册弹层 ---------- */
.photo-sheet {
  position: absolute; bottom: 64px; left: 12px; right: 12px; background: #fff; border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.15); overflow: hidden; z-index: 30;
}
.photo-sheet-item { display: block; width: 100%; padding: 14px; font-size: 14px; text-align: center; border-bottom: 1px solid #f0f1f5; }
.photo-sheet-item:last-child { border-bottom: none; }

/* ---------- toast（就地反馈） ---------- */
.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 60;
  background: rgba(20,22,28,.92); color: #fff; font-size: 13px; padding: 9px 16px; border-radius: 20px;
  max-width: 80%; text-align: center;
}

/* ---------- lightbox ----------
   v680r15 E5：z-index 提升至所有业务弹层之上（us-modal-mask=220, assist-panel=250），
   确保从手工改分弹层点开原图时，原图查看器位于最上层，关闭后返回原弹层且状态不丢。 */
.lightbox-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.86); z-index: 320;
  display: flex; align-items: center; justify-content: center;
}
.lightbox-img { max-width: 96%; max-height: 92%; object-fit: contain; }
.lightbox-close { position: absolute; top: 14px; right: 18px; color: #fff; font-size: 24px; }

/* ---------- 弹层（401 登录框等） ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal { background: #fff; border-radius: 14px; padding: 22px 20px; width: 100%; max-width: 340px; }
.modal h4 { font-size: 16px; margin-bottom: 8px; }
.login-modal-tip { font-size: 12.5px; color: #6b7280; margin-bottom: 12px; }
.modal label { display: block; font-size: 13px; color: #555; margin: 10px 0 6px; }
.modal input {
  width: 100%; padding: 9px 11px; border: 1px solid #d5dbea; border-radius: 8px; outline: none;
}
.form-error { color: #dc2626; font-size: 12px; margin: 8px 0; }
.modal-actions { display: flex; gap: 10px; margin-top: 16px; }
.modal-actions .btn-primary, .modal-actions .btn-ghost { flex: 1; padding: 10px; }

/* ============================================================
   upload.js — 上传工作台（P3）
   ============================================================ */
.wb-card {
  background: #fff; border: 1px solid #e5e7ef; border-radius: 12px; padding: 12px; margin-bottom: 10px;
}
.wb-title { font-size: 13px; color: #6b7280; font-weight: bold; margin-bottom: 8px; }
.up-assignment-info { font-size: 14px; line-height: 1.6; }
.up-assignment-info b { color: #1f2430; }
.up-assignment-info .sub { font-size: 12px; color: #8a93ad; }
.up-assignment-actions { display: flex; gap: 8px; margin-top: 10px; }
.up-assignment-actions .btn-ghost { flex: 1; padding: 8px; }

.up-upload-zone { margin-bottom: 10px; }
.up-camera-row { display: flex; gap: 10px; }
.up-camera-row .up-camera-btn { flex: 1; }
.up-camera-btn {
  display: block; width: 100%; padding: 15px; font-size: 16px; font-weight: bold;
  background: #3b62e0; color: #fff; border-radius: 12px;
}
.up-camera-btn:disabled { background: #c4cae0; cursor: not-allowed; }
.up-attribution { font-size: 12px; color: #8a93ad; text-align: center; margin-top: 6px; }

.up-photo-sheet { position: relative; bottom: auto; left: auto; right: auto; margin-top: 8px; }

.up-progress { background: #fff; border: 1px solid #e5e7ef; border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.progress-track { height: 8px; background: #eef1f7; border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: #3b62e0; width: 0; transition: width .2s; }
.progress-text { font-size: 12px; color: #8a93ad; margin-top: 5px; }

.up-batch-summary { margin-bottom: 10px; }
.up-batch-summary .stat-row { display: flex; gap: 8px; }
.stat-row { display: flex; gap: 8px; }
.stat {
  flex: 1; background: #f4f6fb; border-radius: 10px; text-align: center; padding: 8px 4px;
}
.stat b { font-size: 19px; display: block; }
.stat span { font-size: 11px; color: #777; }
.ok-bar, .warn-bar { border-radius: 8px; padding: 9px 11px; font-size: 13px; margin-top: 8px; }
.ok-bar { background: #ecfdf5; border: 1px solid #a7f3d0; color: #047857; }
.warn-bar { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.kv { display: flex; justify-content: space-between; padding: 4px 0; font-size: 13px; }
.kv .sub { color: #8a93ad; }

.up-row {
  display: flex; align-items: center; gap: 8px; padding: 9px 4px;
  border-bottom: 1px solid #f0f1f5; font-size: 13px;
}
.up-row:last-child { border-bottom: none; }
.up-row .up-state { color: #6b7280; flex: 1; }
.up-row .up-time { color: #a5adc3; font-size: 12px; flex: none; }
/* v680r8 E2：撤销区按班级分组折叠 */
.up-group { margin-bottom: 6px; }
.up-group-head {
  display: flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 7px 4px; font-size: 13px; border-bottom: 1px solid #f0f1f5;
  background: #f7f8fb; border-radius: 6px;
}
.up-group-head .up-group-arrow { color: #3b62e0; font-size: 11px; }
.up-group-head .up-group-count {
  margin-left: auto; color: #8a93ad; font-size: 12px; background: #e8ebf3;
  border-radius: 9px; padding: 0 8px;
}
.up-group-body .up-row { padding-left: 14px; }
/* v680r8 E3：题目细栏「编辑/停用」按钮 */
.up-asg-act {
  margin-left: 6px; padding: 3px 9px; font-size: 12px; flex: none;
  border: 1px solid #c4cae0; color: #3b62e0; background: #fff; border-radius: 5px;
}
.up-asg-act.danger { color: #d9534f; border-color: #e0b4b2; }
.up-revoke {
  padding: 4px 10px; border: 1px solid #d9534f; color: #d9534f; background: #fff; border-radius: 5px; font-size: 12px;
}
.up-done { margin-top: 4px; }
.up-done:disabled { background: #c4cae0; cursor: not-allowed; }

/* 折叠双功能区（批次F F-20/F-27 修订）：题目管理区 + 作文上传区，同一时刻只展开一个 */
.up-fold { margin-bottom: 10px; }
.fold-head {
  display: flex; align-items: center; justify-content: space-between;
  background: #f4f6fb; border: 1px solid #e5e7ef; border-radius: 12px;
  padding: 10px 12px; margin-bottom: 10px;
}
.fold-title { font-size: 14px; font-weight: bold; color: #1f2430; }
.fold-head .btn-ghost { padding: 4px 10px; font-size: 12px; }
.fold-thin {
  display: flex; align-items: center; gap: 8px;
  background: #f8fafc; border: 1px solid #e5e7ef; border-radius: 10px;
  padding: 11px 12px; font-size: 13px; color: #1f2430; cursor: pointer;
}
.fold-thin-ico { font-size: 15px; }
.fold-thin-sub { font-size: 12px; color: #8a93ad; }
.fold-thin-count { margin-left: auto; }
.fold-arrow { margin-left: auto; color: #3b62e0; font-weight: bold; white-space: nowrap; }
.fold-thin.is-disabled { background: #f2f4f8; color: #b6bccb; cursor: not-allowed; }
.fold-thin.is-disabled .fold-thin-sub { color: #a9b0c0; }

/* G2-8 批次总览卡：题目细栏下方折叠卡（默认收起，点开看 已传/已批/失败/待办tier） */
.batch-overview-card {
  border: 1px solid #e5e7ef; border-radius: 10px; margin-top: 8px;
  background: #fff; overflow: hidden;
}
.batch-overview-card .bo-head {
  display: flex; align-items: center; gap: 6px; padding: 9px 12px;
  font-size: 13px; font-weight: bold; color: #1f2430; cursor: pointer;
  background: #f8fafc;
}
.batch-overview-card .bo-arrow { margin-left: auto; color: #3b62e0; font-weight: bold; transition: transform 0.15s; }
.batch-overview-card.bo-open .bo-arrow { transform: rotate(180deg); }
.batch-overview-card .bo-body { display: none; padding: 8px 12px 10px; }
.batch-overview-card.bo-open .bo-body { display: block; }
.batch-overview-card .bo-line { font-size: 13px; line-height: 1.6; color: #3b4456; }
.batch-overview-card .bo-line + .bo-line { border-top: 1px dashed #eef1f6; padding-top: 4px; margin-top: 4px; }

/* v680r4：新建题目内联面板表单（#upload-body 折叠双区布局已于批次J J-2 移除） */
.f-label { display: block; font-size: 12px; color: #6b7280; margin: 8px 0 4px; }
.f-input { width: 100%; padding: 9px 11px; border: 1px solid #d5dbea; border-radius: 8px; outline: none; }
.inline-panel .actions { display: flex; gap: 8px; margin-top: 12px; }
.inline-panel .actions .btn-primary, .inline-panel .actions .btn-ghost { flex: 1; }
.edit-draft { width: 100%; padding: 9px 11px; border: 1px solid #d5dbea; border-radius: 8px; outline: none; font-size: 13px; }
.edit-title, .edit-type { width: 100%; padding: 9px 11px; border: 1px solid #d5dbea; border-radius: 8px; outline: none; }
.cls-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.cls-item {
  padding: 6px 10px; border: 1px solid #d5dbea; border-radius: 8px; font-size: 13px;
  display: inline-flex; align-items: center; gap: 4px;
}
.cls-item input { width: auto; }
/* v680r7 ③：题目 OCR 识别持久加载态（面板内转圈） */
.ocr-loading { text-align: center; padding: 22px 0; }
.ocr-spinner {
  width: 30px; height: 30px; margin: 0 auto 10px;
  border: 3px solid #d5dbea; border-top-color: #3b62e0; border-radius: 50%;
  animation: ocr-spin 0.8s linear infinite;
}
@keyframes ocr-spin { to { transform: rotate(360deg); } }
.asg-group-name { font-size: 12px; color: #8a93ad; margin: 8px 0 4px; }
.asg-row { padding: 9px 4px; border-bottom: 1px solid #f0f1f5; font-size: 13px; cursor: pointer; }
.asg-row:last-child { border-bottom: none; }
.asg-row .sub { font-size: 11px; color: #8a93ad; }

/* ============================================================
   todo.js — 待办中心（P3）
   ============================================================ */
.todo-group {
  background: #fff; border: 1px solid #e5e7ef; border-radius: 11px; padding: 10px; margin-bottom: 10px;
}
.tier-head { font-size: 12px; font-weight: 700; color: #3b62e0; margin: 6px 2px 8px; }
.todo-group-head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.g-count { color: #8a93ad; font-weight: normal; font-size: 12px; }
.pill { font-size: 10px; padding: 1px 7px; border-radius: 10px; font-weight: normal; }
.pill.red { background: #fee2e2; color: #b91c1c; }
.pill.orange { background: #ffedd5; color: #c2410c; }
.pill.blue { background: #dbeafe; color: #1d4ed8; }
.todo-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 4px;
  border-bottom: 1px solid #f0f1f5; cursor: pointer;
}
.todo-item:last-of-type { border-bottom: none; }
.todo-item .thumb { width: 48px; height: 48px; flex-shrink: 0; }
.todo-item .thumb img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 6px; border: 1px solid #e5e7ef;
}
.thumb-ph { font-size: 22px; }
.todo-item .info { flex: 1; min-width: 0; font-size: 13px; }
.todo-item .info .sub { font-size: 11px; color: #8a93ad; }
.todo-batch { padding-top: 8px; }
.batch-confirm {
  width: 100%; padding: 9px; border: 1px solid #3b62e0; color: #3b62e0; background: #fff;
  border-radius: 8px; font-size: 13px;
}
.batch-confirm:disabled { opacity: .5; }

/* 详情 */
.td-card {
  background: #fff; border: 1px solid #e5e7ef; border-radius: 11px; padding: 12px; margin-bottom: 10px;
}
.td-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.td-head b { flex: 1; }
.td-count { font-size: 12px; color: #8a93ad; }
.td-back { padding: 4px 10px; font-size: 12px; }
.td-photo {
  display: block; width: 100%; max-height: 260px; object-fit: contain; background: #f0f2f5;
  border: 1px solid #e5e7ef; border-radius: 6px; margin: 6px 0; cursor: zoom-in;
}
.rv-rotate-btn {
  position: absolute; top: 8px; right: 8px; padding: 4px 10px; font-size: 13px;
  border: none; border-radius: 6px; background: rgba(0,0,0,.55); color: #fff; cursor: pointer;
}
.review-photo-wrap { position: relative; margin: 6px 0; }
.td-num-copy { cursor: pointer; color: #3b62e0; }
.td-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.td-actions .btn-primary, .td-actions .btn-ghost { flex: 1; min-width: 90px; }
.td-actions select { padding: 8px; border: 1px solid #d5dbea; border-radius: 8px; flex: 1; min-width: 110px; }
/* 身份确认归属更正自定义折叠下拉 */
.td-roster-drop { position: relative; flex: 1; min-width: 110px; }
.td-roster-toggle {
  padding: 8px; border: 1px solid #d5dbea; border-radius: 8px; cursor: pointer;
  background: #fff; font-size: 13px; display: flex; align-items: center; justify-content: space-between;
}
.td-roster-drop.open .td-roster-toggle { border-color: #3b62e0; }
.td-roster-arrow { font-size: 10px; color: #8a93ad; }
.td-roster-panel {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 30;
  background: #fff; border: 1px solid #d5dbea; border-radius: 8px;
  max-height: 240px; overflow-y: auto; box-shadow: 0 4px 12px rgba(0,0,0,.08);
  margin-top: 4px;
}
.td-roster-class-head {
  padding: 6px 10px; cursor: pointer; font-size: 13px; font-weight: 600;
  color: #3b62e0; background: #f5f7ff; border-bottom: 1px solid #e5e7ef;
  display: flex; align-items: center; gap: 4px;
}
.td-roster-class-body { }
.td-roster-stu {
  padding: 6px 10px 6px 24px; cursor: pointer; font-size: 13px;
  border-bottom: 1px solid #f3f4f8;
}
.td-roster-stu:hover { background: #eef2ff; }
.td-roster-stu.active { background: #e0e7ff; color: #3b62e0; font-weight: 600; }
.td-deduction { width: 70px; padding: 8px; border: 1px solid #d5dbea; border-radius: 8px; }
.td-actions .sub { flex: 100%; }
.td-suspect-form .f-input { width: 100%; }
.rv-step { width: 32px; height: 34px; padding: 0; font-size: 18px; line-height: 1; border: 1px solid #d5dbea; border-radius: 8px; background: #fff; cursor: pointer; }
.rv-step:active { background: #eef1f8; }
.td-manual-form { margin-top: 10px; }
.td-manual-photo-wrap { margin: 6px 0; }
.td-manual-photo { display: block; width: 100%; max-height: 260px; object-fit: contain; background: #f0f2f5; border: 1px solid #e5e7ef; border-radius: 6px; cursor: zoom-in; }
.td-manual-ocr { max-height: 180px; overflow-y: auto; background: #f7f8fb; border: 1px solid #e5e7ef; border-radius: 6px; padding: 8px; font-size: 13px; white-space: pre-wrap; word-break: break-word; margin: 6px 0; }
.td-manual-form .f-label { display: block; margin: 8px 0 4px; }
.td-manual-form input[type="number"], .td-manual-form input[type="text"] { padding: 8px; border: 1px solid #d5dbea; border-radius: 8px; width: 100%; box-sizing: border-box; }
.td-manual-form .actions { display: flex; gap: 8px; margin-top: 10px; }
.td-manual-form .actions .btn-primary, .td-manual-form .actions .btn-ghost { flex: 1; }
.td-manual-loading { padding: 12px; color: #8a93ad; }
.check { display: flex; align-items: center; gap: 6px; font-size: 13px; margin: 8px 0; }
.check input { width: auto; }

/* 内联面板通用 */
.inline-panel {
  background: #fff; border: 1px solid #e5e7ef; border-radius: 11px; padding: 12px; margin-bottom: 10px;
}
.ip-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.ip-title { font-size: 14px; font-weight: bold; }
.ip-close { color: #8a93ad; font-size: 16px; }
.confirm-inline {
  display: flex; align-items: center; gap: 8px; padding: 8px; margin-top: 6px;
  background: #f8fafc; border: 1px solid #e5e7ef; border-radius: 8px; font-size: 13px;
}
.confirm-inline .ci-text { flex: 1; }
.confirm-inline .ci-yes, .confirm-inline .ci-no { padding: 4px 12px; border-radius: 6px; font-size: 12px; }
.confirm-inline .ci-yes { background: #3b62e0; color: #fff; }
.confirm-inline .ci-no { border: 1px solid #d5dbea; color: #6b7280; background: #fff; }

/* ============================================================
   stats.js / export.js — 学情 / 错情分析（P4）
   ============================================================ */
.stats-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.stats-nav-title { font-size: 13px; color: #6b7280; }
.stats-body-inner .wb-sub { font-size: 12px; color: #8a93ad; margin: 8px 0 6px; }
.grade-class {
  background: #f8fafc; border: 1px solid #e5e7ef; border-radius: 10px; padding: 10px 12px;
  margin-bottom: 8px; cursor: pointer;
}
.grade-class b { color: #1f2430; }
.grade-class .sub { font-size: 12px; color: #8a93ad; margin-top: 2px; }
.weak-top { font-size: 12px; color: #6b7280; margin-top: 6px; }
.weak-chip {
  display: inline-block; background: #eef2ff; color: #4338ca; border-radius: 10px;
  padding: 1px 8px; margin: 0 4px 2px 0; font-size: 11px;
}
.rowline {
  display: flex; align-items: center; gap: 6px; padding: 8px 2px;
  border-bottom: 1px solid #f0f1f5; font-size: 13px; cursor: pointer;
}
.rowline:last-child { border-bottom: none; }
.rowline .sub { font-size: 12px; color: #8a93ad; }

/* 班级多选（错情/学情成绩表下载共用）：带勾选图示反馈 */
.ex-classes { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.ex-class {
  display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px;
  border: 1px solid #d5dbea; border-radius: 16px; font-size: 12px; cursor: pointer;
  background: #fff; color: #374151; user-select: none;
}
.ex-class input[type="checkbox"] { width: auto; margin: 0; }
.ex-class.active { background: #eef2ff; border-color: #3b62e0; color: #1d4ed8; font-weight: 600; }
.ex-class-all { margin-right: 2px; }
/* G2-6 成绩表下载：批次多选（同考试组批）带勾选图示 */
.ex-batches { display: flex; flex-direction: column; gap: 4px; margin: 6px 0; }
.ex-batch {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px;
  border: 1px solid #d5dbea; border-radius: 8px; font-size: 12px; cursor: pointer;
  background: #fff; color: #374151; user-select: none;
}
.ex-batch input[type="checkbox"] { width: auto; margin: 0; }
.ex-batch.active { background: #eef2ff; border-color: #3b62e0; color: #1d4ed8; font-weight: 600; }

.ex-toolbar { display: flex; gap: 8px; margin-bottom: 8px; }
.ex-stu {
  display: flex; align-items: center; gap: 6px; padding: 8px 2px;
  border-bottom: 1px solid #f0f1f5; font-size: 13px;
}
.ex-stu:last-child { border-bottom: none; }
.ex-stu input[type="checkbox"] { width: auto; }
.ex-stu .ex-one { margin-left: auto; padding: 3px 10px; font-size: 12px; }
.ex-yellowbar {
  background: #fffbeb; border: 1px solid #fde68a; color: #92400e; border-radius: 8px;
  padding: 7px 10px; font-size: 12px; margin-top: 8px;
}
.ex-batch .f-input { width: 100%; }

/* ============ 头像「我的」菜单页（v680r8 E6） ============ */
.settings-overlay {
  position: fixed; inset: 0; z-index: 200; background: rgba(15, 23, 42, .45);
  display: flex; justify-content: flex-end;
}
.settings-panel {
  width: 86%; max-width: 360px; height: 100%; background: #fff; box-shadow: -6px 0 24px rgba(0,0,0,.12);
  display: flex; flex-direction: column;
}
.settings-head {
  display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid #eef0f5;
  flex: none;
}
.settings-head .settings-title { font-weight: 700; font-size: 15px; }
.settings-back {
  background: none; border: none; color: #3b62e0; font-size: 14px; cursor: pointer;
  margin-right: auto;
}
.settings-body { flex: 1; overflow-y: auto; padding: 14px 16px; }
.settings-user { display: flex; align-items: center; gap: 12px; padding: 8px 0 16px; }
.settings-avatar {
  width: 48px; height: 48px; border-radius: 50%; background: #eef2ff; color: #3b62e0;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.settings-uname { font-size: 16px; font-weight: 700; }
.settings-urole { font-size: 12px; color: #8a93ad; }
.settings-menu { display: flex; flex-direction: column; gap: 8px; }
.settings-item {
  background: #f8fafc; border: 1px solid #e5e7ef; border-radius: 10px; padding: 13px 14px;
  font-size: 14px; text-align: left; color: #1f2430; cursor: pointer;
}
.settings-item.danger { color: #d9534f; border-color: #e0b4b2; }
.settings-subtitle { font-size: 13px; color: #6b7280; margin: 16px 0 6px; font-weight: 600; }
.settings-form { padding: 4px 0; }
.settings-row {
  display: flex; align-items: center; gap: 6px; padding: 8px 2px;
  border-bottom: 1px solid #f0f1f5; font-size: 13px;
}
.settings-row:last-child { border-bottom: none; }
.settings-row .sr-main { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.settings-row button {
  background: #fff; border: 1px solid #c4cae0; color: #3b62e0; border-radius: 6px;
  padding: 3px 8px; font-size: 12px; cursor: pointer; flex: none;
}
.settings-preview { font-size: 12px; color: #6b7280; margin: 8px 0; }

/* ============ 上传统计四层树（H-2，取代 G2-8 batch_overview） ============ */
.up-stats-btn { margin-top: 8px; width: 100%; }
.us-overlay {
  position: fixed; inset: 0; z-index: 210; background: #fff;
  display: flex; flex-direction: column;
}
.us-overlay-head {
  display: flex; align-items: center; gap: 8px; padding: 12px 14px;
  border-bottom: 1px solid #eef0f5; flex: none; font-size: 15px;
}
.us-overlay-head b { margin-right: auto; }
.us-overlay-close {
  background: #f1f3f9; border: none; color: #3b62e0; border-radius: 8px;
  width: 30px; height: 30px; font-size: 15px; cursor: pointer;
}
.us-overlay-body { flex: 1; overflow-y: auto; padding: 10px 12px 20px; }
/* 面包屑两行折叠（方案B）：年+月一行（.us-month），日+题+班一行（.us-grp） */
.up-stats .us-month {
  display: flex; align-items: center; gap: 6px; cursor: pointer; flex-wrap: wrap;
  padding: 8px; border-radius: 8px; font-size: 14px;
  background: #eef2ff; margin-top: 4px;
}
.up-stats .us-month b { color: #1f2430; }
.up-stats .us-month-body { padding-left: 0; }
.up-stats .us-grp {
  display: flex; align-items: center; gap: 6px; cursor: pointer; flex-wrap: wrap;
  padding: 8px; border-radius: 8px; font-size: 13.5px;
  background: #f5f7ff; margin-top: 4px;
}
.up-stats .us-grp .us-path { color: #6b7280; font-size: 12px; white-space: nowrap; }
.up-stats .us-grp .us-title { font-weight: 600; color: #1f2430; }
.up-stats .us-grp .us-cls {
  color: #3b62e0; font-weight: 600; font-size: 12px; white-space: nowrap;
}
.up-stats .us-grp-body { padding-left: 0; }
.us-arrow { width: 12px; flex: none; color: #8a93ad; }
.us-tag { margin-left: auto; color: #6b7280; font-size: 12px; font-weight: 400; white-space: nowrap; }
.us-type {
  background: #eef2ff; color: #3b62e0; border-radius: 6px; font-size: 11px;
  padding: 1px 6px; flex: none;
}
.us-row {
  display: flex; align-items: center; gap: 8px; padding: 8px 6px 8px 0;
  border-bottom: 1px solid #f3f4f8; font-size: 13px;
}
.us-row-main { flex: 1; min-width: 0; }
.us-row-main b { margin-right: 4px; }
.us-state { color: #3b62e0; margin: 0 4px; }
.us-meta { color: #8a93ad; font-size: 11.5px; display: block; }
.us-mark {
  display: inline-block; border-radius: 5px; font-size: 11px; padding: 0 5px;
  margin-right: 4px;
}
.us-mark.dup { background: #fef3c7; color: #92400e; }
.us-mark.manual { background: #dcfce7; color: #047857; }
.us-row-actions { flex: none; display: flex; gap: 6px; }
.us-row-actions .btn-ghost { padding: 4px 9px; font-size: 12px; }
.us-modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 220;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.us-modal {
  background: #fff; border-radius: 14px; padding: 18px 18px 20px; width: 100%;
  max-width: 340px; box-shadow: 0 10px 30px rgba(0,0,0,.18);
}
.us-modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.us-modal-close { background: none; border: none; color: #8a93ad; font-size: 16px; cursor: pointer; }
.us-modal-body label { display: block; font-size: 12.5px; color: #6b7280; margin: 10px 0 5px; }
.us-modal-body input, .us-modal-body select {
  width: 100%; box-sizing: border-box; border: 1px solid #d4d9e6; border-radius: 8px;
  padding: 9px 10px; font-size: 14px;
}
.us-modal-actions { display: flex; gap: 10px; margin-top: 16px; }
.us-modal-actions .btn-primary, .us-modal-actions .btn-ghost { flex: 1; padding: 10px; }

/* v680r15 E2/E5：手工给分弹层 — 作文信息区（原图 + OCR + AI 分对照） */
.us-manual-essay { margin-bottom: 6px; }
.us-manual-essay .kv { display: flex; justify-content: space-between; font-size: 12.5px; color: #374151; margin-bottom: 6px; }
.us-manual-photo-wrap { margin: 4px 0 8px; text-align: center; }
.us-manual-photo { max-width: 100%; max-height: 220px; border-radius: 8px; border: 1px solid #e5e7eb; cursor: zoom-in; }
.us-photo-broken { display: inline-block; width: 100%; padding: 14px; box-sizing: border-box;
  background: #f3f4f6; color: #9ca3af; font-size: 12.5px; border-radius: 8px; border: 1px dashed #d1d5db; }
/* v680r15 E5：OCR 纯文本区 — 不溢出边界、两端对齐、中英混排/长单词/标点粘连均可换行 */
.us-manual-ocr {
  max-width: 100%; box-sizing: border-box;
  margin: 4px 0 8px; padding: 10px 12px;
  background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 8px;
  font-size: 13px; line-height: 1.7; color: #1f2937;
  white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word;
  text-align: justify; text-justify: inter-character;
  max-height: 200px; overflow-y: auto;
}

/* ============================================================
   批次J J-1 小助悬浮球 + 聊天面板
   ============================================================ */
.assist-fab {
  position: fixed; right: 12px; z-index: 240;
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(59, 98, 224, 0.55);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
  cursor: pointer; touch-action: none;
}
.assist-fab img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
.assist-panel {
  position: fixed; inset: 0; z-index: 250; background: rgba(15,23,42,.45);
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
}
.assist-panel > * { width: 100%; max-width: 480px; }
.assist-panel-head {
  display: flex; align-items: center; gap: 8px;
  background: #fff; padding: 12px 14px; border-radius: 16px 16px 0 0;
  border-bottom: 1px solid #eef0f5; flex: none;
}
.assist-panel-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.assist-panel-title { font-size: 15px; font-weight: 700; }
.assist-panel-close { margin-left: auto; color: #8a93ad; font-size: 17px; padding: 4px; }
.assist-panel-body {
  flex: 1; overflow-y: auto; padding: 12px; background: #eef1f6; -webkit-overflow-scrolling: touch;
}

/* ============================================================
   批次J J-10改版 统计树两行折叠：年+月 / 日+题+班 两层，学生缩进一层
   用 .up-stats 前缀提升特异性
   ============================================================ */
.up-stats .js-month { padding-left: 0; }
.up-stats .js-grp { padding-left: 0; }
.up-stats .js-stu { padding-left: 20px; }

/* ============================================================
   批次J J-13b/J-13c 提交计数窗 + 刷新中断行
   ============================================================ */
.up-countbar {
  position: sticky; top: 0; z-index: 20;
  background: #eef2ff; border: 1px solid #c7d2fe; border-radius: 10px;
  padding: 8px 10px; font-size: 13px; margin-bottom: 8px;
  color: #1f2430;
}
.up-countbar b { margin: 0 2px; }
.up-q-oversize {
  color: #b91c1c; background: #fee2e2; border-radius: 5px;
  font-size: 11px; padding: 0 5px; flex: none;
}
.up-q-row .up-q-retry { padding: 3px 9px; font-size: 12px; flex: none; }
.up-q-row.up-q-fail .up-q-state { color: #b91c1c; }

/* J-11 小助思考中动画 */
.think-spinner {
  display: inline-block; width: 12px; height: 12px; margin-right: 4px;
  border: 2px solid #c4cae0; border-top-color: #3b62e0; border-radius: 50%;
  vertical-align: middle; animation: ocr-spin 0.8s linear infinite;
}

/* ============================================================
   批次J J-2 作文页重构：常驻条 / 统计树常态内嵌 / 拍照相册吸底
   ============================================================ */
.up-current-bar {
  background: #fff; border: 1px solid #e5e7ef; border-radius: 12px;
  padding: 10px 12px; margin-bottom: 10px;
}
.up-cbar-status b { color: #1f2430; font-size: 14px; }
.up-cbar-status .up-cbar-sub { font-size: 12px; color: #8a93ad; }
.up-cbar-status .up-cbar-teacher { font-size: 12px; color: #8a93ad; }
.up-cbar-confirm {
  margin-top: 8px; padding: 8px; border-radius: 8px; font-size: 13px;
  background: #f8fafc; border: 1px solid #e5e7ef;
}
.up-cbar-confirm button { margin-left: 6px; padding: 5px 10px; font-size: 12px; }
.up-recent-list { margin-top: 8px; }
.up-cbar-recent-title { font-size: 12px; color: #6b7280; margin-bottom: 4px; }
.up-cbar-recent-row {
  display: flex; align-items: center; gap: 8px; padding: 8px 4px;
  border-bottom: 1px solid #f0f1f5; font-size: 13px; cursor: pointer;
}
.up-cbar-recent-row:last-child { border-bottom: none; }
.up-cbar-rdate { color: #8a93ad; font-size: 12px; flex: none; }
.up-cbar-recent-row b { flex: 1; min-width: 0; }
.up-cbar-rtype { color: #3b62e0; font-size: 12px; flex: none; }
.up-cbar-rteacher { color: #8a93ad; font-size: 12px; flex: none; }

/* 统计树常态内嵌（J-2）：页面内可滚动区域，默认展开 */
.up-stats {
  background: #fff; border: 1px solid #e5e7ef; border-radius: 12px;
  margin-bottom: 10px; overflow: hidden;
}
.us-head {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border-bottom: 1px solid #eef0f5; font-size: 14px;
}
.us-head b { margin-right: auto; }
.us-head .btn-ghost { padding: 4px 10px; font-size: 12px; }
.up-stats .us-overlay-body { max-height: 46vh; }
.us-note {
  font-size: 12px; color: #b45309; background: #fef3c7; border-radius: 6px;
  padding: 3px 8px; margin: 3px 0; display: inline-block;
}
.us-thumb {
  width: 40px; height: 40px; border-radius: 6px; object-fit: cover;
  border: 1px solid #e5e7ef; flex: none; cursor: pointer;
}
.us-revoke {
  padding: 4px 9px; border: 1px solid #d9534f; color: #d9534f;
  background: #fff; border-radius: 5px; font-size: 12px; flex: none;
}

/* 拍照/相册双按钮吸底固定（J-2，Tab 栏正上方拇指区，不随内容滚动） */
.up-upload-bar {
  position: sticky; bottom: 0; z-index: 20;
  background: #fff; padding: 8px 0 4px; margin: 0 -2px;
}

/* ============================================================
   批次J J-3 题目页
   ============================================================ */
#asg-new { margin-bottom: 10px; }
.asg-recent-row {
  display: flex; align-items: center; gap: 8px; padding: 8px 4px;
  border-bottom: 1px solid #f0f1f5; font-size: 13px; cursor: pointer;
}
.asg-recent-row:last-child { border-bottom: none; }
.asg-rdate { color: #8a93ad; font-size: 12px; flex: none; }
.asg-recent-row b { flex: 1; min-width: 0; }
.asg-rtype { color: #3b62e0; font-size: 12px; flex: none; }
.asg-rteacher { color: #8a93ad; font-size: 12px; flex: none; }
.asg-card {
  background: #f8fafc; border: 1px solid #e5e7ef; border-radius: 10px;
  padding: 10px 12px; margin-bottom: 8px;
}
.asg-card-head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.asg-card-head b { flex: 1; min-width: 0; font-size: 14px; }
.asg-card .sub { font-size: 12px; color: #6b7280; line-height: 1.7; }
.asg-type {
  background: #eef2ff; color: #3b62e0; border-radius: 6px; font-size: 11px;
  padding: 1px 6px; flex: none;
}
.asg-inactive {
  background: #f3f4f6; color: #6b7280; border-radius: 6px; font-size: 11px;
  padding: 1px 6px; flex: none;
}
.asg-card-actions { display: flex; gap: 8px; margin-top: 8px; }
.asg-card-actions .btn-ghost { flex: 1; padding: 6px; font-size: 12px; }
.btn-ghost.danger { color: #d9534f; border-color: #e0b4b2; }

