/* PC错题本模板统一主题：黑色文字、浅蓝灰背景，题库DSL内容样式由enterprise-question-render-print.css负责。 */
.wrong-book-answer-template { width: 100%; color: #000; font-size: 14px; line-height: 1.6; }
.wrong-book-answer-template * { color: #000 !important; }
.wrong-book-answer-header { margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid #cbd4da; }
.wrong-book-answer-header h1 { margin: 0 0 8px; text-align: center; font-size: 22px; }
.wrong-book-answer-header p { margin: 4px 0; font-size: 12px; }
.wrong-book-answer-only-flow { column-count: 2; column-gap: 24px; column-rule: 1px solid #e2e7eb; column-fill: auto; }
.wrong-book-answer-only-group { margin-bottom: 16px; break-inside: auto; }
.wrong-book-answer-only-group h2 { margin: 0 0 8px; padding: 6px 8px; background: #e9eef1; font-size: 14px; break-after: avoid; }
.wrong-book-answer-only-item { margin-bottom: 10px; break-inside: auto; page-break-inside: auto; overflow-wrap: break-word; }
.wrong-book-answer-only-item h3 { margin: 6px 0; font-size: 13px; break-after: avoid; }
.wrong-book-answer-only-item p { orphans: 2; widows: 2; }
.wrong-book-answer-template img, .wrong-book-answer-template svg { max-width: 100%; height: auto; }
.wrong-book-answer-template table { max-width: 100%; }
@media screen {
  .wrong-book-answer-only-flow { column-fill: balance; }
}
@media screen and (max-width: 760px) {
  .wrong-book-answer-only-flow { column-count: 1; }
}

.wrong-book-single-template,
.wrong-book-stage-template,
.wrong-book-teacher-template {
  --wrong-book-primary: #365b76;
  --wrong-book-primary-dark: #29475d;
  --wrong-book-text: #000;
  --wrong-book-muted: #000;
  --wrong-book-border: #cbd4da;
  --wrong-book-heading-blue-text: #000;
  --wrong-book-heading-blue-bg: #e9eef1;
  --wrong-book-heading-blue-border: #60798b;
  --wrong-book-heading-warm-text: #000;
  --wrong-book-heading-warm-bg: #f1eee7;
  --wrong-book-heading-warm-border: #8a7758;
  color: #000 !important;
}

/* 阶段本与教师讲义沿用同一套印刷颜色和题目字号，避免三个模板各唱各的调。 */
.wrong-book-stage-template .qk-stem,
.wrong-book-stage-template .qk-answer,
.wrong-book-stage-template .qk-explanation,
.wrong-book-teacher-template .qk-stem,
.wrong-book-teacher-template .qk-answer,
.wrong-book-teacher-template .qk-explanation {
  color: #000 !important;
  font-size: 14px;
  line-height: 1.65;
}

.wrong-book-stage-template .wrong-book-tone-card,
.wrong-book-teacher-template .wrong-book-tone-card {
  color: #000 !important;
  background: var(--wrong-book-heading-blue-bg) !important;
  border: 1px solid var(--wrong-book-border) !important;
  border-left: 4px solid var(--wrong-book-heading-blue-border) !important;
  box-shadow: none !important;
}

.wrong-book-stage-template .wrong-book-tone-card--answer,
.wrong-book-teacher-template .wrong-book-tone-card--answer {
  color: #000 !important;
  background: var(--wrong-book-heading-warm-bg) !important;
  border-left-color: var(--wrong-book-heading-warm-border) !important;
}

.wrong-book-stage-template .wrong-book-tone-card--closing,
.wrong-book-teacher-template .wrong-book-tone-card--closing {
  color: #000 !important;
  background: #f7f9fa !important;
  border-left-width: 1px !important;
  border-top: 4px solid var(--wrong-book-heading-blue-border) !important;
}

.wrong-book-stage-template :is([style^="color: #409eff"], [style*=" color: #409eff"], [style^="color: #1890ff"], [style*=" color: #1890ff"],
  [style^="color: #4facfe"], [style*=" color: #4facfe"], [style^="color: #00f2fe"], [style*=" color: #00f2fe"]),
.wrong-book-teacher-template :is([style^="color: #409eff"], [style*=" color: #409eff"], [style^="color: #2f5ea8"], [style*=" color: #2f5ea8"]) {
  color: #000 !important;
}

.wrong-book-stage-template :is([style^="color: #67c23a"], [style*=" color: #67c23a"], [style^="color: #52c41a"], [style*=" color: #52c41a"]),
.wrong-book-teacher-template :is([style^="color: #67c23a"], [style*=" color: #67c23a"]) {
  color: #000 !important;
}

.wrong-book-stage-template :is([style^="color: #e6a23c"], [style*=" color: #e6a23c"], [style^="color: #fa8c16"], [style*=" color: #fa8c16"],
  [style^="color: #d48806"], [style*=" color: #d48806"]),
.wrong-book-teacher-template :is([style^="color: #e6a23c"], [style*=" color: #e6a23c"], [style^="color: #ff9800"], [style*=" color: #ff9800"]) {
  color: #000 !important;
}

.wrong-book-stage-template :is([style^="color: #f56c6c"], [style*=" color: #f56c6c"], [style^="color: #f5576c"], [style*=" color: #f5576c"]),
.wrong-book-teacher-template :is([style^="color: #f56c6c"], [style*=" color: #f56c6c"]) {
  color: #000 !important;
}

.wrong-book-stage-template :is([style^="color: #666"], [style*=" color: #666"], [style^="color:#666"], [style*=" color:#666"]),
.wrong-book-teacher-template :is([style^="color: #666"], [style*=" color: #666"], [style^="color:#666"], [style*=" color:#666"]) {
  color: #000 !important;
}

.wrong-book-stage-template :is([style^="color: #999"], [style*=" color: #999"], [style^="color:#999"], [style*=" color:#999"],
  [style^="color: #909399"], [style*=" color: #909399"], [style^="color:#909399"], [style*=" color:#909399"],
  [style^="color: #bbb"], [style*=" color: #bbb"]),
.wrong-book-teacher-template :is([style^="color: #999"], [style*=" color: #999"], [style^="color:#999"], [style*=" color:#999"],
  [style^="color: #909399"], [style*=" color: #909399"], [style^="color:#909399"], [style*=" color:#909399"]) {
  color: #000 !important;
}

/* 大块内容内部卡片改为白底，保持黑白打印层级。 */
.wrong-book-stage-template .wrong-book-tone-card [style*="background: rgba(255"],
.wrong-book-teacher-template .wrong-book-tone-card [style*="background: rgba(255"] {
  color: #000 !important;
  background: #fff !important;
  border-left-color: #60798b !important;
}

.wrong-book-stage-template .wrong-book-tone-card [style*="opacity:"],
.wrong-book-teacher-template .wrong-book-tone-card [style*="opacity:"] {
  opacity: 1 !important;
}

/* 文档字号统一为12/14/16/18/24/36px六档。 */
:is(.wrong-book-single-template, .wrong-book-stage-template, .wrong-book-teacher-template)
  :is([style*="font-size: 10px"], [style*="font-size: 11px"]) {
  font-size: 12px !important;
  line-height: 1.45 !important;
}

:is(.wrong-book-single-template, .wrong-book-stage-template, .wrong-book-teacher-template)
  :is([style*="font-size: 13px"], [style*="font-size: 15px"]) {
  font-size: 14px !important;
}

:is(.wrong-book-single-template, .wrong-book-stage-template, .wrong-book-teacher-template)
  :is([style*="font-size: 17px"], [style*="font-size: 20px"]) {
  font-size: 18px !important;
}

:is(.wrong-book-single-template, .wrong-book-stage-template, .wrong-book-teacher-template)
  :is([style*="font-size: 22px"], [style*="font-size: 28px"]) {
  font-size: 24px !important;
}

.wrong-book-stage-template [style*="background: #e6f7ff"],
.wrong-book-stage-template [style*="background: #f5f9ff"],
.wrong-book-stage-template [style*="background: #f6ffed"],
.wrong-book-teacher-template [style*="background: #e3f2fd"],
.wrong-book-teacher-template [style*="background: #eef4ff"],
.wrong-book-teacher-template [style*="background: #f0f9ff"] {
  background: #edf2f5 !important;
}

.wrong-book-stage-template [style*="background: #fff7e6"],
.wrong-book-stage-template [style*="background: #fff8f0"],
.wrong-book-stage-template [style*="background: #fffbe6"],
.wrong-book-teacher-template [style*="background: #fff3e0"],
.wrong-book-teacher-template [style*="background: #fdf6ec"],
.wrong-book-teacher-template [style*="background: #faecd8"] {
  background: #f3f0e9 !important;
}

.wrong-book-stage-template table,
.wrong-book-teacher-template table {
  max-width: 100%;
  table-layout: fixed;
}

.wrong-book-stage-template img,
.wrong-book-teacher-template img {
  max-width: 100% !important;
  height: auto !important;
}

/* 错题本预览与独立PDF统一使用印刷字号，不覆盖题库、组卷等其他qk渲染页面。 */
.wrong-book-single-template .qk-stem,
.wrong-book-single-template .qk-answer,
.wrong-book-single-template .qk-explanation {
  color: #000 !important;
  font-size: 14px;
  line-height: 1.65;
}

.wrong-book-single-template .qk-stem p,
.wrong-book-single-template .qk-answer p,
.wrong-book-single-template .qk-explanation p {
  margin-bottom: 6px;
}

.wrong-book-single-template .qk-sub-question,
.wrong-book-single-template .qk-sub-answer,
.wrong-book-single-template .qk-sub-explanation {
  break-inside: auto;
  page-break-inside: auto;
}

.wrong-book-single-template .qk-sub-question__number,
.wrong-book-single-template .qk-sub-answer__number,
.wrong-book-single-template .qk-sub-explanation__number {
  font-size: 14px;
  line-height: 1.65;
}

.wrong-book-single-template .wrong-book-cover-kicker {
  color: #000 !important;
  background: #eef2f4 !important;
}

.wrong-book-single-template .wrong-book-cover-icon {
  color: #000 !important;
  border-color: var(--wrong-book-border) !important;
  background: #f7f9fa !important;
  filter: saturate(0.55);
}

.wrong-book-single-template .wrong-book-section-title {
  color: #000 !important;
  background: #f1f4f6 !important;
}

.wrong-book-single-template .wrong-book-score-banner {
  color: #000 !important;
  background: #eef2f4 !important;
  border: 1px solid var(--wrong-book-border) !important;
  border-left: 4px solid var(--wrong-book-heading-blue-border) !important;
}

.wrong-book-single-template .wrong-book-metric-value {
  color: #000 !important;
}

.wrong-book-single-template .wrong-book-rank-value {
  color: #000 !important;
}

.wrong-book-single-template :is([style^="color: #409eff"], [style*=" color: #409eff"], [style^="color: rgb(64, 158, 255)"], [style*=" color: rgb(64, 158, 255)"]) {
  color: #000 !important;
}

.wrong-book-single-template :is([style^="color: #67c23a"], [style*=" color: #67c23a"], [style^="color: rgb(103, 194, 58)"], [style*=" color: rgb(103, 194, 58)"]) {
  color: #000 !important;
}

.wrong-book-single-template :is([style^="color: #e6a23c"], [style*=" color: #e6a23c"], [style^="color: rgb(230, 162, 60)"], [style*=" color: rgb(230, 162, 60)"]) {
  color: #000 !important;
}

.wrong-book-single-template :is([style^="color: #f56c6c"], [style*=" color: #f56c6c"], [style^="color: rgb(245, 108, 108)"], [style*=" color: rgb(245, 108, 108)"]) {
  color: #000 !important;
}

/* 印刷辅助文字不使用浅灰，避免黑白打印或复印后发虚。 */
.wrong-book-single-template :is([style^="color: #666"], [style*=" color: #666"], [style^="color:#666"], [style*=" color:#666"],
  [style^="color: rgb(102, 102, 102)"], [style*=" color: rgb(102, 102, 102)"]) {
  color: #000 !important;
}

.wrong-book-single-template :is([style^="color: #999"], [style*=" color: #999"], [style^="color:#999"], [style*=" color:#999"],
  [style^="color: #909399"], [style*=" color: #909399"], [style^="color:#909399"], [style*=" color:#909399"],
  [style^="color: rgb(153, 153, 153)"], [style*=" color: rgb(153, 153, 153)"],
  [style^="color: rgb(144, 147, 153)"], [style*=" color: rgb(144, 147, 153)"]) {
  color: #000 !important;
}

.wrong-book-single-template .wrong-book-question-badge,
.wrong-book-stage-template .wrong-book-question-badge,
.wrong-book-teacher-template .wrong-book-question-badge {
  color: #000 !important;
  background: #e9eef1 !important;
  border: 1px solid #cbd4da !important;
}

.wrong-book-single-template .wrong-book-source-badge {
  color: #000 !important;
  background: #edf3f6 !important;
  border-color: #cfdae2 !important;
}

.wrong-book-single-template .wrong-book-content-heading,
.wrong-book-stage-template .wrong-book-content-heading,
.wrong-book-teacher-template .wrong-book-content-heading {
  display: flex !important;
  align-items: center !important;
  min-height: 30px;
  margin-bottom: 8px !important;
  padding: 5px 10px !important;
  box-sizing: border-box;
  color: #000 !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 1.45 !important;
  letter-spacing: 0.1px;
  border-left-width: 3px !important;
  border-left-style: solid !important;
  border-radius: 4px !important;
  break-after: avoid;
  page-break-after: avoid;
}

.wrong-book-single-template .wrong-book-content-heading--original,
.wrong-book-stage-template .wrong-book-content-heading--original,
.wrong-book-teacher-template .wrong-book-content-heading--original {
  color: #000 !important;
  background: var(--wrong-book-heading-blue-bg) !important;
  border-left-color: var(--wrong-book-heading-blue-border) !important;
}

.wrong-book-single-template .wrong-book-content-heading--answer,
.wrong-book-stage-template .wrong-book-content-heading--answer,
.wrong-book-teacher-template .wrong-book-content-heading--answer {
  color: #000 !important;
  background: var(--wrong-book-heading-warm-bg) !important;
  border-left-color: var(--wrong-book-heading-warm-border) !important;
}

.wrong-book-single-template .wrong-book-content-heading--analysis,
.wrong-book-stage-template .wrong-book-content-heading--analysis,
.wrong-book-teacher-template .wrong-book-content-heading--analysis {
  color: #000 !important;
  background: var(--wrong-book-heading-blue-bg) !important;
  border-left-color: var(--wrong-book-heading-blue-border) !important;
}

.wrong-book-single-template .wrong-book-content-heading--similar,
.wrong-book-stage-template .wrong-book-content-heading--similar,
.wrong-book-teacher-template .wrong-book-content-heading--similar {
  color: #000 !important;
  background: var(--wrong-book-heading-blue-bg) !important;
  border-left-color: var(--wrong-book-heading-blue-border) !important;
}

.wrong-book-single-template .wrong-book-growth-card {
  color: #000 !important;
  background: #f7f9fa !important;
  border: 1px solid #cbd4da !important;
  border-top: 4px solid #60798b !important;
}

.wrong-book-single-template .wrong-book-growth-point {
  color: #000 !important;
  background: #fff !important;
  border-left-color: #60798b !important;
}

.wrong-book-single-template .wrong-book-score-banner [style*="opacity:"],
.wrong-book-single-template .wrong-book-growth-card [style*="opacity:"] {
  opacity: 1 !important;
}

.wrong-book-single-template .wrong-book-print-tag,
.wrong-book-stage-template .wrong-book-print-tag,
.wrong-book-teacher-template .wrong-book-print-tag {
  color: #000 !important;
  background: #f2f4f5 !important;
  border: 1px solid #cbd4da !important;
}

/* 个人错题本正文采用教材式连续双栏：每页先读完左栏，再进入右栏。 */
.wrong-book-single-template .wrong-book-two-column-flow {
  column-count: 2;
  column-fill: auto;
  column-gap: 9mm;
  column-rule: 1px solid #cbd3d9;
}

.wrong-book-single-template .wrong-book-column-card {
  width: 100%;
  min-width: 0;
  container-name: wrong-book-card;
  container-type: inline-size;
}

.wrong-book-single-template .wrong-book-question-card,
.wrong-book-single-template .wrong-book-answer-question-group {
  break-inside: auto;
  page-break-inside: auto;
}

.wrong-book-single-template .wrong-book-question-meta,
.wrong-book-single-template .wrong-book-summary-block,
.wrong-book-single-template .wrong-book-writing-space {
  break-inside: avoid;
  page-break-inside: avoid;
}

.wrong-book-single-template .wrong-book-content-block,
.wrong-book-single-template .wrong-book-similar-card,
.wrong-book-single-template .wrong-book-answer-card {
  break-inside: auto;
  page-break-inside: auto;
}

.wrong-book-single-template .wrong-book-question-meta {
  break-after: avoid;
  page-break-after: avoid;
}

/* 答题区域跟随题干末尾，避免新页只剩一个空白书写框。长题干仍可正常跨栏。 */
.wrong-book-single-template .wrong-book-practice-response,
.wrong-book-stage-template .wrong-book-reflection-space {
  break-before: avoid;
  page-break-before: avoid;
}

.wrong-book-single-template .wrong-book-similar-stem > :last-child {
  break-after: avoid;
  page-break-after: avoid;
}

.wrong-book-single-template .wrong-book-analysis-title {
  break-after: avoid;
  page-break-after: avoid;
}

.wrong-book-single-template .wrong-book-answer-section-title {
  break-before: page;
  page-break-before: always;
}

.wrong-book-single-template .wrong-book-writing-space {
  box-sizing: border-box;
}

.wrong-book-single-template .wrong-book-practice-flow .wrong-book-writing-space--practice {
  min-height: 105px !important;
}

/* 题目正文严格保持双栏，图片和表格只在当前栏内自适应。 */
.wrong-book-single-template .wrong-book-question-card,
.wrong-book-single-template .wrong-book-answer-card {
  column-span: none !important;
}

@media screen and (max-width: 760px) {
  .wrong-book-single-template .wrong-book-two-column-flow {
    column-count: 1;
    column-rule: 0;
  }
}

/* 教师讲义概览允许自然跨页，讲解表单独起页；表头重复且单行不拆分。 */
.wrong-book-teacher-template .wrong-book-teacher-overview-section {
  break-inside: auto !important;
  page-break-inside: auto !important;
}

/* 难度汇总表允许自然续页，避免大讲义概览被整块推后。 */
.wrong-book-teacher-template .wrong-book-teacher-difficulty-block {
  break-inside: auto !important;
  page-break-inside: auto !important;
}

.wrong-book-teacher-template .wrong-book-teacher-explanation-section {
  break-before: auto;
  page-break-before: auto;
}

/* 错题巩固是教师讲义的独立正文章节，固定从新页开始。 */
.wrong-book-teacher-template .wrong-book-teacher-practice-section {
  break-before: page;
  page-break-before: always;
}

/* 双面打印时，结束页固定落在左页（偶数页/纸张背面）；Chromium 会按需补留白页。 */
@media print {
  :is(.wrong-book-single-template, .wrong-book-stage-template, .wrong-book-teacher-template) .wrong-book-ending-page {
    break-before: left !important;
    page-break-before: left !important;
  }
}

.wrong-book-teacher-template .wrong-book-teacher-table-wrap {
  overflow: visible !important;
  break-inside: auto;
  page-break-inside: auto;
}

.wrong-book-stage-template table thead,
.wrong-book-teacher-template table thead {
  display: table-header-group;
}

.wrong-book-stage-template table tr,
.wrong-book-teacher-template table tr {
  break-inside: avoid;
  page-break-inside: avoid;
}

.wrong-book-stage-template section > div:first-child,
.wrong-book-teacher-template .wrong-book-teacher-overview-section > div:first-child,
.wrong-book-teacher-template .wrong-book-teacher-explanation-section > div:first-child,
.wrong-book-teacher-template .wrong-book-teacher-practice-section > div:first-child {
  break-after: avoid;
  page-break-after: avoid;
}

/* 阶段本与教师讲义的题目正文同样采用连续双栏，统计表和章节标题仍保持通栏。 */
.wrong-book-stage-template .wrong-book-stage-question-flow,
.wrong-book-stage-template .wrong-book-stage-answer-flow,
.wrong-book-teacher-template .wrong-book-teacher-question-flow {
  column-count: 2;
  column-fill: auto;
  column-gap: 9mm;
  column-rule: 1px solid #cbd3d9;
}

.wrong-book-stage-template .wrong-book-column-card,
.wrong-book-teacher-template .wrong-book-column-card {
  width: 100%;
  min-width: 0;
  container-name: wrong-book-card;
  container-type: inline-size;
}

/* 三类模板的长题卡都允许跨栏跨页，避免尺寸隔离把整题推到下一页。 */
.wrong-book-single-template .wrong-book-column-card,
.wrong-book-stage-template .wrong-book-column-card,
.wrong-book-teacher-template .wrong-book-column-card {
  container-name: none !important;
  container-type: normal !important;
}

/* 第九章成品导读与正文：统计自然跨页，短标题与紧邻内容同行。 */
:is(.wrong-book-single-template, .wrong-book-stage-template, .wrong-book-teacher-template) .wrong-book-reading-note {
  color: #000 !important;
  font-size: 12px;
  line-height: 1.6;
  margin: 6px 0;
  overflow-wrap: anywhere;
}

:is(.wrong-book-single-template, .wrong-book-stage-template, .wrong-book-teacher-template) .wrong-book-reading-guide {
  margin: 12px 0;
  padding: 10px 12px;
  border-left: 3px solid #60798b;
  background: #f3f5f6;
  color: #000 !important;
  font-size: 14px;
  line-height: 1.65;
  break-inside: auto;
}

:is(.wrong-book-single-template, .wrong-book-stage-template, .wrong-book-teacher-template) .wrong-book-reading-guide p {
  margin: 4px 0;
}

.wrong-book-single-template .wrong-book-overview-section {
  max-height: none;
  overflow: visible;
  break-inside: auto;
  page-break-inside: auto;
}

:is(.wrong-book-single-template, .wrong-book-stage-template) .wrong-book-practice-section,
.wrong-book-stage-template .wrong-book-answer-section {
  break-before: page;
  page-break-before: always;
}

:is(.wrong-book-single-template, .wrong-book-stage-template, .wrong-book-teacher-template)
  :is(.wrong-book-practice-group-title, .wrong-book-section-title, .wrong-book-answer-label) {
  color: #000 !important;
  font-weight: 600;
  break-inside: avoid;
  break-after: avoid;
  page-break-after: avoid;
}

:is(.wrong-book-single-template, .wrong-book-stage-template, .wrong-book-teacher-template) .wrong-book-section-title {
  font-size: 22px !important;
  padding: 12px;
}

.wrong-book-single-template .wrong-book-practice-group-title {
  font-size: 17px;
  margin: 12px 0 8px;
  border-bottom: 1px solid #60798b;
  padding-bottom: 6px;
}

.wrong-book-stage-template :is(.wrong-book-stage-question-card, .wrong-book-stage-answer-card) {
  margin-bottom: 12px;
  padding: 8px 10px;
  border: 1px solid #cbd4da;
  box-sizing: border-box;
}

.wrong-book-stage-template .wrong-book-stage-similar-card {
  margin-top: 10px;
}

.wrong-book-stage-template .wrong-book-reflection-space {
  min-height: 70px;
  margin: 10px 0;
  padding: 6px;
  border: 1px dashed #a9b3bb;
  color: #000 !important;
  font-size: 12px;
  break-inside: avoid;
}

:is(.wrong-book-single-template, .wrong-book-stage-template, .wrong-book-teacher-template) .wrong-book-question-meta {
  line-height: 1.6;
  break-after: avoid;
  overflow-wrap: anywhere;
}

:is(.wrong-book-single-template, .wrong-book-stage-template, .wrong-book-teacher-template)
  :is(.wrong-book-print-tag, .wrong-book-source-badge, .wrong-book-question-badge) {
  display: inline;
  padding: 2px 4px;
  font-size: 12px;
  line-height: 1.8;
  white-space: normal;
  overflow-wrap: anywhere;
}

:is(.wrong-book-single-template, .wrong-book-stage-template, .wrong-book-teacher-template) .wrong-book-overview-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
}

:is(.wrong-book-single-template, .wrong-book-stage-template, .wrong-book-teacher-template) .wrong-book-overview-table :is(th, td) {
  padding: 7px 6px;
  border: 1px solid #cbd4da;
  text-align: center;
}

:is(.wrong-book-single-template, .wrong-book-stage-template, .wrong-book-teacher-template) table :is(th, td) {
  overflow-wrap: anywhere;
  white-space: normal;
}

.wrong-book-single-template table thead { display: table-header-group; }
.wrong-book-single-template table tr { break-inside: avoid; }

:is(.wrong-book-single-template, .wrong-book-stage-template, .wrong-book-teacher-template)
  :is(.qk-stem, .qk-answer, .qk-explanation) {
  font-size: 14px;
  line-height: 1.65;
  color: #000 !important;
}

/* 无尺寸隔离的题卡也能按栏宽排列选项，长选项在格内自然换行。 */
:is(.wrong-book-single-template, .wrong-book-stage-template, .wrong-book-teacher-template)
  .wrong-book-column-card .qk-option-group:is([data-columns="2"], [data-columns="4"]) {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)) !important;
}

.wrong-book-stage-template .wrong-book-stage-question-flow {
  overflow: visible !important;
  break-inside: auto !important;
  page-break-inside: auto !important;
}

.wrong-book-stage-template .wrong-book-stage-kpoint-heading,
.wrong-book-stage-template .wrong-book-stage-exam-heading {
  break-inside: avoid !important;
  page-break-inside: avoid !important;
  break-after: avoid !important;
  page-break-after: avoid !important;
}

.wrong-book-stage-template .wrong-book-stage-question-card,
.wrong-book-stage-template .wrong-book-stage-answer-card,
.wrong-book-teacher-template .wrong-book-teacher-question-card,
.wrong-book-stage-template .wrong-book-stage-similar-card,
.wrong-book-teacher-template .wrong-book-teacher-similar-card {
  column-span: none !important;
  break-inside: auto !important;
  page-break-inside: auto !important;
}

.wrong-book-stage-template .wrong-book-stage-question-card > div:first-child,
.wrong-book-stage-template .wrong-book-stage-answer-card > div:first-child,
.wrong-book-stage-template .wrong-book-stage-similar-card > div:first-child,
.wrong-book-teacher-template .wrong-book-teacher-question-card h4,
.wrong-book-teacher-template .wrong-book-teacher-similar-card h4 {
  break-after: avoid;
  page-break-after: avoid;
}

/* 滚动预览没有纸张高度，均衡分配左右栏；PDF继续使用上方的顺序填栏规则。 */
@media screen {
  .wrong-book-single-template .wrong-book-two-column-flow,
  .wrong-book-stage-template .wrong-book-stage-question-flow,
  .wrong-book-stage-template .wrong-book-stage-answer-flow,
  .wrong-book-teacher-template .wrong-book-teacher-question-flow {
    column-fill: balance;
  }
}

@media screen and (max-width: 760px) {
  .wrong-book-stage-template .wrong-book-stage-question-flow,
  .wrong-book-stage-template .wrong-book-stage-answer-flow,
  .wrong-book-teacher-template .wrong-book-teacher-question-flow {
    column-count: 1;
    column-rule: 0;
  }
}

/* 四类成品统一黑色文字，覆盖模板/题目内联颜色；预览翻页控件保留其禁用样式。 */
:is(.wrong-book-single-template, .wrong-book-stage-template, .wrong-book-teacher-template),
:is(.wrong-book-single-template, .wrong-book-stage-template, .wrong-book-teacher-template)
  :where(*:not(.wrong-book-preview-pagination, .wrong-book-preview-pagination *)) {
  color: #000 !important;
  -webkit-text-fill-color: #000 !important;
}

.wrong-book-stage-template .wrong-book-preview-pagination,
.wrong-book-stage-template .wrong-book-preview-pagination * {
  -webkit-text-fill-color: currentColor !important;
}

/* 灰度之外，文字容器的透明度也会导致打印发淡。图片自身的透明度不作修改。 */
:is(.wrong-book-single-template, .wrong-book-stage-template, .wrong-book-teacher-template)
  :where(div, section, p, span, small, li, td, th)[style*="opacity"]:not(:where(.wrong-book-preview-pagination, .wrong-book-preview-pagination *)) {
  opacity: 1 !important;
}
