/* 星海智阅 — 设计系统（极光 Aurora 品牌 + 中性主体） */
:root {
  --primary: #6C4DF6;
  --primary-dark: #5A3CE8;
  --primary-light: #F0ECFE;
  --aurora-teal: #2AA89E;
  --info: #4B7DE8;
  --info-light: #EEF4FF;
  --aurora: linear-gradient(135deg, #6C4DF6 0%, #2AA89E 100%);
  --success: #16A085;
  --success-light: #E8F6F4;
  --warning: #E8960A;
  --warning-light: #FDF3E1;
  --danger: #E5484D;
  --danger-light: #FDECEC;
  --neutral: #8A8F98;
  --neutral-light: #F0F1F3;
  --text-primary: #1B1C24;
  --text-secondary: #6B7280;
  --text-muted: #9CA3AF;
  --bg: #F7F8FA;
  --surface: #FFFFFF;
  --border: #E5E7EB;
  --radius-btn: 8px;
  --radius-card: 12px;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-modal: 0 20px 60px rgba(0,0,0,0.15);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Noto Sans SC", -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: none; }

/* ── 顶栏 ── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 16px;
  height: 60px; padding: 0 24px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 700; color: var(--text-primary); }
.brand-logo {
  width: 28px; height: 28px; flex: none;
  object-fit: contain;
}
.topnav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.nav-link {
  padding: 6px 14px; border-radius: 8px;
  font-size: 14px; font-weight: 500; color: var(--text-secondary);
  white-space: nowrap; text-decoration: none;
}
.nav-link:hover { color: var(--primary); background: var(--primary-light); }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-secondary); }
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { color: var(--text-muted); }
.topbar-spacer { flex: 1; }
.user-menu { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-secondary); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary-light); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
}

/* ── 布局 ── */
.container { max-width: 1200px; margin: 0 auto; padding: 24px; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.page-title { font-size: 22px; font-weight: 700; }
.page-sub { color: var(--text-secondary); font-size: 13px; margin-top: 2px; }

/* ── 按钮 ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: var(--radius-btn);
  font-size: 14px; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; transition: all .15s;
  white-space: nowrap; user-select: none;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-secondary { background: var(--surface); color: var(--text-primary); border-color: var(--border); }
.btn-secondary:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { opacity: .9; }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover:not(:disabled) { color: var(--primary); background: var(--primary-light); }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-link { background: none; border: none; color: var(--primary); cursor: pointer; font-size: 13px; }
.btn-link.danger { color: var(--danger); }

/* ── 卡片 ── */
.card {
  background: var(--surface); border-radius: var(--radius-card);
  border: 1px solid var(--border); box-shadow: var(--shadow-card);
}
.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

/* ── 徽章 ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
}
.badge.pending { background: var(--warning-light); color: var(--warning); }
.badge.grading { background: var(--primary-light); color: var(--primary); }
.badge.graded { background: var(--success-light); color: var(--success); }
.badge.todo { background: var(--neutral-light); color: var(--neutral); }
.badge.danger { background: var(--danger-light); color: var(--danger); }
.badge-sub { color: var(--text-muted); }

/* ── 表单 ── */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-secondary); }
.input, select.input, textarea.input {
  width: 100%; padding: 10px 12px; border-radius: var(--radius-btn);
  border: 1px solid var(--border); font-size: 14px; font-family: inherit;
  background: var(--surface); transition: border-color .15s;
}
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.field-error { color: var(--danger); font-size: 12px; margin-top: 4px; }

/* ── 表格 ── */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
.table th { font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .3px; }
.table tr:hover td { background: #FAFBFC; }
.table .row-actions { display: flex; gap: 8px; }

/* ── Tab ── */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.tab {
  padding: 10px 20px; font-size: 14px; font-weight: 600; cursor: pointer;
  color: var(--text-secondary); border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab .count { color: var(--text-muted); font-weight: 400; margin-left: 4px; }

/* ── 弹窗 ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center;
  animation: fadeIn .15s;
}
.modal {
  background: var(--surface); border-radius: var(--radius-card);
  box-shadow: var(--shadow-modal); width: 90%; max-width: 480px; padding: 24px;
}
.modal-title { font-size: 17px; font-weight: 700; margin-bottom: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ── Toast ── */
#toast-container { position: fixed; top: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  padding: 12px 18px; border-radius: 10px; background: var(--surface);
  box-shadow: var(--shadow-modal); font-size: 14px; min-width: 220px; max-width: 360px;
  border-left: 3px solid var(--primary); animation: slideIn .2s;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }

/* ── 空状态 ── */
.empty {
  text-align: center; padding: 60px 20px; color: var(--text-secondary);
}
.empty .empty-icon { font-size: 48px; margin-bottom: 12px; opacity: .6; }
.empty h3 { font-size: 16px; color: var(--text-primary); margin-bottom: 6px; }

/* ── 分屏 ── */
.split {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.split-pane { border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); overflow: hidden; }
.split-pane .pane-head { padding: 12px 16px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 14px; background: #FAFBFC; }
.split-pane .pane-body { padding: 16px; max-height: 75vh; overflow-y: auto; }
.split-pane img { max-width: 100%; border-radius: 6px; margin-bottom: 12px; display: block; }

/* ── 批改结果 Markdown ── */
.md-body h1, .md-body h2, .md-body h3 { margin: 16px 0 8px; }
.md-body h2 { font-size: 17px; }
.md-body h3 { font-size: 15px; }
.md-body p { margin: 8px 0; }
.md-body blockquote {
  margin: 8px 0; padding: 8px 14px; border-left: 3px solid var(--primary);
  background: var(--primary-light); border-radius: 0 6px 6px 0; color: var(--text-primary);
}
.md-body ul, .md-body ol { margin: 8px 0 8px 20px; }
.md-body .katex-display { overflow-x: auto; padding: 6px 0; }

/* ── 批改报告（HTML 排版视图）── 极光风 · 冰原光带 ── */
.grading-report {
  position: relative;
  background:
    radial-gradient(1100px 480px at 88% -12%, rgba(108, 77, 246, 0.09), transparent 60%),
    radial-gradient(900px 420px at -8% 26%, rgba(42, 168, 158, 0.08), transparent 55%),
    radial-gradient(760px 360px at 50% 114%, rgba(108, 77, 246, 0.06), transparent 60%),
    #FDFDFE;
  border-radius: 16px;
  padding: 30px 32px 42px;
  line-height: 1.7;
}

/* 卷面头部（学校名 + 校训）—— 试卷抬头，居中 + 极光分隔线 */
.grading-report .paper-header {
  position: relative;
  text-align: center;
  padding: 2px 0 20px;
  margin-bottom: 22px;
}
.grading-report .paper-header::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 160px;
  height: 3px;
  border-radius: 2px;
  background: var(--aurora);
  opacity: 0.55;
}
.grading-report .paper-title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-primary);
}
.grading-report .paper-subtitle {
  margin-top: 6px;
  font-size: 11.5px;
  letter-spacing: 1.5px;
  color: var(--text-muted);
}
.grading-report .paper-motto {
  margin-top: 4px;
  font-size: 13px;
  letter-spacing: 6px;
  color: var(--primary);
  font-weight: 600;
}

