/* 嘉豪智慧课堂 · AI 作文智能批改 / 智能阅卷（对齐 bs.zunzhe88.cn 亮黄主题） */
:root {
  --bg: #F5F7FA;
  --card: #FFFFFF;
  --line: #E4E8EE;
  --line-strong: #D7DDE5;
  --text: #1F2937;
  --ink: #14181F;
  --muted: #6B7280;
  --gold: #FFD400;
  --gold-hover: #FFDF52;
  --gold-deep: #C9A500;
  --gold-dark: #A88500;
  --gold-ink: #4F3F00;
  --gold-50: #FFFBEB;
  --gold-100: #FFF4C7;
  --red: #E5484D;
  --green: #25C06A;
  --blue: #3B7DE0;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 1px rgba(15, 23, 42, .03);
  --shadow-float: 0 12px 32px -12px rgba(15, 23, 42, .18);
  --font: Inter, "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 520px at 8% -12%, rgba(255, 212, 0, .16), transparent 62%),
    radial-gradient(700px 460px at 100% 0%, rgba(201, 165, 0, .06), transparent 55%);
  pointer-events: none;
  z-index: -1;
}
button { font-family: inherit; cursor: pointer; border: none; }
input, select, textarea { font-family: inherit; }
a { color: var(--gold-dark); text-decoration: none; }
[hidden], .hidden { display: none !important; }

/* ---------------- 顶部栏（与 bs 一致） ---------------- */
.topbar {
  position: sticky;
  top: 0;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(18px, 3vw, 40px);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  z-index: 40;
}
.login-topbar { position: static; background: transparent; backdrop-filter: none; border-bottom: none; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto; color: #FFD400;
}
.brand-mark svg { display: block; width: 32px; height: 32px; }
.brand-name { font-size: 20px; font-weight: 700; letter-spacing: .5px; color: var(--ink); line-height: 1.15; }
.brand-sub { font-size: 11px; color: var(--muted); letter-spacing: .5px; }
.topbar-ctx { flex: 1; display: flex; align-items: center; justify-content: center; gap: 14px; min-width: 0; padding: 0 24px; }
.ctx-search { position: relative; width: min(360px, 34vw); }
.ctx-search .ctx-ico {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; color: var(--muted); pointer-events: none;
}
.ctx-search input {
  width: 100%;
  height: 36px;
  padding: 0 14px 0 34px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #F7F8FA;
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: border .16s ease, box-shadow .16s ease, background .16s ease;
}
.ctx-search input:focus { border-color: var(--gold-deep); background: #fff; box-shadow: 0 0 0 3px rgba(255, 212, 0, .16); }
.ctx-pill {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #FFFDF3;
  color: var(--gold-ink);
  font-size: 12.5px;
  white-space: nowrap;
}
.ctx-pill svg { width: 15px; height: 15px; color: var(--gold-deep); }
.topbar-class { font-size: 13px; color: var(--gold-dark); font-weight: 600; letter-spacing: .5px; white-space: nowrap; }
.topbar-right { display: flex; gap: 8px; }

/* ---------------- 按钮 ---------------- */
.ghost-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-size: 13px;
  transition: all .16s ease;
}
.ghost-btn:hover { background: var(--gold-50); border-color: var(--gold); color: var(--ink); }
.ghost-btn:disabled { opacity: .45; cursor: not-allowed; }
.ghost-btn svg { width: 15px; height: 15px; }
.ghost-btn.on { background: var(--gold); border-color: var(--gold); color: var(--ink); font-weight: 600; }
.primary-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 12px 24px;
  border-radius: 8px;
  background: var(--gold);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .3px;
  box-shadow: 0 2px 6px rgba(201, 165, 0, .18);
  transition: background .16s ease, transform .16s ease;
}
.primary-btn svg { width: 16px; height: 16px; }
.primary-btn:hover { background: var(--gold-hover); transform: translateY(-1px); }
.primary-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.primary-btn.wide { width: 100%; margin-top: 12px; }
.back-btn { background: none; color: var(--muted); padding: 0; margin-bottom: 8px; font-size: 13px; }
.back-btn:hover { color: var(--ink); }

