/* ============ 题库页 qb.html 专属样式 ============ */

/* 学科 tabs 计数 */
.nav #qbStat { align-self: center; }

/* 左侧筛选面板 */
.qb-filters .f-row { margin-bottom: 4px; }
.qb-tip-panel p { margin: 0; }

/* 题目卡片 */
.qb-list { display: flex; flex-direction: column; gap: 14px; }
.q-card { background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; transition: all .15s; }
.q-card:hover { border-color: rgba(47,125,255,.5); box-shadow: 0 0 20px rgba(47,125,255,.12); }
.q-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.q-type { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #04101f; font-size: 12px; font-weight: bold; border-radius: 4px; padding: 2px 9px; }
.q-diff { font-size: 12px; border-radius: 4px; padding: 2px 8px; border: 1px solid var(--line); color: var(--muted); }
.q-diff.d1 { color: #5ee68a; border-color: rgba(94,230,138,.4); }
.q-diff.d2 { color: #ffd75e; border-color: rgba(255,215,94,.4); }
.q-diff.d3 { color: #ffab5e; border-color: rgba(255,171,94,.4); }
.q-diff.d4 { color: #ff6e6e; border-color: rgba(255,110,110,.4); }
.q-imgflag { font-size: 12px; color: var(--primary-2); }
.q-noans { font-size: 12px; color: #c0392b; background: #fdeceb; border-radius: 4px; padding: 1px 6px; }

/* 题干表格（P0：原卷数据表/实验表还原） */
.qb-tbl { border-collapse: collapse; margin: 8px 0; font-size: 14px; }
.qb-tbl td { border: 1px solid #8aa0b8; padding: 3px 10px; min-width: 24px; text-align: center; }
.qb-tbl tr td:first-child { font-weight: normal; }
.q-src { margin-left: auto; font-size: 12px; color: var(--muted); max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 题干（白纸底，公式图正常排版） */
.q-stem { background: #fff; color: #1c2b3a; border-radius: 8px; padding: 14px 18px; font-size: 14.5px; line-height: 2; font-family: "Microsoft YaHei", "PingFang SC", serif; max-height: 340px; overflow-y: auto; }
.q-stem img.fml { vertical-align: -0.12em; max-height: 1.55em; max-width: 100%; }
/* 公式占位（图片未加载时） */
.q-stem i[k], .q-ansbox i[k] { display: inline-block; min-width: 1.4em; height: 1em; border-bottom: 1px dashed #97a6bd; vertical-align: -0.12em; background: repeating-linear-gradient(45deg, #eef2f7 0 4px, #f7fafc 4px 8px); border-radius: 2px; }

/* 答案/详解 */
.q-ansbox { margin-top: 10px; background: rgba(47,125,255,.06); border: 1px dashed rgba(47,125,255,.35); border-radius: 8px; padding: 12px 16px; font-size: 13.5px; line-height: 1.9; color: #cfe0ff; max-height: 300px; overflow-y: auto; }
.q-ansbox img.fml { vertical-align: -0.12em; max-height: 1.5em; }
.q-ansbox b { color: #8fc3ff; }
.q-ana { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); color: #b9cbec; }

/* 卡片底部 */
.q-foot { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.q-btn { background: rgba(47,125,255,.12); border: 1px solid var(--line); color: #bcd8ff; border-radius: 6px; padding: 6px 14px; font-size: 13px; cursor: pointer; transition: all .15s; }
.q-btn:hover { border-color: var(--primary); color: #fff; }
.q-btn.bk-add.on { background: rgba(255,206,77,.15); border-color: rgba(255,206,77,.5); color: #ffce4d; }
.q-id { margin-left: auto; font-size: 11px; color: var(--muted); opacity: .6; }

/* 加载态 */
.qb-loading { text-align: center; padding: 70px 0; color: var(--muted); font-size: 15px; }

/* ============ 组卷篮 ============ */
.bk-count { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #04101f; border-radius: 10px; font-size: 12px; padding: 1px 9px; margin-left: 6px; }
.bk-types { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; min-height: 4px; }
.bk-tag { font-size: 12px; background: rgba(47,125,255,.14); border: 1px solid var(--line); border-radius: 4px; padding: 2px 8px; color: #bcd8ff; }
.bk-list { max-height: 300px; overflow-y: auto; margin-bottom: 10px; }
.bk-item { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-bottom: 1px dashed var(--line); font-size: 13px; color: #c9d9f2; }
.bk-item .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: default; }
.bk-del { color: var(--muted); cursor: pointer; font-size: 16px; padding: 0 6px; }
.bk-del:hover { color: #ff6e6e; }
.bk-actions { display: flex; flex-direction: column; gap: 8px; }
.bk-ver { font-size: 13px; color: #c9d9f2; display: flex; align-items: center; gap: 6px; cursor: pointer; }
.bk-ver input { accent-color: var(--primary); }
.bk-title-row { flex-direction: column; align-items: stretch; gap: 4px; }
.bk-title-row input { background: rgba(255,255,255,.06); border: 1px solid var(--line); color: #eaf3ff; border-radius: 6px; padding: 7px 10px; font-size: 13px; }
.bk-actions .btn-ghost.full { width: 100%; }
.btn-ghost { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 6px; padding: 8px 0; cursor: pointer; font-size: 13px; }
.btn-ghost:hover { border-color: var(--primary); color: #eaf3ff; }

/* 题库页布局微调（左右侧栏更窄） */
.layout { grid-template-columns: 250px 1fr 250px; }
@media (max-width: 1100px) { .layout { grid-template-columns: 1fr; } .bk-list { max-height: 160px; } }

/* ============ KaTeX 公式（题库卡片内） ============ */
.fmltex { display: inline-block; vertical-align: middle; margin: 0 2px; }
.q-stem .katex, .q-ans .katex, .q-ana .katex { font-size: 1.08em; }
.q-stem .katex-display, .q-ana .katex-display { margin: 6px 0; }
/* 深色背景下 KaTeX 继承文字颜色即可，确保 not italic 修正 */
.katex .mord.text { font-family: "Times New Roman", serif; }
