* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary: #2563eb; --primary-dark: #1d4ed8;
  --bg: #f3f5f9; --card: #ffffff; --border: #e2e8f0;
  --text: #1e293b; --muted: #64748b; --danger: #dc2626;
}
html { touch-action: manipulation; }  /* 禁用双击缩放(误触后整页放大且刷新保持), 双指缩放保留 */
body { font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif; background: var(--bg); color: var(--text);
  display: flex; flex-direction: column; min-height: 100vh; } /* flex 列布局: 配合页脚 margin-top:auto 实现短内容时页脚吸底 */
.hidden { display: none !important; }
.hint { color: var(--muted); font-size: 12px; font-weight: normal; }
.error { color: var(--danger); font-size: 13px; margin-top: 8px; min-height: 18px; }

/* ===== 登录 ===== */
.auth-wrap { flex: 1 0 auto; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #dbeafe 0%, #f3f5f9 60%); }
.auth-card { background: var(--card); padding: 40px; border-radius: 14px; width: 380px;
  box-shadow: 0 12px 40px rgba(37,99,235,.12); }
.auth-card h1 { font-size: 24px; text-align: center; }
.auth-sub { text-align: center; color: var(--muted); margin: 8px 0 20px; font-size: 13px; }
.auth-tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 18px; }
.auth-tabs button { flex: 1; padding: 10px; background: none; border: none; cursor: pointer;
  font-size: 15px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -2px; }
.auth-tabs button.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.auth-card input, .auth-card select { width: 100%; padding: 11px 12px; margin-bottom: 12px;
  border: 1px solid var(--border); border-radius: 8px; font-size: 14px; }
