:root {
  --brand: #ef7d3a;
  --brand-d: #d9641f;
  --bg: #fbf7f2;
  --card: #ffffff;
  --text: #2a2622;
  --muted: #9a8f86;
  --line: #efe6dd;
  --ok: #2f9e6f;
  --shadow: 0 6px 24px rgba(120, 80, 40, 0.10);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ===== 登录 ===== */
.login-wrap {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #fdeede 0%, #fbf7f2 60%);
}
.login-card {
  width: 380px; max-width: 92vw; background: var(--card);
  border-radius: 18px; box-shadow: var(--shadow); padding: 34px 32px 28px;
}
.brand { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.brand .logo {
  padding: 0 10px; height: 46px; border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), #f6a96a);
  color: #fff; font-weight: 800; font-size: 14px; letter-spacing: 1px;
  display: flex; align-items: center; justify-content: center; white-space: nowrap;
}
.brand h1 { font-size: 19px; margin: 0; }
.brand .sub { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); }
.login-card label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; }
.login-card input {
  width: 100%; height: 44px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 10px; font-size: 15px; outline: none;
}
.login-card input:focus { border-color: var(--brand); }
/* 记住登录设备（免密登录） */
.remember-line {
  display: flex !important; align-items: center; gap: 8px;
  margin: 16px 2px 0 !important; cursor: pointer; user-select: none;
}
.remember-line input[type="checkbox"] {
  width: 16px; height: 16px; margin: 0;
  accent-color: var(--brand); cursor: pointer; flex: none;
}
.remember-txt { font-size: 13px; color: var(--muted); }
#login-btn {
  width: 100%; height: 46px; margin-top: 22px;
  background: var(--brand); color: #fff; border: none; border-radius: 10px;
  font-size: 16px; font-weight: 600; cursor: pointer; transition: .15s;
}
#login-btn:hover { background: var(--brand-d); }
.hint { text-align: center; font-size: 12px; color: var(--muted); margin-top: 14px; }
.foot { margin-top: 26px; font-size: 12px; color: var(--muted); }

/* ===== 看板 ===== */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px; padding: 0 22px; background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.brand.small { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.brand.small .logo { height: 34px; border-radius: 9px; font-size: 12px; padding: 0 8px; }
.user { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); }
.ghost {
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  padding: 7px 14px; border-radius: 8px; cursor: pointer; font-size: 13px;
}
.ghost:hover { border-color: var(--brand); color: var(--brand); }

.org-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 2px; }
.org-tag {
  display: inline-block; padding: 4px 12px; border-radius: 20px;
  background: #fdeede; color: var(--brand-d); font-size: 12.5px; font-weight: 600;
}
.quota { font-size: 12.5px; color: var(--muted); }

.content { max-width: 860px; margin: 0 auto; padding: 22px 18px 60px; display: flex; flex-direction: column; gap: 16px; }
.panel { background: var(--card); border-radius: 14px; padding: 18px 20px; box-shadow: var(--shadow); }
.panel-title { font-size: 15px; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; gap: 9px; }
.step {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--brand); color: #fff; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
}