/* 学生信息栏 —— 下划线填空条目 */
.grading-report .student-info {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin-bottom: 18px;
  font-size: 14px;
  color: var(--text-primary);
}
.grading-report .student-info-item {
  white-space: nowrap;
  line-height: 1.9;
}

/* 学生总得分 —— 极光高亮卡 */
.grading-report .total-score {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
  padding: 12px 18px;
  background: linear-gradient(90deg, rgba(108, 77, 246, 0.09), rgba(42, 168, 158, 0.09));
  border: 1px solid rgba(108, 77, 246, 0.16);
  border-radius: 10px;
}
.grading-report .total-score-value {
  font-size: 17px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.5px;
}
.grading-report .total-score-note {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* 大题 —— 冰台（磨砂玻璃卡片） */
.grading-report .section {
  margin-bottom: 28px;
  padding: 22px 24px 24px;
  background: rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  border: 1px solid rgba(108, 77, 246, 0.10);
  border-radius: 14px;
  box-shadow:
    0 1px 2px rgba(27, 28, 36, 0.04),
    0 10px 28px -14px rgba(108, 77, 246, 0.16);
}

/* 大题标题 —— 极光竖条发光 */
.grading-report .section-label {
  position: relative;
  padding-left: 16px;
  margin: 0 0 10px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--text-primary);
}
.grading-report .section-label::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 20px;
  border-radius: 2px;
  background: var(--aurora);
  box-shadow: 0 0 12px rgba(108, 77, 246, 0.4);
}