/* ---------------- 登录（与 bs 一致） ---------------- */
.login-view {
  flex: 1;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  align-items: center;
  gap: clamp(30px, 5vw, 84px);
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: clamp(40px, 8vh, 90px) clamp(18px, 4vw, 60px) 60px;
}
.login-badge {
  display: inline-block;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--gold);
  background: var(--gold-50);
  color: var(--gold-ink);
  font-size: 12px;
  letter-spacing: 1px;
}
.login-left h1 {
  font-size: clamp(36px, 4.4vw, 64px);
  line-height: 1.14;
  margin: 18px 0 20px;
  letter-spacing: -.5px;
  font-weight: 700;
  color: var(--ink);
}
.login-features { display: flex; gap: 32px; margin: 26px 0 0; flex-wrap: wrap; }
.feature b { display: block; font-size: 24px; color: var(--ink); font-weight: 700; }
.feature b::after { content: ""; display: block; width: 22px; height: 3px; background: var(--gold); margin-top: 6px; border-radius: 2px; }
.feature span { font-size: 12px; color: var(--muted); }
.login-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(26px, 3vw, 40px);
  box-shadow: var(--shadow-float);
}
.login-card h2 { margin: 0 0 22px; font-size: 24px; letter-spacing: .2px; color: var(--ink); }
.field { display: block; margin-bottom: 16px; }
.field span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 7px; letter-spacing: .3px; }
.field select, .field input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: #F9FAFB;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border .16s ease, box-shadow .16s ease, background .16s ease;
}
.field select:focus, .field input:focus {
  border-color: var(--gold-deep);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 212, 0, .16);
}
.check { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; margin: 4px 0 20px; }
.check input { accent-color: var(--gold-deep); }
.login-error { color: var(--red); font-size: 13px; min-height: 18px; margin: 10px 0 0; }

/* ---------------- 视图（与 bs 一致） ---------------- */
.view {
  max-width: 1460px;
  width: 100%;
  margin: 0 auto;
  padding: 30px clamp(18px, 3.4vw, 52px) 48px;
  min-height: calc(100vh - 64px);
  animation: fadeUp .3s ease;
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(22px, 2.2vw, 30px); margin: 0 0 5px; margin-top: 0; letter-spacing: .2px; color: var(--ink); font-weight: 600; }
.section-head p { margin: 0; font-size: 13px; color: var(--muted); }
.muted { color: var(--muted); font-size: 12px; }

