:root { --question-gap: 6px; } body { font-family: "Noto Serif", "Noto Serif CJK SC", "Noto Sans CJK SC", "Noto Sans", "STSongti-SC", "PingFang SC", "Songti SC", serif; line-height: 1.65; color: #000; background: #fff; font-size: 14px; } .page { max-width: 720px; margin: 0 auto; padding: 0 12px; } .header { text-align: center; margin-bottom: 1.5rem; border-bottom: 2px solid #000; padding-bottom: 1rem; } /* 大题标题:不与后面内容分开 */ .section-title { font-size: 16px; font-weight: bold; margin-top: 16px; margin-bottom: 10px; page-break-after: avoid; break-after: avoid; } /* 题目整体:不分页 */ .question { margin-bottom: 14px; page-break-inside: avoid; break-inside: avoid; -webkit-column-break-inside: avoid; } /* 题目网格:不分页 */ .question-grid { display: grid; grid-template-columns: auto 1fr; column-gap: 4px; row-gap: 6px; align-items: flex-start; page-break-inside: avoid; break-inside: avoid; } .question-lead { display: flex; gap: 4px; align-items: flex-start; font-weight: 600; font-size: 14px; line-height: 1.65; margin-top: 1px; } .question-lead.spacer { visibility: hidden; } .question-number { white-space: nowrap; margin-right: 2px; } .grading-boxes { gap: 4px; flex-wrap: wrap; align-items: center; } .grading-boxes span { vertical-align: middle; } /* 题目内容:防止孤行 */ .question-main { font-size: 14px; line-height: 1.65; font-family: inherit; display: block; orphans: 3; widows: 3; } .question-score { margin-right: 6px; font-weight: 600; } .question-stem { display: inline-block; font-size: 14px; font-family: inherit; orphans: 3; widows: 3; } /* 选项容器:不分页 */ .options { display: grid; row-gap: 8px; margin-top: 8px; page-break-inside: avoid; break-inside: avoid; } .options-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px 12px; page-break-inside: avoid; break-inside: avoid; } .options-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; page-break-inside: avoid; break-inside: avoid; } .options-grid-1 { display: grid; grid-template-columns: 1fr; gap: 8px; page-break-inside: avoid; break-inside: avoid; } /* 单个选项:不分页 */ .option { display: flex; align-items: baseline; font-size: 13.2px; line-height: 1.6; page-break-inside: avoid; break-inside: avoid; } .option strong { margin-right: 4px; flex: 0 0 auto; line-height: 1.6; } .option-value { display: inline; } .option-short { white-space: nowrap; } .option-long { white-space: normal; word-break: break-word; } .option-compact { line-height: inherit; } .option p, .option div { margin: 0; display: inline; } .option .katex { font-size: 1em !important; vertical-align: 0; } /* 仅提升分式可读性(不放大整行选项) */ .option .katex .mfrac { font-size: 1em !important; } /* 选项里的分子分母保持可读且不挤压横线 */ .option .katex .mfrac .mtight { font-size: 1em !important; } /* 分数线稍加粗 */ .option .katex .frac-line { border-bottom-width: 0.055em !important; } /* 自动化实测后的分式微调:分母下移、分子上移,避免贴线 */ .option .katex .mfrac .vlist > span:nth-child(1) { transform: translateY(0.24em) !important; } .option .katex .mfrac .vlist > span:nth-child(3) { transform: translateY(-0.16em) !important; } .option .katex-display { display: inline; margin: 0 !important; vertical-align: baseline; } /* 答案区域:不分页 */ .answer-area { position: relative; margin-top: 4px; page-break-inside: avoid; break-inside: avoid; } .answer-area.boxy { min-height: 150px; border: 1.5px solid #444; border-radius: 6px; padding: 14px; } .answer-label { position: absolute; top: -10px; left: 10px; font-size: 10px; background: #fff; padding: 0 4px; color: #555; letter-spacing: 1px; } /* 答案元信息:不分页 */ .answer-meta { font-size: 12px; color: #2f2f2f; line-height: 1.75; margin-top: 4px; page-break-inside: avoid; break-inside: avoid; } .answer-line + .answer-line { margin-top: 4px; } .solution-step { align-items: center; gap: 6px; } .step-box { display: inline-block; } .step-label { white-space: nowrap; } .solution-heading { font-weight: 700; } .solution-content { display: inline-block; line-height: 1.75; } /* 解析区域:不分页 */ .solution-section { margin-top: 8px; padding: 6px 8px; page-break-inside: avoid; break-inside: avoid; } .solution-section strong { font-size: 13px; } .solution-parsed { margin-top: 6px; line-height: 1.8; } svg, .math-render svg { max-width: 100%; height: auto; display: block; /* 确保SVG中的文字和图形元素正确对齐 */ shape-rendering: geometricPrecision; text-rendering: geometricPrecision; } /* 优化SVG中文字标签的显示 */ svg text { font-family: "Noto Serif", "Noto Serif CJK SC", "Noto Sans CJK SC", "Noto Sans", "STSongti-SC", "PingFang SC", "Songti SC", serif !important; font-size: 13px !important; font-weight: bold; font-style: normal; dominant-baseline: middle; text-anchor: middle; alignment-baseline: central; /* 确保文字在点的正中央 */ paint-order: stroke fill; stroke: none; fill: #000; } /* SVG中点标签的精确对齐 */ svg text.label-point { font-size: 14px; font-weight: bold; dx: 0; dy: 0; } /* 确保SVG中的圆形和线条正确渲染 */ svg circle, svg line, svg polygon, svg polyline { shape-rendering: geometricPrecision; } /* PDF图片容器:防止图片跨页分割 - 增强版 */ .pdf-figure { break-inside: avoid; page-break-inside: avoid; -webkit-column-break-inside: avoid; break-before: avoid; break-after: avoid; page-break-before: avoid; page-break-after: avoid; margin: 8px 0; display: block; /* 确保图片不会在页面底部被截断 */ min-height: 30px; /* 限制独立图块尺寸,避免图片压过文字 */ max-height: 82mm; } .pdf-figure img { max-width: min(84%, 420px); max-height: 82mm; width: auto; height: auto; display: block; margin: 0 auto; object-fit: contain; box-sizing: border-box; -webkit-print-color-adjust: exact; print-color-adjust: exact; image-rendering: -webkit-optimize-contrast; } /* 题干中的图片样式(向后兼容) */ .question-stem img, .question-main img, .question-content img, .answer-meta img, .answer-line img, .solution-content img, .solution-section img, .solution-parsed img { display: block; max-width: 220px; max-height: 60mm; width: auto; height: auto; margin: 6px auto; box-sizing: border-box; object-fit: contain; -webkit-print-color-adjust: exact; print-color-adjust: exact; image-rendering: -webkit-optimize-contrast; } /* 选项中的图片样式 - 防止超出容器 */ .option img { max-width: 100%; height: auto; vertical-align: middle; } .question-stem .katex, .question-main .katex, .question-content .katex { font-size: 1em !important; /* 避免题干/解析中的行内公式整体下沉 */ vertical-align: 0; } .question-stem .katex-display, .question-main .katex-display, .question-content .katex-display { margin: 0.35em 0 !important; } @include('pdf.partials.grading-scan-sheet-styles')