/* 分值/说明 */
.grading-report .section-instruction {
  margin: -2px 0 18px 16px;
  padding-left: 12px;
  border-left: 2px solid var(--border);
  font-size: 12.5px;
  color: var(--text-muted);
}

/* 题目块 */
.grading-report .question {
  position: relative;
  margin-bottom: 14px;
  padding: 18px 20px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.grading-report .question:last-child { margin-bottom: 0; }
.grading-report .question:hover {
  border-color: rgba(108, 77, 246, 0.28);
  box-shadow: 0 6px 20px -10px rgba(108, 77, 246, 0.22);
}

/* 题号 —— 紫晶石 */
.grading-report .question-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  margin: 0 10px 8px 0;
  padding: 3px 11px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  box-shadow:
    inset 0 0 0 1px rgba(108, 77, 246, 0.14),
    0 2px 8px -2px rgba(108, 77, 246, 0.25);
  vertical-align: middle;
}

/* 题目原文 */
.grading-report .question-text {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-primary);
}

/* 学生回答 —— 冰川蓝光带 */
.grading-report .student-answer {
  margin-top: 14px;
  padding: 13px 16px 13px 18px;
  background: linear-gradient(90deg, rgba(75, 125, 232, 0.10), rgba(75, 125, 232, 0.02));
  border: 1px solid rgba(75, 125, 232, 0.16);
  border-left: 3px solid var(--info);
  border-radius: 0 10px 10px 0;
  font-size: 14px;
  line-height: 1.75;
}
.grading-report .student-answer::before {
  content: '学生回答';
  display: block;
  width: fit-content;
  margin-bottom: 8px;
  padding: 2px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--info);
  background: rgba(75, 125, 232, 0.14);
}

/* 参考答案 —— 极光青光带 */
.grading-report .reference-answer {
  margin-top: 12px;
  padding: 13px 16px 13px 18px;
  background: linear-gradient(90deg, rgba(22, 160, 133, 0.09), rgba(22, 160, 133, 0.02));
  border: 1px solid rgba(22, 160, 133, 0.16);
  border-left: 3px solid var(--success);
  border-radius: 0 10px 10px 0;
  font-size: 14px;
  line-height: 1.75;
}
.grading-report .reference-answer::before {
  content: '参考答案';
  display: block;
  width: fit-content;
  margin-bottom: 8px;
  padding: 2px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--success);
  background: rgba(22, 160, 133, 0.14);
}

/* 得分 —— 翠玉徽章 */
.grading-report .score {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 14px 8px 0 0;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: var(--success);
  background: var(--success-light);
  box-shadow: inset 0 0 0 1px rgba(22, 160, 133, 0.16);
}
.grading-report .score::before { content: '✓'; font-weight: 800; }

/* 知识点 —— 紫水晶标签 */
.grading-report .knowledge-point {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 14px 8px 0 0;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  box-shadow: inset 0 0 0 1px rgba(108, 77, 246, 0.13);
}
.grading-report .knowledge-point::before { content: '◆'; font-size: 10px; }

/* 得分原因 —— 冰下刻痕 */
.grading-report .reason {
  clear: both;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px dashed var(--border);
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-secondary);
}
.grading-report .reason::before {
  content: '得分原因';
  margin-right: 8px;
  font-weight: 700;
  color: var(--text-primary);
}

/* 嵌套大题（大题内的小题分组）—— 降级为透明缩进分组 */
.grading-report .section .section {
  margin-bottom: 18px;
  padding: 0 0 0 16px;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  border-left: 2px solid rgba(108, 77, 246, 0.16);
  border-radius: 0;
  box-shadow: none;
}
.grading-report .section .section .section-label { font-size: 15px; }
.grading-report .section .section .section-label::before { width: 3px; height: 16px; }