/* ---------------- 选人 ---------------- */
.roster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(142px, 1fr)); gap: 12px; }
.roster-item {
  padding: 20px 12px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--line);
  text-align: center;
  transition: all .16s ease;
}
.roster-item:hover {
  transform: translateY(-2px);
  border-color: var(--gold-deep);
  box-shadow: var(--shadow-float);
}
.roster-item b { display: block; font-size: 19px; margin-bottom: 5px; letter-spacing: .2px; color: var(--ink); font-weight: 600; }
.roster-item span { font-size: 11px; color: var(--muted); }
.roster-item em {
  display: inline-block; margin-top: 6px; font-style: normal;
  font-size: 10px; padding: 2px 8px; border-radius: 999px;
  background: #FFF9DB; color: #8A6D00; border: 1px solid #F1E3A2;
}
.chip-group { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
  padding: 7px 13px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.chip.active { background: var(--gold-50); border-color: var(--gold); color: var(--gold-ink); font-weight: 600; }
.empty { text-align: center; color: var(--muted); padding: 60px 0; font-size: 13px; }

/* ---------------- 工作台 ---------------- */
.main {
  display: grid;
  grid-template-columns: 378px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.card-head h2 { font-size: 15px; font-weight: 700; color: var(--ink); margin: 0; letter-spacing: .3px; }
.step {
  width: 22px; height: 22px; border-radius: 7px;
  background: var(--gold); color: var(--ink);
  font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}
.step.alt { background: var(--gold-50); color: var(--gold-dark); border: 1px solid var(--gold-100); }
.card-hint { margin-left: auto; font-size: 11.5px; color: var(--muted); white-space: nowrap; }

/* ---------------- 上传 ---------------- */
.drop {
  border: 1.5px dashed var(--line-strong);
  background: #FFFDF6;
  border-radius: 10px;
  min-height: 168px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  transition: border-color .16s ease, background .16s ease;
}
.drop:hover, .drop.over { border-color: var(--gold); background: var(--gold-50); }
.drop-in { text-align: center; padding: 20px 14px; color: var(--muted); }
.drop-in b { display: block; font-size: 13.5px; margin: 10px 0 4px; color: var(--ink); font-weight: 600; }
.drop-in span { font-size: 11.5px; color: var(--muted); }
.drop-ico {
  width: 44px; height: 44px; margin: 0 auto;
  border-radius: 50%; background: var(--gold-100); color: var(--gold-dark);
  display: inline-flex; align-items: center; justify-content: center;
}
.drop-ico svg { width: 22px; height: 22px; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.thumbs img { width: 74px; height: 74px; object-fit: cover; border-radius: 9px; border: 1px solid var(--line); cursor: pointer; }
.progress { margin-top: 11px; height: 6px; border-radius: 6px; background: #F0F1F4; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #FFD400, #FFC400); transition: width .25s; }

/* ---------------- 表单 ---------------- */
.row { display: flex; gap: 10px; flex-wrap: wrap; }
label.fld { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 96px; }
input[type="text"], input[type="number"], select, textarea {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13.5px;
  color: var(--text);
  background: #F9FAFB;
  outline: none;
  transition: border .16s ease, box-shadow .16s ease, background .16s ease;
}
select { padding-right: 6px; }
input:focus, select:focus, textarea:focus { border-color: var(--gold-deep); background: #fff; box-shadow: 0 0 0 3px rgba(255, 212, 0, .16); }
textarea { width: 100%; min-height: 160px; font-size: 13px; line-height: 1.7; resize: vertical; }

/* ---------------- 结果 ---------------- */
.result-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 420px; gap: 10px; color: #9AA3AF; }
.result-empty svg { width: 64px; height: 64px; color: #D7DDE5; }
.result-empty b { font-size: 14px; color: #6B7280; font-weight: 600; }
.score { display: flex; align-items: baseline; gap: 8px; }
.score b { font-size: 44px; line-height: 1; color: var(--gold-deep); }
.score span { color: var(--muted); font-size: 13px; }
.dims { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.dim { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: #FFFDF6; }
.dim i { font-style: normal; float: right; font-weight: 700; color: var(--gold-deep); }
.dim small { display: block; color: var(--muted); font-size: 12px; }
.dim .lv { font-size: 10.5px; color: var(--gold-ink); background: var(--gold-50); border: 1px solid var(--gold-100); border-radius: 4px; padding: 0 4px; }
.split { font-size: 12.5px; color: var(--muted); margin: 8px 0 2px; }
.split b { color: var(--gold-deep); font-size: 15px; }
.off { margin-left: 8px; font-size: 11px; color: var(--red); border: 1px solid #F3C2C4; background: #FFF1F1; border-radius: 4px; padding: 1px 6px; }
.dim .ev { margin-top: 3px; color: #8A6D00; font-size: 11.5px; }
.note { font-size: 12px; color: #8A6A00; background: #FFF8E6; border: 1px solid #FFE9A8; border-radius: 8px; padding: 6px 10px; margin: 8px 0; }
.para { border-left: 3px solid var(--gold); background: #FFFDF6; border-radius: 0 8px 8px 0; padding: 7px 10px; margin: 6px 0; font-size: 13px; line-height: 1.75; }
.para em { font-style: normal; color: var(--gold-dark); font-weight: 600; margin-right: 6px; }
.para small { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
h4 { margin: 14px 0 6px; font-size: 13.5px; color: var(--ink); }
ul { margin: 0; padding-left: 18px; font-size: 13.5px; line-height: 1.8; }
li { margin: 3px 0; }
.issue { border-left: 3px solid var(--gold); padding: 6px 10px; background: #FFFBE6; border-radius: 0 8px 8px 0; margin: 6px 0; font-size: 13px; }
.issue b { color: var(--gold-dark); font-size: 11.5px; margin-right: 4px; }
.issue em { font-style: normal; color: #9A7B00; }
.issue small { color: var(--muted); display: block; }

/* ---------------- 历史 ---------------- */
.hist { display: flex; flex-direction: column; gap: 7px; max-height: 320px; overflow: auto; }
.hi {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  transition: border .16s ease, background .16s ease;
}
.hi:hover { border-color: var(--gold); background: var(--gold-50); }
.hi .t { flex: 1; min-width: 0; }
.hi .t b { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hi .t span { font-size: 11px; color: var(--muted); }
.hi .sc { font-size: 12px; color: var(--gold-dark); font-weight: 700; white-space: nowrap; }

/* ---------------- 阅卷 ---------------- */
table.result-tbl { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.result-tbl th, .result-tbl td { border-bottom: 1px solid var(--line); padding: 6px 4px; text-align: left; }
.result-tbl th { color: var(--muted); font-weight: 600; }
.result-tbl tr.row-go { cursor: pointer; }
.result-tbl tr.row-go:hover { background: var(--gold-50); }
.ok { color: var(--green); font-weight: 700; }
.no { color: var(--red); font-weight: 700; }
.sum { font-size: 14px; margin: 8px 0; color: var(--muted); }
.sum b { font-size: 30px; color: var(--gold-deep); }
.stage-body { min-height: 420px; }

/* ---------------- 模式选择 ---------------- */
.mode-grid { max-width: 900px; margin: 8vh auto 0; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.mode-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 38px 28px; text-align: center; box-shadow: var(--shadow);
  transition: all .18s ease;
}
.mode-card:hover { transform: translateY(-3px); border-color: var(--gold); box-shadow: var(--shadow-float); background: var(--gold-50); }
.mode-card b { display: block; font-size: 22px; color: var(--ink); letter-spacing: .5px; }
.mode-card span { display: block; margin-top: 8px; font-size: 12.5px; color: var(--muted); }

/* ---------------- 整体扫描 ---------------- */
.batch-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.batch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.batch-grid img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border: 1px solid var(--line); border-radius: 9px; background: #fff; }

/* ---------------- 悬浮窗 ---------------- */
.modal {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(15, 23, 42, .46);
  display: flex; align-items: center; justify-content: center; padding: 18px;
}
.modal-panel {
  width: 100%; max-width: 720px; max-height: 88vh; overflow: auto;
  background: #fff; border-radius: 14px; padding: 20px 22px;
  box-shadow: 0 24px 64px -20px rgba(15, 23, 42, .4);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-head h3 { margin: 0; font-size: 17px; color: var(--ink); }
.close-x { background: none; color: var(--muted); font-size: 22px; line-height: 1; padding: 0 4px; }
.close-x:hover { color: var(--ink); }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.set-summary { font-size: 12.5px; color: var(--muted); line-height: 1.9; word-break: break-all; }
.set-summary b { color: var(--gold-dark); font-weight: 600; }
.paper-rows { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; max-height: 42vh; overflow: auto; }
.paper-rows .prow { display: flex; gap: 6px; align-items: center; }
.paper-rows .prow input:first-child { width: 56px; flex: 0 0 auto; }
.paper-rows .prow input { min-width: 0; }

/* ---------------- 原卷 · 留痕 ---------------- */
.paper-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.paper-tools .check { margin: 0; }
.papers { display: flex; flex-direction: column; gap: 14px; margin-bottom: 14px; }
.paper { position: relative; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.paper .paper-img { display: block; width: 100%; }
.paper .paper-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.stamp {
  position: absolute; right: 16px; top: 14px;
  width: 84px; height: 84px; border: 3px solid #E5484D; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #E5484D; font-weight: 700; font-size: 24px; line-height: 1.05;
  font-family: "Segoe Script", "Comic Sans MS", KaiTi, STKaiti, cursive;
  transform: rotate(-10deg); background: rgba(255, 255, 255, .55);
}
.stamp span { font-size: 11px; font-weight: 600; margin-top: 2px; }
.stamp::after {
  content: ""; position: absolute; left: 16px; right: 16px; bottom: 15px;
  height: 2px; background: #E5484D; opacity: .85; transform: rotate(-2deg);
}
#printArea { display: none; }
@media print {
  body.printing > *:not(#printArea) { display: none !important; }
  body.printing #printArea { display: block !important; }
  #printArea .paper { page-break-after: always; break-after: page; border: none; border-radius: 0; }
  #printArea.marks-only .paper .paper-img { visibility: hidden; }
  #printArea.no-marks .paper .paper-svg,
  #printArea.no-marks .stamp { display: none; }
  @page { margin: 8mm; }
}

/* ---------------- 提示 ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%);
  background: rgba(20, 24, 31, .93); color: #fff;
  padding: 10px 16px; border-radius: 8px; font-size: 13px;
  max-width: 80vw; z-index: 99; box-shadow: var(--shadow-float);
  line-height: 1.6;
}

@media (max-width: 1180px) {
  .main { grid-template-columns: 1fr; }
  .topbar-ctx { padding: 0 10px; }
  .ctx-pill { display: none; }
}
@media (max-width: 900px) {
  .login-view { grid-template-columns: 1fr; padding: 24px 20px 40px; }
  .login-left { text-align: center; }
  .login-features { justify-content: center; gap: 24px; }
  .login-left h1 { margin: 14px 0 10px; }
  .ctx-search { display: none; }
  .topbar-class { font-size: 12px; }
  .dims { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .brand-name { font-size: 17px; }
  .brand-sub { font-size: 10px; }
  .topbar-right .ghost-btn { padding: 7px 10px; font-size: 12px; }
}
