paper-body-grading-styles.blade.php 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  1. :root {
  2. --question-gap: 6px;
  3. }
  4. body {
  5. font-family: "Noto Serif", "Noto Serif CJK SC", "Noto Sans CJK SC", "Noto Sans", "STSongti-SC", "PingFang SC", "Songti SC", serif;
  6. line-height: 1.65;
  7. color: #000;
  8. background: #fff;
  9. font-size: 14px;
  10. }
  11. .page {
  12. max-width: 720px;
  13. margin: 0 auto;
  14. padding: 0 12px;
  15. }
  16. .header { text-align: center; margin-bottom: 1.5rem; border-bottom: 2px solid #000; padding-bottom: 1rem; }
  17. /* 大题标题:不与后面内容分开 */
  18. .section-title {
  19. font-size: 16px;
  20. font-weight: bold;
  21. margin-top: 16px;
  22. margin-bottom: 10px;
  23. page-break-after: avoid;
  24. break-after: avoid;
  25. }
  26. /* 题目整体:不分页 */
  27. .question {
  28. margin-bottom: 14px;
  29. page-break-inside: avoid;
  30. break-inside: avoid;
  31. -webkit-column-break-inside: avoid;
  32. }
  33. /* 题目网格:不分页 */
  34. .question-grid {
  35. display: grid;
  36. grid-template-columns: auto 1fr;
  37. column-gap: 4px;
  38. row-gap: 6px;
  39. align-items: flex-start;
  40. page-break-inside: avoid;
  41. break-inside: avoid;
  42. }
  43. .question-lead {
  44. display: flex;
  45. gap: 4px;
  46. align-items: flex-start;
  47. font-weight: 600;
  48. font-size: 14px;
  49. line-height: 1.65;
  50. margin-top: 1px;
  51. }
  52. .question-lead.spacer { visibility: hidden; }
  53. .question-number { white-space: nowrap; margin-right: 2px; }
  54. .grading-boxes { gap: 4px; flex-wrap: wrap; align-items: center; }
  55. .grading-boxes span { vertical-align: middle; }
  56. /* 题目内容:防止孤行 */
  57. .question-main {
  58. font-size: 14px;
  59. line-height: 1.65;
  60. font-family: inherit;
  61. display: block;
  62. orphans: 3;
  63. widows: 3;
  64. }
  65. .question-score { margin-right: 6px; font-weight: 600; }
  66. .question-stem {
  67. display: inline-block;
  68. font-size: 14px;
  69. font-family: inherit;
  70. orphans: 3;
  71. widows: 3;
  72. }
  73. /* 选项容器:不分页 */
  74. .options {
  75. display: grid;
  76. row-gap: 8px;
  77. margin-top: 8px;
  78. page-break-inside: avoid;
  79. break-inside: avoid;
  80. }
  81. .options-grid-4 {
  82. display: grid;
  83. grid-template-columns: repeat(4, 1fr);
  84. gap: 8px 12px;
  85. page-break-inside: avoid;
  86. break-inside: avoid;
  87. }
  88. .options-grid-2 {
  89. display: grid;
  90. grid-template-columns: 1fr 1fr;
  91. gap: 8px 20px;
  92. page-break-inside: avoid;
  93. break-inside: avoid;
  94. }
  95. .options-grid-1 {
  96. display: grid;
  97. grid-template-columns: 1fr;
  98. gap: 8px;
  99. page-break-inside: avoid;
  100. break-inside: avoid;
  101. }
  102. /* 单个选项:不分页 */
  103. .option {
  104. display: flex;
  105. align-items: baseline;
  106. font-size: 13.2px;
  107. line-height: 1.6;
  108. page-break-inside: avoid;
  109. break-inside: avoid;
  110. }
  111. .option strong { margin-right: 4px; flex: 0 0 auto; line-height: 1.6; }
  112. .option-value { display: inline; }
  113. .option-short { white-space: nowrap; }
  114. .option-long { white-space: normal; word-break: break-word; }
  115. .option-compact { line-height: inherit; }
  116. .option p, .option div { margin: 0; display: inline; }
  117. .option .katex {
  118. font-size: 1em !important;
  119. vertical-align: 0;
  120. }
  121. /* 仅提升分式可读性(不放大整行选项) */
  122. .option .katex .mfrac {
  123. font-size: 1em !important;
  124. }
  125. /* 选项里的分子分母保持可读且不挤压横线 */
  126. .option .katex .mfrac .mtight {
  127. font-size: 1em !important;
  128. }
  129. /* 分数线稍加粗 */
  130. .option .katex .frac-line {
  131. border-bottom-width: 0.055em !important;
  132. }
  133. /* 自动化实测后的分式微调:分母下移、分子上移,避免贴线 */
  134. .option .katex .mfrac .vlist > span:nth-child(1) {
  135. transform: translateY(0.24em) !important;
  136. }
  137. .option .katex .mfrac .vlist > span:nth-child(3) {
  138. transform: translateY(-0.16em) !important;
  139. }
  140. .option .katex-display {
  141. display: inline;
  142. margin: 0 !important;
  143. vertical-align: baseline;
  144. }
  145. /* 答案区域:不分页 */
  146. .answer-area {
  147. position: relative;
  148. margin-top: 4px;
  149. page-break-inside: avoid;
  150. break-inside: avoid;
  151. }
  152. .answer-area.boxy {
  153. min-height: 150px;
  154. border: 1.5px solid #444;
  155. border-radius: 6px;
  156. padding: 14px;
  157. }
  158. .answer-label {
  159. position: absolute;
  160. top: -10px;
  161. left: 10px;
  162. font-size: 10px;
  163. background: #fff;
  164. padding: 0 4px;
  165. color: #555;
  166. letter-spacing: 1px;
  167. }
  168. /* 答案元信息:不分页 */
  169. .answer-meta {
  170. font-size: 12px;
  171. color: #2f2f2f;
  172. line-height: 1.75;
  173. margin-top: 4px;
  174. page-break-inside: avoid;
  175. break-inside: avoid;
  176. }
  177. .answer-line + .answer-line { margin-top: 4px; }
  178. .solution-step {
  179. align-items: center;
  180. gap: 6px;
  181. }
  182. .step-box { display: inline-block; }
  183. .step-label { white-space: nowrap; }
  184. .solution-heading { font-weight: 700; }
  185. .solution-content { display: inline-block; line-height: 1.75; }
  186. /* 解析区域:不分页 */
  187. .solution-section {
  188. margin-top: 8px;
  189. padding: 6px 8px;
  190. page-break-inside: avoid;
  191. break-inside: avoid;
  192. }
  193. .solution-section strong {
  194. font-size: 13px;
  195. }
  196. .solution-parsed {
  197. margin-top: 6px;
  198. line-height: 1.8;
  199. }
  200. svg, .math-render svg {
  201. max-width: 100%;
  202. height: auto;
  203. display: block;
  204. /* 确保SVG中的文字和图形元素正确对齐 */
  205. shape-rendering: geometricPrecision;
  206. text-rendering: geometricPrecision;
  207. }
  208. /* 优化SVG中文字标签的显示 */
  209. svg text {
  210. font-family: "Noto Serif", "Noto Serif CJK SC", "Noto Sans CJK SC", "Noto Sans", "STSongti-SC", "PingFang SC", "Songti SC", serif !important;
  211. font-size: 13px !important;
  212. font-weight: bold;
  213. font-style: normal;
  214. dominant-baseline: middle;
  215. text-anchor: middle;
  216. alignment-baseline: central;
  217. /* 确保文字在点的正中央 */
  218. paint-order: stroke fill;
  219. stroke: none;
  220. fill: #000;
  221. }
  222. /* SVG中点标签的精确对齐 */
  223. svg text.label-point {
  224. font-size: 14px;
  225. font-weight: bold;
  226. dx: 0;
  227. dy: 0;
  228. }
  229. /* 确保SVG中的圆形和线条正确渲染 */
  230. svg circle, svg line, svg polygon, svg polyline {
  231. shape-rendering: geometricPrecision;
  232. }
  233. /* PDF图片容器:防止图片跨页分割 - 增强版 */
  234. .pdf-figure {
  235. break-inside: avoid;
  236. page-break-inside: avoid;
  237. -webkit-column-break-inside: avoid;
  238. break-before: avoid;
  239. break-after: avoid;
  240. page-break-before: avoid;
  241. page-break-after: avoid;
  242. margin: 8px 0;
  243. display: block;
  244. /* 确保图片不会在页面底部被截断 */
  245. min-height: 30px;
  246. /* 限制独立图块尺寸,避免图片压过文字 */
  247. max-height: 82mm;
  248. }
  249. .pdf-figure img {
  250. max-width: min(84%, 420px);
  251. max-height: 82mm;
  252. width: auto;
  253. height: auto;
  254. display: block;
  255. margin: 0 auto;
  256. object-fit: contain;
  257. box-sizing: border-box;
  258. -webkit-print-color-adjust: exact;
  259. print-color-adjust: exact;
  260. image-rendering: -webkit-optimize-contrast;
  261. }
  262. /* 题干中的图片样式(向后兼容) */
  263. .question-stem img,
  264. .question-main img,
  265. .question-content img,
  266. .answer-meta img,
  267. .answer-line img,
  268. .solution-content img,
  269. .solution-section img,
  270. .solution-parsed img {
  271. display: block;
  272. max-width: 220px;
  273. max-height: 60mm;
  274. width: auto;
  275. height: auto;
  276. margin: 6px auto;
  277. box-sizing: border-box;
  278. object-fit: contain;
  279. -webkit-print-color-adjust: exact;
  280. print-color-adjust: exact;
  281. image-rendering: -webkit-optimize-contrast;
  282. }
  283. /* 选项中的图片样式 - 防止超出容器 */
  284. .option img {
  285. max-width: 100%;
  286. height: auto;
  287. vertical-align: middle;
  288. }
  289. .question-stem .katex,
  290. .question-main .katex,
  291. .question-content .katex {
  292. font-size: 1em !important;
  293. /* 避免题干/解析中的行内公式整体下沉 */
  294. vertical-align: 0;
  295. }
  296. .question-stem .katex-display,
  297. .question-main .katex-display,
  298. .question-content .katex-display {
  299. margin: 0.35em 0 !important;
  300. }
  301. @include('pdf.partials.grading-scan-sheet-styles')