/* 学员网格（已改为下拉选择，见 .stu-select / .stu-card） */
.mini {
  width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--line);
  background: #fff; cursor: pointer; font-size: 13px; display: flex; align-items: center; justify-content: center; color: var(--muted);
}
.mini:hover { border-color: var(--brand); color: var(--brand); }
.mini.act-del:hover { border-color: #ff6b6b; color: #ff6b6b; }
.mini.perm-del { width: auto; padding: 0 6px; font-size: 14px; }
.mini.perm-del:hover { border-color: #ff4444; color: #ff4444; background: #fff1f0; }

/* ===== 学员下拉选择 + 当前学员卡（编辑/移除按钮始终可见） ===== */
.stu-select {
  width: 100%; height: 44px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 10px;
  font-size: 15px; color: var(--text); outline: none; background: #fff;
}
.stu-select:focus { border-color: var(--brand); }
.stu-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 12px; padding: 12px 14px;
  border: 1.5px solid var(--brand); border-radius: 11px; background: #fdf3ea;
}
.stu-card-info { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; min-width: 0; }
.stu-card-name { font-weight: 700; font-size: 16px; color: var(--text); }
.stu-card-grade, .stu-card-gender { font-size: 12.5px; color: var(--brand-d); }
.stu-card-acts { display: flex; gap: 8px; flex-shrink: 0; }

/* 通用小按钮（添加学员 / 刷新 / 修改密码 等） */
.mini-btn {
  border: 1px solid var(--line); background: #fff; color: var(--brand-d);
  padding: 6px 12px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; transition: .15s; flex-shrink: 0;
}
.mini-btn:hover { border-color: var(--brand); color: var(--brand); background: #fdf3ea; }
.mini-btn.ghost { color: var(--muted); font-weight: 500; }
.mini-btn.ghost:hover { border-color: #ff6b6b; color: #ff6b6b; background: #fff1f0; }
.mini-btn:disabled { background: #f1e7df; color: #c9bdb2; cursor: not-allowed; }

/* 学科 chips */
.chip-row { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  border: 1.5px solid var(--line); border-radius: 20px; padding: 8px 16px;
  cursor: pointer; font-size: 14px; background: #fff; transition: .15s;
}
.chip:hover { border-color: #f4c39c; }
.chip.active { border-color: var(--brand); background: var(--brand); color: #fff; }
.chip.locked { cursor: default; opacity: 0.85; }
.chip.locked:hover { border-color: var(--brand); }
.lock-icon { font-size: 12px; }
.chip.archived { border-color: #c0dd97; background: #f7fbf2; color: #3b6d11; }
.chip.archived:hover { border-color: #97c459; }
.kp-arch {
  margin-left: 8px; border: 1px solid #d3d1c7; background: #fff; color: #5f5e5a;
  border-radius: 12px; padding: 1px 8px; font-size: 11px; cursor: pointer; vertical-align: 1px; transition: .15s;
}
.kp-arch:hover { border-color: var(--brand); color: var(--brand-d); background: #fdf3ea; }
.chip.archived .kp-arch { border-color: #97c459; color: #3b6d11; background: #eaf3de; }
.chip.archived .kp-arch:hover { background: #c0dd97; }

/* ===== 归档错题 TAB ===== */
.arch-list { display: flex; flex-direction: column; gap: 8px; }
.arch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px; box-shadow: var(--shadow);
}
.arch-name { font-size: 14px; font-weight: 600; color: var(--text); }
.arch-name .cnt { font-size: 11px; color: var(--muted); font-weight: 400; }
.arch-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.arch-restore {
  border: 1.5px solid #97c459; background: #eaf3de; color: #3b6d11;
  border-radius: 8px; padding: 6px 14px; font-size: 13px; cursor: pointer; transition: .15s; flex-shrink: 0;
}
.arch-restore:hover { background: #c0dd97; }

/* 上传区（紧凑版：缩小约一半） */
.dropzone {
  border: 2px dashed var(--line); border-radius: 12px; padding: 14px 12px;
  text-align: center; transition: .15s; background: #fdfaf6;
}
.dropzone.drag { border-color: var(--brand); background: #fdeede; }
.dz-inner p { color: var(--muted); font-size: 13.5px; margin: 6px 0; }
.dz-icon { font-size: 20px; color: var(--brand); }
.dz-btns { display: flex; gap: 10px; justify-content: center; margin: 8px 0; flex-wrap: wrap; }
.btn { background: var(--brand); color: #fff; padding: 8px 14px; border-radius: 9px; cursor: pointer; font-size: 13px; font-weight: 600; display: inline-block; }
.btn:hover { background: var(--brand-d); }
.btn.outline { background: #fff; color: var(--brand); border: 1.5px solid var(--brand); }
.dz-tip { font-size: 12px; }

.preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 9px; margin: 14px 0; }
.preview-grid .pv { position: relative; border-radius: 9px; overflow: hidden; aspect-ratio: 1; background: #eee; border: 1px solid var(--line); }
.preview-grid .pv img { width: 100%; height: 100%; object-fit: cover; }
.preview-grid .pv .rm { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; border: none; cursor: pointer; font-size: 12px; display: flex; align-items: center; justify-content: center; }

.action-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; }
.sel-info { font-size: 13px; color: var(--muted); }
.primary { background: var(--brand); color: #fff; border: none; border-radius: 9px; padding: 11px 22px; font-size: 15px; font-weight: 700; cursor: pointer; }
.primary:disabled { background: #e7d3c4; cursor: not-allowed; }
.primary:not(:disabled):hover { background: var(--brand-d); }

.result { margin-top: 14px; padding: 13px 15px; border-radius: 10px; font-size: 13.5px; }
.result b { color: var(--ok); }
.result.ok { background: #ecfaf3; border: 1px solid #bce9d3; color: #1c6b46; }
.result.err { background: #fff1f0; border-color: #ffccc7; color: #cf1322; }

/* 进度条 */
.progress { margin-top: 14px; height: 22px; border-radius: 11px; background: #f1e7df; overflow: hidden; position: relative; border: 1px solid var(--line); }
.progress-bar { height: 100%; width: 0%; border-radius: 11px; background: linear-gradient(90deg, var(--brand), #f6a96a); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; font-weight: 600; transition: width .2s ease; }

/* 裁剪（剪切）弹窗（电脑端：横向/纵向各扩大 20%）——flex 弹性布局，图片区随屏幕高度自适应收缩，按钮区始终可见 */
.crop-modal { max-width: 624px; width: 94%; max-height: 94vh; display: flex; flex-direction: column; }
.crop-modal .modal-title,
.crop-modal .crop-tip,
.crop-modal .crop-tools,
.crop-modal .modal-actions { flex: none; }
.crop-stage {
  width: 100%;
  flex: 1 1 auto;          /* 占据剩余高度，小屏自动收缩，大屏自动撑开 */
  min-height: 140px;       /* 最小高度保底，避免过小 */
  background: #1c1c1c; border-radius: 10px; overflow: hidden; margin: 6px 0; position: relative;
}
.crop-stage img,
.crop-stage .cropper-container,
.crop-stage .cropper-wrap-box,
.crop-stage canvas {
  display: block;
  max-width: 100% !important;
  max-height: 100% !important;
}
.crop-stage { display: flex; align-items: center; justify-content: center; }
.crop-tip { font-size: 12px; color: var(--muted); margin: 4px 0 0; }
/* 自定义可旋转裁剪框（图片不动，框可倾斜/移动/缩放） */
.rcb {
  position: absolute; z-index: 12; cursor: move;
  border: 2px solid var(--brand);
  box-shadow: 0 0 0 1px rgba(255,255,255,.55);
  transform-origin: center center;
}
.rcb-box { position: absolute; inset: 0; }
.rcb-handle {
  position: absolute; width: 14px; height: 14px; background: #fff;
  border: 2px solid var(--brand); border-radius: 3px; z-index: 2;
}
/* 隐形触控热区：视觉保持 14px，命中范围扩到约 42px（小屏易点） */
.rcb-handle::before { content: ''; position: absolute; }
.rcb-nw::before, .rcb-ne::before, .rcb-sw::before, .rcb-se::before { inset: -14px; }
.rcb-n::before, .rcb-s::before { inset: -6px -14px; }
.rcb-e::before, .rcb-w::before { inset: -14px -6px; }
/* 四角手柄 */
.rcb-nw { left: -8px; top: -8px; cursor: nwse-resize; }
.rcb-ne { right: -8px; top: -8px; cursor: nesw-resize; }
.rcb-sw { left: -8px; bottom: -8px; cursor: nesw-resize; }
.rcb-se { right: -8px; bottom: -8px; cursor: nwse-resize; }
/* 四边中点手柄：拖边只改一个维度，小屏好命中 */
.rcb-n, .rcb-s { left: 50%; transform: translateX(-50%); width: 30px; height: 18px; }
.rcb-n { top: -8px; cursor: ns-resize; }
.rcb-s { bottom: -8px; cursor: ns-resize; }
.rcb-e, .rcb-w { top: 50%; transform: translateY(-50%); height: 30px; width: 18px; }
.rcb-e { right: -8px; cursor: ew-resize; }
.rcb-w { left: -8px; cursor: ew-resize; }
.rcb-rotate {
  position: absolute; top: -36px; left: 50%; transform: translateX(-50%);
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--brand); color: #fff; border: 2px solid #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: grab; font-size: 14px; z-index: 3; box-shadow: 0 2px 6px rgba(0,0,0,.35);
  user-select: none;
}
.rcb-rotate:active { cursor: grabbing; }
.crop-tools { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 8px 0; }
.crop-tools .tool { border: 1.5px solid var(--line); background: #fff; color: var(--brand-d); padding: 7px 14px; border-radius: 9px; cursor: pointer; font-size: 13.5px; font-weight: 600; transition: .15s; }
.crop-tools .tool:hover { border-color: var(--brand); background: #fdf3ea; }
.crop-tools .tool:active { transform: scale(.96); }
.crop-tools .tool-full { border-color: var(--ok); color: var(--ok); background: #f4fbf5; }
.crop-tools .tool-full:hover { border-color: var(--ok); background: #e5f4ea; }
#crop-ok[disabled] { background: #e7d3c4; cursor: not-allowed; }

/* 文件树 */
.files-tree { font-size: 13.5px; }
.files-tree .empty { color: var(--muted); }
.files-hint { font-size: 12px; color: var(--muted); margin: -8px 0 10px; padding: 6px 12px; background: #fdfaf6; border-radius: 8px; border: 1px solid var(--line); }
.ft-dir { margin: 4px 0; }
.ft-dir > .ft-name { font-weight: 600; color: #4a4038; }
.ft-name { color: #4a4038; }
.ft-name.collapsible { cursor: pointer; user-select: none; }
.ft-name.collapsible:hover { color: var(--brand); }
.ft-name .tw { display: inline-block; transition: transform .15s; color: var(--muted); }
.ft-name.collapsible.open .tw { transform: rotate(90deg); }
.ft-name .cnt { font-size: 11.5px; color: var(--muted); font-weight: 400; }
.ft-children { margin-left: 16px; border-left: 1px dashed var(--line); padding-left: 12px; }
.ft-children[hidden] { display: none !important; }
.ft-date { margin-top: 12px; }
.ft-date-title { font-weight: 600; color: #4a4038; cursor: pointer; user-select: none; padding: 4px 0; }
.ft-date-title:hover { color: var(--brand); }
.ft-date-title .tw { display: inline-block; transition: transform .15s; color: var(--muted); }
.ft-date-title.open .tw { transform: rotate(90deg); }
.ft-file { display: flex; align-items: center; gap: 8px; padding: 4px 0; color: var(--text); }
.ft-file .fn { font-size: 13px; word-break: break-all; }
.ft-file .sz { font-size: 12px; color: var(--muted); flex-shrink: 0; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 36px; transform: translateX(-50%); background: #2a2622; color: #fff; padding: 11px 20px; border-radius: 10px; font-size: 14px; z-index: 100; box-shadow: var(--shadow); }

/* 删除队列 */
.history-list { display: flex; flex-direction: column; gap: 8px; }
.hist { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: #fdfaf6; border: 1px solid var(--line); border-radius: 9px; }
.hist .hn { font-weight: 600; font-size: 14px; }
.hist .hg { font-size: 12.5px; color: var(--muted); flex: 1; }
.hist .restore { flex-shrink: 0; }
.hist .restore:hover { border-color: var(--ok); color: var(--ok); }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(40, 30, 20, .45); display: flex; align-items: center; justify-content: center; z-index: 200; overflow-y: auto; }
.modal-mask[hidden] { display: none !important; }
.modal { width: 360px; max-width: 92vw; background: #fff; border-radius: 14px; box-shadow: 0 18px 50px rgba(60, 40, 20, .28); overflow: hidden; }
.modal-title { font-size: 16px; font-weight: 700; padding: 18px 20px 6px; }
.modal-body { padding: 8px 20px 4px; }
.confirm-msg { font-size: 14px; line-height: 1.6; color: var(--text); margin: 6px 0 12px; white-space: pre-line; }
.fld { display: flex; flex-direction: column; gap: 5px; margin: 12px 0; font-size: 13px; color: var(--muted); }
.fld input, .fld select { height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; font-size: 15px; color: var(--text); outline: none; background: #fff; }
.fld input:focus, .fld select:focus { border-color: var(--brand); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px 18px; }
.modal-actions .primary, .modal-actions .ghost { padding: 9px 18px; font-size: 14px; }
.form-msg { font-size: 12.5px; color: var(--muted); margin: 8px 0 0; }

/* ===== 学情分析 ===== */
.panel-tip-sm { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 4px; }
.analytics-filter { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.fld-inline { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.fld-inline select { height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; outline: none; background: #fff; color: var(--text); min-width: 120px; }
.fld-inline select:focus { border-color: var(--brand); }
.analytics-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; margin-bottom: 18px; }
.ana-card { background: #fdfaf6; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; text-align: center; }
.ana-card .ana-num { font-size: 28px; font-weight: 800; color: var(--brand-d); line-height: 1; }
.ana-card .ana-label { font-size: 12px; color: var(--muted); margin-top: 6px; }
.ana-card.accent { background: linear-gradient(135deg, var(--brand), #f6a96a); border: none; }
.ana-card.accent .ana-num { color: #fff; }
.ana-card.accent .ana-label { color: rgba(255,255,255,.9); }
.analytics-body { font-size: 14px; }
.ana-section { margin-bottom: 20px; }
.ana-section-title { font-size: 14px; font-weight: 700; margin-bottom: 10px; color: var(--text); display: flex; align-items: center; gap: 6px; }
.ana-section-title::before { content: ''; width: 3px; height: 16px; background: var(--brand); border-radius: 2px; }
.ana-bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 13px; }
.ana-bar-label { width: 200px; flex-shrink: 0; text-align: right; color: var(--text); white-space: normal; line-height: 1.3; }
.ana-bar-track { width: 360px; max-width: 100%; height: 22px; background: #f1e7df; border-radius: 6px; overflow: hidden; position: relative; }
.ana-bar-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--brand), #f6a96a); transition: width .3s ease; display: flex; align-items: center; justify-content: flex-end; padding-right: 8px; color: #fff; font-size: 12px; font-weight: 600; min-width: 24px; }
.ana-bar-count { width: 32px; flex-shrink: 0; font-weight: 700; color: var(--brand-d); text-align: left; }
.ana-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ana-table th { padding: 8px 10px; text-align: left; color: var(--muted); font-size: 12px; font-weight: 600; background: #fdfaf6; border-bottom: 1px solid var(--line); }
.ana-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); }
.ana-table tr:hover td { background: #fdf3ea; }
.ana-table .tag-sub { display: inline-block; padding: 2px 8px; border-radius: 12px; background: #fdeede; color: var(--brand-d); font-size: 11px; }
.ana-empty { text-align: center; color: var(--muted); padding: 30px 0; font-size: 14px; }
.ana-loading { text-align: center; color: var(--muted); padding: 30px 0; font-size: 14px; }
.ana-meta { font-size: 11px; color: var(--muted); margin-top: 16px; text-align: right; }

/* ===== 错题打印 TAB ===== */
.email-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.email-item { display: flex; align-items: center; justify-content: space-between; padding: 9px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fdfaf6; }
.email-addr { font-size: 14px; color: var(--text); word-break: break-all; }
.email-acts { display: flex; gap: 6px; flex-shrink: 0; }
.email-add { display: flex; gap: 8px; }
.email-add input { flex: 1; min-width: 0; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; font-size: 14px; outline: none; background: #fff; color: var(--text); }
.email-add input:focus { border-color: var(--brand); }
.chip .cnt { font-size: 11px; opacity: .85; margin-left: 2px; font-weight: 400; }
.print-opts { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 12px; }
.num-input { width: 90px; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; outline: none; background: #fff; color: var(--text); }
.num-input:focus { border-color: var(--brand); }
.print-opts input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--brand); cursor: pointer; }
.print-mode { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.mode-card {
  display: flex; flex-direction: column; gap: 4px;
  border: 1.5px solid var(--line); border-radius: 12px; padding: 14px 16px;
  cursor: pointer; transition: .15s; background: #fff;
}
.mode-card:hover { border-color: #f4c39c; }
.mode-card.active { border-color: var(--brand); background: #fdf3ea; box-shadow: 0 2px 10px rgba(239,125,58,.12); }
.mode-card input { display: none; }
.mode-title { font-size: 14.5px; font-weight: 700; color: var(--text); }
.mode-card.active .mode-title { color: var(--brand-d); }
.mode-desc { font-size: 12px; color: var(--muted); line-height: 1.5; }
.print-ok .res-title { font-weight: 700; color: var(--brand-d); margin-bottom: 8px; font-size: 14px; }
.res-url { background: #fdfaf6; border: 1px dashed var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 10px; }
.res-url a { color: var(--brand); word-break: break-all; font-size: 13px; }
.res-actions { display: flex; gap: 8px; }

/* ===== 手机端适配（上传区紧凑 + 响应式）===== */
@media (max-width: 600px) {
  .dropzone { padding: 10px 8px; }
  .dz-icon { font-size: 18px; }
  .dz-inner p { font-size: 12px; margin: 4px 0; }
  .dz-btns { gap: 8px; margin: 6px 0; }
  .dz-btns .btn { padding: 7px 12px; font-size: 12.5px; }
  .dz-tip { font-size: 11px; }
  .preview-grid { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 6px; }
  .email-add { flex-direction: column; }
  .arch-row { flex-direction: column; align-items: stretch; }
  /* 裁剪弹窗小屏适配：全屏 + 按钮等分，避免黑边与溢出 */
  .crop-modal {
    width: 100% !important;
    max-width: 100vw !important;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }
  .crop-modal .modal-title { padding: 14px 16px 4px; font-size: 15px; }
  .crop-tip { font-size: 11px; line-height: 1.4; margin: 2px 8px; }
  .crop-tools { gap: 4px; padding: 0 8px; margin: 6px 0; }
  .crop-tools .tool { padding: 7px 6px; font-size: 12px; flex: 1 1 auto; min-width: 0; white-space: nowrap; }
  .modal-actions { padding: 10px 12px 14px; gap: 8px; }
  .modal-actions .ghost,
  .modal-actions .primary { flex: 1 1 auto; padding: 11px; font-size: 14px; }
}

/* ===== 主导航 TABS ===== */
.tabs { display: flex; gap: 10px; background: var(--card); padding: 6px; border-radius: 12px; box-shadow: var(--shadow); }
.tab { flex: 1; border: none; background: transparent; color: var(--muted); font-size: 15px; font-weight: 700; padding: 12px 0; border-radius: 9px; cursor: pointer; transition: .15s; }
.tab:hover { color: var(--brand); }
.tab.active { background: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(239,125,58,.3); }
.tab-pane { display: flex; flex-direction: column; gap: 16px; }
.tab-pane[hidden] { display: none; }

/* ===== 教师工具：工具卡片 ===== */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.tool-card { display: flex; flex-direction: column; gap: 6px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); cursor: pointer; transition: .15s; }
.tool-card:hover { border-color: var(--brand); box-shadow: 0 4px 14px rgba(239,125,58,.15); transform: translateY(-1px); }
.tc-icon { font-size: 26px; }
.tc-name { font-size: 16px; font-weight: 700; color: var(--text); }
.tc-desc { font-size: 12px; color: var(--muted); line-height: 1.5; }
.tc-go { margin-top: 4px; font-size: 13px; font-weight: 700; color: var(--brand); }

/* ===== 教师工具：口算子页面控制区 ===== */
.math-controls { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.mc-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mc-label { font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; }
.chk-inline { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.param-row { display: flex; gap: 10px; flex-wrap: wrap; width: 100%; }
.param-group { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); flex-wrap: wrap; }
.pg-name { font-size: 12px; font-weight: 700; color: var(--muted); }
.param-sel { padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 12.5px; background: #fff; color: var(--text); }

/* ===== 试卷区 ===== */
.math-paper { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 28px 32px; box-shadow: var(--shadow); }
.pp-head { border-bottom: 2px solid #333; padding-bottom: 10px; margin-bottom: 14px; }
.pp-title { font-size: 24px; font-weight: 700; text-align: center; color: #222; letter-spacing: 2px; }
.pp-sub { text-align: center; font-size: 13px; color: #666; margin-top: 2px; }
.pp-meta { display: flex; justify-content: space-between; gap: 16px; margin-top: 12px; font-size: 13px; color: #333; flex-wrap: wrap; }
.pp-meta span { border-bottom: 1px solid #999; padding: 0 6px 2px; min-width: 90px; }
.pp-sec { margin-bottom: 18px; }
.pp-sec-title { font-size: 15px; font-weight: 700; color: #333; margin-bottom: 10px; padding-left: 8px; border-left: 4px solid #f58a4a; }

.oral-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px 18px; }
.oral-item { font-size: 15px; color: #222; padding: 4px 2px; white-space: nowrap; }
/* .oral-blank: 等号后填空区（无下划线，留 50px 写答案），下方新规则生效 */

.col-item { margin-bottom: 14px; }
.col-q { font-size: 15px; color: #222; margin-bottom: 6px; font-weight: 600; }
.col-grid {
  background-image:
    linear-gradient(to right, rgba(0,0,0,.10) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0,0,0,.10) 1px, transparent 1px);
  background-size: 22px 22px;
  border: 1px solid #ccc; border-radius: 4px; min-height: 90px;
}

.step-item { margin-bottom: 16px; }
.step-q { font-size: 15px; color: #222; margin-bottom: 6px; font-weight: 600; }
.step-lines { display: flex; flex-direction: column; gap: 16px; }
.sl-row { display: flex; align-items: center; gap: 8px; }
.sl-eq { width: 14px; font-size: 15px; color: #222; }
.sl-line { flex: 1; border-bottom: 1px solid #999; }

.ans-tag { display: inline-block; margin-left: 8px; font-size: 12px; color: #c0392b; font-weight: 700; }

/* ===== 打印：只输出试卷 ===== */
@media print {
  .no-print { display: none !important; }
  body { background: #fff !important; }
  .app-shell, .topbar, .tabs { display: none !important; }
  #dash-view { padding: 0 !important; }
  .tab-pane[hidden] { display: none !important; }
  #tab-tools { display: block !important; }
  .tools-page { box-shadow: none; }
  .math-paper { box-shadow: none; border: none; border-radius: 0; padding: 0 8px; margin: 0; }
  .oral-grid { grid-template-columns: repeat(5, 1fr); gap: 8px 20px; }
  .col-grid { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .pp-title { font-size: 22px; }
  @page { margin: 14mm 12mm; }
}

/* ===== 题型分组（口算/计算）===== */
.math-tpl-groups { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.tpl-group { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--bg); }
.tg-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.tg-title { font-size: 14px; font-weight: 700; color: var(--text); }
.tg-tip { font-size: 12px; color: var(--muted); }
.chip.archived { border-style: dashed; opacity: .85; }
.chip .kp-arch { margin-left: 6px; border: 1px solid var(--border); background: #fff; color: var(--brand); font-size: 12px; padding: 2px 8px; border-radius: 6px; cursor: pointer; }
.chip .kp-arch:hover { background: var(--brand); color: #fff; }

/* ===== 下划线统一长度（覆盖旧规则）===== */
.pp-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 12px; font-size: 13px; color: #333; padding: 0 4px; }
.pp-meta .pm-item { display: flex; align-items: baseline; gap: 6px; }
.pp-meta .pm-line { flex: 1; height: 1em; min-width: 60px; }
.oral-blank { display: inline-block; width: 50px; height: 1em; vertical-align: middle; margin-left: 6px; }

/* ===== 口算工具 v3：套数 + 3列 + 空白作答区 + 答案页 ===== */
.pp-set { page-break-after: always; }
.pp-set-title { text-align: center; font-size: 18px; font-weight: 700; color: #222; margin: 6px 0 10px; letter-spacing: 4px; }
.pp-set:last-child { page-break-after: auto; }

.col-area { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 20px; }
.col-item { margin-bottom: 4px; }
.col-q { font-size: 15px; color: #222; margin-bottom: 6px; font-weight: 600; }

.step-area { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 20px; }
.step-item { margin-bottom: 4px; }
.step-q { font-size: 15px; color: #222; margin-bottom: 6px; font-weight: 600; }

.blank-area { background: #fff; border: 1px solid #d8d8d8; border-radius: 4px; }

/* 答案页（教师批阅，独立输出） */
.ans-page { page-break-before: always; }
.ans-title { font-size: 18px; font-weight: 700; text-align: center; color: #222; margin-bottom: 4px; letter-spacing: 2px; }
.ans-page::after { content: '（答案页）'; display: block; text-align: center; font-size: 12px; color: #999; margin-bottom: 10px; }
.ans-sec { margin-bottom: 14px; }
.ans-sec-title { font-size: 14px; font-weight: 700; color: #333; margin-bottom: 8px; padding-left: 8px; border-left: 4px solid #f58a4a; }
.ans-list { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 14px; color: #222; }
.ans-cell { white-space: nowrap; }

@media print {
  .col-area, .step-area { grid-template-columns: repeat(3, 1fr); gap: 12px 16px; }
  .blank-area { border-color: #e5e5e5; }
  .ans-page { page-break-before: always; }
}

/* ===== 答案页 v2：无序号，行列与原题对应 ===== */
.ans-set { margin-bottom: 16px; }
.ans-set-title { font-size: 15px; font-weight: 700; color: #333; margin: 6px 0 10px; letter-spacing: 2px; }
.ans-grid { display: grid; gap: 4px 18px; font-size: 14px; color: #222; }
.ans-grid.oral { grid-template-columns: repeat(4, 1fr); }
.ans-grid.calc { grid-template-columns: repeat(3, 1fr); }
.ans-cell { white-space: nowrap; }
@media print { .ans-grid.oral { grid-template-columns: repeat(5, 1fr); } }

/* ===== 趣味思维练习：24点 ===== */
.p24-item { margin-bottom: 18px; }
.p24-q { font-size: 14px; color: #333; margin-bottom: 8px; }
.p24-cards { display: flex; gap: 10px; margin-bottom: 8px; }
.p24-card { width: 46px; height: 62px; border: 1.5px solid #333; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; background: #fff; color: #c0392b; }
.p24-line { border-bottom: 1px solid #aaa; width: 70%; margin: 6px 0 2px; }

/* ===== 趣味思维：数独 / 幻方 ===== */
.sdk-item { margin-bottom: 24px; }
.sdk-q { font-size: 14px; color: #333; margin-bottom: 8px; }
.sudoku-grid { display: grid; grid-template-columns: repeat(9, 34px); width: max-content; border: 2px solid #333; background: #fff; }
.sd-cell { width: 34px; height: 34px; border: 0.5px solid #bbb; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; color: #222; }
.sd-cell.tb { border-top: 2px solid #333; }
.sd-cell.lf { border-left: 2px solid #333; }
.sd-cell.empty { background: #fbfbfb; }
.sudoku-grid.small { grid-template-columns: repeat(9, 22px); }
.sudoku-grid.small .sd-cell { width: 22px; height: 22px; font-size: 12px; }
.magic-grid { display: grid; grid-template-columns: repeat(3, 52px); width: max-content; border: 2px solid #333; background: #fff; }
.mg-cell { width: 52px; height: 52px; border: 1px solid #999; display: inline-flex; align-items: center; justify-content: center; font-size: 20px; color: #222; }
.mg-cell.empty { background: #fbfbfb; }
.magic-grid.small { grid-template-columns: repeat(3, 32px); }
.magic-grid.small .mg-cell { width: 32px; height: 32px; font-size: 14px; }

/* ===== 趣味思维：找规律 / 图形计数 ===== */
.seq-item { margin-bottom: 16px; }
.seq-q { font-size: 14px; color: #333; margin-bottom: 6px; }
.seq-line { font-size: 17px; color: #222; letter-spacing: 2px; font-weight: 600; }
.seq-hint { margin-left: 10px; }
.shape-item { margin-bottom: 20px; }
.shape-q { font-size: 14px; color: #333; margin-bottom: 10px; }
.shape-svg { margin: 6px 0 10px; }
.shape-line { font-size: 15px; color: #333; }

/* ===== 学情热力图 + 雷达图 ===== */
.hm-wrap { overflow-x: auto; }
.hm-table { border-collapse: collapse; font-size: 12px; }
.hm-table th, .hm-table td { border: 1px solid #e5ddd5; padding: 3px 4px; text-align: center; }
.hm-table th { background: #faf6f1; font-weight: 600; color: #5F5E5A; font-size: 11px; }
.hm-stu { text-align: left !important; min-width: 56px; font-weight: 600; color: #444; white-space: nowrap; }
.hm-cell { width: 36px; height: 28px; min-width: 36px; color: #fff; font-weight: 700; font-size: 11px; }
.hm-row { cursor: pointer; }
.hm-row.sel { outline: 2px solid #D85A30; }
.hm-row.sel td.hm-stu { background: #FAEEDA; }
.radar-wrap { margin-top: 8px; display: flex; justify-content: center; }
.ana-radar-title { font-size: 13px; font-weight: 700; color: #444; margin: 12px 0 2px; }

/* ===== 热力图单元格加宽 + 未分类提醒 ===== */
.hm-table th { min-width: 56px; white-space: nowrap; padding: 6px 4px; }
.hm-cell { width: 56px; height: 36px; min-width: 56px; font-size: 12px; }
.ana-unc-tip { padding: 8px 12px; background: #FFF6E5; border: 1px solid #F5DAA0; border-radius: 6px; color: #8B5A07; font-size: 12.5px; margin-bottom: 14px; }
.hm-cell-none { background: #F7F4F0 !important; color: transparent; }
.chip .kp-reset { margin-left: 4px; border: 1px solid var(--border); background: #fff; color: #185FA5; font-size: 12px; padding: 2px 8px; border-radius: 6px; cursor: pointer; }
.chip .kp-reset:hover { background: #185FA5; color: #fff; }
.hm-table { width: 100%; table-layout: fixed; }
.hm-table th { min-width: 110px; white-space: normal; line-height: 1.35; padding: 8px 6px; vertical-align: bottom; word-break: break-all; font-size: 11px; }
.hm-cell { width: 110px; height: 50px; min-width: 110px; font-size: 13px; }
.hm-stu { width: 80px; min-width: 80px !important; }

/* ===== 作业采集子 tab + 跨页拍摄 ===== */
.sub-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.sub-tab { padding: 8px 20px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg); color: var(--muted); font-size: 14px; font-weight: 700; cursor: pointer; transition: .15s; }
.sub-tab:hover { border-color: var(--brand); color: var(--brand); }
.sub-tab.active { background: var(--brand); color: #fff; border-color: var(--brand); }

.spread-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 10px; }
.spread-col { border: 1px dashed #d8ccc0; border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.spread-title { font-size: 14px; font-weight: 700; color: var(--text); }
.spread-drop { border: 1px dashed #ccc; border-radius: 10px; padding: 18px; text-align: center; background: var(--bg); }
.spread-drop .dz-inner { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.spread-preview { width: 100%; border-radius: 8px; border: 1px solid var(--border); max-height: 240px; object-fit: contain; background: #fff; }
.spread-acts { display: flex; gap: 8px; }
.spread-merge-row { margin-top: 12px; }
.spread-result-title { font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.spread-merged-preview { max-width: 100%; border-radius: 10px; border: 1px solid var(--border); background: #fff; }
@media (max-width: 640px) { .spread-grid { grid-template-columns: 1fr; } }

/* ===== 错题归类管理 ===== */
.classify-block { margin-top: 14px; }
.cb-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.cb-title { font-size: 14px; font-weight: 700; color: var(--text); }
.cb-count { font-size: 12px; color: var(--muted); }
.cb-tip { font-size: 11px; color: var(--muted); }
.classify-list { border: 1px solid var(--border); border-radius: 10px; padding: 8px; background: var(--bg); }
.cl-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-bottom: 1px dashed #eee; font-size: 13px; flex-wrap: wrap; }
.cl-row:last-child { border-bottom: none; }
.cl-row:hover { background: #FFF9F4; }
.cl-check { flex-shrink: 0; }
.cl-date { color: #9A8F86; font-size: 12px; width: 84px; flex-shrink: 0; }
.cl-stu { color: var(--brand-d); font-weight: 600; width: 52px; flex-shrink: 0; }
.cl-q { flex: 1; min-width: 160px; color: var(--text); }
.cl-kp { color: #185FA5; font-size: 12px; flex-shrink: 0; }
.cl-acts { display: flex; gap: 6px; flex-shrink: 0; }
.classify-modal { max-width: 420px; width: 100%; }
