/* ===== 基础 ===== */
:root {
  --primary: #4f6ef7;
  --primary-dark: #3b56d4;
  --primary-light: #eef1ff;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --text: #1f2937;
  --text-2: #6b7280;
  --text-3: #9ca3af;
  --bg: #f5f7fb;
  --card: #ffffff;
  --border: #e5e7eb;
  --radius: 14px;
  --shadow: 0 4px 20px rgba(31, 41, 55, 0.08);
  --shadow-lg: 0 12px 40px rgba(31, 41, 55, 0.15);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.hidden { display: none !important; }

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* ===== 按钮 ===== */
.btn {
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: rgba(0,0,0,0.06); color: var(--text); }
.btn-danger { background: #fee2e2; color: var(--danger); }
.btn-danger:hover { background: #fecaca; }
.btn-success { background: var(--success); color: #fff; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }

/* ===== 表单 ===== */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; }
.input, .select, textarea.input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: #fff;
  outline: none;
  transition: border 0.2s, box-shadow 0.2s;
}
.input:focus, .select:focus, textarea.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.12);
}
textarea.input { resize: vertical; min-height: 80px; line-height: 1.6; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }

/* ===== 登录页 ===== */
.view { min-height: 100vh; }
#view-login { display: flex; align-items: center; justify-content: center; position: relative; padding: 24px; }
.login-bg {
  position: fixed; inset: 0;
  background: linear-gradient(135deg, #4f6ef7 0%, #7c5cf0 45%, #b05cf0 100%);
}
.login-bg::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(255,255,255,0.18) 0%, transparent 50%),
              radial-gradient(circle at 80% 70%, rgba(255,255,255,0.12) 0%, transparent 45%);
}
.login-card {
  position: relative; z-index: 1;
  width: 420px; max-width: 100%;
  background: var(--card);
  border-radius: 20px;
  padding: 40px 36px;
  box-shadow: var(--shadow-lg);
}
.login-logo { text-align: center; margin-bottom: 26px; }
.logo-badge {
  width: 60px; height: 60px; margin: 0 auto 12px;
  background: linear-gradient(135deg, #4f6ef7, #7c5cf0);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px;
  box-shadow: 0 8px 24px rgba(79,110,247,0.35);
}
.logo-badge.small { width: 34px; height: 34px; border-radius: 10px; font-size: 17px; margin: 0; box-shadow: 0 3px 10px rgba(79,110,247,0.3); }
.login-logo h1 { font-size: 22px; margin-bottom: 4px; }
.login-logo p { color: var(--text-3); font-size: 13px; }
.tabs { display: flex; background: var(--bg); border-radius: 12px; padding: 4px; margin-bottom: 24px; }
.tab { flex: 1; border: none; background: transparent; padding: 9px; border-radius: 9px; font-size: 14px; font-weight: 500; color: var(--text-2); }
.tab.active { background: #fff; color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.login-role-title {
  text-align: center; font-size: 15px; font-weight: 600; color: var(--primary);
  background: var(--primary-light); border-radius: 10px; padding: 10px; margin-bottom: 16px;
}
.role-select { display: flex; gap: 12px; }
.role-option { flex: 1; }
.role-option input { display: none; }
.role-option span {
  display: block; text-align: center; padding: 10px;
  border: 1.5px solid var(--border); border-radius: 10px;
  font-size: 14px; color: var(--text-2); transition: all 0.2s;
}
.role-option input:checked + span { border-color: var(--primary); background: var(--primary-light); color: var(--primary); font-weight: 500; }
.hint { text-align: center; color: var(--text-3); font-size: 12px; margin-top: 14px; }
.msg { text-align: center; color: var(--danger); font-size: 13px; min-height: 20px; margin-top: 10px; }

/* ===== 顶栏 ===== */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 28px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.app-title { font-size: 16px; font-weight: 700; }
.role-tag { font-size: 12px; padding: 3px 10px; border-radius: 20px; font-weight: 500; }
.role-tag.teacher { background: #ede9fe; color: #7c3aed; }
.role-tag.student { background: #ecfdf5; color: #059669; }
.role-tag.admin { background: #fef3c7; color: #b45309; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.user-name { font-size: 14px; color: var(--text-2); }

/* ===== 导航 ===== */
.nav-tabs { display: flex; gap: 4px; padding: 0 28px; background: #fff; border-bottom: 1px solid var(--border); }
.nav-tab {
  border: none; background: transparent;
  padding: 14px 18px; font-size: 14px; font-weight: 500; color: var(--text-2);
  border-bottom: 2px solid transparent; transition: all 0.2s;
}
.nav-tab:hover { color: var(--primary); }
.nav-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.content { max-width: 1280px; margin: 0 auto; padding: 28px; }

/* 题库管理面板激活时，整个面板靠左对齐，sidebar/panel-head 都在 panel 内的左侧 */
body.qb-active .content {
  margin-left: 0;
  margin-right: auto;
  max-width: none;
}
.panel { display: none; }
.panel.active { display: block; animation: fadeIn 0.25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.panel-head h2 { font-size: 20px; }
.toolbar { display: flex; gap: 12px; margin-bottom: 20px; }
.toolbar .select { width: 140px; }
#result-task-select .select { width: auto; min-width: 320px; max-width: 100%; }
.search-input { flex: 1; }

/* ===== 卡片 ===== */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex; flex-direction: column; gap: 12px;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(31,41,55,0.12); }
.card-head { display: flex; align-items: center; justify-content: space-between; }
.subject-tag { font-size: 12px; padding: 3px 10px; border-radius: 20px; font-weight: 500; }
.subject-tag.politics { background: #fee2e2; color: #dc2626; }
.subject-tag.history { background: #fef3c7; color: #b45309; }
.subject-tag.default { background: var(--primary-light); color: var(--primary); }
.card-question { font-size: 15px; line-height: 1.6; color: var(--text); }
.card-answer {
  font-size: 13px; color: var(--text-2); line-height: 1.6;
  background: var(--bg); border-radius: 10px; padding: 12px;
  max-height: 120px; overflow-y: auto;
}
.card-answer.dim { color: var(--text-3); }
.card-actions { display: flex; gap: 8px; margin-top: auto; }
.card-actions .btn { flex: 1; }

/* ===== 任务卡片 ===== */
.task-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; }
.task-card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid var(--border);
  padding: 20px; display: flex; flex-direction: column; gap: 12px;
}
.task-title { font-size: 16px; font-weight: 600; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.status-badge { font-size: 12px; padding: 3px 10px; border-radius: 20px; font-weight: 500; white-space: nowrap; }
.status-badge.on { background: #ecfdf5; color: #059669; }
.status-badge.wait { background: #fef3c7; color: #b45309; }
.status-badge.end { background: #f3f4f6; color: #9ca3af; }
.status-badge.assigned { background: var(--primary-light); color: var(--primary); }
.status-badge.completed { background: #d1fae5; color: #047857; font-weight: 600; }
.q-chip.done { background: #d1fae5; color: #047857; border-color: #a7f3d0; }
.task-meta { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); }
.task-meta .row { display: flex; align-items: center; gap: 8px; }
.task-questions { display: flex; flex-wrap: wrap; gap: 6px; }
.q-chip { font-size: 12px; background: var(--bg); border-radius: 8px; padding: 4px 10px; color: var(--text-2); border: 1px solid var(--border); }
.task-progress { background: var(--bg); border-radius: 8px; height: 8px; overflow: hidden; }
.task-progress .bar { height: 100%; background: linear-gradient(90deg, var(--primary), #7c5cf0); border-radius: 8px; transition: width 0.4s; }
.task-foot { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--text-3); margin-top: auto; }
.task-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.task-actions .btn { flex: 1; min-width: 70px; }

/* ===== 统计 ===== */
.stat-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; text-align: center; }
.stat-card .num { font-size: 28px; font-weight: 700; color: var(--primary); }
.stat-card .label { font-size: 13px; color: var(--text-2); margin-top: 4px; }

.table-wrap { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); }
th { background: var(--bg); color: var(--text-2); font-weight: 500; font-size: 12.5px; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafbff; }

/* ===== 分数 ===== */
/* 百分制分数徽标（列表 / 卡片中展示得分） */
.score-badge {
  display: inline-flex; align-items: baseline; gap: 1px;
  padding: 2px 10px; border-radius: 999px;
  font-size: 15px; font-weight: 700; line-height: 1.6;
}
.score-badge i { font-size: 11px; font-style: normal; font-weight: 500; opacity: 0.75; }

/* ===== 成绩统计：顶部索引冻结 ===== */
.result-sticky-header {
  position: sticky;
  top: 56px; /* .topbar 高度 */
  background: var(--bg);
  z-index: 10;
  padding-bottom: 12px;
}
.result-sticky-header .panel-head {
  margin: 0;
  padding-top: 12px;
}
.result-sticky-header .toolbar {
  margin-bottom: 0;
}

/* 学生列表 sidebar 也 sticky，停在顶部索引下方 */
#panel-results .student-sidebar {
  position: sticky;
  top: 220px; /* topbar 56 + sticky-header 约 164 */
  max-height: calc(100vh - 240px);
  display: flex;
  flex-direction: column;
}
/* "👥 学生" 标题：钉在 sidebar 顶部，背景覆盖下方滚动内容 */
#panel-results .student-sidebar .sidebar-title {
  position: sticky;
  top: 0;
  background: var(--card);
  z-index: 5;
  padding: 8px 6px 10px;
  margin: -14px -12px 8px; /* 抵消 sidebar padding，让标题横跨整个卡片宽度 */
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
/* 学生列表：占据剩余高度，内部独立滚动 */
#panel-results .student-sidebar .student-list {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding-right: 4px; /* 给滚动条留点空间 */
}

/* ===== 批量导入预览 ===== */
#bi-pane-text.hidden, #bi-pane-pdf.hidden { display: none; }
.bi-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.bi-item .bi-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
}
.bi-item .bi-head strong { font-size: 13px; color: var(--text); }
.bi-item .bi-head .select { width: 100px; padding: 4px 8px; }
.bi-item .bi-field { margin-bottom: 8px; }
.bi-item .bi-field label {
  font-size: 11px; color: var(--text-2); display: block; margin-bottom: 4px; font-weight: 500;
}
.bi-item .bi-field textarea { font-size: 13px; line-height: 1.5; }

/* ===== 导出 PDF 面板 ===== */
.export-panel {
  margin-top: 24px; padding: 20px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.export-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; font-size: 15px; font-weight: 600; }
.export-row { display: flex; gap: 12px; align-items: flex-end; margin-bottom: 12px; flex-wrap: wrap; }
.export-item { display: flex; flex-direction: column; gap: 6px; }
.export-item label { font-size: 12px; color: var(--text-2); font-weight: 500; }
.export-item .input, .export-item .select { width: 160px; }
.export-btn-item { margin-left: auto; }
.export-btn-item .btn { padding: 10px 24px; }

@media (max-width: 720px) {
  .export-item .input, .export-item .select { width: 100%; }
  .export-row { flex-direction: column; align-items: stretch; }
  .export-btn-item { margin-left: 0; }
}

/* ===== 成绩统计：左右双视图（学生列表 + 详细作答） ===== */
.student-split { display: flex; gap: 16px; align-items: stretch; }
.student-sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px; box-shadow: var(--shadow);
  position: sticky; top: 86px; align-self: flex-start;
}
.sidebar-title { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 10px; padding: 4px 6px; }
.student-list { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.student-list li {
  padding: 10px 12px; border-radius: 9px; cursor: pointer;
  display: flex; flex-direction: column; gap: 6px;
  transition: background 0.15s;
}
.student-list li:hover { background: var(--bg); }
.student-list li.active { background: var(--primary-light); }
.student-list li .name { font-size: 13.5px; font-weight: 500; color: var(--text); }
.student-list li.active .name { color: var(--primary); }
.student-list li .meta { display: flex; gap: 6px; }
.student-list li .badge {
  font-size: 11px; padding: 2px 8px; border-radius: 10px;
  background: var(--bg); color: var(--text-3); font-weight: 500;
}
.student-list li.active .badge { background: #fff; color: var(--primary); }

.student-detail {
  flex: 1; min-width: 0;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 20px 18px; box-shadow: var(--shadow);
  position: relative;
  /* 学生详情卡片自身成为滚动容器，让 detail-header 钉在卡片顶端 */
  max-height: calc(100vh - 240px);
  overflow-y: auto;
}
.student-detail .detail-header {
  position: sticky;
  top: 0; /* 相对 .student-detail 卡片顶部 */
  background: var(--card);
  z-index: 10; /* 提高层级，确保完全遮住下方滚动内容 */
  margin: -12px -20px 0; /* 与 detail-body 紧贴，无间隙 */
  padding: 10px 20px 10px;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(31, 41, 55, 0.06);
}
/* 姓名行：单行布局，姓名标识 + 作答记录标题 + 统计 + 状态，全部一屏内显示 */
.student-detail .detail-name-row {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: nowrap;
  min-width: 0;
}
.student-detail .name-label {
  font-size: 11px; font-weight: 500;
  background: var(--primary-light); color: var(--primary);
  padding: 3px 10px; border-radius: 10px;
  white-space: nowrap;
  line-height: 1.4;
  flex-shrink: 0;
}
.student-detail .name-value {
  font-size: 18px; font-weight: 700; color: var(--text);
  line-height: 1.4;
  flex-shrink: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 130px;
}
.student-detail .title-icon { font-size: 14px; line-height: 1.4; flex-shrink: 0; }
.student-detail .title-text {
  font-size: 13px; font-weight: 600; color: var(--text-2);
  line-height: 1.4;
  white-space: nowrap;
  flex-shrink: 0;
}
.student-detail .status-badge {
  font-size: 11px; padding: 3px 10px; border-radius: 10px;
  white-space: nowrap;
  line-height: 1.4;
  flex-shrink: 0;
}
.student-detail .status-badge.status-none { background: #fee2e2; color: var(--danger); }

.student-detail .detail-body { display: flex; flex-direction: column; gap: 12px; }
.student-detail .dim { font-size: 12px; color: var(--text-3); line-height: 1.4; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.attempt-item {
  background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px;
}
.attempt-item .row1 { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.attempt-item .q-title { font-size: 14px; font-weight: 500; color: var(--text); line-height: 1.5; flex: 1; min-width: 0; }
.attempt-item .meta { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.attempt-item .score-line { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.attempt-item .dim { font-size: 12px; color: var(--text-3); }
.attempt-item .feedback {
  font-size: 13px; color: var(--text-2); background: var(--primary-light);
  border-radius: 8px; padding: 6px 10px; margin-bottom: 10px;
}
.attempt-item .std-answer, .attempt-item .your-answer {
  font-size: 13px; background: var(--bg); border-radius: 8px; padding: 10px 12px; margin-bottom: 6px; line-height: 1.6;
}
.attempt-item .your-answer { margin-bottom: 0; }
.attempt-item .std-answer .label, .attempt-item .your-answer .label { font-size: 11px; color: var(--text-3); margin-bottom: 4px; font-weight: 500; }
.attempt-item .std-answer .text { color: var(--text); }
.attempt-item .your-answer .text { color: var(--text-2); }

@media (max-width: 720px) {
  .student-split { flex-direction: column; }
  .student-sidebar { width: 100%; position: static; }
}

/* ===== 提问记录（学生端）：左右双视图 ===== */
.history-split { display: flex; gap: 16px; align-items: flex-start; }
.history-sidebar {
  width: 200px; flex-shrink: 0;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px; box-shadow: var(--shadow);
  position: sticky; top: 86px;
  align-self: flex-start;
}
.history-sidebar .sidebar-title {
  font-size: 13px; font-weight: 600; color: var(--text-2);
  margin-bottom: 10px; padding: 4px 6px;
}
.his-group-list { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.his-group-list li {
  padding: 10px 12px; border-radius: 9px; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  transition: background 0.15s; font-size: 13.5px;
}
.his-group-list li:hover { background: var(--bg); }
.his-group-list li.active { background: var(--primary-light); color: var(--primary); font-weight: 500; }
.his-group-list li .name { display: flex; align-items: center; gap: 6px; }
.his-group-list li .count {
  font-size: 11px; padding: 2px 8px; border-radius: 10px;
  background: var(--bg); color: var(--text-3); font-weight: 500;
}
.his-group-list li.active .count { background: #fff; color: var(--primary); }
.history-main { flex: 1; min-width: 0; }

@media (max-width: 720px) {
  .history-split { flex-direction: column; }
  .history-sidebar { width: 100%; position: static; }
}

.history-group { margin-bottom: 16px; }
.history-group-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; margin-bottom: 8px;
  background: linear-gradient(135deg, var(--primary-light), #f5f3ff);
  border-radius: 10px; border: 1px solid var(--border);
}
.history-group-head .hg-title { font-size: 14px; font-weight: 600; color: var(--text); }
.history-group-head .hg-meta { font-size: 12.5px; color: var(--text-2); }

/* ===== 背诵历史 ===== */
.history-list { display: flex; flex-direction: column; gap: 14px; }
.history-item { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.history-item .row1 { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 12px; flex-wrap: wrap; }
.history-item .question { font-weight: 600; font-size: 15px; }
.history-item .meta { font-size: 12px; color: var(--text-3); }
.history-item .score-line { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.history-item .feedback { font-size: 13px; color: var(--text-2); }
.history-item .your-answer { font-size: 13px; color: var(--text-2); background: var(--bg); border-radius: 10px; padding: 10px 12px; margin-top: 8px; }

/* ===== 作答页 ===== */
.answer-panel { max-width: 760px; margin: 0 auto; }
.answer-progress { display: flex; gap: 8px; margin-bottom: 20px; }
.answer-progress .dot { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; background: var(--bg); color: var(--text-3); border: 2px solid var(--border); }
.answer-progress .dot.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.answer-progress .dot.done { background: var(--success); color: #fff; border-color: var(--success); }
.answer-progress .line { flex: 1; height: 2px; background: var(--border); margin: auto; }
.answer-progress .line.done { background: var(--success); }

.answer-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); padding: 28px; }
.q-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.q-header .idx { font-size: 14px; font-weight: 700; color: var(--primary); }
.answer-card .question { font-size: 18px; line-height: 1.7; font-weight: 600; margin-bottom: 24px; }

.record-box {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 30px; text-align: center; transition: all 0.2s;
}
.record-box.recording { border-color: var(--danger); background: #fef2f2; }
.record-btn {
  width: 76px; height: 76px; border-radius: 50%;
  border: none; background: var(--primary); color: #fff;
  font-size: 30px; transition: all 0.2s;
  box-shadow: 0 8px 24px rgba(79,110,247,0.35);
}
.record-btn:hover { transform: scale(1.05); }
.record-btn.recording { background: var(--danger); box-shadow: 0 0 0 0 rgba(239,68,68,0.6); animation: pulse 1.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(239,68,68,0.5); } 70% { box-shadow: 0 0 0 16px rgba(239,68,68,0); } 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); } }
.record-tip { margin-top: 14px; font-size: 13px; color: var(--text-2); }
.record-tip .status-text { display: block; margin-top: 6px; font-weight: 500; }

/* 作答输入区：麦克风 + 文字框合并为一块，语音与文字共用同一个作答文本框 */
.answer-input { margin-top: 18px; display: flex; flex-direction: column; gap: 16px; }
.answer-input .record-box { margin: 0; padding: 24px; }
.answer-input .recognized-box { margin: 0; }
.recognized-box label { font-size: 13px; color: var(--text-2); display: block; margin-bottom: 6px; }
.recognized-box textarea { width: 100%; }
.answer-submit-row { display: flex; gap: 12px; margin-top: 20px; align-items: center; justify-content: space-between; }
.answer-submit-row .left { display: flex; gap: 12px; }

.result-box { margin-top: 24px; border-radius: var(--radius); padding: 22px; background: var(--bg); animation: fadeIn 0.3s; }
/* 作答结果：百分制分数展示 */
.result-score { display: flex; align-items: baseline; justify-content: center; gap: 10px; margin-bottom: 12px; }
.result-score-num { font-size: 56px; font-weight: 800; line-height: 1; letter-spacing: -1px; animation: pop 0.35s ease backwards; }
.result-score-num span { font-size: 18px; font-weight: 600; margin-left: 2px; }
.result-score-band { font-size: 13px; font-weight: 600; padding: 3px 12px; border-radius: 999px; }
.result-score-bar { height: 8px; max-width: 320px; margin: 0 auto 16px; border-radius: 999px; background: #e5e7eb; overflow: hidden; }
.result-score-bar i { display: block; height: 100%; border-radius: 999px; transition: width 0.5s ease; }
@keyframes pop { from { transform: scale(0.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.result-feedback { text-align: center; color: var(--text-2); font-size: 14px; margin-bottom: 16px; }
.standard-answer { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-bottom: 16px; }
.standard-answer .label { font-size: 12px; color: var(--text-3); margin-bottom: 6px; }
.standard-answer .text { font-size: 14px; line-height: 1.7; color: var(--text); }
.result-actions { display: flex; justify-content: center; gap: 12px; }

/* ===== 弹窗 ===== */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 20px; backdrop-filter: blur(3px);
}
.modal {
  background: #fff; border-radius: 18px; padding: 26px;
  width: 560px; max-width: 100%; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg); animation: modalIn 0.25s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(0.97); } to { opacity: 1; transform: none; } }
.modal h3 { font-size: 18px; margin-bottom: 20px; }
.modal .form { display: flex; flex-direction: column; gap: 2px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

.chk-list { border: 1.5px solid var(--border); border-radius: 10px; max-height: 220px; overflow-y: auto; padding: 6px; }
.chk-item { display: flex; align-items: flex-start; gap: 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.chk-item:hover { background: var(--bg); }
.chk-item input { margin-top: 3px; accent-color: var(--primary); }
.chk-item .q-subject { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.chk-item.sel { background: var(--primary-light); }

/* ===== Toast ===== */
.toast {
  position: fixed; top: 24px; left: 50%; transform: translateX(-50%);
  background: #1f2937; color: #fff; padding: 12px 22px; border-radius: 12px;
  font-size: 14px; z-index: 200; box-shadow: var(--shadow-lg);
  animation: fadeIn 0.25s;
}
.toast.success { background: #059669; }
.toast.error { background: #dc2626; }

.empty-tip { text-align: center; color: var(--text-3); padding: 60px 0; font-size: 14px; }

/* ===== 题库管理：题组侧边栏 ===== */
.qb-layout {
  display: flex; gap: 20px; align-items: flex-start;
}
.qb-sidebar { width: 250px; flex-shrink: 0; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); padding: 14px; position: sticky; top: 86px; }
.qb-sidebar-header { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 10px; padding: 4px 6px; }
.qb-group-list { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.qb-group-list li {
  padding: 7px 10px; border-radius: 8px; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 6px;
  font-size: 13.5px; color: var(--text); transition: background 0.15s;
}
.qb-group-list li:hover { background: var(--bg); }
.qb-group-list li.active { background: var(--primary-light); color: var(--primary); font-weight: 500; }
.qb-group-list li .count { font-size: 11px; padding: 2px 7px; border-radius: 10px; background: var(--bg); color: var(--text-3); }
.qb-group-list li.active .count { background: #fff; color: var(--primary); }

/* 科目分组（按科目 → 题组二级嵌套，纵向堆叠，题组横向并排） */
.qb-subject-li {
  display: block !important; /* 强制块级，让子元素纵向堆叠 */
  list-style: none !important;
  padding: 0 !important;
  width: 100%; box-sizing: border-box;
}
.qb-subject-li:hover { background: transparent !important; }
.qb-subject-row {
  padding: 9px 10px; border-radius: 8px; cursor: pointer;
  display: flex; justify-content: flex-start; align-items: center;
  gap: 6px;
  white-space: nowrap;
  width: 100%; box-sizing: border-box;
  font-size: 13px; font-weight: 500; color: var(--text-2); transition: background 0.15s;
}
.qb-subject-row .qb-subject-name {
  text-align: left;
}
.qb-subject-row .qb-subject-meta {
  margin-left: auto;
  font-size: 11px; color: var(--text-3); font-weight: normal;
  padding: 2px 8px; border-radius: 10px;
  background: var(--bg);
}
.qb-subject-row:hover { background: var(--bg); }
.qb-subject-row.expanded { color: var(--text); }
.qb-subject-row.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.qb-subject-row.active::before { color: var(--primary); }
.qb-subject-row::before {
  content: '▸'; margin-right: 4px; transition: transform 0.15s; color: var(--text-3);
  flex-shrink: 0;
}
.qb-subject-row.expanded::before { transform: rotate(90deg); color: var(--primary); }
.qb-subject-row .count { flex-shrink: 0; }

/* 题目组：展开后在父科目下方堆叠 + 内部横向多列排列 */
.qb-subject-groups {
  list-style: none !important;
  padding: 4px 0 8px 18px;
  margin: 0 !important;
  width: 100%; box-sizing: border-box;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 4px;
}
.qb-subject-groups .qb-group-item {
  padding: 6px 8px;
  font-size: 12.5px;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 6px;
  width: 100%; box-sizing: border-box;
  white-space: nowrap;
  list-style: none !important;
}
.qb-subject-groups .qb-group-item .name {
  overflow: hidden; text-overflow: ellipsis;
}
.qb-subject-groups .qb-group-item .count {
  flex-shrink: 0; font-size: 10px;
}

.qb-empty-tip { list-style: none; padding: 4px 24px; font-size: 11px; color: var(--text-3); }
.qb-group-list {
  list-style: none !important;
  padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.qb-group-list > li {
  display: flex; justify-content: space-between; align-items: center; gap: 6px;
  list-style: none !important;
  padding: 7px 10px; border-radius: 8px; cursor: pointer;
  font-size: 13.5px; color: var(--text); transition: background 0.15s;
  width: 100%; box-sizing: border-box;
}
.qb-group-list > li:hover { background: var(--bg); }
.qb-group-list > li.active { background: var(--primary-light); color: var(--primary); font-weight: 500; }
.qb-group-list > li .count {
  font-size: 11px; padding: 2px 7px; border-radius: 10px;
  background: var(--bg); color: var(--text-3); flex-shrink: 0;
}
.qb-group-list > li.active .count { background: #fff; color: var(--primary); }
.qb-group-list li.group-actions {
  margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); justify-content: center;
  font-size: 12.5px; color: var(--text-2);
}
.qb-main { flex: 1; min-width: 0; }

@media (max-width: 720px) {
  .qb-layout { flex-direction: column; }
  .qb-sidebar { width: 100%; position: static; }
}

@media (max-width: 720px) {
  .card-grid, .task-grid { grid-template-columns: 1fr; }
  .stat-cards { grid-template-columns: 1fr; }
  .content { padding: 16px; }
  .toolbar { flex-direction: column; }
  .toolbar .select { width: 100%; }
}

/* ============ 麦克风权限提示 ============ */
.mic-perm-tip {
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.6;
  border: 1px solid;
}
.mic-perm-tip .tip-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
}
.mic-perm-tip.denied {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #7f1d1d;
}
.mic-perm-tip.prompt {
  background: #fef3c7;
  border-color: #fde68a;
  color: #92400e;
}
.mic-perm-tip .btn {
  margin-top: 10px;
}
.mic-perm-tip kbd {
  display: inline-block;
  padding: 1px 6px;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 12px;
  font-family: monospace;
}

/* ===== 任务编辑页（独立整页视图） =====
   .topbar 高度约 63px（sticky，见上方 .topbar 定义），整页头栏紧贴其下方吸附 */
body.te-open .content { max-width: none; margin-left: 0; margin-right: auto; padding: 0 28px 48px; }

.te-topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 0; margin-bottom: 16px;
  position: sticky; top: 63px; z-index: 15;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.te-topbar h2 { font-size: 20px; margin-right: auto; }

.te-layout { display: flex; gap: 20px; align-items: flex-start; }
.te-left { flex: 1 1 auto; min-width: 0; }
.te-right {
  width: 380px; flex-shrink: 0;
  display: flex; flex-direction: column; gap: 14px;
  position: sticky; top: 145px;
  max-height: calc(100vh - 165px); overflow-y: auto;
}

.te-left-head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.te-left-head .search-input { flex: 1; min-width: 160px; }
.te-left-head .select { width: 150px; }
.te-tip { font-size: 12.5px; color: var(--text-3); margin-bottom: 12px; }

.te-groups { display: flex; flex-direction: column; gap: 12px; }
.te-group {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow); overflow: hidden;
}
.te-group-head {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; background: var(--primary-light); cursor: pointer;
}
.te-group-head input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; flex-shrink: 0; }
.te-group-name { font-weight: 600; font-size: 14px; }
.te-group-count { font-size: 12px; color: var(--text-2); }
.te-group-desc { font-size: 12px; color: var(--text-3); max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-left: 10px; border-left: 1px solid var(--border); }
.te-group-toggle { margin-left: auto; color: var(--text-2); font-size: 13px; flex-shrink: 0; }
.te-group-body { padding: 6px; display: flex; flex-direction: column; gap: 2px; max-height: 420px; overflow-y: auto; }
.te-group.collapsed .te-group-body { display: none; }

.te-q-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.te-q-row:hover { background: var(--bg); }
.te-q-row.on { background: var(--primary-light); }
.te-q-row input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--primary); flex-shrink: 0; }
.te-q-text { flex: 1; min-width: 0; font-size: 13.5px; line-height: 1.55; }

.te-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow); padding: 14px;
}
.te-card-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.te-picked { max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; }
.te-pick-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; font-size: 13px; cursor: pointer; }
.te-pick-row:hover { background: var(--bg); }
.te-pick-row input[type="checkbox"] { accent-color: var(--primary); flex-shrink: 0; }
.te-pick-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.te-pick-del {
  background: transparent; border: none; cursor: pointer; color: var(--text-3);
  font-size: 17px; line-height: 1; padding: 0 5px; border-radius: 6px; flex-shrink: 0;
}
.te-pick-del:hover { color: var(--danger); background: #fee2e2; }
.te-empty { font-size: 13px; color: var(--text-3); padding: 12px 0; text-align: center; }
.te-hint { font-size: 12px; color: var(--text-3); margin-top: 8px; line-height: 1.6; }

/* 窄屏：右栏改为堆叠在下方 */
@media (max-width: 1100px) {
  .te-layout { flex-direction: column; }
  .te-right { width: 100%; position: static; max-height: none; overflow: visible; }
  .te-topbar { position: static; }
}

/* 批量导入：整页工作区 */
body.batch-workspace-open { overflow: hidden; }
.modal-mask.batch-workspace { padding: 0; background: var(--bg); backdrop-filter: none; }
.batch-workspace .modal {
  width: 100%; max-width: none; height: 100dvh; max-height: none;
  border-radius: 0; padding: 0; box-shadow: none; animation: none;
  display: flex; flex-direction: column; overflow: hidden; background: var(--bg);
}
.bi-workspace-header {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 20px 32px; background: #fff; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.bi-workspace-header h3 { margin: 0 0 6px; font-size: 22px; }
.bi-workspace-header p { margin: 0; color: var(--text-3); font-size: 13px; }
.bi-workspace-header > .btn { white-space: nowrap; }
.bi-workspace-body {
  flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(340px, 2fr) minmax(0, 3fr);
  gap: 24px; padding: 24px 32px; overflow: hidden;
}
.bi-source-panel, .bi-preview-panel {
  min-width: 0; overflow-y: auto; padding: 24px; background: #fff;
  border: 1px solid var(--border); border-radius: 14px;
}
.bi-source-panel #bi-text { min-height: 300px; }
.bi-source-panel #bi-img-text { min-height: 220px; }
.bi-source-panel textarea { resize: vertical; line-height: 1.7; }
.bi-source-panel .tabs { display: flex; }
.bi-source-panel .tab { flex: 1; padding: 12px 8px; white-space: nowrap; }
.bi-group-panel { border-top: 1px solid var(--border); margin-top: 24px; padding-top: 20px; }
.bi-group-panel #bi-new-group { min-width: 0; flex: 1; }
.bi-group-panel #bi-create-group { flex-shrink: 0; white-space: nowrap; }
.bi-group-panel .chk-item { display: flex; align-items: center; gap: 10px; }
.bi-group-panel .chk-item input { width: auto; margin: 0; }
.bi-preview-title { display: block; font-size: 17px; font-weight: 700; margin-bottom: 20px; }
.bi-preview-panel #bi-preview { max-height: none; }
.bi-preview-panel .empty-tip { min-height: 320px; display: grid; place-items: center; }
.bi-preview-panel .bi-field textarea { font-size: 15px; line-height: 1.7; resize: vertical; }
.bi-preview-panel textarea[data-bi-a] { min-height: 150px; }
.bi-workspace-footer {
  margin: 0; padding: 16px 32px; background: #fff; border-top: 1px solid var(--border);
  align-items: center; flex-shrink: 0;
}
.bi-workspace-footer > span { margin-right: auto; color: var(--text-3); font-size: 13px; }
@media (max-width: 850px) {
  .bi-workspace-body { grid-template-columns: 1fr; overflow-y: auto; padding: 16px; gap: 16px; }
  .bi-source-panel, .bi-preview-panel { overflow: visible; padding: 18px; }
  .bi-workspace-header { padding: 16px; gap: 12px; }
  .bi-workspace-header h3 { font-size: 18px; }
  .bi-workspace-header p { display: none; }
  .bi-workspace-footer { padding: 12px 16px; }
  .bi-workspace-footer > span { display: none; }
}

/* 全科记工作台：统一排版、颜色、留白与响应式布局。 */
:root {
  --primary: #2864c5; --primary-dark: #1d4fa3; --primary-light: #edf4ff;
  --success: #27806a; --warning: #b98230; --danger: #bf4b4b;
  --text: #24354e; --text-2: #61718a; --text-3: #7b899e;
  --bg: #f5f7fb; --card: #fff; --border: #e1e7f0;
  --radius: 12px; --shadow: 0 2px 5px #20385d04; --shadow-lg: 0 24px 80px #142c5029;
  --nav-width: 202px; --header-height: 76px; --site-footer-height: 0px;
}
body { font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
/* 备案栏位于正常文档流；固定高度的工作台为它预留一行，避免遮住内容。 */
body.has-site-footer { --site-footer-height: 40px; }
.has-site-footer > .view, .has-site-footer > #view-login { min-height: calc(100dvh - var(--site-footer-height)); }
.site-footer { padding: 12px 16px; color: #999; font-size: 12px; line-height: 16px; text-align: center; flex-shrink: 0; }
.site-footer a { color: inherit; }
.site-footer a:hover { text-decoration: underline; }
.aq-page.has-site-footer { display: flex; flex-direction: column; min-height: 100dvh; }
.aq-page.has-site-footer > .content { flex: 1; width: 100%; }
@media (min-width: 761px) {
  .has-site-footer .view:not(#view-login) > .nav-tabs { bottom: var(--site-footer-height); }
}
a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { touch-action: manipulation; }
button, a, input, select, textarea { outline-offset: 4px; }
:focus-visible { outline: 2px solid var(--primary); }
input[type=checkbox] { accent-color: var(--primary); width: 16px; height: 16px; flex-shrink: 0; }
.btn { border-radius: 7px; padding: 10px 16px; font-weight: 550; line-height: 1.5; transition: background .16s, border-color .16s; }
.btn-primary:hover { transform: none; }
.btn-ghost { background: #fff; border: 1px solid var(--border); color: var(--text-2); }
.btn-ghost:hover { background: #f2f6fc; border-color: #bacce6; }
.btn-danger { background: #fcf2f0; color: #b44a42; }
.btn-success { background: var(--primary); }
.btn-sm { font-size: 12px; padding: 6px 12px; }
.input, .select, textarea.input, #login-form input { border-width: 1px; border-radius: 7px; padding: 11px 13px; background-color: #fff; }
.identity-list { display: grid; gap: 8px; max-height: 55vh; overflow-y: auto; margin-top: 20px; }
.identity-option { display: flex; justify-content: space-between; align-items: center; gap: 16px; text-align: left; }
.identity-option small { display: block; color: var(--text-3); font-weight: normal; margin-top: 4px; }
.input:focus, .select:focus, textarea.input:focus { box-shadow: 0 0 0 3px #2864c513; }
.field label { color: var(--text); font-size: 13px; margin-bottom: 8px; }
.logo-badge, .logo-badge.small { background: var(--primary); border-radius: 9px; box-shadow: none; color: #fff; }
.logo-badge svg { width: 30px; height: 30px; }
.logo-badge.small { width: 38px; height: 38px; }
.logo-badge.small svg { width: 23px; height: 23px; }
.topbar { height: var(--header-height); padding: 0 30px; border-bottom-color: var(--border); gap: 24px; }
.topbar-left { gap: 12px; min-width: 0; }
.app-title { font-size: 17px; letter-spacing: .02em; }
.topbar-right { gap: 10px; }
.user-name { font-size: 12px; }
.role-tag { border-radius: 5px; font-size: 10px; letter-spacing: .08em; padding: 4px 8px; }
.role-tag.teacher, .role-tag.student { background: #edf4ff; color: var(--primary); }
.role-tag.admin { background: #edf4ff; color: #2864c5; }
.view:not(#view-login) > .nav-tabs {
  position: fixed; left: 0; top: var(--header-height); bottom: 0; width: var(--nav-width);
  flex-direction: column; gap: 8px; padding: 38px 18px;
  background: #edf2fa; border-right: 1px solid var(--border); border-bottom: 0; z-index: 15;
}
.view:not(#view-login) > .nav-tabs::before { content: '工作空间'; color: #8594ab; font-size: 10px; letter-spacing: .16em; padding: 0 16px 14px; }
.view:not(#view-login) > .nav-tabs::after { content: '全科记\A反复背诵，牢牢记住'; white-space: pre; position: absolute; bottom: 30px; left: 34px; font-size: 11px; line-height: 2; color: #8494ac; }
.nav-tab { display: flex; align-items: center; gap: 12px; border: 0; padding: 13px 16px; border-radius: 7px; font-size: 13px; text-align: left; }
.nav-tab::before { content: ''; width: 16px; height: 16px; opacity: .65; border: 1.5px solid currentColor; border-radius: 3px; }
.nav-tab[data-view=questionBank]::before, .nav-tab[data-view=myHistory]::before { border-right-width: 5px; }
.nav-tab[data-view=results]::before { border-top: 0; border-right: 0; border-radius: 0; background: linear-gradient(to top, currentColor 0 55%, transparent 55%) 3px 0/3px 100% no-repeat, linear-gradient(to top,currentColor 0 90%,transparent 90%) 9px 0/3px 100% no-repeat; }
.nav-tab.active { color: #fff; background: #2864c5; border: 0; }
.nav-tab:hover:not(.active) { background: #e0eafa; }
.view:not(#view-login) > .content, body.qb-active .view:not(#view-login) > .content, body.te-open .view > .content {
  margin: 0 0 0 var(--nav-width); max-width: none; padding: 36px 38px 60px;
}
.panel.active { animation: none; }
.panel-head { margin-bottom: 26px; gap: 20px; align-items: center; }
.panel-head > div:not(.page-heading) { flex-wrap: wrap; }
.panel-head h2 { font-size: 27px; font-weight: 650; letter-spacing: -.035em; }
.page-heading .eyebrow { display: block; color: #7c8da7; font-size: 10px; font-weight: 650; letter-spacing: .18em; text-transform: uppercase; margin-bottom: 7px; }
.page-heading p { font-size: 12px; color: var(--text-3); margin-top: 7px; }
.overview-strip { display: flex; gap: 32px; padding: 0 0 24px; margin: 0 0 26px; border-bottom: 1px solid var(--border); color: var(--text-3); font-size: 12px; }
.overview-strip strong { font-size: 22px; font-weight: 600; color: var(--text); margin-right: 6px; font-variant-numeric: tabular-nums; }
.qb-layout { gap: 26px; align-items: start; }
.qb-sidebar { width: 208px; flex-shrink: 0; border: 0; background: transparent; box-shadow: none; padding: 0; position: sticky; top: 100px; }
.qb-sidebar-header { padding: 12px 0; font-size: 11px; letter-spacing: .08em; border-bottom: 0; color: var(--text-3); }
.qb-group-list { padding: 0; }
.qb-group-list > li { border-radius: 7px; }
.qb-subject-row { padding: 12px 10px; border-radius: 6px; gap: 5px; flex-wrap: wrap; }
.qb-subject-name { font-size: 12px; }
.qb-subject-meta { font-size: 10px; color: var(--text-3); }
.qb-group-list li.active, .qb-group-item.active { background: #e4eeff; color: var(--primary); }
.qb-group-item { padding: 11px 10px 11px 16px; border-radius: 6px; gap: 5px; line-height: 1.6; }
.qb-group-item .name { font-size: 11px; white-space: normal; overflow: visible; text-overflow: clip; }
.count { font-variant-numeric: tabular-nums; }
.toolbar { padding: 0; margin-bottom: 20px; gap: 10px; align-items: center; }
.toolbar .select { width: 130px; flex-shrink: 0; }
.card-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 285px), 1fr)); gap: 16px; }
.card { padding: 22px; box-shadow: none; gap: 14px; border-radius: 10px; }
.card:hover { transform: none; box-shadow: 0 5px 20px #24354e08; border-color: #bacce6; }
.card-head > span:last-child { font-size: 10px !important; }
.subject-tag { border-radius: 4px; padding: 3px 8px; font-size: 10px; font-weight: 600; }
.subject-tag.politics { color: #965f4b; background: #f5ebe6; }
.subject-tag.history { color: #8b773a; background: #f4efdd; }
.card-question { font-size: 15px; line-height: 1.75; font-weight: 600; min-height: 42px; }
.question-source { margin: 8px 0; min-width: 0; font-size: 12px; line-height: 1.7; }
.question-source > summary { width: fit-content; max-width: 100%; color: var(--primary); cursor: pointer; overflow-wrap: anywhere; }
.question-source > summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 3px; }
.question-source-detail { display: grid; gap: 3px; padding: 8px 10px; margin-top: 6px; border-radius: 6px; background: var(--bg); color: var(--text-2); overflow-wrap: anywhere; }
.question-source-pending > summary { color: #9a5200; }
.question-source-pending .question-source-detail { background: #fff7e8; color: #784b10; }
.card-answer { white-space: pre-wrap; background: #f6f8fc; border-radius: 6px; padding: 12px 14px; font-size: 12px; line-height: 1.85; max-height: 165px; }
.card-label { display: block; font-size: 10px; font-weight: 600; color: #8996ac; margin-bottom: 6px; letter-spacing: .08em; }
.card-keywords { font-size: 10px; line-height: 1.8; color: #8793a6; max-height: 44px; overflow: auto; }
.card-actions { padding-top: 14px; border-top: 1px solid #edf1f7; justify-content: flex-end; }
.card-actions .btn { flex: 0 1 auto; }
.card-actions .btn-ghost { border-color: transparent; background: transparent; }
.task-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 20px; }
.task-card { padding: 24px; box-shadow: none; gap: 18px; }
.task-title { font-size: 17px; }
.task-progress { height: 5px; }
.task-progress .bar { background: var(--primary); }
.task-meta { font-size: 12px; line-height: 1.8; gap: 10px; }
.task-foot { color: var(--text-2); }
.task-actions { padding-top: 14px; border-top: 1px solid var(--border); }
.stat-card { box-shadow: none; text-align: left; padding: 22px 25px; border: 1px solid var(--border); border-radius: 10px; }
.stat-card .num { font-size: 30px; color: var(--text); font-weight: 550; line-height: 1.3; font-variant-numeric: tabular-nums; }
.stat-card .label { font-size: 12px; color: var(--text-3); margin-top: 9px; }
.stat-cards { gap: 18px; margin-bottom: 28px; }
.history-list, .history-group, .table-wrap, .student-sidebar, .student-detail { box-shadow: none; border-color: var(--border); border-radius: 10px; }
.history-item { box-shadow: none; border-color: var(--border); padding: 18px 22px; }
.history-item .row1 { gap: 12px; }
.history-item strong { font-size: 13px; }
.history-item .meta { font-size: 11px; }
#admin-admin-list, #admin-teacher-list, #admin-student-list { padding: 20px; background: #fff; border: 1px solid var(--border); }
#admin-admin-list .history-item, #admin-teacher-list .history-item, #admin-student-list .history-item { border: 0; border-bottom: 1px solid #edf1f7; border-radius: 0; padding: 13px 4px; }
#admin-admin-list h3, #admin-teacher-list h3, #admin-student-list h3 { margin-bottom: 18px !important; }
.student-list li.active { background: var(--primary-light); border-color: var(--primary); }
.result-sticky-header { top: var(--header-height); background: var(--bg); padding-top: 16px; }
.detail-header { background: #f6f8fc; border-bottom-color: var(--border); }
.detail-name-row .name-value { color: var(--text); font-size: 22px; }
table th { background: #f3f6fb; color: var(--text-2); font-size: 12px; font-weight: 500; }
table td { font-size: 13px; }
.summary-table td, .summary-table th { padding: 14px !important; }
.empty-tip { grid-column: 1 / -1; font-size: 13px; color: var(--text-3); padding: 65px 25px; }
.modal-open { overflow: hidden; }
.modal-mask { background: #192e3359; backdrop-filter: blur(4px); }
.modal { border-radius: 14px; box-shadow: var(--shadow-lg); padding: 30px; max-width: 680px; }
.modal h3 { font-size: 20px; letter-spacing: -.02em; }
.tabs { border-radius: 7px; }
.tab { border-radius: 5px; font-size: 12px; }
.tab.active { box-shadow: 0 1px 4px #243b5610; }
.chk-item { gap: 10px; }
.chk-item input { width: 16px; flex-shrink: 0; }
.bi-workspace-header, .bi-workspace-footer { padding-left: 32px; padding-right: 32px; }
.bi-workspace-header h3 { font-size: 22px; }
.bi-workspace-body { grid-template-columns: minmax(330px, 2fr) minmax(0, 3fr); }
.bi-item { border-color: var(--border); border-radius: 9px; }
.te-topbar { top: var(--header-height); background: var(--bg); border-bottom-color: var(--border); }
.te-right { top: calc(var(--header-height) + 84px); width: 370px; }
.te-card, .te-group { box-shadow: none; }
.te-card-title { color: var(--text); }
.te-layout { gap: 24px; }
.te-card input[type=datetime-local] { min-width: 0; width: 100%; font-size: 12px; padding: 10px 6px; }
#bi-parse-llm { background: var(--primary-light) !important; border-color: #c9d9f0 !important; color: var(--primary) !important; }
.te-q-row { padding: 15px; }
.te-q-row.on { background: var(--primary-light); }
.answer-panel { max-width: 820px; }
.answer-card { box-shadow: none; border: 1px solid var(--border); padding: 36px; }
.answer-card .question { font-size: 23px; line-height: 1.8; font-weight: 600; }
.answer-progress { overflow-x: auto; justify-content: flex-start; padding: 12px; }
.answer-progress .dot { flex-shrink: 0; }
.answer-progress .line { flex-shrink: 0; min-width: 12px; }
.record-box { background: #f0f5fd; border: 1px solid #dee8f5; }
.record-btn { background: var(--primary); box-shadow: none; font-size: 13px; }
.record-btn:hover { transform: none; }
.result-box { background: #f1f6fe; border-color: #d9e5f5; }
.standard-answer .text, .std-answer .text, .your-answer .text { white-space: pre-wrap; line-height: 1.9; }
.toast { border-radius: 9px; font-size: 13px; }
/* 登录页：安静的分栏阅读空间 */
#view-login { padding: 0; display: grid; grid-template-columns: 1fr 1fr; min-height: 100dvh; background: #fbfcff; }
.login-bg { display: none; }
.login-story { align-self: stretch; background: #183b73; color: #fff; padding: 68px clamp(40px,7vw,110px); display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.login-story::after { content: ''; position: absolute; width: 550px; height: 550px; border: 1px solid #ffffff12; border-radius: 50%; right: -260px; bottom: -230px; box-shadow: 0 0 0 70px #ffffff04, 0 0 0 140px #ffffff03; pointer-events: none; }
.login-story .story-brand { position: absolute; top: 52px; left: clamp(40px,7vw,110px); display: flex; gap: 12px; align-items: center; font-size: 15px; font-weight: 600; }
.story-brand .logo-badge { margin: 0; background: #ffffff12; }
.story-eyebrow { color: #aac4ed; font-size: 11px; letter-spacing: .22em; margin-bottom: 28px; }
.login-story h2 { font-size: clamp(32px,3.5vw,52px); font-weight: 500; line-height: 1.5; letter-spacing: -.03em; }
.login-story h2 em { font-style: normal; color: #b4d5ff; }
.login-story p { color: #b5c9e8; font-size: 13px; line-height: 2; margin-top: 22px; }
.story-steps { display: flex; gap: 28px; border-top: 1px solid #ffffff22; margin-top: 55px; padding-top: 24px; color: #d0def5; font-size: 12px; }
.story-steps b { font-size: 10px; font-weight: 400; display: block; color: #8eaad2; margin-bottom: 8px; letter-spacing: .1em; }
.login-card { width: 440px; max-width: calc(100% - 64px); margin: auto; padding: 40px 20px; box-shadow: none; background: transparent; border-radius: 0; }
.login-logo { text-align: left; margin-bottom: 32px; }
.login-logo > .logo-badge { display: none; }
.login-logo h1 { font-size: 29px; font-weight: 650; margin-bottom: 12px; }
.login-logo p { color: var(--text-2); line-height: 1.8; font-size: 13px; }
#login-tabs { margin-bottom: 28px; border: 1px solid #e3e9f3; padding: 5px; }
#login-tabs .tab { padding: 10px 4px; }
.login-role-title { text-align: left; background: transparent; padding: 0; margin: 0 0 22px; font-size: 15px; color: var(--text); }
#login-form input { width: 100%; min-height: 48px; border: 1px solid var(--border); outline: none; }
#login-form input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px #2864c513; }
#login-form .field { margin-bottom: 22px; }
#login-form .btn-block { min-height: 48px; margin-top: 8px; }
#login-form .hint { margin-top: 24px; font-size: 11px; }
.aq-page > .content { max-width: 1320px; padding: 35px; }
.aq-page .topbar { position: sticky; }
.aq-actions { flex-wrap: wrap; }
@media (min-width: 1600px) { .view:not(#view-login) > .content { padding-left: 48px; padding-right: 48px; } }
@media (max-width: 1150px) {
  :root { --nav-width: 170px; }
  .view:not(#view-login) > .content, body.qb-active .view:not(#view-login) > .content, body.te-open .view > .content { padding: 28px 22px; }
  .panel-head { align-items: flex-start; flex-direction: column; }
  .qb-sidebar { width: 170px; }
  .topbar-right .user-name { max-width: 180px; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
  .te-layout { flex-direction: column; }
  .te-right { width: 100%; position: static; max-height: none; }
}
@media (max-width: 760px) {
  :root { --header-height: 64px; }
  .topbar { padding: 12px 16px; height: auto; min-height: 64px; flex-wrap: wrap; gap: 12px; position: relative; }
  .app-title { font-size: 14px; }
  .topbar-right { flex-wrap: wrap; }
  .topbar-right .user-name { max-width: none; }
  .view:not(#view-login) > .nav-tabs { position: sticky; top: 0; width: 100%; bottom: auto; flex-direction: row; padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--border); gap: 5px; overflow-x: auto; }
  .view:not(#view-login) > .nav-tabs::before, .view:not(#view-login) > .nav-tabs::after { display: none; }
  .nav-tab { padding: 11px 14px; white-space: nowrap; flex-shrink: 0; font-size: 12px; gap: 7px; }
  .nav-tab::before { width: 12px; height: 12px; }
  .view:not(#view-login) > .content, body.qb-active .view:not(#view-login) > .content, body.te-open .view > .content { margin: 0; padding: 24px 16px 40px; }
  .panel-head h2 { font-size: 24px; }
  .panel-head > div { max-width: 100%; }
  .panel-head .btn { font-size: 12px; padding: 8px 10px; }
  .qb-layout { flex-direction: column; }
  .qb-sidebar { width: 100%; max-height: 240px; overflow-y: auto; position: static; background: #edf2fa; padding: 12px; border-radius: 9px; }
  .qb-main { width: 100%; }
  .toolbar { flex-wrap: wrap; }
  .toolbar .select, .toolbar .input { min-width: 0 !important; }
  #result-task { width: 100%; }
  .toolbar .search-input { min-width: 130px !important; }
  .overview-strip { gap: 22px; }
  .stat-cards { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
  .stat-card { padding: 15px 10px; }
  .stat-card .num { font-size: 24px; }
  .stat-card .label { font-size: 10px; }
  .history-item .row1 { flex-wrap: wrap; }
  .history-item .row1 > div { flex-wrap: wrap; }
  .history-split, .student-split { flex-direction: column; }
  .student-sidebar, .history-sidebar { width: 100%; max-height: 240px; position: static; }
  .student-detail, .history-main { min-width: 0; width: 100%; }
  .result-sticky-header, .te-topbar { position: static; }
  .te-topbar { flex-wrap: wrap; gap: 12px; }
  .te-left-head { flex-wrap: wrap; }
  .te-card input[type=datetime-local] { min-width: 0; width: 100%; }
  .bi-workspace-body { grid-template-columns: 1fr; }
  .bi-workspace-header { padding: 18px; }
  .bi-workspace-header h3 { font-size: 17px; }
  .modal-mask { padding: 12px; }
  .modal { padding: 24px 18px; max-height: 92dvh; }
  .answer-card { padding: 23px 18px; }
  .answer-card .question { font-size: 19px; }
  .answer-submit-row { flex-wrap: wrap; gap: 12px; }
  .record-box { padding: 15px; }
  #view-login { display: flex; flex-direction: column; }
  .login-story { width: 100%; padding: 26px; }
  .login-story .story-brand { position: static; }
  .login-story h2 { font-size: 25px; margin-top: 22px; }
  .story-eyebrow, .story-steps, .login-story p { display: none; }
  .login-card { max-width: 100%; padding: 35px 26px; }
  .login-logo h1 { font-size: 25px; }
  .aq-page > .content { padding: 24px 16px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* 统一工作台在较矮窗口中允许导航滚动。 */
@media (min-width: 761px) { .view:not(#view-login) > .nav-tabs { overflow-y: auto; padding-bottom: 110px; } }
@media (max-height: 650px) and (min-width: 761px) { .view:not(#view-login) > .nav-tabs::after { display: none; } }

.review-task-note { padding: 16px 20px; margin: 16px 0; border: 1px solid var(--border); border-radius: 9px; background: var(--primary-light); color: var(--text-2); line-height: 1.8; }

/* 成绩页只保留页面顶栏吸附，内容按文档流排列，避免多重吸顶遮挡。 */
#panel-results .result-sticky-header { position: static; padding-bottom: 24px; }
#panel-results .student-sidebar { position: static; max-height: 70vh; }
#panel-results .student-detail { max-height: none; overflow: visible; padding: 0; }
#panel-results .student-detail .detail-header { position: static; margin: 0; padding: 20px; border-radius: 10px 10px 0 0; box-shadow: none; }
#panel-results .student-detail .detail-name-row { flex-wrap: wrap; gap: 12px; }
#panel-results .student-detail .dim { flex-basis: 100%; white-space: normal; }
#panel-results .detail-body { padding: 20px; }
.review-help { color: var(--text-2); font-size: 12px; line-height: 1.8; margin: 14px 0; }
.review-rule, .review-list-head, .review-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 16px 0; }
.review-rule input { width: 100px; }
.review-list-head { justify-content: space-between; }
.review-task-list { max-height: 240px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.review-task-row { display: flex; gap: 12px; align-items: center; padding: 14px; border-bottom: 1px solid var(--border); cursor: pointer; }
.review-task-row > span:first-of-type { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.review-task-row small { display: block; color: var(--text-3); margin-top: 5px; }
.review-task-row > span:last-child { white-space: nowrap; color: var(--primary); font-size: 12px; }
.review-preview { max-height: 180px; overflow: auto; background: var(--primary-light); border-radius: 8px; font-size: 13px; }
.review-preview > div { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.review-actions { justify-content: flex-end; margin-bottom: 0; }

/* 桌面成绩工作区：外框固定，各内容区独立滚动。 */
@media (min-width: 761px) {
  body:has(#view-teacher:not(.hidden) #panel-results.active) { overflow: hidden; }
  body:has(#view-teacher:not(.hidden) #panel-results.active) #view-teacher > .content { height: calc(100dvh - var(--header-height) - var(--site-footer-height)); padding-top: 22px; padding-bottom: 22px; }
  #panel-results.active { display: flex; flex-direction: column; height: 100%; min-height: 0; }
  #panel-results .result-sticky-header { flex: 0 0 auto; padding-top: 0; padding-bottom: 18px; }
  #panel-results #result-body { flex: 1; min-height: 0; overflow: auto; }
  #panel-results #result-body:has(> .student-split) { display: flex; flex-direction: column; overflow: hidden; }
  #panel-results .result-context { flex: 0 1 auto; max-height: 24%; overflow: auto; margin-bottom: 14px; }
  #panel-results .student-split { flex: 1; min-height: 0; align-items: stretch; overflow: hidden; }
  #panel-results .student-sidebar { height: 100%; max-height: none; align-self: stretch; overflow: hidden; }
  #panel-results .student-sidebar .sidebar-title { position: static; flex-shrink: 0; }
  #panel-results .student-list { overscroll-behavior: contain; }
  #panel-results .student-detail { display: flex; flex-direction: column; height: 100%; overflow: hidden; }
  #panel-results .student-detail .detail-header { flex: 0 0 auto; }
  #panel-results .student-detail .detail-body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
}

/* 各管理栏目统一为固定概览区和可滚动内容区。 */
@media (min-width: 761px) {
  body:has(#view-teacher:not(.hidden) > .content > :is(#panel-manageUsers,#panel-manageSubjects,#panel-questionBank,#panel-taskManage).active) { overflow: hidden; }
  body:has(#view-teacher:not(.hidden) > .content > :is(#panel-manageUsers,#panel-manageSubjects,#panel-questionBank,#panel-taskManage).active) #view-teacher > .content { height: calc(100dvh - var(--header-height) - var(--site-footer-height)); padding-top: 22px; padding-bottom: 22px; }
  #view-teacher :is(#panel-manageUsers,#panel-manageSubjects,#panel-questionBank,#panel-taskManage).active { display: flex; flex-direction: column; height: 100%; min-height: 0; }
  #view-teacher :is(#panel-manageUsers,#panel-manageSubjects,#panel-questionBank,#panel-taskManage) > :is(.panel-head,.stat-cards,.overview-strip,p) { flex-shrink: 0; }
  .account-scroll, #admin-subject-list, #task-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  #task-list { align-content: start; padding-right: 6px; }
  #panel-questionBank .qb-layout { flex: 1; min-height: 0; overflow: hidden; align-items: stretch; }
  #panel-questionBank .qb-sidebar { position: static; display: flex; flex-direction: column; min-height: 0; }
  #panel-questionBank .qb-sidebar-header { flex-shrink: 0; }
  #panel-questionBank .qb-group-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  #panel-questionBank .qb-main { display: flex; flex-direction: column; min-height: 0; }
  #panel-questionBank .toolbar { flex-shrink: 0; }
  #panel-questionBank #question-list { flex: 1; min-height: 0; overflow-y: auto; align-content: start; padding-right: 6px; overscroll-behavior: contain; }
}

/* 紧凑工作台：把空间留给内容。 */
#view-teacher .panel-head { margin-bottom: 14px; gap: 12px; }
#view-teacher .panel-head h2 { font-size: 21px; letter-spacing: 0; }
#view-teacher .panel-head .btn { padding: 8px 12px; }
#panel-manageUsers > .stat-cards, #qb-overview { display: none; }
#view-teacher > .nav-tabs { padding-top: 18px; }
#view-teacher > .nav-tabs::before, #view-teacher > .nav-tabs::after { display: none; }
#panel-results .result-sticky-header .panel-head { padding-top: 0; margin-bottom: 12px; }
#panel-results .student-detail .detail-header { padding: 12px 16px; }
#panel-results .student-detail .name-label, #panel-results .student-detail .title-text, #panel-results .student-detail .title-icon { display: none; }
#panel-results .student-detail .dim { flex-basis: auto; }
#panel-results .result-context:empty { display: none; }
.nav-toggle { width: 36px; height: 36px; padding: 0; font-size: 20px; display: inline-flex; align-items: center; justify-content: center; }
@media (min-width: 761px) {
  :root { --header-height: 60px; }
  body.nav-collapsed :is(#view-teacher, #view-student) { --nav-width: 64px; }
  body.nav-collapsed :is(#workspace-nav, #student-nav) { padding: 18px 8px; }
  body.nav-collapsed :is(#workspace-nav, #student-nav)::before,
  body.nav-collapsed :is(#workspace-nav, #student-nav)::after,
  body.nav-collapsed :is(#workspace-nav, #student-nav) .nav-label { display: none; }
  body.nav-collapsed :is(#workspace-nav, #student-nav) .nav-tab { justify-content: center; padding: 12px 0; gap: 0; }
  body.nav-collapsed :is(#workspace-nav, #student-nav) .nav-tab::before { content: attr(data-short); width: auto; height: auto; border: 0; background: none; font-size: 15px; font-weight: 600; opacity: 1; }
  #view-teacher .panel-head { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .history-sidebar { top: calc(var(--header-height) + 16px); max-height: calc(100dvh - var(--header-height) - 32px); overflow-y: auto; }
}
@media (max-width: 760px) {
  body.nav-collapsed :is(#workspace-nav, #student-nav) { display: none; }
  .history-sidebar { overflow-y: auto; }
}

/* 作答时自由切题，正式完成时才将空题记为 0 分。 */
.answer-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.answer-task-title { min-width: 0; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.answer-toolbar .btn { flex-shrink: 0; }
.answer-progress { flex-wrap: wrap; gap: 8px; padding: 4px; max-height: 130px; overflow-y: auto; margin-bottom: 8px; }
.answer-progress .dot { cursor: pointer; font-family: inherit; }
.answer-progress .dot.draft { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
.answer-progress .dot.active { background: var(--primary); color: #fff; border-color: var(--primary); outline: 2px solid var(--primary); outline-offset: 2px; }
.answer-progress .dot:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.answer-status, .answer-rule { color: var(--text-2); font-size: 13px; line-height: 1.7; }
.answer-status { margin: 0 0 18px; }
.answer-rule { margin: 12px 0 0; }
.answer-navigation, .answer-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.answer-submit-row { flex-wrap: wrap; }
.answer-complete-intro { margin: 16px 0; color: var(--text-2); }
.answer-blank-list, .answer-summary-grid { display: flex; flex-wrap: wrap; gap: 8px; max-height: 200px; overflow-y: auto; margin: 20px 0; }
.answer-summary { text-align: center; }
.answer-summary p { color: var(--text-2); line-height: 1.8; margin: 12px 0; }
.answer-final-score { color: var(--primary); font-size: 42px; font-weight: 650; margin: 24px 0; }
.answer-final-score span { display: block; font-size: 14px; font-weight: 400; margin-top: 4px; }
.answer-summary-grid { justify-content: center; }
@media (max-width: 600px) {
  .answer-submit-row { align-items: stretch; }
  .answer-navigation, .answer-actions { width: 100%; }
  .answer-navigation .btn, .answer-actions .btn { flex: 1; }
  .answer-progress { max-height: 126px; }
}
