table-fix.css 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. /* 审核表格修复样式 - 增强版,确保覆盖原有样式 */
  2. /* 通用表格样式 */
  3. .message-content table,
  4. .markdown-content table,
  5. .bot .message-content table {
  6. width: 100% !important;
  7. table-layout: fixed !important;
  8. border-collapse: collapse !important;
  9. margin: 1em 0 !important;
  10. box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05) !important;
  11. border-radius: 4px !important;
  12. overflow: hidden !important; /* 确保圆角边框生效 */
  13. display: table !important; /* 强制表格显示为表格,而不是块 */
  14. }
  15. /* 表格单元格通用样式 */
  16. .message-content table th,
  17. .message-content table td,
  18. .markdown-content table th,
  19. .markdown-content table td,
  20. .bot .message-content table th,
  21. .bot .message-content table td {
  22. padding: 10px !important;
  23. border: 1px solid #e2e8f0 !important;
  24. vertical-align: top !important;
  25. word-wrap: break-word !important;
  26. word-break: break-word !important;
  27. white-space: normal !important;
  28. height: auto !important;
  29. overflow: visible !important;
  30. line-height: 1.5 !important;
  31. text-align: center !important; /* 确保所有单元格文字居中 */
  32. }
  33. /* 表头样式 - 确保居中显示 */
  34. .message-content table th,
  35. .markdown-content table th,
  36. .bot .message-content table th {
  37. background-color: #eef2ff !important; /* 轻微的紫色背景 */
  38. color: #4F46E5 !important; /* 与网站主题色匹配 */
  39. font-weight: 600 !important;
  40. text-align: center !important; /* 强制表头文字居中显示 */
  41. padding: 12px 10px !important; /* 增加表头高度 */
  42. }
  43. /* 序号列(第一列)宽度和居中 */
  44. .message-content table th:first-child,
  45. .message-content table td:first-child,
  46. .markdown-content table th:first-child,
  47. .markdown-content table td:first-child,
  48. .bot .message-content table th:first-child,
  49. .bot .message-content table td:first-child {
  50. width: 5% !important;
  51. min-width: 40px !important;
  52. text-align: center !important;
  53. vertical-align: middle !important;
  54. font-weight: 500 !important;
  55. }
  56. /* 违规原文列(第二列)宽度 */
  57. .message-content table th:nth-child(2),
  58. .message-content table td:nth-child(2),
  59. .markdown-content table th:nth-child(2),
  60. .markdown-content table td:nth-child(2),
  61. .bot .message-content table th:nth-child(2),
  62. .bot .message-content table td:nth-child(2) {
  63. width: 30% !important;
  64. }
  65. /* 违规原因列(第三列)宽度 */
  66. .message-content table th:nth-child(3),
  67. .message-content table td:nth-child(3),
  68. .markdown-content table th:nth-child(3),
  69. .markdown-content table td:nth-child(3),
  70. .bot .message-content table th:nth-child(3),
  71. .bot .message-content table td:nth-child(3) {
  72. width: 30% !important;
  73. }
  74. /* 修改建议列(第四列)宽度 */
  75. .message-content table th:nth-child(4),
  76. .message-content table td:nth-child(4),
  77. .markdown-content table th:nth-child(4),
  78. .markdown-content table td:nth-child(4),
  79. .bot .message-content table th:nth-child(4),
  80. .bot .message-content table td:nth-child(4) {
  81. width: 35% !important;
  82. }
  83. /* 第一行文字居中 - 针对性强化 */
  84. .message-content table tbody tr:first-child td,
  85. .markdown-content table tbody tr:first-child td,
  86. .bot .message-content table tbody tr:first-child td {
  87. text-align: center !important;
  88. vertical-align: middle !important;
  89. background-color: #f9fafb !important; /* 轻微的灰色背景 */
  90. }
  91. /* 让表格行有更好的视觉区分 */
  92. .message-content table tbody tr:nth-child(even),
  93. .markdown-content table tbody tr:nth-child(even),
  94. .bot .message-content table tbody tr:nth-child(even) {
  95. background-color: #f9fafb !important;
  96. }
  97. .message-content table tbody tr:hover,
  98. .markdown-content table tbody tr:hover,
  99. .bot .message-content table tbody tr:hover {
  100. background-color: #f3f4f7 !important;
  101. }
  102. /* 专门针对审核结果表格的增强样式 */
  103. table.audit-result,
  104. table[data-type="audit-result"],
  105. .message-content table.audit-result,
  106. .message-content table[data-type="audit-result"],
  107. .markdown-content table.audit-result,
  108. .markdown-content table[data-type="audit-result"],
  109. .bot .message-content table.audit-result,
  110. .bot .message-content table[data-type="audit-result"] {
  111. width: 100% !important;
  112. border: 1px solid #e2e8f0 !important;
  113. display: table !important;
  114. }
  115. /* 审核结果表格的单元格增强 */
  116. table.audit-result th,
  117. table.audit-result td,
  118. table[data-type="audit-result"] th,
  119. table[data-type="audit-result"] td,
  120. .message-content table.audit-result th,
  121. .message-content table.audit-result td,
  122. .message-content table[data-type="audit-result"] th,
  123. .message-content table[data-type="audit-result"] td,
  124. .markdown-content table.audit-result th,
  125. .markdown-content table.audit-result td,
  126. .markdown-content table[data-type="audit-result"] th,
  127. .markdown-content table[data-type="audit-result"] td,
  128. .bot .message-content table.audit-result th,
  129. .bot .message-content table.audit-result td,
  130. .bot .message-content table[data-type="audit-result"] th,
  131. .bot .message-content table[data-type="audit-result"] td {
  132. padding: 12px !important;
  133. vertical-align: top !important;
  134. text-align: center !important; /* 确保所有单元格文字居中 */
  135. }
  136. /* 审核结果表格的表头增强 - 强制居中 */
  137. table.audit-result th,
  138. table[data-type="audit-result"] th,
  139. .message-content table.audit-result th,
  140. .message-content table[data-type="audit-result"] th,
  141. .markdown-content table.audit-result th,
  142. .markdown-content table[data-type="audit-result"] th,
  143. .bot .message-content table.audit-result th,
  144. .bot .message-content table[data-type="audit-result"] th {
  145. text-align: center !important;
  146. background-color: #eef2ff !important; /* 轻微的紫色背景 */
  147. color: #4F46E5 !important; /* 与网站主题色匹配 */
  148. }
  149. /* 审核结果表格第一行增强 - 强制居中 */
  150. table.audit-result tbody tr:first-child td,
  151. table[data-type="audit-result"] tbody tr:first-child td,
  152. .message-content table.audit-result tbody tr:first-child td,
  153. .message-content table[data-type="audit-result"] tbody tr:first-child td,
  154. .markdown-content table.audit-result tbody tr:first-child td,
  155. .markdown-content table[data-type="audit-result"] tbody tr:first-child td,
  156. .bot .message-content table.audit-result tbody tr:first-child td,
  157. .bot .message-content table[data-type="audit-result"] tbody tr:first-child td {
  158. text-align: center !important;
  159. vertical-align: middle !important;
  160. background-color: #f9fafb !important; /* 轻微的灰色背景 */
  161. }
  162. /* 响应式样式 */
  163. @media (max-width: 768px) {
  164. .message-content table,
  165. .markdown-content table,
  166. .bot .message-content table {
  167. display: block !important;
  168. overflow-x: auto !important;
  169. -webkit-overflow-scrolling: touch !important;
  170. width: 100% !important; /* 确保在移动设备上也是100%宽度 */
  171. }
  172. .message-content table th,
  173. .message-content table td,
  174. .markdown-content table th,
  175. .markdown-content table td,
  176. .bot .message-content table th,
  177. .bot .message-content table td {
  178. min-width: 120px !important;
  179. text-align: center !important; /* 确保在移动设备上也居中 */
  180. }
  181. /* 即使在移动设备上也保持表格的宽度一致,只在需要时允许水平滚动 */
  182. table.audit-result,
  183. table[data-type="audit-result"],
  184. .message-content table.audit-result,
  185. .message-content table[data-type="audit-result"],
  186. .markdown-content table.audit-result,
  187. .markdown-content table[data-type="audit-result"],
  188. .bot .message-content table.audit-result,
  189. .bot .message-content table[data-type="audit-result"] {
  190. display: block !important;
  191. overflow-x: auto !important;
  192. white-space: nowrap !important;
  193. width: 100% !important;
  194. }
  195. table.audit-result td,
  196. table[data-type="audit-result"] td,
  197. .message-content table.audit-result td,
  198. .message-content table[data-type="audit-result"] td,
  199. .markdown-content table.audit-result td,
  200. .markdown-content table[data-type="audit-result"] td,
  201. .bot .message-content table.audit-result td,
  202. .bot .message-content table[data-type="audit-result"] td {
  203. white-space: normal !important;
  204. min-width: 150px !important;
  205. text-align: center !important; /* 确保在移动设备上也居中 */
  206. }
  207. }
  208. /* 表格单元格文字黑色和居中显示(不包括表头) */
  209. .message-content table td,
  210. .markdown-content table td,
  211. .bot .message-content table td,
  212. table td {
  213. color: #000000 !important; /* 确保所有普通单元格文字为黑色 */
  214. text-align: center !important; /* 确保所有单元格文字居中 */
  215. }
  216. /* 保持表头样式不变,但依然居中 */
  217. .message-content table th,
  218. .markdown-content table th,
  219. .bot .message-content table th,
  220. table th {
  221. text-align: center !important; /* 确保表头文字居中 */
  222. }
  223. /* 覆盖safe-row的颜色,也使用黑色 */
  224. .message-content table tr.safe-row td,
  225. .markdown-content table tr.safe-row td,
  226. .bot .message-content table tr.safe-row td,
  227. .message-content table.risk-table tr.safe-row td,
  228. .markdown-content table.risk-table tr.safe-row td,
  229. .bot .message-content table.risk-table tr.safe-row td,
  230. .safe-row td {
  231. color: #000000 !important; /* 使用纯黑色 */
  232. }
  233. /* 特殊行的样式优先级调整 */
  234. /* 由于需要所有表格文字均为黑色,因此注释掉特殊颜色的样式 */
  235. /*
  236. .message-content table tr.violation-row td,
  237. .markdown-content table tr.violation-row td,
  238. .bot .message-content table tr.violation-row td,
  239. .message-content table.risk-table tr.violation-row td,
  240. .markdown-content table.risk-table tr.violation-row td,
  241. .bot .message-content table.risk-table tr.violation-row td {
  242. color: var(--audit-fail-color) !important;
  243. }
  244. .message-content table tr.warning-row td,
  245. .markdown-content table tr.warning-row td,
  246. .bot .message-content table tr.warning-row td {
  247. color: var(--warning-color) !important;
  248. }
  249. */
  250. /* 确保所有表格单元格都居中显示和文字黑色 - 最高优先级规则 */
  251. .message-content table td,
  252. .markdown-content table td,
  253. .bot .message-content table td,
  254. table td,
  255. tr td,
  256. tbody td,
  257. .message-content tbody td,
  258. .markdown-content tbody td {
  259. text-align: center !important;
  260. color: #000000 !important;
  261. vertical-align: middle !important; /* 垂直居中 */
  262. }