/* 嵌套题目（1.1 / (1)(2)）—— 降级 */
.grading-report .question .question {
  margin: 12px 0 8px;
  padding: 14px 16px;
  background: #FBFBFD;
  border-color: rgba(108, 77, 246, 0.08);
  border-radius: 10px;
  box-shadow: none;
}
.grading-report .question .question .question-number {
  min-width: 28px;
  padding: 2px 9px;
  font-size: 12px;
}

/* 公式在报告内的适配 */
.grading-report .katex { font-size: 1.05em; }
.grading-report .katex-display { overflow-x: auto; margin: 10px 0; padding: 4px 0; }

.math-fallback { color: var(--danger); font-family: monospace; font-size: 13px; }

/* ── 进度条 ── */
.progress { height: 8px; border-radius: 4px; background: var(--neutral-light); overflow: hidden; }
.progress-bar { height: 100%; background: var(--aurora); border-radius: 4px; transition: width .3s; }

/* ── 登录 / 注册（星海分屏 · 左品牌区 + 右表单区）── */
.auth-page {
  min-height: 100vh; display: grid;
  grid-template-columns: minmax(400px, 44%) 1fr;
  background: var(--surface);
}
.auth-brand {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center;
  padding: 72px 64px; color: #fff;
  background:
    radial-gradient(1100px 640px at 18% -12%, rgba(42, 168, 158, 0.38), transparent 56%),
    radial-gradient(900px 600px at 112% 112%, rgba(108, 77, 246, 0.55), transparent 62%),
    linear-gradient(152deg, #22194e 0%, #372a86 46%, #1e5662 100%);
}
/* 星点纹理 */
.auth-brand::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 18%, rgba(255,255,255,.7), transparent 50%),
    radial-gradient(1.5px 1.5px at 28% 62%, rgba(255,255,255,.5), transparent 50%),
    radial-gradient(2px 2px at 44% 30%, rgba(255,255,255,.6), transparent 50%),
    radial-gradient(1.5px 1.5px at 58% 74%, rgba(255,255,255,.45), transparent 50%),
    radial-gradient(1px 1px at 70% 22%, rgba(255,255,255,.6), transparent 50%),
    radial-gradient(2px 2px at 82% 58%, rgba(255,255,255,.5), transparent 50%),
    radial-gradient(1.5px 1.5px at 90% 36%, rgba(255,255,255,.55), transparent 50%),
    radial-gradient(1.5px 1.5px at 8% 88%, rgba(255,255,255,.4), transparent 50%),
    radial-gradient(2px 2px at 36% 90%, rgba(255,255,255,.35), transparent 50%);
  pointer-events: none;
}
.auth-brand::after {
  content: '';
  position: absolute; width: 420px; height: 420px; border-radius: 50%;
  background: rgba(108, 77, 246, 0.28); filter: blur(100px);
  bottom: -120px; left: -120px; pointer-events: none;
}
.auth-brand .brand { position: relative; z-index: 1; color: #fff; font-size: 26px; gap: 14px; }
.auth-brand .brand-logo { width: 44px; height: 44px; filter: drop-shadow(0 2px 8px rgba(255,255,255,.35)); }
.auth-brand-headline {
  position: relative; z-index: 1;
  margin-top: 22px; font-size: 30px; font-weight: 800; letter-spacing: 1px; line-height: 1.35;
}
.auth-brand-sub { position: relative; z-index: 1; margin-top: 12px; font-size: 15px; color: rgba(255,255,255,.82); letter-spacing: .5px; }
.auth-brand-points { position: relative; z-index: 1; margin-top: 40px; display: flex; flex-direction: column; gap: 18px; }
.auth-brand-point { display: flex; align-items: flex-start; gap: 14px; }
.auth-brand-point .ic {
  flex: none; width: 34px; height: 34px; border-radius: 10px; margin-top: 1px;
  display: flex; align-items: center; justify-content: center; font-size: 17px;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22);
  backdrop-filter: blur(4px);
}
.auth-brand-point b { display: block; font-size: 15px; font-weight: 700; }
.auth-brand-point span { display: block; font-size: 13px; color: rgba(255,255,255,.7); margin-top: 2px; }
.auth-brand-foot { position: relative; z-index: 1; margin-top: 56px; font-size: 12px; color: rgba(255,255,255,.55); line-height: 1.8; }

