@import url('/assets/source-image-layout.css');
/* ==========================================================================
   职岗通AI题库管理工作台
   三联式：左 检索/范围/馆藏 · 中 万象AI 助手 · 右 文献列表
   ========================================================================== */

:root {
  --brand: #5b5bd6;
  --brand-soft: #eeeefc;
  --brand-deep: #4545c0;
  --bg: #ffffff;
  --bg-soft: #fafbfc;
  --bg-sink: #f1f3f6;
  --panel: #ffffff;
  --border: #ebedf1;
  --border-strong: #dfe3e9;
  --text: #23272f;
  --text-mid: #4e5666;
  --text-dim: #949bab;
  --ok: #12a150;
  --warn: #b7791f;
  --warn-soft: #fff8e6;
  --danger: #d9453d;
  --mark: #fff3c4;
  --radius: 9px;
  --radius-lg: 14px;
  --shadow: 0 1px 2px rgba(20, 26, 40, .04), 0 8px 28px rgba(20, 26, 40, .08);
  --w-left: 306px;
  --w-mid: 396px;
  --font: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--text); background: var(--bg);
  font-size: 13.5px; line-height: 1.62; -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
.spacer { flex: 1; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #dfe3ea; border-radius: 9px; }
::-webkit-scrollbar-track { background: transparent; }

/* ── 三联骨架 ───────────────────────────────────────────── */
.shell { display: flex; height: 100vh; overflow: hidden; }
.pane { display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
.pane-mid { width: var(--w-left); flex: 0 0 var(--w-left); background: var(--bg-soft); border-right: 1px solid var(--border); }
.pane-left { width: var(--w-mid); flex: 0 0 var(--w-mid); background: #fcfcfd; border-right: 1px solid var(--border); }
.pane-right { flex: 1; min-width: 0; background: var(--bg); }
.pane-close, .pane-open { display: none; }
.pane-close { border: none; background: transparent; color: var(--text-dim); font-size: 19px; line-height: 1; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.pane-close:hover { background: var(--bg-sink); color: var(--text); }
.pane-open { border: none; background: transparent; font-size: 17px; cursor: pointer; color: var(--text-mid); padding: 4px 8px; border-radius: 8px; }
.pane-open:hover { background: var(--bg-sink); }

/* ── 左联：品牌与检索 ───────────────────────────────────── */
.brand { display: flex; align-items: center; gap: 9px; padding: 15px 14px 12px; }
.brand .logo { width: 29px; height: 29px; border-radius: 9px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 15px; flex: 0 0 auto; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text b { font-size: 13px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { color: var(--text-dim); font-size: 10.5px; }

.pane-scroll { flex: 1; overflow-y: auto; padding: 0 12px 14px; }
.pane-foot { border-top: 1px solid var(--border); padding: 8px 14px; font-size: 11.5px; color: var(--text-dim); display: flex; align-items: center; gap: 6px; }
.pane-foot .mini { padding: 0 7px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); display: inline-block; flex: 0 0 auto; }
.dot.off { background: var(--danger); }

.stat-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 12px; }
.stat-main { font-size: 12px; color: var(--text-mid); white-space: nowrap; }
.stat-main b { font-size: 16px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 11px; color: var(--text-dim); margin-top: 3px; }

.block { margin-bottom: 12px; }
.block-head { display: flex; align-items: baseline; gap: 6px; font-size: 11.5px; font-weight: 650; color: var(--text-mid); letter-spacing: .3px; padding: 0 2px 6px; }
.block-head .block-sub { font-weight: 400; color: var(--text-dim); font-size: 11px; }
.nav-hint { font-size: 12px; color: var(--text-dim); padding: 3px 4px; }

.searchbox { display: flex; align-items: center; gap: 7px; background: var(--panel); border: 1px solid var(--border-strong); border-radius: 10px; padding: 0 5px 0 10px; height: 37px; transition: border-color .15s, box-shadow .15s; }
.searchbox:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(91,91,214,.1); }
.searchbox .sicon { color: var(--text-dim); font-size: 12px; }
.searchbox input { flex: 1; min-width: 0; border: none; background: transparent; outline: none; height: 100%; font-size: 13px; }
.searchbox .go { border: none; background: var(--brand); color: #fff; border-radius: 8px; padding: 6px 13px; cursor: pointer; font-weight: 600; font-size: 12.5px; }
.searchbox .go:hover { background: var(--brand-deep); }

.scope-row { display: flex; align-items: center; gap: 7px; margin-top: 8px; }
.scope-label { font-size: 12px; color: var(--text-dim); flex: 0 0 auto; }
.scope-chips { display: flex; flex-wrap: wrap; gap: 5px; min-width: 0; }
.scope-chips .sc { border: 1px solid var(--border-strong); background: var(--panel); color: var(--text-mid); border-radius: 20px; padding: 1px 9px; font-size: 11.5px; cursor: pointer; }
.scope-chips .sc.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }

.hint-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 11px 13px; margin-bottom: 8px; text-align: center; }
.hint-card b { font-size: 12.5px; }
.hint-card p { margin: 4px 0 0; font-size: 11.5px; color: var(--text-dim); line-height: 1.6; }

.quick-row { display: flex; gap: 6px; flex-wrap: wrap; }

.btn { border: 1px solid var(--border-strong); background: var(--panel); color: var(--text-mid); border-radius: 8px; padding: 5px 11px; cursor: pointer; white-space: nowrap; font-size: 12.5px; transition: all .12s; }
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--brand-deep); border-color: var(--brand-deep); color: #fff; }
.btn.danger { border-color: #f0c9c6; color: var(--danger); background: #fdf4f3; }
.btn.danger:hover { background: #fbe9e7; border-color: var(--danger); }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.mini { border: 1px solid var(--border-strong); background: var(--panel); color: var(--text-dim); border-radius: 7px; padding: 1px 8px; font-size: 11.5px; cursor: pointer; white-space: nowrap; }
.mini:hover { border-color: var(--brand); color: var(--brand); }

.nav-item { display: flex; align-items: center; gap: 8px; padding: 5px 9px; border-radius: 8px; color: var(--text-mid); cursor: pointer; border: none; background: transparent; width: 100%; text-align: left; font-size: 12.5px; transition: background .12s, color .12s; }
.nav-item:hover { background: #eef0f4; color: var(--text); }
.nav-item.active { background: var(--brand-soft); color: var(--brand-deep); font-weight: 600; }
.nav-item .ico { flex: 0 0 17px; text-align: center; font-size: 12px; }
.nav-item .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .num { font-size: 11px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.nav-item.active .num { color: var(--brand); }
.nav-item.small { font-size: 12px; padding: 4px 9px; }

.facet-panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px; max-height: 320px; overflow-y: auto; }

/* 题库二级目录 */
.cat1 { margin-bottom: 1px; }
.cat1-row { display: flex; align-items: center; gap: 2px; border-radius: 8px; }
.cat1-row:hover { background: #eef0f4; }
.cat1-row.active { background: var(--brand-soft); }
.cat1-row .num { font-size: 11px; color: var(--text-dim); padding-right: 8px; font-variant-numeric: tabular-nums; }
.cat-toggle { border: none; background: transparent; cursor: pointer; color: var(--text-dim); font-size: 10px; width: 18px; padding: 2px 0; flex: 0 0 auto; }
.cat-toggle:hover { color: var(--brand); }
.cat-name { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; border: none; background: transparent; cursor: pointer; padding: 5px 2px; color: var(--text-mid); font-size: 13px; font-weight: 600; text-align: left; }
.cat1-row.active .cat-name { color: var(--brand-deep); }
.cat-name .ico { flex: 0 0 17px; text-align: center; font-size: 12px; }
.cat-name .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat2-list { margin: 1px 0 5px 19px; border-left: 1px solid var(--border); padding-left: 6px; }
.cat2-wrap { }
.cat2-row { display: flex; align-items: center; gap: 2px; }
.cat2-row .num { font-size: 11px; color: var(--text-dim); padding-right: 8px; font-variant-numeric: tabular-nums; }
.cat2-row .cat2 { flex: 1; min-width: 0; font-size: 12.5px; }
.cat2-row .cat2.active { background: var(--brand-soft); color: var(--brand-deep); font-weight: 600; }
.cat-toggle.sub { width: 15px; font-size: 9px; }
.cat-toggle.ghost { cursor: default; }
.cat3-list { margin: 1px 0 4px 15px; border-left: 1px dashed var(--border); padding-left: 6px; }
.cat3-list .cat3 { font-size: 12px; padding: 3px 8px; }
.cat3-list .cat3 .label { color: var(--text-mid); }
.cat3-list .cat3.active { background: var(--brand-soft); color: var(--brand-deep); font-weight: 600; }
.cat3-list .cat3.active .label { color: var(--brand-deep); }
.facet-group { margin-bottom: 7px; }
.facet-head { display: flex; justify-content: space-between; font-size: 11px; font-weight: 650; color: var(--text-dim); padding: 3px 6px; }
.facet-item { display: flex; gap: 8px; align-items: center; border: none; background: transparent; cursor: pointer; padding: 3px 7px; border-radius: 7px; color: var(--text-mid); font-size: 12px; text-align: left; width: 100%; }
.facet-item:hover { background: var(--bg-sink); color: var(--text); }
.facet-item.on { background: var(--brand-soft); color: var(--brand-deep); font-weight: 600; }
.facet-item .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.facet-item .num { font-size: 11px; color: var(--text-dim); font-variant-numeric: tabular-nums; }

/* ── 中联：万象AI 助手 ─────────────────────────────────── */
.chat-head { display: flex; align-items: center; gap: 9px; padding: 14px 14px 10px; border-bottom: 1px solid var(--border); }
.chat-head .avatar { width: 27px; height: 27px; border-radius: 9px; color: #fff; font-size: 12px; font-weight: 700; background: linear-gradient(135deg, #5b5bd6, #7b53d6); display: grid; place-items: center; flex: 0 0 auto; }
.chat-head .ttl { display: flex; flex-direction: column; flex: 1; min-width: 0; font-size: 13px; font-weight: 650; }
.chat-head .ttl small { font-size: 10.5px; color: var(--text-dim); font-weight: 400; }
.iconbtn { border: none; background: transparent; color: var(--text-dim); cursor: pointer; font-size: 13px; padding: 3px 6px; border-radius: 7px; }
.iconbtn:hover { background: var(--bg-sink); color: var(--text); }

.chat-ctx { padding: 8px 14px; font-size: 11.5px; color: var(--text-dim); display: flex; flex-wrap: wrap; gap: 5px; align-items: center; border-bottom: 1px solid var(--border); }
.chat-ctx .chip { font-size: 11px; padding: 1px 7px; }

.ai-log { flex: 1; overflow-y: auto; padding: 13px 14px; }
.msg { margin-bottom: 14px; }
.msg .who { font-size: 11px; color: var(--text-dim); margin-bottom: 4px; }
.msg.user .bubble { background: var(--brand); color: #fff; border-radius: 12px 12px 4px 12px; padding: 9px 12px; margin-left: 34px; white-space: pre-wrap; word-break: break-word; }
.msg.ai .bubble { background: var(--panel); border: 1px solid var(--border); border-radius: 12px 12px 12px 4px; padding: 11px 13px; word-break: break-word; }
.msg.ai .bubble > :first-child { margin-top: 0; }
.msg.ai .bubble > :last-child { margin-bottom: 0; }
.bubble h1, .bubble h2, .bubble h3, .bubble h4 { font-size: 13.5px; margin: 12px 0 6px; }
.bubble p { margin: 7px 0; }
.bubble ul, .bubble ol { margin: 7px 0; padding-left: 19px; }
.bubble code { background: var(--bg-sink); border-radius: 4px; padding: 1px 5px; font-size: 12px; }
.bubble pre { background: var(--bg-sink); border-radius: 8px; padding: 10px; overflow-x: auto; }
.bubble table { border-collapse: collapse; margin: 8px 0; font-size: 12.5px; width: 100%; }
.bubble td { border: 1px solid var(--border); padding: 4px 7px; }
.bubble blockquote { margin: 8px 0; padding: 6px 10px; border-left: 3px solid var(--warn); background: var(--warn-soft); border-radius: 0 8px 8px 0; font-size: 12.5px; color: var(--warn); }
.bubble a { color: var(--brand); text-decoration: underline; }
.typing::after { content: '▍'; animation: blink 1s steps(2) infinite; color: var(--brand); }
@keyframes blink { 50% { opacity: 0; } }
.stage-note { display: flex; align-items: center; gap: 8px; margin: 4px 0 6px; padding: 7px 10px; border-radius: 8px; background: var(--brand-soft); color: var(--text-mid); font-size: 12px; }
.stage-note .spinner { width: 12px; height: 12px; border-width: 2px; }
.refs { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border-strong); display: flex; flex-direction: column; gap: 6px; }
.refs .t { font-size: 11px; color: var(--text-dim); font-weight: 600; }
.refs .ref { font-size: 12px; display: flex; flex-direction: column; gap: 1px; padding-left: 9px; position: relative; }
.refs .ref::before { content: '·'; position: absolute; left: 0; color: var(--text-dim); }
.refs .ref button { border: none; background: transparent; color: var(--brand); cursor: pointer; padding: 0; text-align: left; text-decoration: underline; text-underline-offset: 2px; line-height: 1.45; }
.refs .ref .src { color: var(--text-dim); font-size: 11px; }
.ref-toggle { align-self: flex-start; border: 1px solid var(--border-strong); background: var(--panel); color: var(--text-mid); border-radius: 20px; padding: 2px 10px; font-size: 11.5px; cursor: pointer; }
.ref-toggle:hover { border-color: var(--brand); color: var(--brand); }

.ai-suggest { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; }
.ai-suggest button { border: 1px solid var(--border-strong); background: var(--panel); color: var(--text-mid); border-radius: 20px; padding: 3px 10px; font-size: 11.5px; cursor: pointer; }
.ai-suggest button:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

.ai-input { padding: 0 14px 14px; }
.ai-input .box { border: 1px solid var(--border-strong); border-radius: 12px; background: var(--panel); padding: 8px 10px; transition: border-color .15s, box-shadow .15s; }
.ai-input .box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(91,91,214,.1); }
.ai-input textarea { width: 100%; border: none; background: transparent; outline: none; resize: none; font-size: 13px; max-height: 140px; min-height: 42px; line-height: 1.6; }
.ai-input .row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.ai-input .row .hint { font-size: 11px; color: var(--text-dim); margin-right: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── 右联：文献列表 ─────────────────────────────────────── */
.main-head { display: flex; align-items: center; gap: 12px; padding: 17px 24px 9px; }
.main-title { min-width: 0; }
.main-title h1 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: .2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.main-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.main-acts { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.tbtn { border: 1px solid var(--border-strong); background: var(--panel); color: var(--text-mid); border-radius: 8px; padding: 5px 11px; cursor: pointer; font-size: 12.5px; white-space: nowrap; transition: all .12s; }
.tbtn:hover { border-color: var(--brand); color: var(--brand); }
.tbtn.on { background: var(--brand-soft); border-color: #cfd0f5; color: var(--brand-deep); font-weight: 600; }
.sel { border: 1px solid var(--border-strong); background: var(--panel); border-radius: 8px; padding: 5px 7px; cursor: pointer; color: var(--text-mid); font-size: 12.5px; }

.main-bar { display: flex; align-items: center; gap: 9px; padding: 0 24px 11px; }
.findbox { flex: 1; display: flex; align-items: center; gap: 6px; background: var(--bg-sink); border: 1px solid var(--border-strong); border-radius: 9px; padding: 0 5px 0 10px; height: 34px; min-width: 0; transition: border-color .15s, box-shadow .15s; }
.findbox:focus-within { border-color: var(--brand); background: var(--panel); box-shadow: 0 0 0 3px rgba(91,91,214,.1); }
.findbox .sicon { color: var(--text-dim); font-size: 12px; }
.findbox input { flex: 1; min-width: 0; border: none; background: transparent; outline: none; height: 100%; font-size: 12.5px; }
.findbox .find-count { font-size: 11.5px; color: var(--text-dim); font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.tabs { display: flex; background: var(--bg-sink); border-radius: 9px; padding: 3px; flex: 0 0 auto; }
.tabs button { border: none; background: transparent; padding: 4px 13px; border-radius: 7px; cursor: pointer; color: var(--text-mid); font-size: 12.5px; }
.tabs button.active { background: var(--panel); color: var(--brand-deep); font-weight: 600; box-shadow: 0 1px 3px rgba(20,26,40,.08); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 24px 10px; }
.chips:empty { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--brand-soft); color: var(--brand-deep); border-radius: 20px; padding: 2px 8px 2px 11px; font-size: 11.5px; border: 1px solid #dedefb; }
.chip button { border: none; background: transparent; color: inherit; cursor: pointer; font-size: 13px; line-height: 1; padding: 0 2px; opacity: .65; }
.chip button:hover { opacity: 1; }

.list-head { display: flex; align-items: center; gap: 10px; padding: 10px 24px 4px; font-size: 12px; color: var(--text-dim); border-top: 1px solid var(--border); }
.list-head .prog { color: var(--warn); background: var(--warn-soft); border-radius: 20px; padding: 1px 9px; }
.scroller { flex: 1; overflow-y: auto; padding: 0 24px 34px; }

.doclist { display: flex; flex-direction: column; }
.doc { display: flex; gap: 11px; padding: 9px 10px; border-bottom: 1px solid var(--border); cursor: pointer; border-radius: 10px; transition: background .12s; align-items: center; }
.doc:hover { background: var(--bg-soft); }
.doc.selected { background: var(--brand-soft); }
.doc .pick { flex: 0 0 auto; display: flex; align-items: center; }
.doc .pick input { width: 14px; height: 14px; cursor: pointer; accent-color: var(--brand); }
.doc .ficon { flex: 0 0 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; font-size: 8px; font-weight: 700; color: #fff; letter-spacing: .2px; overflow: hidden; opacity: .92; }
.ficon.pdf { background: #e14b42; } .ficon.doc, .ficon.docx { background: #2b579a; }
.ficon.xls, .ficon.xlsx { background: #1d7044; } .ficon.ppt, .ficon.pptx { background: #d24726; }
.ficon.txt { background: #5b6577; } .ficon.img { background: #7e57c2; }
.ficon.zip, .ficon.rar, .ficon.sevenz { background: #8a6d3b; } .ficon.other { background: #949bab; }
.doc .body { flex: 1; min-width: 0; }
.doc .name { font-size: 14px; font-weight: 600; line-height: 1.4; margin-bottom: 1px; color: var(--text); }
.doc .name mark { background: var(--mark); padding: 0 1px; border-radius: 2px; }
.doc .cat { display: inline-block; font-size: 11px; color: var(--brand-deep); background: var(--brand-soft); border-radius: 5px; padding: 0 7px; margin-left: 7px; vertical-align: 1px; font-weight: 500; }
.doc .meta { display: flex; flex-wrap: wrap; gap: 0 12px; font-size: 12px; color: var(--text-dim); line-height: 1.7; }
.doc .meta .m { white-space: nowrap; }
.doc .meta .m b { color: var(--text-mid); font-weight: 600; }
.doc .tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 3px; }
.tag { font-size: 11px; border-radius: 5px; padding: 0 6px; background: var(--bg-sink); color: var(--text-mid); white-space: nowrap; }
.tag.ok { background: #eefaf2; color: #12a150; }
.tag.pending { background: #fff8e6; color: #b7791f; }
.tag.year { background: #fdf2e8; color: #a35a12; }
.doc .acts { flex: 0 0 auto; display: flex; align-items: center; gap: 2px; }
.doc .fav { border: none; background: transparent; cursor: pointer; font-size: 15px; color: #d5d8e0; padding: 0 3px; line-height: 1; }
.doc .fav:hover { color: #f0a92b; }
.doc .fav.on { color: #f0a92b; }
.doc mark { background: var(--mark); border-radius: 2px; }

/* 选中操作条 */
.selbar { display: flex; align-items: center; gap: 10px; padding: 10px 24px; border-top: 1px solid var(--border); background: var(--panel); box-shadow: 0 -2px 12px rgba(20,26,40,.05); }
.selbar .sel-count { font-size: 12.5px; color: var(--brand-deep); font-weight: 600; flex: 0 0 auto; }

/* 全文命中 */
.deepbox { margin: 12px 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.deephead { background: var(--brand-soft); color: var(--brand-deep); font-size: 12px; padding: 8px 13px; }
.deepbox .doc { border-bottom: 1px solid var(--border); }
.snippet { background: var(--bg-soft); border-left: 3px solid var(--brand); border-radius: 0 8px 8px 0; padding: 6px 10px; margin: 5px 0 0; font-size: 12.5px; color: var(--text-mid); }

/* ── 状态 ───────────────────────────────────────────────── */
.empty { text-align: center; padding: 62px 20px; color: var(--text-dim); }
.empty .big { font-size: 34px; margin-bottom: 10px; opacity: .5; }
.loading { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 46px; color: var(--text-dim); }
.spinner { width: 15px; height: 15px; border: 2px solid var(--border-strong); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.banner { margin: 12px 0; padding: 9px 13px; border-radius: var(--radius); background: var(--warn-soft); color: var(--warn); font-size: 12.5px; }

/* ── 抽屉 / 弹窗 ────────────────────────────────────────── */
.mask { position: fixed; inset: 0; background: rgba(18,22,32,.3); opacity: 0; pointer-events: none; transition: opacity .18s; z-index: 55; }
.mask.on { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(900px, 95vw); background: var(--bg); box-shadow: var(--shadow); transform: translateX(102%); transition: transform .22s ease; z-index: 60; display: flex; flex-direction: column; }
.drawer.on { transform: none; }
.drawer-head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 20px 11px; border-bottom: 1px solid var(--border); }
.drawer-head h2 { margin: 0; font-size: 15.5px; line-height: 1.5; }
.drawer-head .sub { font-size: 12px; color: var(--text-dim); margin-top: 3px; }
.drawer-close { border: none; background: transparent; font-size: 22px; line-height: 1; cursor: pointer; color: var(--text-dim); padding: 2px 8px; border-radius: 8px; }
.drawer-close:hover { background: var(--bg-sink); color: var(--text); }
.drawer-tabs { display: flex; gap: 4px; padding: 9px 20px 0; border-bottom: 1px solid var(--border); }
.drawer-tabs button { border: none; background: transparent; padding: 7px 13px; cursor: pointer; color: var(--text-mid); border-bottom: 2px solid transparent; font-size: 13px; }
.drawer-tabs button.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.drawer-body { flex: 1; overflow: auto; padding: 14px 20px 30px; }
.drawer-body iframe { width: 100%; height: 74vh; border: 1px solid var(--border); border-radius: 10px; }
.drawer-body .plain { white-space: pre-wrap; font-size: 12.5px; line-height: 1.8; color: var(--text-mid); background: var(--bg-soft); border-radius: 10px; padding: 14px 16px; }
.drawer-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.drawer-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 13px; }

.modal { position: fixed; inset: 0; background: rgba(18,22,32,.3); display: none; align-items: center; justify-content: center; z-index: 65; padding: 20px; }
.modal.on { display: flex; }
.modal-box { background: var(--panel); border-radius: var(--radius-lg); width: min(580px, 96vw); max-height: 90vh; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h2 { flex: 1; margin: 0; font-size: 15.5px; }
.modal-body { padding: 16px 20px 22px; overflow-y: auto; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 5px; }
.field input, .field select { width: 100%; border: 1px solid var(--border-strong); border-radius: 8px; padding: 8px 10px; outline: none; background: var(--panel); }
.field input:focus, .field select:focus { border-color: var(--brand); }
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }
.modal-note { font-size: 12px; color: var(--text-dim); background: var(--bg-soft); border-radius: 8px; padding: 9px 11px; margin-top: 4px; }
.code-out { font-family: ui-monospace, Consolas, monospace; font-size: 19px; font-weight: 700; letter-spacing: 2px; color: var(--brand); text-align: center; padding: 12px; background: var(--brand-soft); border-radius: 10px; margin: 8px 0; }

/* ── 响应式：三联合并 ───────────────────────────────────── */
@media (max-width: 1560px) { :root { --w-left: 288px; --w-mid: 360px; } }
@media (max-width: 1360px) {
  :root { --w-left: 268px; --w-mid: 330px; }
  .doc .meta .m.opt { display: none; }
}
/* 中联（助手）改为浮层 */
@media (max-width: 1200px) {
  .pane-left { position: fixed; top: 0; bottom: 0; left: var(--w-left); z-index: 70; box-shadow: var(--shadow); transform: translateX(-104%); transition: transform .2s ease; }
  .pane-left.on { transform: none; }
  .pane-left .pane-close { display: block; }
}
/* 左联（检索）改为浮层，只留文献列表 */
@media (max-width: 940px) {
  .pane-mid { position: fixed; top: 0; bottom: 0; left: 0; z-index: 72; box-shadow: var(--shadow); transform: translateX(-104%); transition: transform .2s ease; }
  .pane-mid.on { transform: none; }
  .pane-mid .pane-close, .pane-open { display: block; }
  .pane-left { left: 0; z-index: 74; }
  .main-head, .main-bar, .chips, .list-head, .scroller, .selbar { padding-left: 15px; padding-right: 15px; }
}
@media (max-width: 620px) {
  .q .opts, .q .ans, .q .qfoot { margin-left: 0; }
  .main-title h1 { font-size: 17px; }
  .drawer { width: 100vw; }
  .selbar { flex-wrap: wrap; }
}

/* ── 深色 ───────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root {
    --brand: #7a7ae8; --brand-soft: #23234a; --brand-deep: #9d9df2;
    --bg: #14171d; --bg-soft: #171b22; --bg-sink: #1e232c; --panel: #1a1f27;
    --border: #262c37; --border-strong: #313846;
    --text: #e6e9ef; --text-mid: #aeb6c4; --text-dim: #78818f;
    --mark: #4a3d10; --warn-soft: #33280f;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 32px rgba(0,0,0,.4);
  }
  .pane-left { background: #161a21; }
  .nav-item:hover { background: #1f242e; }
  .nav-item.active { background: #23234a; }
  .chip { border-color: #2f2f60; }
  .tag.ok { background: #14261c; color: #5fd08e; }
  .tag.pending { background: #2b2413; color: #e3bb6a; }
  .tag.year { background: #2b2113; color: #e0a75e; }
  .doc .fav { color: #3a4150; }
  .tbtn.on { border-color: #3a3a72; }
  .ficon.img { background: #6d4fc4; }
  .btn.danger { background: #2a1a19; border-color: #4a2624; }
}
@media (prefers-color-scheme: dark) {
  html:not([data-ds-light-theme]) .searchbox,
  html:not([data-ds-light-theme]) .findbox { background: var(--bg-sink); }
}

/* ── 试卷大题与材料 ─────────────────────────────────────── */
.exam-section {
  margin: 26px 0 10px; padding: 8px 12px; font-size: 14.5px;
  background: var(--brand-soft); color: var(--brand-deep);
  border-radius: 9px; border-left: 3px solid var(--brand);
}
.exam-material {
  background: var(--panel); border: 1px solid var(--border-strong); border-radius: 10px;
  padding: 12px 14px; margin: 0 0 14px; font-size: 13px; line-height: 1.85; color: var(--text-mid);
  max-height: 420px; overflow-y: auto;
}
.exam-material .mh { font-size: 11.5px; font-weight: 650; color: var(--text-dim); margin-bottom: 6px; letter-spacing: .4px; }
.exam-material .mtext { white-space: pre-wrap; word-break: break-word; }
/* 材料自带的源文件图表（表格 / 柱状图 / 饼图，按源文件原样显示） */
.exam-material .mfigs { margin: 2px 0 8px; display: flex; flex-direction: column; gap: 8px; }
.exam-material .mfl { font-size: 11.5px; font-weight: 650; color: var(--text-dim); letter-spacing: .4px; }
.exam-material .mfigs img {
  max-width: 100%; height: auto; border: 1px solid var(--border); border-radius: 6px; background: #fff;
}
.image-missing {
  width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px dashed var(--warn);
  border-radius: 6px; color: var(--warn); background: var(--panel);
  font-size: 12px; line-height: 1.6;
}
/* 文字版材料折叠在图片下面，图片是源文件原样，文字只用于检索/复制 */
.exam-material .mtextwrap { margin-top: 4px; }
.exam-material .mtextwrap > summary {
  cursor: pointer; font-size: 11.5px; color: var(--text-dim); list-style: none; padding: 3px 0;
}
.exam-material .mtextwrap > summary::-webkit-details-marker { display: none; }
.exam-material .mtextwrap > summary::before { content: '▸ '; }
.exam-material .mtextwrap[open] > summary::before { content: '▾ '; }
.exam-material.rev { margin: 0 0 10px; max-height: 340px; }
/* 材料与题干之间空一行（每个小题都显示材料，靠这行留白把材料与题干分开） */
.mblank { height: 1.35em; }
.exam-q.single .exam-material { margin-bottom: 0; }

/* ── 单题一页：选项纵向排列 + 翻页条 ─────────────────── */
.exam-q.single { max-width: 900px; }
/* 材料题：资料一个独立板块（固定显示），题干 + 选项一个独立板块，左右并排；
   题干卡片的圆角矩形保持原样（780px、居中、16px 圆角、浅灰边框、轻微投影），不因并排而变窄 */
.exam-q.single.has-material { max-width: 1340px; }
/* 没有材料的小题保持原样：卡片照旧 780px 居中，不做两栏 */
.qsplit { display: block; }
.qsplit .qside { min-width: 0; display: flex; justify-content: center; }
.qsplit .qside .qcard { margin-top: 14px; }
.qsplit .qside .mblank { height: 0; }
/* 有材料的小题才切成「左资料 + 右题干」两栏 */
.qsplit.with-material { display: grid; grid-template-columns: minmax(300px, 1fr) 780px; gap: 22px; align-items: start; }
.qsplit.with-material .mpanel {
  position: sticky; top: 12px; max-height: calc(100vh - 150px); overflow-y: auto;
  justify-self: center; width: 100%; max-width: 780px;
}
.qsplit.with-material .mpanel .exam-material { margin: 0; max-height: none; }
.qsplit.with-material .qside .qcard { margin-top: 0; }
@media (max-width: 1200px) {
  .qsplit.with-material { grid-template-columns: 1fr; gap: 0; }
  .qsplit.with-material .mpanel { position: static; max-height: none; }
  .qsplit.with-material .qside .mblank { height: 1.35em; }
  .qsplit.with-material .qside .qcard { margin-top: 0; }
}
.opts-vertical { display: flex; flex-direction: column; gap: 9px; margin: 16px 0 0; }
.opts-vertical .optrow {
  display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px;
  border: 1px solid var(--border-strong); border-radius: 10px; background: var(--panel);
  cursor: pointer; transition: border-color .12s, background .12s;
}
.opts-vertical .optrow:hover { border-color: var(--brand); background: var(--brand-soft); }
.opts-vertical .optrow.sel { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 2px rgba(91,91,214,.12); }
.opts-vertical .optrow input { margin-top: 3px; flex: 0 0 auto; }
.opts-vertical .optrow .lb { font-weight: 700; color: var(--brand-deep); flex: 0 0 auto; }
.opts-vertical .optrow .otext { flex: 1; min-width: 0; line-height: 1.7; }
.pagebar {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin: 22px 0 8px; padding-top: 16px; border-top: 1px solid var(--border);
}
.pagebar .pageno { font-size: 13px; color: var(--text-dim); min-width: 130px; text-align: center; }
#qnav button.on { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ── 能力分析 ───────────────────────────────────────────── */
.analysis .verdict { border-radius: 10px; padding: 11px 14px; margin-bottom: 10px; font-size: 13.5px; }
.analysis .verdict b { display: block; font-size: 14.5px; margin-bottom: 2px; }
.analysis .verdict span { color: var(--text-dim); font-size: 12.5px; }
.analysis .verdict p { margin: 6px 0 0; font-size: 12.5px; color: var(--text-mid); }
.analysis .verdict.bad { background: #fdf2f1; border-left: 3px solid var(--danger); }
.analysis .verdict.mid { background: var(--warn-soft); border-left: 3px solid var(--warn); }
.analysis .verdict.good { background: #eefaf2; border-left: 3px solid var(--accent); }
.analysis h3 { margin: 18px 0 8px; font-size: 14px; }
.abrow { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 8px; }
.ablbl { flex: 0 0 108px; font-size: 12px; padding: 3px 8px; border-radius: 6px; text-align: center; }
.ablbl.bad { background: #fdf2f1; color: var(--danger); }
.ablbl.mid { background: var(--warn-soft); color: var(--warn); }
.ablbl.good { background: #eefaf2; color: var(--accent); }
.abtags { display: flex; flex-wrap: wrap; gap: 6px; }
.abtag { font-size: 12px; border-radius: 20px; padding: 3px 10px; background: var(--bg-sink); color: var(--text-mid); }
.abtag i { font-style: normal; color: var(--text-dim); margin-left: 4px; font-size: 11px; }
.abtag.bad { background: #fdf2f1; color: var(--danger); }
.abtag.mid { background: var(--warn-soft); color: var(--warn); }
.abtag.good { background: #eefaf2; color: var(--accent); }
.abnone { font-size: 12px; color: var(--text-dim); }
.abtable { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.abtable th, .abtable td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--border); }
.abtable th { color: var(--text-dim); font-weight: 600; font-size: 11.5px; }
.abtable tr.bad td:first-child { color: var(--danger); font-weight: 600; }
.abtable tr.good td:first-child { color: var(--accent); font-weight: 600; }
.sbar { height: 7px; background: var(--bg-sink); border-radius: 4px; overflow: hidden; }
.sbar i { display: block; height: 100%; border-radius: 4px; }
.sbar i.good { background: var(--accent); }
.sbar i.mid { background: var(--warn); }
.sbar i.bad { background: var(--danger); }
.abactions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* ── 题目卡片：白色圆角矩形 + 浅灰边框，整体居中 ─────────── */
#examBody { display: flex; justify-content: center; }
#examBody #pageHost { width: 100%; display: flex; justify-content: center; }
.exam-q.single {
  width: 100%; max-width: 780px; margin: 0 auto; padding: 0 16px 8px;
  display: flex; flex-direction: column; align-items: center;
}
.exam-q.single .exam-section,
.exam-q.single .exam-material { width: 100%; max-width: 780px; }
/* 材料题里，材料板块跟着左栏走（右栏固定 780px 放题干卡片） */
.exam-q.single.has-material .exam-section { max-width: none; }
.qcard {
  width: 100%; max-width: 780px; box-sizing: border-box;
  background: #fff; border: 1px solid #e4e7ec; border-radius: 16px;
  padding: 22px 26px 18px; margin-top: 14px;
  box-shadow: 0 1px 3px rgba(20, 26, 40, .04), 0 10px 30px rgba(20, 26, 40, .05);
  position: relative; overflow: hidden;
}
/* 完整 Logo 平铺：round 按卡片尺寸均分整块图案，避免窄屏挤成三列或裁断 Logo。
   原 Logo 在 SVG 图块内等比居中；题卡变高或图片加载后自动补满行列。 */
.qcard .wmk-layer {
  position: absolute;
  inset: 16px;
  background: url('/assets/logo-zgt-watermark.svg') 0 0 / 240px 176px round;
  opacity: .06;
  pointer-events: none;
  user-select: none;
  z-index: 9;
}
/* 卡片内容浮在底层背景之上；水印层（.wmk-layer）单独抬到最上层 */
.qcard > *:not(.wmk-layer) { position: relative; z-index: 1; }
.qcard .qhead { justify-content: flex-start; margin-bottom: 12px; }
.qcard .stem { font-size: 15.5px; line-height: 1.8; color: var(--text); margin-bottom: 4px; }
.qcard .opts-vertical { margin-top: 14px; gap: 10px; }
.qcard .opts-vertical .optrow {
  border: 1px solid #e4e7ec; border-radius: 10px; background: #fcfcfd; padding: 12px 15px;
}
.qcard .opts-vertical .optrow:hover { border-color: #c9cdf5; background: #f6f7ff; }
.qcard .opts-vertical .optrow.sel { border-color: var(--brand); background: #f0f1ff; box-shadow: 0 0 0 2px rgba(91,91,214,.10); }
.qcard .cardnote { font-size: 12px; color: var(--text-dim); margin-top: 10px; }
.qcard .pagebar {
  margin-top: 20px; padding-top: 16px; border-top: 1px solid #eef0f4;
  display: flex; align-items: center; justify-content: center; gap: 12px;
}
.qcard .pagebar .pageno { font-size: 12.5px; color: var(--text-dim); min-width: 120px; text-align: center; }
/* 深色模式 */
@media (prefers-color-scheme: dark) {
  html:not([data-ds-light-theme]) .qcard { background: var(--panel); border-color: var(--border-strong); box-shadow: none; }
  html:not([data-ds-light-theme]) .qcard .opts-vertical .optrow { background: var(--bg-sink); border-color: var(--border-strong); }
  html:not([data-ds-light-theme]) .qcard .pagebar { border-top-color: var(--border); }
}

/* ── 目录四级缩进与层级观感 ─────────────────────────────── */
#catalogTree .cat2-wrap.lvl3 > .cat2-row { padding-left: 4px; }
#catalogTree .cat2-wrap.lvl3 .cat2 { font-size: 12.5px; }
#catalogTree .cat2-wrap.lvl4 > .cat2-row { padding-left: 2px; }
#catalogTree .cat2-wrap.lvl4 .cat2 { font-size: 12px; }
#catalogTree .cat2-wrap.lvl4 .cat2 .label { color: var(--text-mid); }
#catalogTree .cat2-wrap.lvl4 .cat2-row.active .cat2 { background: var(--brand-soft); color: var(--brand-deep); font-weight: 600; }
#catalogTree .cat3-list .cat2-wrap.lvl4 { border-left: 1px dashed var(--border); margin-left: 4px; padding-left: 4px; }

/* ══ 出题工作台（/teach.html）══════════════════════════════ */
.teach-shell { max-width: 1180px; }
.kindpick { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.kindcard {
  text-align: left; border: 1px solid var(--border); background: var(--bg-elev); border-radius: var(--radius-lg);
  padding: 14px 16px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; transition: .15s;
}
.kindcard:hover { border-color: var(--brand); box-shadow: var(--shadow-1); }
.kindcard.on { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px var(--brand-soft); }
.kindcard .ki { font-size: 20px; }
.kindcard b { font-size: 14.5px; }
.kindcard i { font-style: normal; font-size: 12px; color: var(--text-soft); line-height: 1.6; }
.kinddesc { margin: 12px 0 0; font-size: 12.5px; color: var(--text-dim); }

.ai-panel { border-color: color-mix(in srgb, var(--brand) 30%, var(--border)); }
.airow { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.airow textarea {
  flex: 1; min-width: 280px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--bg); font-size: 13px; line-height: 1.6; resize: vertical;
}
.aiacts { display: flex; gap: 8px; flex-wrap: wrap; }
.aiout { margin-top: 12px; }

.tagbar { margin: 8px 0 4px; }
.tagrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.tagrow select, .tagrow input {
  width: 100%; padding: 7px 9px; border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--bg); font-size: 12.5px; color: var(--text);
}
.prevout { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.prevrow { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; background: var(--bg-soft); font-size: 12.5px; display: flex; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.prevrow.ok { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.prevrow.bad { border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); background: var(--danger-soft); }
.psamples { font-size: 12px; color: var(--text-dim); line-height: 1.8; margin-top: 6px; }
.warnbar { margin: 10px 0; padding: 9px 12px; border-radius: var(--radius); background: var(--warn-soft); color: var(--warn); font-size: 12.5px; }
.hint { font-size: 12px; color: var(--text-dim); }

.mrowhead { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.modulelist { display: flex; flex-direction: column; gap: 12px; }
.mrow { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px 14px; background: var(--bg-soft); }
.mrowtop { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mrowtop .mno { font-weight: 700; font-size: 12.5px; color: var(--brand-strong); }
.mrowtop .m-title { flex: 1; min-width: 180px; padding: 7px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg); font-size: 13px; }
.minline { font-size: 12px; color: var(--text-dim); display: inline-flex; align-items: center; gap: 5px; }
.minline input { width: 66px; padding: 6px 8px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg); font-size: 12.5px; }
.mrowtop select { padding: 6px 8px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg); font-size: 12.5px; }
.mstatus { margin-top: 8px; font-size: 12px; color: var(--text-dim); }
.subpanel { margin-top: 20px; border-top: 1px dashed var(--border-strong); padding-top: 16px; }
.subpanel h3 { margin: 0 0 8px; font-size: 13.5px; }
.uploadrow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 10px 0; }
#upText { width: 100%; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg); font-size: 12.5px; line-height: 1.7; }

.pickerrow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.pickerrow input { flex: 1; min-width: 220px; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg); font-size: 13px; }
.pklist { max-height: 420px; overflow: auto; display: flex; flex-direction: column; gap: 6px; }
.pkitem { display: flex; gap: 10px; align-items: baseline; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-elev); font-size: 12.5px; cursor: pointer; }
.pkitem:hover { border-color: var(--brand); background: var(--brand-soft); }
.pkitem .pkstem { flex: 1; }

.twomode { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin-bottom: 16px; }
.modecard { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px 14px; background: var(--bg-soft); cursor: pointer; font-size: 12.5px; }
.modecard input { margin-top: 3px; }
.modecard b { display: block; font-size: 13.5px; margin-bottom: 3px; }
.modecard span { color: var(--text-soft); line-height: 1.6; }
.fullpane { margin-top: 6px; }

/* ══ 学员端计时（三种考试类型）════════════════════════════ */
.timingbar { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 20px 0; }
.tb-item { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--bg-soft); color: var(--text-soft); border: 1px solid var(--border); }
.tb-item.on { background: var(--brand-soft); color: var(--brand-strong); border-color: transparent; font-weight: 600; }
.tb-item.bad { background: var(--danger-soft); color: var(--danger); border-color: transparent; font-weight: 600; }
.modnav { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 20px 0; }
.modchip { border: 1px solid var(--border-strong); background: var(--bg-elev); border-radius: 999px; padding: 6px 12px; font-size: 12.5px; cursor: pointer; color: var(--text-soft); }
.modchip i { font-style: normal; color: var(--text-dim); margin-left: 4px; }
.modchip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.modchip.on i { color: rgba(255,255,255,.8); }
.modchip.locked { opacity: .55; text-decoration: line-through; }
.lockbar { margin: 0 0 12px; padding: 10px 14px; border-radius: var(--radius); background: var(--warn-soft); color: var(--warn); font-size: 13px; }
.timesum { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; align-items: center; }
.tslow { width: 100%; text-align: center; font-size: 12px; color: var(--text-dim); margin-top: 4px; }

/* ══ 学员登录页（/student.html）════════════════════════════ */
.login-shell { max-width: 760px; }
.login-card { max-width: 520px; margin: 0 auto; }
.login-card .field input {
  width: 100%; padding: 14px 16px; border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--bg); font-size: 22px; letter-spacing: 4px; font-variant-numeric: tabular-nums; text-align: center;
}
.login-card .field input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); outline: none; }
.login-card .field label { text-align: center; font-size: 13px; }
.login-card .joinactions { justify-content: center; }
.login-card .btn.primary { padding: 10px 22px; font-size: 14px; }

/* ══ 交卷后的扇形统计与源文件依据 ═══════════════════════════ */
.statspanel .statgrid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.statcard {
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-soft);
  padding: 14px; display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.statcard.small { padding: 12px; }
.statcard-t { font-size: 12.5px; color: var(--text-soft); font-weight: 600; text-align: center; }
.donut { display: block; }
.donut-num { font-size: 22px; font-weight: 800; fill: var(--text); font-variant-numeric: tabular-nums; }
.donut-sub { font-size: 11px; fill: var(--text-dim); }
.dlegend { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.dl-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-soft); }
.dl-item i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: 0 0 auto; }
.dl-item b { margin-left: auto; color: var(--text); font-variant-numeric: tabular-nums; }
.dl-item em { font-style: normal; color: var(--text-dim); min-width: 46px; text-align: right; font-variant-numeric: tabular-nums; }

.srcbox {
  margin-top: 10px; border: 1px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--bg-soft); padding: 10px 12px; font-size: 12.5px; line-height: 1.85;
}
.srcbox .srch { font-weight: 700; color: var(--brand-strong); margin-bottom: 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.srcbox .srctext {
  max-height: 190px; overflow: auto; white-space: pre-wrap; color: var(--text-soft);
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-sm, 6px); padding: 8px 10px;
}
.srcbox .srcans { margin-top: 6px; }
.srcbox .srcexp { margin-top: 6px; color: var(--text-soft); }
.srcbox .srcexp .k, .srcbox .srcans .k { color: var(--accent); font-weight: 700; margin-right: 6px; }
.srcbox .srcnote { margin-top: 6px; color: var(--warn); }
.qcard .exp .k { color: var(--accent); font-weight: 700; margin-right: 6px; }

/* ══ 图形题配图 ═══════════════════════════════════════════ */
.figbox {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; justify-content: center;
  margin: 4px 0 14px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius);
  background: #fff;
}
.figbox img {
  max-width: 100%; max-height: 320px; height: auto; display: block;
  border-radius: 4px; background: #fff;
}
.qcard .figbox { background: #fff; }
@media (prefers-color-scheme: dark) {
  html:not([data-ds-light-theme]) .figbox { background: #fff; }
}

/* ══ 题目视图：材料、体检提示 ══════════════════════════════ */
.qmaterial {
  margin: 6px 0 8px; padding: 8px 10px; border: 1px dashed var(--border-strong); border-radius: 8px;
  font-size: 12.5px; line-height: 1.8; color: var(--text-mid); background: var(--panel-soft, transparent);
}
.qmaterial .lbl { color: var(--text-dim); font-weight: 650; margin-right: 6px; }
.qchint {
  margin: 0 0 10px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 12.5px; color: var(--text-mid); background: var(--panel);
}
.qchint.warn { color: var(--warn); border-color: var(--warn); }
.qchint .mini { margin-left: 8px; }

/* ══ 出题工作台：「题目数量 + 分类标签」组 ═══════════════ */
.grouphint { margin: 0 0 12px; font-size: 12.5px; color: var(--text-dim); line-height: 1.8; }
.grouplist { display: flex; flex-direction: column; gap: 10px; }
.grouprow { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-soft); padding: 10px 12px; }
.grouprow .grhead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.grouprow .gno { font-weight: 700; font-size: 12.5px; color: var(--brand-strong); min-width: 46px; }
.grouprow .minline { font-size: 12.5px; color: var(--text-soft); display: inline-flex; align-items: center; gap: 6px; }
.grouprow .minline input, .mrowtop .minline input {
  width: 78px; padding: 6px 8px; border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--bg); font-size: 13px; font-variant-numeric: tabular-nums;
}
.grouprow .gtags { margin-top: 8px; }
.groupadd { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.tagrow .tagmore { white-space: nowrap; }
.tagrow.more { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--border); }

/* ══ 交卷后：单张扇形图 + 文字薄弱分析 ═══════════════════ */
.statgrid2.one { grid-template-columns: minmax(0, 440px); justify-content: center; gap: 0; }
.statgrid2.one .statcard { align-items: center; text-align: center; }
.statgrid2.one .dlegend { justify-content: center; }
.weaktext { font-size: 14px; line-height: 1.95; color: var(--text); }
.weaktext p { margin: 0 0 8px; }
.weaktext b { color: var(--brand-strong); }
.exp.ai { border-left: 3px solid var(--brand); background: var(--bg-soft); }
.exp .pv { color: var(--text-dim); font-size: 13px; margin-left: 6px; }

/* ══ 发布前复查报告 ═══════════════════════════════════════ */
.preflightbox { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px 14px; margin: 10px 0; background: var(--bg-soft); }
.preflightbox.ok { border-left: 4px solid #16a34a; }
.preflightbox.bad { border-left: 4px solid #dc2626; }
.preflightbox .pfh { font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.preflightbox.ok .pfh { color: #16a34a; }
.preflightbox.bad .pfh { color: #dc2626; }
.preflightbox .pfline { font-size: 13px; color: var(--text-soft); margin-bottom: 6px; }
.preflightbox .pfitems { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.preflightbox .pfi { font-size: 12px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg); }
.preflightbox .pfi.ok { border-color: #16a34a; color: #15803d; }
.preflightbox .pfi.bad { border-color: #dc2626; color: #b91c1c; }
.preflightbox .pfwarn { font-size: 12.5px; color: var(--text-soft); margin-top: 6px; line-height: 1.7; }

/* ══ 出题工作台：四步流程 ═══════════════════════════════ */
.kb-shared-material { margin: 12px 0; padding: 12px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); overflow-wrap: anywhere; }
.paper-preview-material { min-width: 0; margin: 18px 0; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); }
.paper-preview-material h3 { margin: 0 0 12px; font-size: 15px; overflow-wrap: anywhere; }
.paper-preview-children { min-width: 0; padding-left: 12px; border-left: 3px solid var(--brand-soft); }
.paper-preview-material .kb-preview-q { margin-bottom: 0; }
.material-table { max-width: 100%; overflow-x: auto; margin: 10px 0; }
.material-table table { width: 100%; border-collapse: collapse; font-size: 13px; }
.material-table :is(th,td) { border: 1px solid var(--border); padding: 7px 10px; text-align: left; white-space: normal; }
.material-table th { background: var(--bg-soft); font-weight: 600; }
.material-source-figure { margin: 10px 0; max-width: 100%; overflow: auto; }
.material-source-figure img { display: block; width: auto; max-width: 100%; max-height: 420px; height: auto; object-fit: contain; }
.material-source-figure figcaption { font-size: 12px; color: var(--text-mid); margin-bottom: 6px; }
.kb-material-evidence { white-space: normal; }
.step .stephead { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.step .stephead h2 { margin: 0; }
.step .stepno { width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 14px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.zonehead { margin: 18px 0 8px; }
.zonehead h3 { margin: 0; font-size: 15px; }
.big-actions { margin: 16px 0 8px; }
.btn.xl { padding: 12px 28px; font-size: 15px; font-weight: 700; border-radius: var(--radius-lg); }
details.adv { margin: 10px 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-soft); padding: 8px 12px; }
details.adv > summary { cursor: pointer; font-size: 12.5px; color: var(--text-soft); }
details.adv .advbody { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
details.adv .advbody.col { flex-direction: column; gap: 14px; }
details.adv.big { padding: 12px 16px; }
details.rowmore { display: inline-block; }
details.rowmore > summary { cursor: pointer; font-size: 12px; color: var(--text-dim); padding: 2px 6px; }
details.rowmore .rowmorebody { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; max-width: 260px; }
.subpanel h4 { margin: 0 0 6px; font-size: 13.5px; }

/* Saved source images stay in the original text flow, including small formulas. */
.kb-inline-image-link { display: var(--kb-source-image-flow, inline); max-width: 100%; --kb-chart-max-height: 760px; overflow-x: var(--kb-source-image-overflow, visible); overflow-y: var(--kb-source-image-overflow, visible); scrollbar-width: thin; }
.kb-inline-image { display: var(--kb-source-image-flow, inline-block); width: auto; max-width: var(--kb-source-image-fit, 100%); height: var(--kb-source-image-height, auto); max-height: min(760px, var(--kb-source-image-max-height, 760px)); object-fit: contain; vertical-align: middle; background: #fff; }
.exam-material .mfigs img { width: auto; max-width: 100%; max-height: 420px; object-fit: contain; }
/* All explanation surfaces share layout: separate charts stay readable, text symbols follow the font. */
:is(.exp,.question-explanation,.kb-explain-preview,.source-content,.kb-source-evidence) { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
:is(.exp,.question-explanation,.kb-explain-preview,.source-content,.kb-source-evidence) .kb-inline-image-link { display: block; width: fit-content; max-width: 100%; --kb-chart-max-height: min(360px, 55vh); }
:is(.exp,.question-explanation,.kb-explain-preview,.source-content,.kb-source-evidence) .kb-inline-image {
  display: block; width: auto; max-width: var(--kb-source-image-fit, 100%); max-height: min(360px, 55vh, var(--kb-source-image-max-height, 360px)); margin: 6px 0; object-fit: contain;
}
.kb-image-preview { margin: 12px 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; overflow-wrap: anywhere; }
.kb-image-preview summary { cursor: pointer; margin-bottom: 10px; }
.kb-image-preview p, .otext p { margin: 0; }
.otext { min-width: 0; }
@media (max-width: 760px) {
  .kb-inline-image-link { --kb-chart-max-height: 420px; }
  :is(.exp,.question-explanation,.kb-explain-preview,.source-content,.kb-source-evidence) .kb-inline-image-link { --kb-chart-max-height: min(300px, 55vh); }
  .kb-inline-image { max-height: min(420px, var(--kb-source-image-max-height, 420px)); }
  :is(.exp,.question-explanation,.kb-explain-preview,.source-content,.kb-source-evidence) .kb-inline-image { max-height: min(300px, 55vh, var(--kb-source-image-max-height, 300px)); }
  .kb-image-preview { padding: 8px; }
}
/* Known source extents keep each formula's font scale; only unknown inline
   symbols use the fallback. Long formulas scroll within their own link. */
:root { --kb-inline-image-max-height: 1.5em; }
.kb-inline-image-link.kb-image-in-text { display: var(--kb-source-image-flow, inline-block); width: auto; max-width: 100%; vertical-align: middle; }
.kb-inline-image.kb-image-in-text {
  display: var(--kb-source-image-flow, inline-block); width: auto; height: var(--kb-source-image-height, auto); max-width: var(--kb-source-image-fit, 100%);
  max-height: var(--kb-source-image-inline-limit, var(--kb-inline-image-max-height)); margin: var(--kb-source-image-inline-margin, 0 .08em); vertical-align: middle;
}