.auth-card input:focus, .auth-card select:focus { outline: 2px solid #bfdbfe; border-color: var(--primary); }

/* ===== 通用控件 ===== */
.btn { padding: 9px 18px; border: 1px solid var(--border); background: #fff; border-radius: 8px;
  cursor: pointer; font-size: 14px; transition: all .15s; }
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.danger { color: var(--danger); border-color: #fecaca; }
.btn.danger:hover { background: #fef2f2; }
.btn.small { padding: 4px 10px; font-size: 12px; }
.btn.full { width: 100%; padding: 12px; font-size: 15px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }

/* ===== 顶栏 ===== */
.topbar { display: flex; align-items: center; gap: 24px; background: #fff; border-bottom: 1px solid var(--border);
  padding: 0 24px; height: 56px; position: sticky; top: 0; z-index: 10; }
.brand { font-weight: 700; font-size: 17px; color: var(--primary); }
.brand-logo { height: 30px; width: auto; vertical-align: -8px; margin-right: 2px; }
.auth-logo { height: 36px; width: auto; vertical-align: -8px; }
.topbar nav { display: flex; gap: 4px; flex: 1; }
.nav-btn { padding: 8px 16px; border: none; background: none; cursor: pointer; font-size: 14px;
  color: var(--muted); border-radius: 8px; }
.nav-btn:hover { background: #eff6ff; color: var(--primary); }
.nav-btn.active { background: var(--primary); color: #fff; }
.user-area { display: flex; align-items: center; gap: 10px; }
#user-badge { font-size: 13px; color: var(--muted); }

main { max-width: 1280px; margin: 0 auto; padding: 24px; }
.page h2 { margin-bottom: 16px; font-size: 20px; }

/* ===== 首页统计 ===== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 22px; }
.stat-card .num { font-size: 32px; font-weight: 700; color: var(--primary); }
.stat-card .lbl { color: var(--muted); margin-top: 4px; font-size: 13px; }
/* 醒目区: 题目总数(实心主色) + 各大类题目数(色条白卡), 尺寸与层级全面高于次级统计 */
.stat-hero { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
.hero-card { position: relative; background: #fff; border: 1px solid var(--border); border-left-width: 4px; border-radius: 14px; padding: 20px 18px 16px; box-shadow: 0 1px 3px rgba(15, 23, 42, .06); }
.hero-card .hero-num { font-size: 38px; font-weight: 800; line-height: 1.1; color: var(--primary); font-variant-numeric: tabular-nums; }
.hero-card .hero-lbl { color: var(--muted); margin-top: 6px; font-size: 14px; font-weight: 600; }
.hero-card.hero-total { background: linear-gradient(135deg, #2563eb, #1e40af); border: none; }
.hero-card.hero-total .hero-num { color: #fff; }
.hero-card.hero-total .hero-lbl { color: #dbeafe; }
.hero-card.hero-unc { border-left-color: #cbd5e1; }
.hero-card.hero-unc .hero-num { color: #64748b; }
/* 次级统计: 收敛尺寸, 衬托上方题目数 */
.stat-sm { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.stat-sm .stat-card { padding: 12px 14px; border-radius: 10px; }
.stat-sm .stat-card .num { font-size: 20px; font-weight: 600; }
.stat-sm .stat-card .lbl { margin-top: 2px; font-size: 12px; }

/* ===== 录入题目 ===== */
.edit-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.edit-form label { display: block; font-weight: 600; margin: 14px 0 6px; font-size: 14px; }
.edit-form input[type=text], .edit-form textarea, .edit-form select {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px;
  font-family: inherit; }
.edit-form textarea { resize: vertical; }
.edit-form input:focus, .edit-form textarea:focus, .edit-form select:focus {
  outline: 2px solid #bfdbfe; border-color: var(--primary); }
.option-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.option-row .opt-label { width: 26px; font-weight: 700; color: var(--primary); text-align: center; }
.option-row input[type=text] { flex: 1; }
.form-row { display: grid; grid-template-columns: 160px 1fr; gap: 16px; }
.form-actions { margin-top: 20px; display: flex; gap: 10px; }
.tag-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-chip { padding: 4px 12px; border: 1px solid var(--border); border-radius: 999px; cursor: pointer;
  font-size: 13px; user-select: none; background: #fff; }
.tag-chip.on { background: #dbeafe; border-color: var(--primary); color: var(--primary); }
.preview-pane { position: sticky; top: 76px; }
.preview-pane h3 { margin-bottom: 12px; color: var(--muted); font-size: 14px; }
.question-render { line-height: 1.9; font-size: 15px; min-height: 120px; }
.question-render .opt-line { display: block; margin-left: 8px; }
/* 选择题选项: 行间保留合理空隙 */
.opt-line { display: block; margin: 7px 0 7px 8px; line-height: 1.9; }
.q-body .opt-line:first-of-type { margin-top: 9px; }
/* 填空题空位横线 */
.blank-line { display: inline-block; min-width: 96px; height: 1em; vertical-align: -0.18em;
  border-bottom: 1.5px solid #334155; margin: 0 4px; }

/* ===== 题库浏览 ===== */
/* 筛选栏: 主行(搜索框+核心筛选) + 高级行(可展开) + 底部计数 */
.filter-bar { display: block; margin-bottom: 16px; padding: 14px 16px 10px; }

/* 管理中心: 题目管理(查询+批量删除) */
.aq-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.aq-filters input[type="text"], .aq-filters input:not([type]), .aq-filters select { padding: 6px 10px; border: 1px solid #e2e8f0; border-radius: 6px; font-size: 13px; }
.aq-filters input { flex: 1 1 160px; min-width: 130px; }
.aq-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.aq-table { table-layout: fixed; width: 100%; }
/* 题干渲染 LaTeX 后正常换行完整显示; 仅来源列截断(全文在 title 悬浮) */
.aq-table .aq-src { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aq-table td { vertical-align: middle; }
.aq-table .aq-stem { font-size: 13.5px; line-height: 1.6; word-break: break-word; }
.aq-table .aq-stem .katex-display { margin: 4px 0; }
.aq-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; flex-wrap: wrap; gap: 8px; }

/* 组卷中心: 搜索加题面板条目 */
.addq-item { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border: 1px solid #e2e8f0; border-radius: 8px; margin-bottom: 8px; background: #fff; position: relative; }
.addq-item .addq-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.addq-item .addq-cat { background: #f1f5f9; border-radius: 4px; padding: 0 6px; font-size: 11px; color: #475569; }
.addq-item .addq-stem { max-height: 3.2em; overflow: hidden; font-size: 13.5px; line-height: 1.6; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.addq-item .btn, .addq-item .addq-inpaper { position: absolute; right: 10px; top: 8px; }
.addq-item .addq-inpaper { font-size: 12px; color: #16a34a; font-weight: 600; }
.pager-btn { border: 1px solid #e2e8f0; background: #fff; border-radius: 6px; padding: 3px 10px; margin: 0 2px; cursor: pointer; font-size: 12.5px; }
.pager-btn.cur { background: #2563eb; border-color: #2563eb; color: #fff; font-weight: 600; }
.fb-main { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.fb-search { flex: 1; min-width: 220px; position: relative; display: flex; align-items: center; }
.fb-search-ico { position: absolute; left: 12px; font-size: 13px; opacity: .55; pointer-events: none; }
.fb-search input { width: 100%; padding: 10px 12px 10px 32px; border: 1px solid var(--border);
  border-radius: 10px; font-size: 14px; background: #f8fafc; transition: border-color .15s, box-shadow .15s, background .15s; }
.fb-search input:focus { outline: none; border-color: var(--primary); background: #fff;
  box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.fb-field { display: flex; flex-direction: column; gap: 3px; }
.fb-field > label { font-size: 11px; font-weight: 600; color: #64748b; padding-left: 2px; letter-spacing: .02em; }
.fb-field select, .fb-field input { padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px;
  font-size: 13px; background: #fff; min-width: 96px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.fb-field input { cursor: text; min-width: 130px; }
.fb-field select:hover, .fb-field input:hover { border-color: #cbd5e1; }
.fb-field select:focus, .fb-field input:focus { outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.fb-go { padding: 9px 22px; border-radius: 10px; }
.fb-more { align-self: flex-end; padding: 9px 12px; border: none; background: none; color: var(--primary);
  font-size: 13px; cursor: pointer; border-radius: 8px; transition: background .15s; white-space: nowrap; }
.fb-more:hover { background: #eff6ff; }
.fb-more.open { background: #eff6ff; font-weight: 600; }
.fb-more-arrow { display: inline-block; font-size: 11px; }
.fb-adv { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-top: 12px;
  padding: 12px 12px 4px; border-top: 1px dashed #e2e8f0; background: #fafbfc; border-radius: 0 0 10px 10px;
  animation: fadeIn .18s ease; }
.fb-reset { margin-left: auto; color: #64748b; }
.fb-foot { display: flex; justify-content: flex-end; margin-top: 6px; min-height: 18px; }
.fb-foot .q-count { margin-left: 0; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.q-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; margin-bottom: 14px; }
/* #21 查卷页横向套卷卡片(全宽块, 仿 q-card) */
.sheet-card { background: var(--card, #fff); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 18px; margin-bottom: 12px; cursor: pointer; transition: box-shadow .2s ease; }
.sheet-card:hover { box-shadow: 0 6px 20px rgba(15,23,42,.08); }
.sheet-card-head { display: flex; align-items: flex-start; gap: 10px; }
.sheet-card-title { flex: 1; font-weight: 700; font-size: 14.5px; line-height: 1.55; min-width: 0; word-break: break-all; }
.sheet-card-star { flex-shrink: 0; border: none; background: none; font-size: 20px; line-height: 1;
  color: #cbd5e1; cursor: pointer; padding: 2px 4px; border-radius: 6px; }
.sheet-card-star:hover { color: #f59e0b; background: #fffbeb; }
.sheet-card-star.on { color: #f59e0b; }
.sheet-card-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px;
  font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.sheet-card-meta span { white-space: nowrap; }
.q-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.q-type-badge { padding: 2px 10px; border-radius: 6px; font-size: 12px; font-weight: 600;
  background: #eff6ff; color: var(--primary); }
.q-diff { color: #f59e0b; font-size: 13px; }
.q-tag { padding: 1px 9px; background: #f1f5f9; border-radius: 999px; font-size: 12px; color: var(--muted); }
.q-actions { margin-left: auto; display: flex; gap: 6px; }
.q-body { line-height: 1.9; }
.q-answer { margin-top: 10px; padding: 10px 14px; background: #f8fafc; border-left: 3px solid var(--primary);
  border-radius: 0 8px 8px 0; font-size: 14px; }
.q-answer summary { cursor: pointer; color: var(--primary); font-size: 13px; }
.pager { display: flex; gap: 8px; justify-content: center; margin: 18px 0; }
.pager button { padding: 6px 14px; border: 1px solid var(--border); background: #fff;
  border-radius: 6px; cursor: pointer; }
.pager button.cur { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ===== 标签 ===== */
.tag-add { display: flex; gap: 10px; margin-bottom: 16px; }
.tag-add input { flex: 1; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 10px; }
.tag-item { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px;
  background: #f1f5f9; border-radius: 999px; font-size: 14px; }
.tag-item .cnt { color: var(--muted); font-size: 12px; }
.tag-item .del { cursor: pointer; color: var(--danger); font-weight: 700; }

/* ===== 组卷 ===== */
.paper-layout { display: grid; grid-template-columns: 300px 1fr; gap: 20px; align-items: start; }
.paper-item { padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px;
  cursor: pointer; transition: all .15s; }
.paper-item:hover { border-color: var(--primary); }
.paper-item.active { border-color: var(--primary); background: #eff6ff; }
.paper-item .t { font-weight: 600; margin-bottom: 4px; }
.paper-item .m { font-size: 12px; color: var(--muted); }
.paper-main h3 { margin-bottom: 6px; }
.paper-toolbar { display: flex; gap: 8px; margin: 12px 0; flex-wrap: wrap; }
.paper-q { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-bottom: 10px; }
.paper-q .pq-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 13px; color: var(--muted); }
.paper-q .pq-head input { width: 60px; padding: 3px 8px; border: 1px solid var(--border); border-radius: 6px; }
.auto-panel { background: #f8fafc; border: 1px dashed var(--border); border-radius: 10px; padding: 14px; margin: 12px 0; }
.auto-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.auto-row select, .auto-row input { padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }
.auto-row input { width: 70px; }

/* ===== 打印试卷页 ===== */
.paper-doc { max-width: 800px; margin: 0 auto; background: #fff; padding: 48px 56px; line-height: 2; }
.paper-doc h1 { text-align: center; font-size: 22px; }
.paper-doc .meta { text-align: center; color: var(--muted); margin: 8px 0 20px; font-size: 13px; }
.paper-doc .sec-title { font-size: 16px; font-weight: 700; margin: 18px 0 8px; }
.paper-doc .p-q { margin-bottom: 1.5em; }   /* 题间空一行(需求20260930): 去横线后用语义间距分题 */
.paper-doc .ans-block { border-top: 1px dashed var(--border); margin-top: 30px; padding-top: 16px; }
/* 悬浮操作条: 固定顶部居中, 滚动试卷时始终可见(PC/手机同效); 打印时隐藏(见 @media print) */
.print-bar { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 100;
  max-width: 800px; margin: 0; display: flex; gap: 10px; justify-content: center;
  background: var(--card); padding: 8px 10px; border: 1px solid var(--border); border-radius: 999px;
  box-shadow: 0 6px 24px rgba(15,23,42,.14); }
/* 试卷预览页: 文档+返回钮的相对定位容器(PC 返回钮贴在卡片右下方); padding-top 让出悬浮条高度(打印归零) */
.paper-wrap { position: relative; max-width: 800px; margin: 0 auto; padding-top: 72px; }
.paper-wrap .paper-doc { max-width: none; margin: 0; }
/* 逐题答案解析块(显示答案解析时插到每道题下方) */
.p-q-ans { margin: 8px 0 2px; padding: 8px 14px; background: #f8fafc; border-left: 3px solid var(--primary);
  border-radius: 0 8px 8px 0; font-size: 14px; line-height: 1.9; }
.p-q-ans b { color: var(--primary); }
/* 题号紧挨题干: markdown 题干首段与题号同行, 段首不留空行(查看页 .p-q / 导出预览 .exp-q / 组卷编辑器 .pq-stem) */
.p-q > span.math > p:first-of-type, .exp-q > span.math > p:first-of-type, .pq-stem > p:first-of-type { display: inline; }
/* 答案/思路/解析: 标签与内容紧挨同行; 解析等后续部分由独立 div 另起一行 */
.p-q-ans > p:first-of-type, .q-ans-block span.math > p:first-of-type { display: inline; }
.pq-stem .pq-no { font-weight: 700; margin-right: 2px; }
@media print {
  .print-bar, .back-fab { display: none; }
  body { background: #fff; }
  .paper-doc { padding: 0; }
  .paper-wrap { padding-top: 0; }
}
/* 试卷导出 PDF 的 @page 规则在 paper.html 内联(paged.js 自研 CSS 解析器对 styles.css 里的
   现代选择器(:has 等)可能解析失败并丢弃后续 @page, 内联可确保被解析) */

/* ===== 智能录入 ===== */
.q-card.need-review { border-color: #fca5a5; background: #fffbfb; }
.review-badge { padding: 1px 9px; border-radius: 6px; font-size: 12px; font-weight: 600;
  background: #fef2f2; color: var(--danger); }
.imp-edit { margin-top: 10px; padding: 12px; background: #f8fafc; border-radius: 8px; }
.imp-edit textarea { padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px;
  font-family: inherit; font-size: 13px; resize: vertical; }
.imp-edit input, .imp-edit select { padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }
.pq-ops { display: inline-flex; align-items: center; gap: 4px; }
#ai-config-card input { padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }
#import-result-card.hidden { display: none; }
.q-meta { margin-top: 8px; font-size: 12px; color: var(--muted); }

/* ===== 文档式组卷编辑器 ===== */
.doc-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px;
  position: sticky; top: 64px; z-index: 5; }
.doc-page { background: #fff; max-width: 880px; margin: 0 auto; padding: 56px 64px;
  box-shadow: 0 6px 30px rgba(15,23,42,.10); border-radius: 4px; min-height: 700px;
  line-height: 2; }
.doc-header { text-align: center; margin-bottom: 18px; }
.doc-header input { width: 100%; border: none; border-bottom: 1px dashed transparent; text-align: center;
  background: transparent; font-family: inherit; padding: 4px 0; outline: none; }
.doc-header input:hover:not(:disabled), .doc-header input:focus:not(:disabled) { border-bottom-color: var(--border); }
.doc-title { font-size: 22px; font-weight: 700; }
.doc-subtitle { font-size: 15px; color: #334155; margin-top: 4px; }
.doc-desc { font-size: 12px; color: var(--muted); margin-top: 4px; }
.doc-meta-line { margin-top: 12px; padding: 10px 0; border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.doc-sec-title { font-weight: 700; font-size: 15px; margin: 18px 0 8px; }
.doc-page .paper-q { border: none; padding: 0 0 6px; margin-bottom: 12px; border-radius: 0; }
.doc-page .pq-head { font-size: 14px; color: var(--text); }
.paper-main { background: transparent !important; border: none !important; padding: 0 !important; }

/* ===== 数据表格 ===== */
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th, .data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; }
.data-table th { background: #f8fafc; font-weight: 600; color: var(--muted); font-size: 13px; }

@media (max-width: 900px) {
  .edit-layout, .paper-layout { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; height: auto; padding: 8px 12px; }
}

/* ===== 全局 toast 通知 ===== */
#toast-wrap { position: fixed; top: 70px; right: 20px; z-index: 9999; display: flex;
  flex-direction: column; gap: 10px; pointer-events: none; }
.toast { pointer-events: auto; min-width: 240px; max-width: 380px; padding: 12px 16px;
  border-radius: 10px; background: #fff; box-shadow: 0 10px 32px rgba(15,23,42,.18);
  border-left: 4px solid var(--primary); font-size: 14px; display: flex; align-items: flex-start;
  gap: 8px; animation: toast-in .28s cubic-bezier(.21,1.02,.73,1) both; }
.toast.success { border-left-color: #16a34a; }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: #f59e0b; }
.toast.out { animation: toast-out .25s ease-in both; }
@keyframes toast-in { from { opacity: 0; transform: translateX(60px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(60px); } }

/* ===== loading 旋转圈 ===== */
.spinner { display: inline-block; width: 13px; height: 13px; border: 2px solid rgba(100,116,139,.35);
  border-top-color: var(--primary); border-radius: 50%; vertical-align: -2px;
  animation: spin .7s linear infinite; }
.btn.primary .spinner { border-color: rgba(255,255,255,.4); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn:disabled { opacity: .65; cursor: not-allowed; }

/* ===== 骨架屏 ===== */
.sk-card { background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 18px 20px; margin-bottom: 14px; }
.sk-line { height: 14px; border-radius: 6px; margin-bottom: 10px;
  background: linear-gradient(90deg, #eef2f7 25%, #e2e8f0 50%, #eef2f7 75%);
  background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.sk-line.w40 { width: 40%; } .sk-line.w60 { width: 60%; } .sk-line.w80 { width: 80%; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ===== 卡片渐入与展开动画 ===== */
.anim-in { animation: fade-up .3s ease both; }
@keyframes fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.q-card { transition: box-shadow .2s ease; }
.q-card:hover { box-shadow: 0 6px 20px rgba(15,23,42,.07); }
.q-panel { overflow: hidden; animation: panel-in .22s ease both; margin-top: 10px;
  padding: 10px 14px; background: #f8fafc; border-radius: 8px; font-size: 14px; line-height: 1.9; }
.q-panel-ans { border-left: 3px solid #16a34a; }
.q-panel-exp { border-left: 3px solid var(--primary); }
.q-panel .panel-empty { color: var(--muted); font-size: 13px; }
@keyframes panel-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ===== 题目卡片底部（答案/解析按钮在右下角） ===== */
.q-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.q-foot .q-meta { margin-top: 0; flex: 1; }
.q-foot-btns { display: flex; gap: 6px; margin-left: auto; }
.btn.ghost { background: #fff; }
.btn.ghost.on { background: #eff6ff; border-color: var(--primary); color: var(--primary); }
.btn.ghost.exp-btn.on { background: #eff6ff; border-color: var(--primary); color: var(--primary); }
.btn.ghost.ans-btn.on { background: #f0fdf4; border-color: #16a34a; color: #16a34a; }

/* ===== 确认弹窗 ===== */
.confirm-mask { position: fixed; inset: 0; background: rgba(15,23,42,.42); z-index: 9998;
  display: flex; align-items: center; justify-content: center; animation: mask-in .18s ease both; }
@keyframes mask-in { from { opacity: 0; } to { opacity: 1; } }
.confirm-box { background: #fff; border-radius: 14px; padding: 26px 28px; width: 340px;
  text-align: center; box-shadow: 0 20px 60px rgba(15,23,42,.25);
  animation: pop-in .22s cubic-bezier(.21,1.02,.73,1) both; }
@keyframes pop-in { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: none; } }
.confirm-icon { font-size: 30px; margin-bottom: 8px; }
.confirm-box p { font-size: 15px; line-height: 1.7; margin-bottom: 18px; }
.confirm-btns { display: flex; gap: 10px; justify-content: center; }
.confirm-btns .btn { min-width: 96px; }

/* ---------- 知识图谱编辑输入弹窗(替代浏览器 prompt) ---------- */
.mapedit-box { width: 380px; max-width: 92vw; text-align: left; padding: 22px 24px; }
.mapedit-title { font-size: 16px; font-weight: 700; margin-bottom: 4px !important; }
.mapedit-sub { font-size: 13px; color: var(--muted); margin-bottom: 14px !important; }
.mapedit-label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 12px 0 6px; }
#mapedit-input { width: 100%; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 10px; font-size: 15px; }
#mapedit-input:focus { outline: none; border-color: var(--primary, #2563eb); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.mapedit-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.mapedit-tag { padding: 6px 14px; border-radius: 999px; border: 1.5px solid var(--border); background: #fff;
  font-size: 13px; color: var(--muted); cursor: pointer; transition: all .15s; }
.mapedit-tag:hover { border-color: var(--tag-c); color: var(--tag-c); }
.mapedit-tag.on { border-color: var(--tag-c); background: var(--tag-c); color: #fff; font-weight: 600; }
#se-catalog { width: 100%; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 10px; font-size: 15px; background: #fff; }
#se-catalog:focus { outline: none; border-color: var(--primary, #2563eb); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
/* 查卷卡片上的管理员编辑按钮(与收藏星同排) */
.sheet-card-edit { flex-shrink: 0; border: none; background: none; cursor: pointer; font-size: 14px;
  color: #94a3b8; padding: 2px 4px; border-radius: 6px; line-height: 1; }
.sheet-card-edit:hover { color: var(--primary); background: #f1f5f9; }

/* ---------- 个人中心列表: 条目标签 + 操作按钮行 ---------- */
#ucl-body .qp-item-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
#ucl-body .qp-item-meta .qp-meta-text { flex: 1; min-width: 50%; }
#ucl-body .uc-uncollect { float: none; flex-shrink: 0; margin-left: auto; }
#ucl-body .ucl-del { float: none; flex-shrink: 0; margin-left: auto; }

/* ===== 上传进度动画 ===== */
.upload-progress { height: 6px; border-radius: 999px; background: #e2e8f0;
  overflow: hidden; margin: 10px 0 4px; }
.upload-progress-bar { height: 100%; width: 40%; border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), #60a5fa);
  animation: indet 1.1s ease-in-out infinite; }
@keyframes indet { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }
.file-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.file-chip { padding: 3px 10px; background: #eff6ff; color: var(--primary); border-radius: 999px;
  font-size: 12px; animation: fade-up .25s ease both; }

/* ===== 页面切换淡入 ===== */
.page { animation: page-in .25s ease both; }
@keyframes page-in { from { opacity: 0; } to { opacity: 1; } }

/* ===== 操作按钮微反馈 ===== */
.btn { position: relative; }
.btn:not(:disabled):active { transform: scale(.96); }
.tag-chip { transition: all .15s; }
.nav-btn { transition: all .15s; }

/* ===== 辅助图片(录入表单 + 题目展示) ===== */
.img-upload-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.paste-box { flex: 1; min-width: 220px; padding: 10px 14px; border: 1.5px dashed var(--border);
  border-radius: 10px; color: #94a3b8; font-size: 13px; cursor: text; background: #f8fafc;
  transition: all .2s; user-select: none; }
.paste-box:hover, .paste-box:focus { border-color: var(--primary); color: var(--primary);
  background: #eff6ff; outline: none; }
.img-thumb-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.img-thumb { position: relative; width: 96px; height: 96px; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border); animation: fade-up .25s ease both; }
.img-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-thumb .img-del { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px;
  border-radius: 50%; background: rgba(15,23,42,.65); color: #fff; font-size: 14px; line-height: 22px;
  text-align: center; cursor: pointer; transition: background .15s; }
.img-thumb .img-del:hover { background: #dc2626; }
.q-images { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 2px; }
.q-images img { max-width: 220px; max-height: 180px; border-radius: 8px; border: 1px solid var(--border);
  object-fit: contain; background: #fff; }

/* ===== 管理中心 ===== */
.admin-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.admin-tab { padding: 9px 18px; border: 1px solid var(--border); border-radius: 10px; background: #fff;
  cursor: pointer; font-size: 14px; transition: all .15s; }
.admin-tab:hover { border-color: var(--primary); color: var(--primary); }
.admin-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.status-active { color: #16a34a; font-weight: 600; }
.status-paused { color: #dc2626; font-weight: 600; }
.log-detail { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.api-key-code { background: #f1f5f9; padding: 4px 10px; border-radius: 6px; font-size: 13px;
  word-break: break-all; user-select: all; }
.ocr-config { border-top: 1px dashed var(--border); margin-top: 14px; }
code { background: #f1f5f9; padding: 1px 6px; border-radius: 5px; font-size: 12px; }

/* ===== Markdown 渲染内容 ===== */
.q-stem table, .opt-line table, .q-panel table, .math table { border-collapse: collapse; margin: 8px 0; }
.math th, .math td { border: 1px solid #cbd5e1; padding: 4px 10px; font-size: 14px; }
.math th { background: #f8fafc; }
.math blockquote { border-left: 3px solid var(--border); margin: 6px 0; padding: 2px 12px; color: #475569; }
/* markdown 列表: 全局 *{padding:0} 清掉了 ul 缩进, 符号会悬挂到文本左边界之外;
   padding-left:1em 让 •/数字符号与段落文字左边缘对齐, 列表文字统一缩进(题库/详情/组卷/导出共用 .math) */
.math ul, .math ol { margin: 4px 0; padding-left: 1em; }
.math li { margin: 2px 0; }
.math li > p { margin: 0; }
.math img { max-width: 100%; border-radius: 6px; margin: 6px 0; }
.math p { margin: 4px 0; }

/* ================= Round 7 ================= */

/* ===== 购物车式选题篮（浮动按钮 + 侧边抽屉） ===== */
.cart-fab { position: fixed; right: 26px; bottom: 80px; z-index: 90; width: 58px; height: 58px;
  border-radius: 50%; border: none; background: linear-gradient(135deg, var(--primary), #3b82f6);
  color: #fff; font-size: 25px; cursor: pointer; box-shadow: 0 10px 26px rgba(37,99,235,.42);
  transition: transform .18s, box-shadow .18s; }
.cart-fab:hover { transform: translateY(-3px) scale(1.06); box-shadow: 0 14px 32px rgba(37,99,235,.52); }
.cart-fab:active { transform: scale(.95); }
.cart-badge { position: absolute; top: -5px; right: -5px; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 999px; background: var(--danger); color: #fff; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; border: 2px solid #fff;
  animation: pop-in .25s cubic-bezier(.21,1.02,.73,1) both; }
.cart-mask { position: fixed; inset: 0; background: rgba(15,23,42,.35); z-index: 95; animation: mask-in .2s ease both; }
/* 拖拽题篮题目期间: 遮罩放行鼠标/拖拽事件, 否则全屏遮罩会拦截 drop, 题目永远拖不进试卷 */
body.drag-into-doc .cart-mask { pointer-events: none; }
/* 题篮题目「＋加入当前试卷」按钮(拖拽之外的可靠交互) */
.cart-add-btn { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid #bfdbfe; background: #eff6ff; color: #2563eb; font-size: 14px; font-weight: 700; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; align-self: center; transition: all .18s; }
.cart-add-btn:hover { background: linear-gradient(135deg, #2563eb, #4f46e5); color: #fff; border-color: transparent; transform: scale(1.15) rotate(90deg); box-shadow: 0 3px 10px rgba(37,99,235,.4); }
/* 组卷中心顶部: 排版中心入口提示条(替代原工具横栏) */
.doc-studio-tip { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: #64748b; background: #f8fafc; border: 1px dashed #e2e8f0; border-radius: 8px; padding: 7px 14px; margin-bottom: 12px; }
.doc-studio-tip a { color: #2563eb; text-decoration: none; }
.doc-studio-tip a:hover { text-decoration: underline; }
.doc-studio-tip #dl-progress { margin-left: auto; }
.cart-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 410px; max-width: 94vw; z-index: 96;
  background: #fff; box-shadow: -14px 0 44px rgba(15,23,42,.2); display: flex; flex-direction: column;
  transform: translateX(106%); transition: transform .3s cubic-bezier(.21,1.02,.73,1); }
.cart-drawer.open { transform: none; }
.cart-head { display: flex; align-items: center; gap: 8px; padding: 15px 16px;
  border-bottom: 1px solid var(--border); font-size: 16px; }
.cart-toolbar { display: flex; align-items: center; gap: 8px; padding: 10px 16px;
  border-bottom: 1px solid var(--border); background: #f8fafc; }
.cart-toolbar .tag-chip { background: #fff; }
.cart-list { flex: 1; overflow-y: auto; padding: 12px 16px; }
.cart-item { display: flex; gap: 8px; align-items: flex-start; border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; background: #fff;
  animation: fade-up .25s ease both; transition: border-color .15s, box-shadow .15s; }
.cart-item:hover { border-color: var(--primary); box-shadow: 0 4px 14px rgba(37,99,235,.1); }
.cart-item-body { flex: 1; min-width: 0; }
.cart-item-head { display: flex; align-items: center; gap: 6px; margin-bottom: 5px;
  font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.cart-item-stem { font-size: 13px; line-height: 1.7; word-break: break-all; }
.cart-item-stem .blank-line { min-width: 56px; }
.cart-item-del { flex-shrink: 0; cursor: pointer; color: #94a3b8; font-size: 17px; line-height: 1;
  width: 24px; height: 24px; text-align: center; border-radius: 6px; transition: all .15s; }
.cart-item-del:hover { color: #fff; background: var(--danger); }
.cart-check { width: 16px; height: 16px; margin-top: 4px; accent-color: var(--primary); cursor: pointer; flex-shrink: 0; }
.cart-foot { border-top: 1px solid var(--border); padding: 12px 16px; display: flex;
  flex-direction: column; gap: 8px; background: #f8fafc; }
.cart-foot input, .cart-foot select { padding: 9px 12px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 14px; font-family: inherit; background: #fff; }
.cart-foot input:focus, .cart-foot select:focus { outline: 2px solid #bfdbfe; border-color: var(--primary); }

/* ===== AI录题上传区 ===== */
.upload-zone { border: 2px dashed var(--border); border-radius: 14px; padding: 34px 20px;
  text-align: center; cursor: pointer; background: #fbfdff; transition: all .2s; }
.upload-zone:hover, .upload-zone.dragover { border-color: var(--primary); background: #eff6ff;
  box-shadow: inset 0 0 0 4px rgba(37,99,235,.06); }
.upload-zone.dragover { transform: scale(1.01); }
.upload-zone-icon { font-size: 38px; margin-bottom: 8px; }
.upload-zone-text { font-size: 15px; font-weight: 600; }
.upload-zone-hint { color: var(--muted); font-size: 12px; margin-top: 6px; }
.btn.big { padding: 12px 28px; font-size: 15px; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; }
.file-chip-del { cursor: pointer; color: var(--primary); font-weight: 700; border-radius: 50%;
  width: 16px; height: 16px; line-height: 15px; text-align: center; font-size: 12px; }
.file-chip-del:hover { background: var(--primary); color: #fff; }
.engine-badge { display: inline-block; margin-left: 8px; padding: 1px 9px; border-radius: 999px;
  background: #ecfdf5; color: #15803d; border: 1px solid #bbf7d0; font-size: 11px; font-weight: 600;
  vertical-align: 2px; }
.imp-check { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }

/* ===== 管理中心 tab 页 ===== */
.atab-page { animation: page-in .25s ease both; }

/* ===== 组卷中心：目录树侧栏 ===== */
.paper-side { position: sticky; top: 76px; max-height: calc(100vh - 110px); overflow-y: auto; }
.folder-head { display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px; font-size: 15px; }
.folder-group { margin-bottom: 4px; }
.folder-row { display: flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 8px;
  cursor: pointer; font-size: 14px; transition: background .15s; user-select: none; }
.folder-row:hover { background: #f1f5f9; }
.folder-row.sel { background: #eff6ff; color: var(--primary); font-weight: 600; }
.folder-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-name .cnt { color: var(--muted); font-size: 12px; font-weight: normal; }
.folder-ops { display: none; gap: 4px; }
.folder-row:hover .folder-ops { display: inline-flex; }
.folder-ops span { cursor: pointer; color: var(--muted); padding: 0 4px; border-radius: 4px;
  font-size: 13px; line-height: 1.4; }
.folder-ops span:hover { background: #e2e8f0; color: var(--text); }
.folder-papers { margin-left: 14px; padding-left: 10px; border-left: 2px solid #eef2f7; }
.folder-papers .paper-item { margin-top: 6px; }
.folder-pager { display: flex; align-items: center; gap: 4px; margin: 8px 0 4px; font-size: 12px; }
.folder-pager .fp-btn, .folder-pager .fp-num { cursor: pointer; padding: 1px 7px; border: 1px solid var(--border); border-radius: 6px; color: var(--muted); background: #fff; user-select: none; }
.folder-pager .fp-num.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.folder-pager .fp-btn.dis { opacity: .35; pointer-events: none; }
.folder-pager .fp-btn:hover, .folder-pager .fp-num:hover { border-color: var(--primary); color: var(--primary); }
.folder-pager .fp-num.on:hover { color: #fff; }
.folder-row { cursor: pointer; }
/* 试卷条目 hover 操作(重命名/复制/移动/删除) + 讲义类型徽标 */
.paper-item { position: relative; }
.paper-item .paper-ops { position: absolute; right: 8px; top: 8px; display: none; gap: 2px; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 2px 4px; box-shadow: 0 4px 14px rgba(15,23,42,.12); }
.paper-item:hover .paper-ops { display: flex; }
.paper-item .paper-ops span { cursor: pointer; padding: 2px 5px; border-radius: 5px; font-size: 13px; color: var(--muted); }
.paper-item .paper-ops span:hover { background: #eff6ff; color: var(--primary); }
.ptype-badge { display: inline-block; font-size: 11px; font-weight: 600; color: #7c3aed; background: #f3e8ff; border-radius: 5px; padding: 0 5px; margin-right: 5px; vertical-align: 1px; }
.paper-move-menu { position: fixed; z-index: 1200; min-width: 170px; max-width: 240px; max-height: 300px; overflow: auto; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(15,23,42,.18); padding: 5px; }
.paper-move-menu .pmm-item { padding: 7px 10px; border-radius: 7px; font-size: 13px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.paper-move-menu .pmm-item:hover { background: #eff6ff; color: var(--primary); }

/* ---- 组卷中心: 新建小组件(试卷/讲义/文件夹) ---- */
.np-area { position: relative; margin-top: 10px; }
.np-open { width: 100%; justify-content: center; }
.np-widget { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 300; background: var(--card); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 28px rgba(15,23,42,.16); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.np-seg { display: flex; gap: 3px; background: var(--bg); border-radius: 8px; padding: 3px; }
.np-seg-item { flex: 1; border: none; background: transparent; border-radius: 6px; padding: 6px 4px; font-size: 13px; cursor: pointer; color: var(--muted); transition: background .15s, color .15s; white-space: nowrap; }
.np-seg-item:hover { color: var(--primary); }
.np-seg-item.active { background: #fff; color: var(--primary); font-weight: 600; box-shadow: 0 1px 3px rgba(15,23,42,.12); }
.np-input { width: 100%; box-sizing: border-box; padding: 7px 9px; border: 1px solid var(--border); border-radius: 7px; font-size: 13px; background: #fff; }
.np-input:focus { outline: 2px solid #bfdbfe; border-color: var(--primary); }
.np-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ===== 讲义编辑器：题目卡片与拖拽排序 ===== */
.doc-page { --accent: #1e293b; }
.doc-page .paper-q { position: relative; margin-bottom: 4px; padding: 10px 12px 12px;
  border-radius: 8px; transition: background .15s, box-shadow .15s, opacity .15s; }
.doc-page .paper-q:hover { background: rgba(241,245,249,.55); }
.doc-page .paper-q[draggable="true"] .pq-stem { cursor: default; }
.drag-handle { cursor: grab; color: #cbd5e1; font-size: 15px; padding: 0 4px; user-select: none;
  border-radius: 4px; transition: color .15s; }
.drag-handle:hover { color: var(--primary); }
.drag-handle:active { cursor: grabbing; }
.paper-q.dragging { opacity: .45; background: #eff6ff !important;
  box-shadow: 0 0 0 2px rgba(37,99,235,.35); }
.paper-q.drop-before { box-shadow: 0 -3px 0 0 var(--primary); border-radius: 0; }
.paper-q.drop-after { box-shadow: 0 3px 0 0 var(--primary); border-radius: 0; }
.pq-no { color: var(--text); font-size: 14px; }
/* 题目卡片悬浮工具栏(悬停题目时浮现在右上角) */
.pq-floater { position: absolute; top: 6px; right: 8px; z-index: 5; display: inline-flex; align-items: center;
  gap: 2px; padding: 3px 6px; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
  box-shadow: 0 4px 14px rgba(15,23,42,.10); opacity: 0; transform: translateY(-4px);
  transition: opacity .15s, transform .15s; pointer-events: none; }
.paper-q:hover .pq-floater, .paper-q.dragging .pq-floater { opacity: 1; transform: none; pointer-events: auto; }
.pq-floater .drag-handle { font-size: 14px; }
.pqf-btn { border: none; background: none; padding: 4px 8px; font-size: 12px; color: #475569;
  border-radius: 7px; cursor: pointer; white-space: nowrap; transition: background .12s, color .12s; }
.pqf-btn:hover { background: #eff6ff; color: var(--primary); }
.pqf-btn.danger:hover { background: #fef2f2; color: var(--danger); }
.pqf-score { font-size: 12px; color: #64748b; padding: 0 4px; white-space: nowrap; }
.pqf-score input { width: 52px; padding: 3px 6px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 12px; }
.pq-type { margin-left: 2px; }
.pq-stem { word-break: break-word; }
.pq-stem textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--primary); border-radius: 8px;
  font-family: inherit; font-size: 14px; line-height: 1.8; resize: vertical; outline: 2px solid #bfdbfe; }

/* Word 式在线编辑器(工具栏+编辑区+实时预览) */
.we-wrap { border: 1px solid var(--primary); border-radius: 10px; background: #fff; overflow: hidden;
  box-shadow: 0 2px 10px rgba(37, 99, 235, .08); }
.we-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 8px; background: #f8fafc;
  border-bottom: 1px solid #e2e8f0; position: sticky; top: 0; z-index: 2; }
.we-btn { min-width: 30px; height: 28px; padding: 0 7px; border: 1px solid #e2e8f0; border-radius: 6px;
  background: #fff; color: #334155; font-size: 13px; cursor: pointer; transition: all .12s; line-height: 1; }
.we-btn:hover { background: #eff6ff; border-color: #93c5fd; color: var(--primary); transform: translateY(-1px); }
.we-area { width: 100%; border: none; outline: none; padding: 12px 14px; font-family: inherit;
  font-size: 14px; line-height: 1.9; resize: vertical; box-sizing: border-box; display: block;
  background: #fff; color: #1e293b; }
.we-preview-label { padding: 4px 14px; font-size: 11px; color: #94a3b8; background: #fafaf9;
  border-top: 1px dashed #e2e8f0; letter-spacing: .5px; }
.we-preview { padding: 10px 14px 14px; background: #fafaf9; min-height: 32px; font-size: 14px;
  line-height: 1.9; border-top: none; }
.we-preview p { margin: 4px 0; }


/* 题型标题三种样式（主题 accent 驱动） */
.doc-sec-title { color: var(--accent, #1e293b); break-after: avoid; }
.doc-sec-title.sec-plain { font-weight: 700; }
.doc-sec-title.sec-banner { padding: 8px 14px; border-radius: 8px; color: #fff;
  background: var(--accent, #1e293b); }
.doc-sec-title.sec-badge { padding-left: 10px; border-left: 5px solid var(--accent, #1e293b);
  border-radius: 2px; }
/* 双栏模式下题卡避免跨栏断裂 */
.doc-page[style*="column-count: 2"] .paper-q,
.doc-page[style*="column-count:2"] .paper-q { break-inside: avoid; }

/* 版式面板里的下拉样式统一 */
#panel-theme select, #paper-folder-select { padding: 6px 10px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 13px; font-family: inherit; background: #fff; }

/* 选题篮加题面板 */
.cart-add-check { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }

@media (max-width: 900px) {
  .cart-drawer { width: 100vw; max-width: 100vw; }
  .paper-side { position: static; max-height: none; }
}

/* ---------- Round 8: 大类徽标 / 筛选计数 / 分组标签选择器 ---------- */
.q-cat { display: inline-block; padding: 1px 8px; border-radius: 10px; color: #fff;
  font-size: 12px; line-height: 18px; font-weight: 600; }
.q-count { margin-left: auto; color: #64748b; font-size: 13px; font-weight: 600; white-space: nowrap; }
.tag-group { margin-bottom: 8px; }
.tag-group-title { font-size: 12px; font-weight: 700; color: #475569; margin-bottom: 4px; }
.tag-group-body { display: flex; flex-wrap: wrap; gap: 6px; padding-left: 4px; }

/* ---------- Round 8: 组卷 Word 式编辑 ---------- */
/* 条目间放置区: 平时纤细; 一旦开始拖题(body.drag-into-doc)整体放大, 悬停时高亮 */
.doc-dropzone { position: relative; height: 10px; margin: 2px 0; border-radius: 4px; transition: all .15s; }
body.drag-into-doc .doc-dropzone { height: 26px; margin: 4px 0; background: #f0f7ff;
  outline: 2px dashed #bfdbfe; }
body.drag-into-doc .doc-dropzone .dz-add { opacity: 0 !important; }
.doc-dropzone.hot { height: 30px; background: #dbeafe; outline: 2px dashed #3b82f6;
  box-shadow: 0 0 0 4px rgba(59,130,246,.12); }
.doc-dropzone .dz-add { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  font-size: 11px; color: #94a3b8; background: #f1f5f9; border-radius: 8px; padding: 0 8px;
  cursor: pointer; opacity: 0; transition: opacity .15s; white-space: nowrap; z-index: 2; }
.doc-dropzone:hover .dz-add, .doc-dropzone.hot .dz-add { opacity: 1; }
.doc-dropzone .dz-add:hover { background: #3b82f6; color: #fff; }
/* 拖拽源提示 */
body.drag-into-doc .doc-page { cursor: default; }
/* 文本段落块 */
.paper-block { position: relative; margin: 6px 0; padding: 8px 12px; border-radius: 8px; background: transparent; border: 1px dashed transparent; }
.paper-block:hover { border-color: #e2e8f0; }
/* 文本段落背景预设(编辑面板可选; 默认无背景) */
.paper-block.bg-note { background: #fdf6e3; border: 1px solid #f0e2b6; border-left: 4px solid #f59e0b; }
.paper-block.bg-card { background: #f1f5f9; border: 1px solid #e2e8f0; }
.paper-block.bg-lines { background: repeating-linear-gradient(#fff, #fff 27px, #dbe7f3 28px); border: 1px solid #e2e8f0; }
.paper-block.bg-tip { background: #eff6ff; border: 1px solid #bfdbfe; border-left: 4px solid #3b82f6; }
/* 组卷中心 A4 分页线(视觉页底标识, 不占内容流) */
.doc-a4-flow { position: relative; max-width: 794px !important; }
.a4-page-mark { position: absolute; left: -64px; right: -64px; border-top: 2px dashed #cbd5e1; pointer-events: none; z-index: 2; }
.a4-page-mark span { position: absolute; right: 8px; top: -11px; background: #f1f5f9; color: #94a3b8; font-size: 11px; padding: 1px 10px; border-radius: 8px; border: 1px solid #e2e8f0; }
.paper-block .pb-body { min-height: 20px; }
.paper-block .pb-body p { margin: 4px 0; }
/* 文本段落三级标题: # 一级 / ## 二级 / ### 三级(em 相对字号, 随正文字号缩放; 自动进目录)
   覆盖两种结构: .paper-block>.math(组卷/排版页) 与 .paper-block.math(PDF 导出) */
.paper-block .math h1, .paper-block.math h1 { font-size: 1.45em; font-weight: 700; margin: 18px 0 10px; padding-bottom: 6px; border-bottom: 1.5px solid #e2e8f0; }
.paper-block .math h2, .paper-block.math h2 { font-size: 1.25em; font-weight: 700; margin: 14px 0 8px; }
.paper-block .math h3, .paper-block.math h3 { font-size: 1.1em; font-weight: 700; margin: 10px 0 6px; color: #334155; }
.paper-block .pb-ops { display: none; position: absolute; right: 8px; top: 6px; gap: 6px; }
.paper-block:hover .pb-ops { display: flex; }
/* 卷内已修改题干标记 */
.pq-edited { font-size: 11px; color: #b45309; background: #fef3c7; border-radius: 8px; padding: 0 6px; margin-left: 6px; }
/* 目录折叠箭头 */
.folder-arrow { display: inline-block; width: 16px; cursor: pointer; color: #64748b; font-size: 11px; user-select: none; flex-shrink: 0; }
.folder-arrow.empty { visibility: hidden; }
/* 选题篮拖拽提示 */
.cart-drag-hint { padding: 6px 12px; font-size: 12px; color: #1d4ed8; background: #eff6ff; border-bottom: 1px solid #dbeafe; }
.cart-item[draggable=true] { cursor: grab; }
.cart-item.dragging, .paper-q.dragging { opacity: .5; }
/* 打印页文本块 */
.p-block { margin: 10px 0; }

/* ---------- Round 8: 标签管理二级体系 ---------- */
.tag-cat-card { border: 1px solid #e2e8f0; border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; background: #fff; }
.tag-cat-card.orphan { background: #fafaf9; border-style: dashed; }
.tag-cat-head { display: flex; align-items: center; gap: 10px; }

/* ---------- Round 9: 下载设置面板(开关组) ---------- */
.exp-grid { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 10px; align-items: center; }
.exp-toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px;
  color: #475569; user-select: none; }
.exp-toggle input { display: none; }
.exp-toggle .exp-slider { position: relative; width: 34px; height: 19px; border-radius: 999px;
  background: #e2e8f0; transition: background .18s; flex-shrink: 0; }
.exp-toggle .exp-slider::after { content: ''; position: absolute; left: 2.5px; top: 2.5px; width: 14px; height: 14px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .18s; }
.exp-toggle.on .exp-slider { background: var(--primary); }
.exp-toggle.on .exp-slider::after { transform: translateX(15px); }
.exp-toggle.on { color: var(--text); font-weight: 600; }
.exp-pos { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: #475569; transition: opacity .15s; }
.exp-sep { width: 1px; height: 20px; background: #e2e8f0; margin: 0 2px; }
.exp-pos.disabled { opacity: .38; pointer-events: none; }
.exp-pos label { display: inline-flex; align-items: center; gap: 3px; cursor: pointer; }
.exp-actions { display: flex; gap: 10px; align-items: center; margin-top: 12px; padding-top: 10px;
  border-top: 1px dashed #e2e8f0; }

/* ---------- Round 9: 个人中心(含修改密码) ---------- */
#uc-mask .pw-label { display: block; font-size: 13px; font-weight: 600; color: #334155; margin: 10px 0 4px; }
#uc-mask .pw-label .hint { display: block; font-weight: 400; margin-top: 2px; }
#uc-mask input { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; box-sizing: border-box; }
#uc-mask input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.pw-strength { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; min-height: 18px; }
.pw-check { font-size: 11px; color: #94a3b8; padding: 1px 8px; border-radius: 999px; background: #f1f5f9; }
.pw-check.ok { color: #15803d; background: #dcfce7; font-weight: 600; }

/* ---------- 个人中心弹窗布局 ---------- */
.uc-box { width: 400px; text-align: left; position: relative; }
.uc-close { position: absolute; top: 10px; right: 12px; border: none; background: none; font-size: 15px;
  cursor: pointer; color: var(--muted); padding: 4px 6px; border-radius: 6px; }
.uc-close:hover { background: #f1f5f9; color: var(--text); }
.uc-head { display: flex; align-items: center; gap: 12px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border); }
.uc-avatar { width: 46px; height: 46px; border-radius: 50%; background: #eff6ff; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 24px; }
.uc-name { font-size: 16px; font-weight: 700; }
.uc-role-tag { display: inline-block; margin-top: 4px; font-size: 12px; color: var(--primary);
  background: #eff6ff; border-radius: 999px; padding: 2px 10px; }
.uc-sec { font-size: 13px; font-weight: 700; color: #334155; margin-top: 14px; padding-top: 10px;
  border-top: 1px dashed var(--border); }

/* ---------- 移动端抽屉菜单(PC 默认隐藏) ---------- */
#nav-burger, .nav-user, .nav-mask { display: none; }

/* ---------- 顶栏当前页名(仅移动端显示, 由 mobile.css 打开) ---------- */
#topbar-title { display: none; }

/* ---------- 筛选折叠入口(仅移动端显示, PC 面板常开) ---------- */
.fb-entry { display: none; }

/* ---------- 题目详情页 ---------- */
.qd-mini-row { margin-top: 10px; display: flex; gap: 8px; }
/* 答案/解析独立大卡片: 默认折叠, 点击展开 */
.qd-sec { background: var(--card, #fff); border: 1px solid var(--border); border-radius: 10px;
  margin-top: 10px; overflow: hidden; cursor: pointer; }
.qd-sec-head { display: flex; justify-content: space-between; align-items: center;
  padding: 14px; font-weight: 700; font-size: 14.5px; user-select: none; }
.qd-sec-arrow { color: var(--muted); font-size: 12px; transition: transform .18s; }
.qd-sec.open .qd-sec-arrow { transform: rotate(180deg); }
.qd-sec-body { display: none; padding: 0 14px 14px; line-height: 1.8; cursor: default; }
.qd-sec.open .qd-sec-body { display: block; }
/* 选题/查卷子页签(双端显示) */
.qsub-tabs { display: flex; gap: 6px; margin-bottom: 10px; max-width: 360px;
  background: #e2e8f0; border-radius: 10px; padding: 4px; }
.qsub-tab { flex: 1; border: none; background: transparent; padding: 9px;
  font-size: 14px; border-radius: 8px; color: var(--muted); cursor: pointer; font-weight: 600; }
.qsub-tab.active { background: #fff; color: var(--primary); box-shadow: 0 1px 4px rgba(15,23,42,.12); }
/* 查卷条目收藏星 */
.qp-star { float: right; border: none; background: none; font-size: 20px; color: #cbd5e1;
  cursor: pointer; padding: 0 2px; line-height: 1; }
.qp-star.on { color: #f59e0b; }

/* ---------- 全站: 页面菜单字标题双端隐藏(只留标题栏) ---------- */
.page > h2 { display: none; }

/* ---------- 查卷: 套卷卡片(PC 多列网格工整排列, 移动端自动单列) ---------- */
#qp-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; margin-top: 10px; }
.qp-item { background: var(--card, #fff); border: 1px solid var(--border); border-radius: 10px;
  padding: 13px 15px; cursor: pointer; transition: box-shadow .15s; }
.qp-item:hover { box-shadow: 0 3px 12px rgba(15,23,42,.10); }
.qp-item-title { font-weight: 700; font-size: 14.5px; line-height: 1.5; }
.qp-item-meta { font-size: 12.5px; color: var(--muted); margin-top: 6px; line-height: 1.6; }

/* ---------- 查卷: 来源目录管理按钮(树内 admin 用) ---------- */
.sl-item-ops { flex-shrink: 0; display: inline-flex; gap: 4px; }
.sl-item-ops button { border: 1px solid var(--border); background: var(--card); border-radius: 6px;
  padding: 2px 7px; font-size: 12.5px; cursor: pointer; color: var(--muted); }
.sl-item-ops button:hover { color: var(--primary); border-color: var(--primary); }
.sl-addbar { margin: 12px 0 4px; text-align: center; }
/* 学习攻略图谱页的大类切换 tab */
.guide-map-cats { display: flex; gap: 2px; margin: 4px 0 10px; max-width: 520px;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 4px 6px; }
/* 详情页: 旧答案按钮组/旧面板全端弃用, 统一由 qd-sec 大卡片承担 */
#page-qdetail .q-foot-btns, #page-qdetail .q-panel { display: none; }

/* ---------- 做题标记行 ---------- */
.prac-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.prac-ok { background: #16a34a; color: #fff; border: none; }
.prac-no { background: #dc2626; color: #fff; border: none; }
.prac-status { width: 100%; font-size: 12.5px; color: var(--muted); }

/* ---------- 个人中心页 ---------- */
.ucs-block { margin-top: 14px; }
.ucs-title { font-weight: 700; font-size: 15px; margin-bottom: 10px; }
.uw-item { border: 1px solid var(--border); border-radius: 10px; padding: 12px;
  margin-bottom: 10px; cursor: pointer; }
.uw-item:active { background: #f8fafc; }
.uw-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; gap: 8px; }
.uw-meta { font-size: 12px; color: var(--muted); }
.uw-stem { font-size: 14px; line-height: 1.7; }
/* 题干完整渲染后用 CSS 截断(不在 JS 里截字符, 避免切断 LaTeX 出现裸 $ 源码) */
.uw-clamp { max-height: 7.2em; overflow: hidden; position: relative; word-break: break-word; }
.uw-clamp::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2.4em;
  background: linear-gradient(transparent, #fff); pointer-events: none; }

/* ---------- 个人中心列表页(收藏题目/收藏试卷/个人组卷) ---------- */
.uc-uncollect { float: right; flex-shrink: 0; }

/* ---------- 套卷题目页头部 ---------- */
.sheet-head { margin-bottom: 12px; }
.sheet-title { font-weight: 700; font-size: 16px; line-height: 1.5; }
.sheet-meta { font-size: 13px; color: var(--muted); margin-top: 6px; }
.sheet-admin { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); }
.sheet-admin span { white-space: nowrap; }
.sheet-admin input { width: 84px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; }

/* ---------- 管理中心: 数据统计 ---------- */
.us-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.us-range { display: flex; gap: 6px; }
.us-range-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.us-chart-title { font-size: 13px; font-weight: 600; color: var(--muted); margin: 14px 0 6px; }
.us-risk { border: 1px solid #fecaca; background: #fef2f2; border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.us-risk-name { font-weight: 600; margin-bottom: 4px; }
.us-risk ul { margin: 0; padding-left: 18px; font-size: 13px; color: #b91c1c; line-height: 1.7; }

/* ---------- 账户中心: 头像选择 ---------- */
.ac-avatars { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 6px; }
.ac-av { width: 40px; height: 40px; border-radius: 10px; border: 2px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center; font-size: 22px; cursor: pointer; }
.ac-av.on { border-color: var(--primary); background: #eff6ff; }

/* ---------- 打分: 摘要卡 + 右下悬浮钮 + 底部弹层 ---------- */
.rate-summary { margin-top: 10px; font-size: 13.5px; }
.rate-summary b { color: #d97706; }
.rate-fab { position: fixed; right: 16px; bottom: 72px; z-index: 80; border: none; border-radius: 999px;
  background: #f59e0b; color: #fff; font-size: 14px; font-weight: 700; padding: 12px 18px;
  box-shadow: 0 6px 18px rgba(245,158,11,.45); cursor: pointer; }
/* 全站统一: 返回按钮=蓝渐变圆形悬浮钮(与选题篮同款), 固定右下角最底 */
.back-fab { position: fixed; right: 21px; bottom: 18px; z-index: 90; width: 50px; height: 50px;
  border-radius: 50%; border: none; background: linear-gradient(135deg, var(--primary), #3b82f6);
  color: #fff; font-size: 26px; line-height: 1; cursor: pointer;
  box-shadow: 0 8px 22px rgba(37,99,235,.42); transition: transform .18s, box-shadow .18s; }
.back-fab:hover { transform: translateY(-2px) scale(1.05); box-shadow: 0 12px 28px rgba(37,99,235,.52); }
/* PC 端: 返回钮与右下浮动按钮(选题篮/打分)始终固定屏幕右下角, 滚动页面不消失 */
@media (min-width: 641px) {
  .page > .back-fab, .paper-wrap .back-fab { position: fixed; right: 21px; bottom: 18px; }
}
/* 收藏列表项类型小徽章(套卷/组卷) */
.ucl-kind { font-size: 11px; background: #eff6ff; color: var(--primary); border-radius: 4px;
  padding: 1px 6px; margin-left: 4px; vertical-align: 2px; }
.rate-mask:not(.hidden) { display: block; position: fixed; inset: 0; z-index: 130; background: rgba(15,23,42,.42); }
.rate-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 140; background: #fff;
  border-radius: 14px 14px 0 0; padding: 18px 18px 26px;
  transform: translateY(105%); transition: transform .22s ease; }
.rate-sheet.open { transform: translateY(0); }
.rate-btns { display: flex; gap: 10px; margin-top: 12px; }
.rate-btns .btn { flex: 1; }

/* ---------- 时间筛选(起止日期) ---------- */
.fb-dates { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.fb-dates input { flex: 1; min-width: 0; }
.fb-dates-sep { color: var(--muted); font-size: 12px; flex-shrink: 0; }

/* ---------- 题目打分组件(详情页) ---------- */
.rate-card { margin-top: 10px; }
.rate-title { font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.rate-title .hint { font-weight: 400; margin-left: 6px; }
.rate-row { display: flex; align-items: center; gap: 10px; margin: 4px 0; }
.rate-label { width: 40px; font-size: 13px; color: #334155; font-weight: 600; flex-shrink: 0; }
.rate-stars { display: inline-flex; }
.rate-star { font-size: 26px; color: #cbd5e1; cursor: pointer; padding: 0 3px; line-height: 1.2;
  transition: transform .1s; }
.rate-star:active { transform: scale(1.2); }
.rate-star.on { color: #f59e0b; }
#rate-submit { margin-top: 8px; }
.rate-avg { margin-top: 10px; font-size: 13px; color: var(--muted); }
.rate-avg b { color: #d97706; }

/* ---------- 题目出处行(题干之后) ---------- */
.q-source-line { font-size: 12.5px; color: var(--muted); margin: 5px 0 7px; }

/* PC 题库浏览: 题卡头部不显示标签徽章(含自动标签"未解答"), 仅保留 EN 双语标识 */
@media (min-width: 641px) {
  #question-list .q-head .q-tag:not(.q-tag-en) { display: none; }
}

/* ---------- Round 9: 通用小件 ---------- */
.req { color: #dc2626; font-weight: 700; }
.log-toggle { color: var(--primary); cursor: pointer; font-size: 12px; margin-left: 6px; white-space: nowrap; }
.log-toggle:hover { text-decoration: underline; }
.log-detail { max-width: 340px; word-break: break-all; }

/* ==================== 竞赛知识树: 选题页筛选树 + 学习攻略图谱 ==================== */
/* 选题页: 左侧筛选树 + 右侧题目列表 双栏 */
.pick-wrap { display: flex; gap: 16px; align-items: flex-start; }

/* 移动端抽屉开关: PC 常开侧栏, 隐藏开关按钮 */
.kp-toggle-btn { display: none; }

/* 左侧筛选树 */
.kp-side { width: 268px; flex-shrink: 0; background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 10px; position: sticky; top: 72px;
  max-height: calc(100vh - 96px); display: flex; flex-direction: column; }
.kp-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 10px; gap: 6px; }
.kp-scene { font-weight: 700; font-size: 14px; color: var(--primary); }
/* 大类切换 tab(选题页侧栏 + 学习攻略图谱共用 .kp-cat) */
.kp-cats { display: flex; gap: 2px; flex: 1; min-width: 0; }
.kp-cat { flex: 1; border: none; background: none; padding: 5px 2px; font-size: 12.5px; color: var(--muted);
  border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.kp-cat:hover { color: var(--text); }
.kp-cat.active { color: var(--primary); font-weight: 700; border-bottom-color: var(--primary); }
.kp-close { display: none; border: none; background: none; font-size: 15px; color: var(--muted);
  cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.kp-close:hover { background: #f1f5f9; color: var(--text); }
.kp-search { position: relative; margin-bottom: 8px; }
.kp-search-ico { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); font-size: 12px; opacity: .6; }
.kp-search input { width: 100%; padding: 7px 10px 7px 28px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; }
.kp-search input:focus { outline: 2px solid #bfdbfe; border-color: var(--primary); }
.kp-and { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted);
  padding: 2px 4px 8px; cursor: pointer; user-select: none; }
.kp-and input { accent-color: var(--primary); cursor: pointer; }

/* 树节点 */
.kp-tree { flex: 1; overflow-y: auto; min-height: 120px; padding: 2px; }
.kp-node { user-select: none; }
.kp-row { display: flex; align-items: center; gap: 4px; padding: 4px 6px; border-radius: 6px;
  cursor: pointer; font-size: 13px; line-height: 1.4; }
.kp-row:hover { background: #f1f5f9; }
.kp-row.sel { background: #eff6ff; color: var(--primary); font-weight: 600; }
.kp-arrow { width: 16px; flex-shrink: 0; text-align: center; color: var(--muted); font-size: 11px;
  transition: transform .15s; border-radius: 4px; }
.kp-arrow:not(.leaf):hover { background: #e2e8f0; color: var(--text); }
.kp-arrow.open { transform: rotate(90deg); }
.kp-arrow.leaf { color: #cbd5e1; cursor: default; }
.kp-name { flex: 1; word-break: break-all; }
.kp-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.kp-cnt { font-size: 11px; color: #94a3b8; flex-shrink: 0; }
.kp-kids { padding-left: 15px; border-left: 1px dashed #e2e8f0; margin-left: 7px; }
.kp-empty { color: var(--muted); font-size: 12.5px; text-align: center; padding: 18px 0; }
.kp-foot { display: flex; align-items: center; justify-content: space-between; padding: 10px 4px 0;
  border-top: 1px solid var(--border); margin-top: 8px; }
.kp-count { font-size: 12px; color: var(--muted); }

/* 已选知识点条件条: 横贯题目列表上方, 单个移除/模式切换/一键清空集中一处 */
.kp-active { display: flex; align-items: center; gap: 8px; margin: 0 0 10px;
  background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 10px; padding: 6px 8px 6px 12px; }
.kp-active[hidden] { display: none; }
.kp-active-label { font-size: 12.5px; color: var(--primary); font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.kp-active-label b { font-size: 13px; }
.kp-active-chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0;
  max-height: 66px; overflow-y: auto; scrollbar-width: thin; padding: 2px 0; }
.kp-active-mode { border: 1px solid #ddd6fe; background: #f5f3ff; color: #7c3aed; border-radius: 999px;
  font-size: 12px; padding: 3px 10px; cursor: pointer; white-space: nowrap; flex-shrink: 0; }
.kp-active-mode.and { border-color: #fde68a; background: #fffbeb; color: #b45309; }
.kp-active-clear { border: none; background: none; color: var(--muted); font-size: 12.5px; cursor: pointer;
  white-space: nowrap; flex-shrink: 0; padding: 3px 8px; border-radius: 6px; }
.kp-active-clear:hover { color: var(--danger); background: #fef2f2; }
/* 已选知识点 chips(条件条内) */
.kp-chip { display: inline-flex; align-items: center; gap: 5px; background: #fff; color: var(--primary);
  border: 1px solid #bfdbfe; border-radius: 999px; padding: 3px 10px; font-size: 12.5px; white-space: nowrap; flex-shrink: 0; }
.kp-chip b { cursor: pointer; font-weight: 400; opacity: .6; }
.kp-chip b:hover { opacity: 1; }

/* 移动端知识点抽屉专用遮罩: 桌面不显示(仅 mobile.css 在 ≤640px 下给出样式) */
#kp-mask { display: none; }

/* 标签管理: 知识树导入行 */
.kptag-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* ---------- 学习攻略 ---------- */
.guide-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.guide-card { display: flex; align-items: center; gap: 14px; background: var(--card);
  border: 1px solid var(--border); border-radius: 12px; padding: 18px; cursor: pointer;
  transition: box-shadow .15s, border-color .15s; }
.guide-card:hover { border-color: var(--primary); box-shadow: 0 6px 18px rgba(37,99,235,.10); }
.guide-ico { font-size: 30px; flex-shrink: 0; }
.guide-card-body { flex: 1; }
.guide-card-body b { font-size: 15px; }
.guide-card-body p { font-size: 12.5px; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.guide-arrow { font-size: 20px; color: #cbd5e1; flex-shrink: 0; }

.guide-map-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px;
  margin-bottom: 10px; }
.guide-map-title { font-weight: 700; font-size: 17px; }
.guide-map-meta { font-size: 12.5px; color: var(--muted); }
.guide-map-spacer { flex: 1; }
.guide-map-hint { font-size: 12.5px; color: #b45309; background: #fffbeb; border: 1px solid #fde68a;
  border-radius: 8px; padding: 8px 12px; margin-bottom: 10px; }
.guide-map-hint:empty { display: none; }

/* 图谱海报: 模块化卡片网格 */
.gmap { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 14px; }
.gmap-mod { background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--primary);
  border-radius: 12px; padding: 14px 16px; break-inside: avoid; }
.gmap-mod-head { display: flex; align-items: center; gap: 8px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border); margin-bottom: 10px; flex-wrap: wrap; }
.gmap-idx { width: 24px; height: 24px; border-radius: 8px; color: #fff; font-size: 13px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.gmap-mod-head b { font-size: 15px; }
.gmap-tag { color: #fff; font-size: 11px; border-radius: 999px; padding: 1px 8px; font-style: normal; }
.gmap-tree, .gmap-tree ul { list-style: none; }
.gmap-tree li { margin: 2px 0; }
.gmap-tree ul { padding-left: 16px; border-left: 1px dashed #e2e8f0; margin-left: 5px; }
.gmap-row { display: inline-flex; align-items: center; gap: 6px; padding: 2px 6px; border-radius: 6px;
  font-size: 13.5px; line-height: 1.6; }
.gmap-row:hover { background: #f8fafc; }
.gmap-sq { width: 7px; height: 7px; border: 1.5px solid #94a3b8; border-radius: 2px; flex-shrink: 0; }
.gmap-name { word-break: break-all; }
/* 编辑模式按钮组 */
.gmap-btns { display: inline-flex; gap: 4px; margin-left: 6px; }
.gmap-btns button { border: 1px solid var(--border); background: #fff; border-radius: 6px;
  font-size: 12px; padding: 1px 7px; cursor: pointer; color: var(--muted); line-height: 1.5; }
.gmap-btns button:hover { border-color: var(--primary); color: var(--primary); }
.gmap-addmod { margin-top: 14px; text-align: center; }
/* 编辑态拖拽(HTML5 DnD): 仅把手 ⠿ 可发起拖动; 三zone指示 前插/后插/成为子级 */
.gmap-handle { cursor: grab; color: #cbd5e1; font-size: 13px; user-select: none; flex-shrink: 0;
  padding: 0 3px; border-radius: 4px; }
.gmap-handle:hover { color: var(--primary); background: #eff6ff; }
.gmap-handle:active { cursor: grabbing; }
.gmap-mod-head[data-gid], .gmap-row[data-gid] { transition: box-shadow .1s, background .1s; }
.gmap-mod-head.dragging, .gmap-row.dragging { opacity: .45; }
.gmap-mod-head.drop-before, .gmap-row.drop-before { box-shadow: 0 -3px 0 0 var(--primary); }
.gmap-mod-head.drop-after, .gmap-row.drop-after { box-shadow: 0 3px 0 0 var(--primary); }
.gmap-mod-head.drop-into, .gmap-row.drop-into { background: #eff6ff; outline: 2px dashed var(--primary); outline-offset: 1px; }
.gmap-mod-head.drop-deny, .gmap-row.drop-deny { background: #fef2f2; outline: 2px dashed var(--danger); outline-offset: 1px; cursor: not-allowed; }
/* 节点被拖动后, 同级序号重新编号由渲染层处理; 此处仅保证指示层不被按钮组遮挡 */
.gmap-btns { position: relative; }

/* 录题表单: 题干失焦查重提示条 */
.stem-dup { margin: 6px 0 2px; padding: 8px 12px; border-radius: 8px; font-size: 12.5px; line-height: 1.7; }
.stem-dup.hidden { display: none; }
.stem-dup.exact { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.stem-dup.warn { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.stem-dup.ok { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.stem-dup a { color: var(--primary); margin-left: 6px; white-space: nowrap; }
.stem-dup .dup-item { display: inline-block; margin-right: 14px; }

/* ===== 备案信息页脚 ===== */
.site-footer { display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 18px 12px; margin-top: auto; font-size: 13px; color: var(--muted);
  border-top: 1px solid var(--border); background: var(--card); flex-wrap: wrap; text-align: center; }
.site-footer .beian-link { color: var(--muted); text-decoration: none;
  display: inline-flex; align-items: center; gap: 5px; }
.site-footer .beian-link:hover { color: var(--primary); }
.site-footer .beian-sep { color: var(--border); }
@media print { .site-footer { display: none; } }