/* 右表单区 */
.auth-panel {
  display: flex; align-items: center; justify-content: center;
  padding: 40px 24px; position: relative; overflow: hidden;
  background:
    radial-gradient(900px 500px at 100% -8%, rgba(108, 77, 246, 0.05), transparent 55%),
    radial-gradient(700px 420px at -10% 110%, rgba(42, 168, 158, 0.05), transparent 55%),
    var(--bg);
}
.auth-card {
  width: 400px; max-width: 92vw; position: relative; z-index: 1;
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: 0 20px 50px -20px rgba(27, 28, 36, 0.18);
  padding: 40px 36px;
}
.auth-card .brand { justify-content: center; font-size: 22px; margin-bottom: 4px; }
.auth-sub { text-align: center; color: var(--text-secondary); font-size: 13px; margin-bottom: 24px; }
/* 角色 tab：胶囊分段控件 */
.auth-card .tabs {
  display: flex; gap: 4px; border: none; border-bottom: none;
  background: var(--neutral-light); border-radius: 12px; padding: 4px; margin-bottom: 26px;
}
.auth-card .tab {
  flex: 1; text-align: center; padding: 9px 0; border-radius: 9px;
  border-bottom: none; margin-bottom: 0; font-weight: 600;
  transition: all .15s;
}
.auth-card .tab.active {
  background: var(--surface); color: var(--primary);
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
}
/* 同意条款 */
.auth-consent {
  display: flex; align-items: flex-start; gap: 8px;
  margin: 4px 0 18px; font-size: 12.5px; color: var(--text-secondary); line-height: 1.6;
}
.auth-consent input { margin-top: 3px; flex: none; accent-color: var(--primary); }
.auth-consent a { font-weight: 600; }
.auth-foot {
  margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border);
  text-align: center; font-size: 12px; color: var(--text-muted); line-height: 1.9;
}
.auth-foot a { color: var(--text-secondary); }
.auth-foot a:hover { color: var(--primary); }
.auth-foot .sep { margin: 0 8px; color: var(--border); }
.auth-foot .co { margin-top: 6px; color: var(--text-muted); }

@media (max-width: 860px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-panel { padding: 24px 16px; }
  .auth-card { padding: 32px 24px; }
}

/* ── 知识标签 ── */
.ktag {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  background: var(--primary-light); color: var(--primary); font-size: 12px; font-weight: 600;
}

/* ── 学习建议 / 入口卡 ── */
.entry-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  padding: 28px; border-radius: var(--radius-card); background: var(--surface);
  border: 1px solid var(--border); cursor: pointer; transition: all .15s;
}
.entry-card:hover { border-color: var(--primary); box-shadow: var(--shadow-card); transform: translateY(-2px); }
.entry-icon { width: 48px; height: 48px; border-radius: 12px; background: var(--primary-light); display: flex; align-items: center; justify-content: center; font-size: 24px; }
.entry-card h3 { font-size: 17px; }
.entry-card p { color: var(--text-secondary); font-size: 13px; }

/* ── 上传 ── */
.dropzone {
  border: 2px dashed var(--border); border-radius: var(--radius-card);
  padding: 40px; text-align: center; cursor: pointer; color: var(--text-secondary);
  transition: all .15s;
}
.dropzone.dragover { border-color: var(--primary); background: var(--primary-light); }
.file-list { margin-top: 16px; }
.file-item { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; }

/* ── 骨架/加载 ── */
.spinner {
  width: 16px; height: 16px; border: 2px solid var(--neutral-light);
  border-top-color: var(--primary); border-radius: 50%; display: inline-block;
  animation: spin .7s linear infinite; vertical-align: -3px;
}
.spinner-lg { width: 28px; height: 28px; border-width: 3px; }
.loading { text-align: center; padding: 40px; color: var(--text-secondary); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } }

/* ── 响应式 ── */
@media (max-width: 1024px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .container { padding: 16px; }
  .table { display: block; overflow-x: auto; }
}

/* ── 学生端：我的作业卡片（移动优先）── */
.st-card {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 18px 20px; margin-bottom: 12px;
}
.st-card-main { flex: 1; min-width: 0; }
.st-card-title { font-size: 16px; font-weight: 700; margin-bottom: 4px; word-break: break-word; }
.st-card-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.st-card-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* ── 学生端：报告 ── */
.rpt-total {
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  padding: 18px 20px; margin-bottom: 16px;
  background: linear-gradient(90deg, rgba(108, 77, 246, 0.09), rgba(42, 168, 158, 0.09));
  border: 1px solid rgba(108, 77, 246, 0.16); border-radius: 12px;
}
.rpt-total-label { font-size: 13px; color: var(--text-secondary); font-weight: 600; }
.rpt-total-value { font-size: 28px; font-weight: 800; color: var(--primary); }
.rpt-total-max { font-size: 16px; color: var(--text-muted); font-weight: 600; }
.rpt-section { margin-bottom: 16px; }
.rpt-section-title { font-size: 15px; font-weight: 700; margin-bottom: 10px; }
.rpt-item { padding: 16px 18px; margin-bottom: 12px; }
.rpt-item-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.rpt-qno {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 30px; padding: 2px 10px; border-radius: 8px;
  font-size: 13px; font-weight: 700; color: var(--primary); background: var(--primary-light);
}
.rpt-q { margin-bottom: 10px; }
.rpt-ref {
  margin-top: 10px; padding: 12px 14px;
  background: var(--success-light); border-left: 3px solid var(--success);
  border-radius: 0 8px 8px 0;
}
.rpt-ref-tag { display: block; font-size: 11px; font-weight: 700; color: var(--success); margin-bottom: 6px; }
.rpt-reason { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); font-size: 13px; color: var(--text-secondary); }
.rpt-reason::before { content: '得分原因 '; font-weight: 700; color: var(--text-primary); }

/* ── 移动端（375px）—— 无横向滚动、触摸目标够大 ── */
@media (max-width: 640px) {
  .st-card { flex-direction: column; align-items: stretch; }
  .st-card-side { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; }
  .st-card-actions { justify-content: flex-end; }
  .st-card-actions .btn, .st-card-side .btn { min-height: 40px; padding: 8px 16px; }
  .topbar { padding: 0 14px; gap: 10px; }
  .rpt-item { padding: 14px; }
}

/* ════════════════════════════════════════════════════════════
   试卷渲染（结构化 JSON → HTML）—— 蓝本题面 + 批改详情共用
   冰原光带家族：紫=结构/题号，蓝=学生作答，绿=参考答案，红斜体=识别不确定
   ════════════════════════════════════════════════════════════ */
.paper-render { line-height: 1.7; color: var(--text-primary); }
.paper-render .section { margin: 0 0 18px; }
.paper-render .section-head { display: flex; align-items: center; gap: 10px; margin: 18px 0 10px; }
.paper-render .section-title { font-size: 16px; font-weight: 700; }
.paper-render .section-title::before {
  content: ''; display: inline-block; width: 4px; height: 16px;
  background: var(--aurora); border-radius: 2px; margin-right: 9px; vertical-align: -3px;
}
.paper-render .section-score { margin-left: auto; color: var(--text-muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.paper-render .section .qcard { margin-left: 16px; box-shadow: 0 5px 18px rgba(30,40,80,.05); }
.paper-render .qcard {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 18px 22px; margin: 0 0 16px; box-shadow: 0 6px 24px rgba(30,40,80,.06);
}
.paper-render .qhead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.paper-render .qno { font-size: 18px; font-weight: 800; color: var(--primary); }
.paper-render .qtype { color: #fff; font-size: 12px; padding: 2px 10px; border-radius: 20px; }
.paper-render .qscore { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.paper-render .qmax { margin-left: auto; color: var(--text-muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.paper-render .flag-review {
  display: inline-block; background: var(--warning-light); color: var(--warning);
  font-size: 12px; border-radius: 6px; padding: 1px 8px; margin-left: 6px;
}
.paper-render .qbody { margin: 12px 0 8px; }
.paper-render .qtext { font-size: 15px; }
.paper-render .ans { border-radius: 10px; padding: 10px 14px; margin: 8px 0; font-size: 14px; }
.paper-render .ans.student { background: var(--info-light); border-left: 3px solid var(--info); }
.paper-render .ans.student::before { content: '学生作答'; display: block; font-size: 11px; color: var(--info); margin-bottom: 2px; font-weight: 600; }
.paper-render .ans.student.process::before { content: '解题过程'; display: block; font-size: 11px; color: var(--info); margin-bottom: 2px; font-weight: 600; }
.paper-render .ans.student.result::before { content: '最终答案'; display: block; font-size: 11px; color: var(--info); margin-bottom: 2px; font-weight: 600; }
.paper-render .ans.ref { background: var(--success-light); border-left: 3px solid var(--success); }
.paper-render .ans.ref::before { content: '参考答案'; display: block; font-size: 11px; color: var(--success); margin-bottom: 2px; font-weight: 600; }
.paper-render .ans.expl { background: var(--primary-light); border-left: 3px solid var(--primary); }
.paper-render .ans.expl::before { content: '解析'; display: block; font-size: 11px; color: var(--primary); margin-bottom: 2px; font-weight: 600; }
.paper-render .qbar { margin: 10px 0; }
.paper-render .qbar .bar, .paper-render .pbar .bar { height: 8px; background: #eceff6; border-radius: 4px; overflow: hidden; }
.paper-render .qbar .bar-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--success)); }
.paper-render .qbar .bar-label { font-size: 12px; color: var(--text-muted); margin-top: 3px; font-variant-numeric: tabular-nums; }
.paper-render .tags { margin: 8px 0 0; }
.paper-render .tag { display: inline-block; font-size: 12px; border-radius: 6px; padding: 2px 8px; margin: 0 6px 4px 0; }
.paper-render .tag.kp { background: var(--primary-light); color: var(--primary); }
.paper-render .tag.diff, .paper-render .tag.skill { background: var(--info-light); color: var(--info); }
.paper-render .errs { margin: 8px 0 0; }
.paper-render .err { display: inline-block; background: var(--danger-light); color: var(--danger); font-size: 12px; border-radius: 6px; padding: 2px 8px; margin: 0 6px 4px 0; }
.paper-render .reason { color: var(--text-secondary); font-size: 13px; background: var(--neutral-light); border-radius: 8px; padding: 8px 12px; margin: 8px 0 0; }
.paper-render .reason b { color: var(--text-primary); }
.paper-render .points { margin: 10px 0 0; }
.paper-render .point { display: flex; align-items: center; gap: 10px; margin: 4px 0; }
.paper-render .pname { width: 120px; flex: none; font-size: 13px; color: var(--text-primary); }
.paper-render .pbar { flex: 1; }
.paper-render .pbar .bar { height: 6px; }
.paper-render .pbar .bar-fill { height: 100%; background: var(--primary); }
.paper-render .pbar .bar-label { font-size: 11px; color: var(--text-muted); }
.paper-render .rubrics { margin: 10px 0 0; }
.paper-render .rubric { display: inline-block; margin: 0 10px 6px 0; padding: 3px 10px; border-radius: 6px; background: var(--neutral-light); font-size: 12px; }
.paper-render .rubric-label { color: var(--text-primary); font-weight: 600; }
.paper-render .rubric-max { margin-left: 6px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.paper-render .texfrag { white-space: pre-wrap; }
.paper-render .katex { font-size: 1.05em; }
.paper-render .katex-display { overflow-x: auto; margin: 10px 0; padding: 4px 0; }

/* 识别不确定的内容：去掉 <unsure> 标签后，红 + 斜体提醒（全局 + 试卷渲染内一致） */
.unsure, .paper-render .unsure { color: var(--danger); font-style: italic; }

/* ════════════════════════════════════════════════════════════
   蓝本工作台：2 栏布局（左原卷可收起）+ 模式切换 + 编辑页
   ════════════════════════════════════════════════════════════ */
.bp-layout { display: grid; grid-template-columns: 380px 1fr; gap: 16px; align-items: start; }
.bp-layout.collapsed { grid-template-columns: 1fr; }
.bp-original { position: sticky; top: 76px; }
.bp-original .pane-body { max-height: calc(100vh - 170px); overflow-y: auto; }
.bp-original-head { display: flex; align-items: center; justify-content: space-between; }
.bp-collapse-btn {
  border: none; background: transparent; color: var(--text-muted); cursor: pointer;
  font-size: 13px; padding: 2px 6px; border-radius: 6px;
}
.bp-collapse-btn:hover { background: var(--neutral-light); color: var(--text-primary); }
.bp-show-original {
  display: none; margin-bottom: 12px;
}
.bp-layout.collapsed .bp-show-original { display: inline-flex; }

/* 模式切换条（segmented control） */
.bp-modes { display: inline-flex; gap: 4px; background: var(--neutral-light); border-radius: 10px; padding: 4px; margin-bottom: 14px; }
.bp-mode {
  border: none; background: transparent; padding: 6px 18px; border-radius: 8px;
  font-size: 13px; font-weight: 500; color: var(--text-secondary); cursor: pointer;
}
.bp-mode.active { background: var(--surface); color: var(--primary); box-shadow: 0 1px 3px rgba(0,0,0,.08); font-weight: 600; }

/* Markdown 视图（只读展示） */
.bp-md-view { padding: 18px 20px; }
.bp-md-toolbar { display: flex; gap: 8px; margin-bottom: 12px; }

/* 编辑页（替换视图）：左编辑框 + 右实时预览 */
.bp-editor { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.bp-editor .split-pane { display: flex; flex-direction: column; height: calc(100vh - 180px); }
.bp-editor .pane-body { flex: 1; overflow-y: auto; }
.bp-editor textarea {
  width: 100%; flex: 1; border: none; padding: 16px; resize: none;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px; line-height: 1.7; color: var(--text-primary); background: var(--surface);
  outline: none;
}
.bp-editor-toolbar { display: flex; gap: 8px; margin-bottom: 12px; align-items: center; }
.bp-editor-toolbar .spacer { flex: 1; }

@media (max-width: 1024px) {
  .bp-layout { grid-template-columns: 300px 1fr; }
  .bp-editor { grid-template-columns: 1fr; }
  .bp-editor .split-pane { height: 50vh; }
}
@media (max-width: 640px) {
  .bp-layout { grid-template-columns: 1fr; }
  .bp-original { position: static; }
  .bp-original .pane-body { max-height: 50vh; }
}

/* ── 流程图（navbar 下方统一放置，各工作流页面共用）── */
.flow { display: flex; align-items: stretch; flex-wrap: wrap; margin: 0 0 18px; }
.flow-step {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 10px 30px 10px 14px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); cursor: pointer; text-align: left; font-size: 13px;
  position: relative; min-width: 116px; transition: box-shadow .15s, border-color .15s;
}
.flow-step:not(:disabled):hover { box-shadow: 0 4px 14px rgba(0,0,0,.08); border-color: var(--primary); }
.flow-step-title { font-weight: 600; color: var(--text-primary); }
.flow-step-hint { font-size: 11px; color: var(--text-muted); }
.flow-step.st-ready { border-color: var(--primary); }
.flow-step.st-running { border-color: var(--primary); background: var(--primary-light); cursor: progress; }
.flow-step.st-done { border-color: var(--success); }
.flow-step.st-todo, .flow-step.st-locked { opacity: .55; }
.flow-step.is-disabled { opacity: .55; cursor: not-allowed; }
.flow-check { position: absolute; top: 9px; right: 10px; color: var(--success); font-weight: 700; }
.flow-spin { position: absolute; top: 12px; right: 10px; }
.flow-badge { display: inline-block; font-size: 10px; font-weight: 600; padding: 1px 7px; border-radius: 6px; }
.flow-badge.ai { background: var(--aurora); color: #fff; }
.flow-arrow { align-self: center; color: var(--text-muted); margin: 0 7px; font-size: 18px; }


