@bytechain.cn/colamd-themes 0.3.2 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/.claude/skills/colamd-themes-preview.skill.md +333 -0
  2. package/.claude/skills/colamd-themes.skill.md +10 -0
  3. package/.dsh/skills/colamd-themes/SKILL.md +14 -0
  4. package/.github/supported-topics.yml +17 -0
  5. package/.hermes/skills/tools/colamd-themes/SKILL.md +14 -0
  6. package/.openclaw/skills/colamd-themes/SKILL.md +1 -37
  7. package/.opencode/skills/colamd-themes/SKILL.md +17 -0
  8. package/.trae/rules/colamd-themes.md +0 -36
  9. package/CHANGELOG.md +331 -241
  10. package/DSH_SUPPORT_SUMMARY.md +87 -0
  11. package/README.md +414 -384
  12. package/README_CN.md +412 -384
  13. package/RELEASENOTE.md +541 -389
  14. package/dist/cli.js +36 -55
  15. package/dist/cli.js.map +1 -1
  16. package/dist/color-utils.d.ts +1 -0
  17. package/dist/color-utils.js +25 -6
  18. package/dist/color-utils.js.map +1 -1
  19. package/dist/extractors/pdf-extractor.js +6 -1
  20. package/dist/extractors/pdf-extractor.js.map +1 -1
  21. package/dist/extractors/url-extractor.d.ts +0 -4
  22. package/dist/extractors/url-extractor.js +13 -126
  23. package/dist/extractors/url-extractor.js.map +1 -1
  24. package/dist/generator.d.ts +1 -1
  25. package/dist/generator.js +32 -11
  26. package/dist/generator.js.map +1 -1
  27. package/dist/models.d.ts +5 -4
  28. package/dist/models.js +2 -3
  29. package/dist/models.js.map +1 -1
  30. package/dist/renderer.d.ts +6 -3
  31. package/dist/renderer.js +54 -93
  32. package/dist/renderer.js.map +1 -1
  33. package/dist/templates/template.css +220 -498
  34. package/dist/templates/theme-paradigm.md +530 -658
  35. package/dist/templates/theme-template.hbs +256 -370
  36. package/dist/theme-store.js +19 -3
  37. package/dist/theme-store.js.map +1 -1
  38. package/dist/utils/document-paradigm.d.ts +12 -0
  39. package/dist/utils/document-paradigm.js +109 -0
  40. package/dist/utils/document-paradigm.js.map +1 -0
  41. package/dist/validators.d.ts +4 -1
  42. package/dist/validators.js +115 -1
  43. package/dist/validators.js.map +1 -1
  44. package/mcp-server/dist/index.d.ts +13 -0
  45. package/mcp-server/dist/index.d.ts.map +1 -0
  46. package/mcp-server/dist/index.js +0 -0
  47. package/mcp-server/dist/index.js.map +1 -0
  48. package/mcp-server/package-lock.json +1759 -0
  49. package/mcp-server/package.json +24 -0
  50. package/mcp-server/src/index.ts +0 -0
  51. package/mcp-server/tsconfig.json +19 -0
  52. package/package.json +54 -36
  53. package/skills/build-skills.sh +30 -5
  54. package/skills/colamd-themes/SKILL.md +180 -178
  55. package/src/cli.ts +474 -487
  56. package/src/color-systems.ts +289 -289
  57. package/src/color-utils.ts +137 -120
  58. package/src/contrast.ts +66 -66
  59. package/src/docx-style-paradigm.ts +811 -811
  60. package/src/export-cli.ts +356 -356
  61. package/src/extractors/base.ts +8 -8
  62. package/src/extractors/docx-extractor.ts +417 -417
  63. package/src/extractors/pdf-extractor.ts +533 -527
  64. package/src/extractors/url-extractor.ts +846 -981
  65. package/src/generator.ts +197 -169
  66. package/src/index.ts +29 -29
  67. package/src/models.ts +212 -212
  68. package/src/renderer.ts +310 -359
  69. package/src/templates/template.css +220 -498
  70. package/src/templates/theme-paradigm.md +530 -658
  71. package/src/templates/theme-template.hbs +256 -370
  72. package/src/theme-store.ts +185 -170
  73. package/src/types/pdf-parse.d.ts +12 -12
  74. package/src/utils/cli-utils.ts +84 -84
  75. package/src/utils/document-paradigm.ts +118 -0
  76. package/src/validators.ts +298 -176
  77. package/themes/academic-paper-pt.css +353 -1805
  78. package/themes/academic-paper.css +350 -1099
  79. package/themes/academic-style.css +342 -2430
  80. package/themes/colly.css +256 -370
  81. package/themes/elegant.css +288 -671
  82. package/themes/forest-ink.css +240 -664
  83. package/themes/guizang.css +250 -732
  84. package/themes/hermes-security.css +279 -0
  85. package/themes/meeting-minutes.css +256 -370
  86. package/themes/pixso-design.css +278 -1261
  87. package/themes/salvator-blog.css +256 -370
  88. package/themes/shimo-theme.css +256 -0
  89. package/themes/swiss-design.css +285 -746
  90. package/themes/template.css +220 -498
  91. package/themes/trae-blue.css +280 -737
  92. package/themes/word-contract.css +249 -0
  93. package/themes-preview/demo-content.md +187 -187
  94. package/tsconfig.json +18 -18
  95. package/src/mermaid-presets.ts +0 -142
  96. package/themes/swiss-design copy.css +0 -746
  97. package/themes-preview/colly-preview.html +0 -623
  98. package/themes-preview/meeting-minutes-preview.html +0 -625
  99. package/themes-preview/salvator-blog-preview.html +0 -623
@@ -1,1099 +1,350 @@
1
- /*
2
- * ColaMD 主题:Academic Paper (学术论文打印)
3
- * 版本:v3.0(遵循 theme-paradigm.md 范式)
4
- *
5
- * 风格:纯白底 + 纯黑正文 + 灰度 Mermaid 图表
6
- * 规范:GB/T 7713 中文学术论文排版(宋体正文 + 黑体标题 + 三线表)
7
- * 单位:强制使用 px(禁止 pt,会导致 PDF 导出缩小 25%)
8
- *
9
- * 导入:Theme > Import Theme
10
- */
11
-
12
- /* ═══════════════════════════════════════════════════════════
13
- SECTION 1 — 设计令牌 (Design Tokens)
14
- ═══════════════════════════════════════════════════════════ */
15
-
16
- :root {
17
- --side-bar-bg-color: #f5f5f5;
18
- --control-text-color: #333;
19
- --active-file-bg-color: #e8e8e8;
20
- --active-file-text-color: #000;
21
- --active-file-border-color: #000;
22
- --bg-color: #ffffff;
23
- --text-color: #111111;
24
- --select-text-bg-color: rgba(0, 0, 0, 0.12);
25
- --select-text-font-color: #111111;
26
- --rawblock-edit-panel-bd: #cccccc;
27
- }
28
-
29
- body.theme-custom {
30
-
31
- /* ═══════════════════════════════════════════════════════════
32
- 1.1 种子色板 — 10 级灰度(GB/T 7713 学术论文规范)
33
- ═══════════════════════════════════════════════════════════ */
34
-
35
- --seed-surface: #ffffff; /* L0 页面背景(纯白) */
36
- --seed-panel: #f5f5f5; /* L1 代码/区块背景(浅灰) */
37
- --seed-panel-alt: #fafafa; /* L2 次要表面(极浅灰) */
38
-
39
- --seed-ink: #111111; /* T0 正文/标题(近黑) */
40
- --seed-ink-muted: #333333; /* T1 次要文字 */
41
- --seed-ink-dim: #666666; /* T2 弱化/禁用文字 */
42
-
43
- --seed-border: #111111; /* 强调边框 */
44
- --seed-border-light: #cccccc; /* 浅边框/分割线 */
45
-
46
- /* ═══════════════════════════════════════════════════════════
47
- 1.2 字体系统 — GB/T 7713 学术论文规范
48
- ═══════════════════════════════════════════════════════════ */
49
-
50
- --font-body: "SimSun", "Songti SC", "Source Han Serif SC", "Noto Serif SC",
51
- Georgia, "Times New Roman", serif;
52
-
53
- --font-heading: "SimHei", "Heiti SC", "Source Han Sans SC", "Noto Sans SC",
54
- "Microsoft YaHei", "Arial", sans-serif;
55
-
56
- --font-code: "Courier New", "Consolas", "Source Code Pro", monospace;
57
-
58
- --font-mermaid: var(--font-heading);
59
-
60
- /* ═══════════════════════════════════════════════════════════
61
- 1.3 字号 & 间距 — 屏幕 px 单位
62
- ═══════════════════════════════════════════════════════════ */
63
-
64
- --font-size-root: 16px;
65
-
66
- --font-scale-h1: 1.375; /* 22px — 三号(论文题目) */
67
- --font-scale-h2: 1.125; /* 18px — 四号(一级节) */
68
- --font-scale-h3: 1.0; /* 16px — 小四号(二级节) */
69
- --font-scale-h4: 1.0; /* 16px — 小四号(三级节) */
70
- --font-scale-h5: 0.875; /* 14px — 五号 */
71
- --font-scale-h6: 0.875; /* 14px — 五号 */
72
-
73
- --font-size-mermaid: 12px;
74
-
75
- --line-height-body: 1.5;
76
- --line-height-heading: 1.35;
77
- --line-height-code: 1.5;
78
-
79
- /* ═══════════════════════════════════════════════════════════
80
- 1.4 圆角 & 间距 — 学术论文:直角优先
81
- ═══════════════════════════════════════════════════════════ */
82
-
83
- --radius-sm: 0px;
84
- --radius-md: 0px;
85
- --radius-lg: 0px;
86
- --content-width: 210mm;
87
-
88
- --page-margin-top: 25mm;
89
- --page-margin-bottom: 25mm;
90
- --page-margin-left: 30mm;
91
- --page-margin-right: 25mm;
92
-
93
- /* ═══════════════════════════════════════════════════════════
94
- 1.5 灰度色板 — 10 级亮度感知
95
- ═══════════════════════════════════════════════════════════ */
96
-
97
- --gray-0: #ffffff;
98
- --gray-1: #fafafa;
99
- --gray-2: #f5f5f5;
100
- --gray-3: #eeeeee;
101
- --gray-4: #e0e0e0;
102
- --gray-5: #cccccc;
103
- --gray-6: #999999;
104
- --gray-7: #666666;
105
- --gray-8: #333333;
106
- --gray-9: #111111;
107
- }
108
-
109
- /* ═══════════════════════════════════════════════════════════
110
- SECTION 2 — 语义映射 (Semantic Mapping)
111
- ═══════════════════════════════════════════════════════════ */
112
-
113
- body.theme-custom {
114
-
115
- /* ── 2.1 编辑区表面色 ── */
116
- --bg-color: var(--seed-surface);
117
- --surface-color: var(--seed-panel);
118
- --surface-alt: var(--seed-panel-alt);
119
-
120
- /* ── 2.2 编辑区文字色 ── */
121
- --text-color: var(--seed-ink);
122
- --heading-color: var(--seed-ink);
123
- --text-muted: var(--seed-ink-muted);
124
- --text-dim: var(--seed-ink-dim);
125
-
126
- /* ── 2.3 链接 & 强调 ── */
127
- --link-color: var(--seed-ink);
128
- --accent-color: var(--seed-ink);
129
- --accent-dark: var(--seed-ink);
130
- --accent-light: var(--gray-4);
131
- --selection-bg: rgba(0, 0, 0, 0.12);
132
-
133
- /* ── 2.4 边框 & 分割线 ── */
134
- --border-color: var(--seed-border);
135
- --blockquote-border: var(--seed-ink);
136
- --hr-color: var(--seed-ink);
137
-
138
- /* ── 2.5 内联代码 ── */
139
- --code-bg: var(--gray-3);
140
- --code-color: var(--seed-ink);
141
-
142
- /* ── 2.6 代码块 ── */
143
- --code-block-bg: var(--seed-panel);
144
- --code-block-text: var(--seed-ink);
145
- --code-block-color: var(--seed-ink);
146
-
147
- /* ── 2.7 引用块 ── */
148
- --blockquote-bg: var(--seed-panel-alt);
149
-
150
- /* ── 2.8 表格 — 三线表规范 ── */
151
- --table-header-bg: transparent;
152
- --table-border: var(--seed-ink);
153
-
154
- /* ── 2.9 表格 — 表头文字 ── */
155
- --table-header-text: var(--seed-ink);
156
-
157
- /* ── 2.10 滚动条 ── */
158
- --scrollbar-thumb: var(--gray-5);
159
- --scrollbar-thumb-hover: var(--gray-6);
160
- }
161
-
162
- /* ═══════════════════════════════════════════════════════════
163
- SECTION 3 — Mermaid 图表变量
164
- 学术论文图表:白底黑框灰度,印刷友好
165
- ═══════════════════════════════════════════════════════════ */
166
-
167
- body.theme-custom {
168
-
169
- /* ── 3.1 容器 ── */
170
- --mermaid-background: var(--seed-surface);
171
- --mermaid-border-color: var(--gray-5);
172
- --mermaid-border-radius: var(--radius-md);
173
- --mermaid-padding: 20px;
174
-
175
- /* ── 3.2 字体 ── */
176
- --mermaid-font-family: var(--font-mermaid);
177
- --mermaid-font-size: var(--font-size-mermaid);
178
-
179
- /* ── 3.3 节点 ── */
180
- --mermaid-node-fill: var(--gray-3);
181
- --mermaid-node-bkg: var(--gray-2);
182
- --mermaid-node-stroke: var(--gray-8);
183
- --mermaid-node-stroke-width: 1px;
184
- --mermaid-node-text: var(--seed-ink);
185
-
186
- /* ── 3.4 连线 ── */
187
- --mermaid-edge-stroke: var(--gray-8);
188
- --mermaid-edge-stroke-width: 1px;
189
-
190
- /* ── 3.5 聚类 ── */
191
- --mermaid-cluster-fill: var(--gray-1);
192
- --mermaid-cluster-stroke: var(--gray-7);
193
-
194
- /* ── 3.6 标签 ── */
195
- --mermaid-label-text: var(--seed-ink);
196
- --mermaid-edge-label-text: var(--seed-ink);
197
- --mermaid-edge-label-bg: var(--seed-surface);
198
-
199
- /* ── 3.7 标题 & 坐标轴 ── */
200
- --mermaid-title-text: var(--seed-ink);
201
- --mermaid-axis-text: var(--gray-7);
202
- --mermaid-highlight: var(--gray-8);
203
-
204
- /* ── 3.8 人物节点 ── */
205
- --mermaid-person-stroke: var(--gray-8);
206
- --mermaid-person-bkg: var(--gray-2);
207
-
208
- /* ── 3.9 偏移 ── */
209
- --mermaid-label-offset-y: 0px;
210
-
211
- /* ── 3.10 灰度色板(多系列区分) ── */
212
- --mermaid-cscale0: var(--gray-6);
213
- --mermaid-cscale1: var(--gray-7);
214
- --mermaid-cscale2: var(--gray-6);
215
- --mermaid-cscale3: var(--gray-8);
216
- --mermaid-cscale4: var(--gray-6);
217
- --mermaid-cscale5: var(--gray-7);
218
- --mermaid-cscale6: var(--gray-8);
219
- --mermaid-cscale7: var(--gray-6);
220
- --mermaid-cscale8: var(--gray-7);
221
- --mermaid-cscale9: var(--gray-6);
222
- --mermaid-cscale10: var(--gray-8);
223
- --mermaid-cscale11: var(--gray-7);
224
- }
225
-
226
- /* ═══════════════════════════════════════════════════════════
227
- SECTION 4 — 排版微调变量
228
- ═══════════════════════════════════════════════════════════ */
229
-
230
- body.theme-custom {
231
- --line-height-base: var(--line-height-body);
232
- }
233
-
234
- pre {
235
- --select-text-bg-color: rgba(0, 0, 0, 0.12);
236
- --select-text-font-color: var(--seed-ink);
237
- }
238
-
239
- /* ═══════════════════════════════════════════════════════════════
240
- SECTION 5 — 选择器级微调 (Selector Fine-Tuning)
241
- ═══════════════════════════════════════════════════════════════ */
242
-
243
- /* ── 5.1 全局:纯白底 + 宋体 + 两端对齐 ── */
244
- html { font-size: var(--font-size-root); -webkit-font-smoothing: antialiased; }
245
-
246
- body.theme-custom, html, body {
247
- background-color: var(--bg-color);
248
- color: var(--text-color);
249
- font-family: var(--font-body);
250
- line-height: var(--line-height-body);
251
- text-align: justify;
252
- }
253
-
254
- body.theme-custom #editor { max-width: var(--content-width); margin: 0 auto; padding: var(--page-margin-top) var(--page-margin-right) var(--page-margin-bottom) var(--page-margin-left); }
255
- #write { max-width: var(--content-width); margin: 0 auto; padding: 0; }
256
- #write > ul:first-child, #write > ol:first-child { margin-top: 30px; }
257
-
258
- /* ── 5.2 标题:黑体,GB/T 7713 学术论文规范 ── */
259
- h1, h2, h3, h4, h5, h6,
260
- body.theme-custom h1, body.theme-custom h2, body.theme-custom h3,
261
- body.theme-custom h4, body.theme-custom h5, body.theme-custom h6 {
262
- position: relative;
263
- color: var(--heading-color);
264
- font-family: var(--font-heading);
265
- font-weight: 700;
266
- line-height: var(--line-height-heading);
267
- text-indent: 0;
268
- }
269
-
270
- body.theme-custom h1 {
271
- font-size: calc(var(--font-size-root) * var(--font-scale-h1));
272
- text-align: center;
273
- margin-top: 32px;
274
- margin-bottom: 24px;
275
- }
276
-
277
- body.theme-custom h2 {
278
- font-size: calc(var(--font-size-root) * var(--font-scale-h2));
279
- margin-top: 26px;
280
- margin-bottom: 14px;
281
- }
282
-
283
- body.theme-custom h3 {
284
- font-size: calc(var(--font-size-root) * var(--font-scale-h3));
285
- margin-top: 18px;
286
- margin-bottom: 10px;
287
- }
288
-
289
- body.theme-custom h4 {
290
- font-size: calc(var(--font-size-root) * var(--font-scale-h4));
291
- margin-top: 18px;
292
- margin-bottom: 8px;
293
- }
294
-
295
- body.theme-custom h5 {
296
- font-size: calc(var(--font-size-root) * var(--font-scale-h5));
297
- margin-top: 16px;
298
- margin-bottom: 6px;
299
- }
300
-
301
- body.theme-custom h6 {
302
- font-size: calc(var(--font-size-root) * var(--font-scale-h6));
303
- color: var(--text-muted);
304
- margin-top: 14px;
305
- margin-bottom: 6px;
306
- }
307
-
308
- h1:hover a.anchor, h2:hover a.anchor, h3:hover a.anchor,
309
- h4:hover a.anchor, h5:hover a.anchor, h6:hover a.anchor { text-decoration: none; }
310
-
311
- /* ── 5.3 正文:宋体,首行缩进 2em ── */
312
- body.theme-custom p, body.theme-custom #write > p {
313
- margin: 0;
314
- line-height: var(--line-height-body);
315
- text-align: justify;
316
- text-indent: 2em;
317
- font-size: var(--font-size-root);
318
- }
319
- body.theme-custom p + p { margin-top: 0; }
320
-
321
- /* ── 5.4 内联元素 ── */
322
- strong, body.theme-custom strong { color: var(--text-color); font-weight: 700; }
323
- em, body.theme-custom em { font-style: italic; color: var(--text-color); }
324
- em strong, strong em, body.theme-custom em strong, body.theme-custom strong em { color: var(--text-color); font-weight: 700; }
325
-
326
- a, body.theme-custom a { color: var(--link-color); text-decoration: none; border-bottom: 1px solid var(--link-color); }
327
- a:hover, body.theme-custom a:hover { text-decoration: none; }
328
-
329
- u, body.theme-custom u {
330
- text-decoration: none;
331
- border-bottom: 1px solid var(--border-color);
332
- padding-bottom: 1px;
333
- }
334
-
335
- mark, body.theme-custom mark {
336
- background: var(--accent-light);
337
- color: var(--text-color);
338
- padding: 1px 4px;
339
- border-radius: var(--radius-sm);
340
- }
341
-
342
- del, s { color: var(--text-dim); }
343
-
344
- /* ── 5.5 引用块 ── */
345
- blockquote, body.theme-custom blockquote {
346
- margin: 10px 0;
347
- padding: 10px 16px 10px 20px;
348
- border-left: 3px solid var(--blockquote-border);
349
- background: var(--blockquote-bg);
350
- color: var(--text-color);
351
- font-family: var(--font-body);
352
- font-size: 14px;
353
- }
354
- blockquote p, body.theme-custom blockquote p { margin: 4px 0; text-indent: 0; }
355
-
356
- /* ── 5.6 分割线 ── */
357
- hr, body.theme-custom hr { border: none; border-top: 1px solid var(--hr-color); margin: 32px 0; height: 0; }
358
-
359
- /* ── 5.7 列表:GB/T 7713 学术论文规范 ── */
360
- body.theme-custom ul, body.theme-custom ol, body.theme-custom li { margin: 0; padding: 0; }
361
-
362
- body.theme-custom #editor .ProseMirror > ul,
363
- body.theme-custom #editor .ProseMirror > ol,
364
- body.theme-custom #write > ul:first-of-type,
365
- body.theme-custom #write > ol:first-of-type {
366
- margin: 6px 0 6px 2em;
367
- padding-left: 1.5em;
368
- list-style: none;
369
- counter-reset: ol-lv1 ul-lv1;
370
- }
371
-
372
- body.theme-custom ul ul, body.theme-custom ul ol,
373
- body.theme-custom ol ul, body.theme-custom ol ol {
374
- margin: 0;
375
- padding-left: 1.5em;
376
- list-style: none;
377
- }
378
-
379
- body.theme-custom li {
380
- line-height: 1.6;
381
- font-family: var(--font-body);
382
- font-size: var(--font-size-root);
383
- font-weight: normal;
384
- text-indent: 0;
385
- list-style: none;
386
- padding: 2px 0;
387
- }
388
-
389
- body.theme-custom li::before { content: ""; display: inline; margin-right: 0.35em; }
390
-
391
- /* ProseMirror li > p 内联化 */
392
- body.theme-custom #editor .ProseMirror li > p {
393
- display: inline;
394
- margin: 0;
395
- padding: 0;
396
- text-indent: 0;
397
- font-size: inherit;
398
- font-weight: inherit;
399
- font-family: inherit;
400
- }
401
-
402
- body.theme-custom li strong { font-family: inherit; font-weight: 700; }
403
-
404
- /* 有序列表:1. → (1) → ① → i. */
405
- body.theme-custom ol > li { counter-increment: ol-lv1; }
406
- body.theme-custom ol > li::before { content: counter(ol-lv1) "."; font-family: var(--font-body); }
407
-
408
- body.theme-custom ol > li > ol { counter-reset: ol-lv2; }
409
- body.theme-custom ol > li > ol > li { counter-increment: ol-lv2; }
410
- body.theme-custom ol > li > ol > li::before { content: "(" counter(ol-lv2) ")"; font-family: var(--font-body); }
411
-
412
- body.theme-custom ol > li > ol > li > ol { counter-reset: ol-lv3; }
413
- body.theme-custom ol > li > ol > li > ol > li { counter-increment: ol-lv3; }
414
- body.theme-custom ol > li > ol > li > ol > li::before { content: counter(ol-lv3, cjk-ideographic) ""; font-family: var(--font-body); }
415
-
416
- body.theme-custom ol ol ol ol > li::before { content: counter(list-item, lower-roman) "."; font-family: var(--font-body); }
417
-
418
- /* 无序列表:■ → ● → ○ → ◆ */
419
- body.theme-custom ul > li { counter-increment: ul-lv1; }
420
- body.theme-custom ul > li::before { content: "\25A0\00A0"; }
421
-
422
- body.theme-custom ul > li > ul { counter-reset: ul-lv2; }
423
- body.theme-custom ul > li > ul > li { counter-increment: ul-lv2; }
424
- body.theme-custom ul > li > ul > li::before { content: "\25CF\00A0"; }
425
-
426
- body.theme-custom ul > li > ul > li > ul { counter-reset: ul-lv3; }
427
- body.theme-custom ul > li > ul > li > ul > li { counter-increment: ul-lv3; }
428
- body.theme-custom ul > li > ul > li > ul > li::before { content: "\25CB\00A0"; }
429
-
430
- body.theme-custom ul ul ul ul > li::before { content: "\25C6\00A0"; }
431
-
432
- /* 混合嵌套 */
433
- body.theme-custom ul > li > ol { counter-reset: ol-mix2; }
434
- body.theme-custom ul > li > ol > li { counter-increment: ol-mix2; }
435
- body.theme-custom ul > li > ol > li::before { content: "(" counter(ol-mix2) ")"; font-family: var(--font-body); }
436
- body.theme-custom ul > li > ol > li > ol { counter-reset: ol-mix3; }
437
- body.theme-custom ul > li > ol > li > ol > li { counter-increment: ol-mix3; }
438
- body.theme-custom ul > li > ol > li > ol > li::before { content: counter(ol-mix3, lower-roman) "."; font-family: var(--font-body); }
439
-
440
- body.theme-custom ol > li > ul { counter-reset: ul-mix2; }
441
- body.theme-custom ol > li > ul > li { counter-increment: ul-mix2; }
442
- body.theme-custom ol > li > ul > li::before { content: "\25CF\00A0"; }
443
- body.theme-custom ol > li > ul > li > ul { counter-reset: ul-mix3; }
444
- body.theme-custom ol > li > ul > li > ul > li { counter-increment: ul-mix3; }
445
- body.theme-custom ol > li > ul > li > ul > li::before { content: "\25CB\00A0"; }
446
-
447
- .md-task-list-item > input { margin-left: -1.3em; margin-top: 0.3em; }
448
-
449
- /* ── 5.8 内联代码 ── */
450
- code, tt, body.theme-custom code, body.theme-custom tt {
451
- font-family: var(--font-code);
452
- font-size: 0.88em;
453
- padding: 1px 6px;
454
- margin: 0 1px;
455
- background: var(--code-bg);
456
- border-radius: var(--radius-sm);
457
- color: var(--code-color);
458
- border: none;
459
- }
460
-
461
- /* ── 5.9 代码块 ── */
462
- pre.md-fences {
463
- font-family: var(--font-code);
464
- font-size: 14px;
465
- line-height: var(--line-height-code);
466
- background: var(--code-block-bg);
467
- color: var(--code-block-text);
468
- padding: 14px 18px;
469
- border-radius: var(--radius-sm);
470
- margin: 16px 0;
471
- overflow-x: auto;
472
- border: 1px solid var(--border-color);
473
- }
474
- pre.md-fences code { background: transparent; color: inherit; padding: 0; margin: 0; border-radius: 0; border: none; }
475
-
476
- body.theme-custom #editor .ProseMirror pre {
477
- font-family: var(--font-code);
478
- font-size: 14px;
479
- line-height: var(--line-height-code);
480
- background: var(--code-block-bg) !important;
481
- color: var(--code-block-text) !important;
482
- padding: 14px 18px;
483
- border-radius: var(--radius-sm);
484
- margin: 16px 0;
485
- overflow-x: auto;
486
- border: 1px solid var(--border-color);
487
- }
488
- body.theme-custom #editor .ProseMirror pre code {
489
- background: transparent !important;
490
- color: var(--code-block-text) !important;
491
- padding: 0; margin: 0; border-radius: 0; border: none;
492
- }
493
-
494
- /* ── 5.10 代码语法高亮(黑白打印友好) ── */
495
- .cm-s-inner { font-family: var(--font-code); font-size: 14px; line-height: var(--line-height-code); }
496
-
497
- body.theme-custom .token.comment, body.theme-custom .token.prolog,
498
- body.theme-custom .token.doctype, body.theme-custom .token.cdata,
499
- .cm-s-inner .cm-comment, .cm-s-inner .cm-quote, .cm-s-inner .cm-hr { color: var(--text-dim); font-style: italic; }
500
-
501
- body.theme-custom .token.punctuation, .cm-s-inner .cm-meta { color: var(--text-muted); }
502
-
503
- body.theme-custom .token.keyword, body.theme-custom .token.important,
504
- body.theme-custom .token.selector, body.theme-custom .token.important,
505
- .cm-s-inner .cm-keyword, .cm-s-inner .cm-attribute { color: var(--text-color); font-weight: 700; }
506
-
507
- body.theme-custom .token.property, body.theme-custom .token.tag,
508
- body.theme-custom .token.boolean, body.theme-custom .token.number,
509
- body.theme-custom .token.constant, body.theme-custom .token.symbol,
510
- body.theme-custom .token.attr-name, .cm-s-inner .cm-property { color: var(--text-muted); }
511
-
512
- body.theme-custom .token.string, body.theme-custom .token.char,
513
- body.theme-custom .token.attr-value, .cm-s-inner .cm-string { color: var(--text-color); }
514
-
515
- body.theme-custom .token.regex, body.theme-custom .token.variable,
516
- .cm-s-inner .cm-variable-2, .cm-s-inner .cm-variable-3 { color: var(--text-muted); }
517
-
518
- body.theme-custom .token.operator, body.theme-custom .token.entity,
519
- body.theme-custom .token.url, .cm-s-inner .cm-operator { color: var(--text-color); }
520
-
521
- body.theme-custom .token.atrule, body.theme-custom .token.attr-value,
522
- .cm-s-inner .cm-atom, .cm-s-inner .cm-number { color: var(--text-muted); }
523
-
524
- body.theme-custom .token.function, .cm-s-inner .cm-def { color: var(--text-color); font-weight: 700; }
525
-
526
- body.theme-custom .token.class-name, .cm-s-inner .cm-variable { color: var(--text-color); }
527
-
528
- body.theme-custom .token.deleted { color: var(--text-dim); }
529
- body.theme-custom .token.inserted { color: var(--text-color); }
530
-
531
- /* ── 5.11 表格:三线表规范 ── */
532
- body.theme-custom table {
533
- width: 100%;
534
- border-collapse: collapse;
535
- border-top: 2px solid var(--table-border);
536
- border-bottom: 2px solid var(--table-border);
537
- border-left: none;
538
- border-right: none;
539
- font-size: 14px;
540
- line-height: 1.5;
541
- margin: 18px auto;
542
- }
543
-
544
- body.theme-custom table th {
545
- border: none;
546
- border-bottom: 2px solid var(--table-border);
547
- background: var(--table-header-bg);
548
- font-family: var(--font-heading);
549
- font-size: 14px;
550
- font-weight: 700;
551
- color: var(--table-header-text);
552
- padding: 8px 10px;
553
- text-align: center;
554
- text-indent: 0;
555
- vertical-align: middle;
556
- }
557
-
558
- body.theme-custom table td {
559
- border: none;
560
- font-family: var(--font-body);
561
- font-size: 14px;
562
- color: var(--text-color);
563
- padding: 8px 10px;
564
- text-align: left;
565
- text-indent: 0;
566
- vertical-align: top;
567
- }
568
-
569
- body.theme-custom table p, body.theme-custom table td p {
570
- font-family: var(--font-body);
571
- font-size: 14px;
572
- margin: 0;
573
- padding: 0;
574
- text-align: left;
575
- text-indent: 0;
576
- line-height: 1.4;
577
- }
578
-
579
- body.theme-custom table strong { font-weight: 700; font-family: inherit; }
580
-
581
- /* ── 5.12 图片 ── */
582
- body.theme-custom img { max-width: 100%; border-radius: var(--radius-sm); }
583
- body.theme-custom .md-image { margin: 16px 0; text-align: center; }
584
- body.theme-custom .md-image img { max-width: 100%; height: auto; }
585
- body.theme-custom .md-image .md-image-caption { font-size: 14px; color: var(--text-muted); margin-top: 8px; text-align: center; }
586
-
587
- /* ── 5.13 数学公式 ── */
588
- body.theme-custom .math-inline, body.theme-custom .math-block {
589
- color: var(--text-color);
590
- font-family: "Times New Roman", "SimSun", serif;
591
- }
592
-
593
- body.theme-custom .math-block {
594
- margin: 16px 0;
595
- text-align: center;
596
- overflow-x: auto;
597
- }
598
-
599
- /* ── 5.14 Mermaid 图表 ── */
600
- body.theme-custom .mermaid-block,
601
- body.theme-custom .mermaid-preview,
602
- .md-diagram-panel.md-mermaid {
603
- background: var(--mermaid-background);
604
- border: 1px solid var(--mermaid-border-color);
605
- border-radius: var(--mermaid-border-radius);
606
- padding: var(--mermaid-padding);
607
- margin: 16px 0;
608
- font-family: var(--mermaid-font-family);
609
- font-size: var(--mermaid-font-size);
610
- }
611
-
612
- body.theme-custom .mermaid-preview svg { max-width: 100%; height: auto; }
613
-
614
- body.theme-custom .mermaid-block + p {
615
- font-family: var(--font-body);
616
- font-size: 14px;
617
- text-align: center;
618
- color: var(--text-color);
619
- margin-top: 8px;
620
- }
621
-
622
- /* ── 5.15 脚注 ── */
623
- body.theme-custom .footnotes {
624
- border-top: 1px solid var(--border-color);
625
- font-size: 12px;
626
- margin-top: 32px;
627
- padding-top: 16px;
628
- }
629
-
630
- body.theme-custom .footnotes .footnote { margin: 8px 0; }
631
- body.theme-custom .footnotes .footnote-ref { font-size: 12px; }
632
-
633
- /* ── 5.16 响应式 ── */
634
- @media only screen and (max-width: 768px) {
635
- body.theme-custom #editor { padding: 20px; }
636
- body.theme-custom h1 { font-size: calc(var(--font-size-root) * 1.25); }
637
- body.theme-custom h2 { font-size: calc(var(--font-size-root) * 1.1); }
638
- body.theme-custom .mermaid-block { padding: 12px; }
639
- body.theme-custom .mermaid-preview svg { max-width: 100% !important; height: auto !important; }
640
- }
641
-
642
- /* ═══════════════════════════════════════════════════════════════
643
- SECTION 6 — 打印 / 导出
644
- 原则:屏幕样式的完整镜像。每个屏幕属性都必须在 print 中显式声明。
645
- 学术论文印刷:保留黑体标题 + 宋体正文 + 三线表 + 纯白底色
646
- ═══════════════════════════════════════════════════════════════ */
647
- @media print {
648
- @page {
649
- size: A4;
650
- margin: 25mm 25mm 25mm 30mm;
651
-
652
- @bottom-center {
653
- content: counter(page);
654
- font-family: "SimSun", "Songti SC", serif;
655
- font-size: 12px;
656
- color: var(--gray-9);
657
- }
658
- }
659
-
660
- /* ── 6.0 变量重声明 ── */
661
- body.theme-custom {
662
- --seed-surface: #ffffff;
663
- --seed-panel: #f5f5f5;
664
- --seed-panel-alt: #fafafa;
665
- --seed-ink: #111111;
666
- --seed-ink-muted: #333333;
667
- --seed-ink-dim: #666666;
668
- --seed-border: #111111;
669
- --seed-border-light: #cccccc;
670
- --gray-0: #ffffff;
671
- --gray-1: #fafafa;
672
- --gray-2: #f5f5f5;
673
- --gray-3: #eeeeee;
674
- --gray-4: #e0e0e0;
675
- --gray-5: #cccccc;
676
- --gray-6: #999999;
677
- --gray-7: #666666;
678
- --gray-8: #333333;
679
- --gray-9: #111111;
680
- --font-size-root: 16px;
681
- --line-height-body: 1.5;
682
- --line-height-heading: 1.35;
683
- --line-height-code: 1.5;
684
- --font-scale-h1: 1.375;
685
- --font-scale-h2: 1.125;
686
- --font-scale-h3: 1.0;
687
- --font-scale-h4: 1.0;
688
- --font-scale-h5: 0.875;
689
- --font-scale-h6: 0.875;
690
- --content-width: 210mm;
691
- --font-size-mermaid: 12px;
692
- --radius-sm: 0px;
693
- --radius-md: 0px;
694
- --radius-lg: 0px;
695
- --page-margin-top: 25mm;
696
- --page-margin-bottom: 25mm;
697
- --page-margin-left: 30mm;
698
- --page-margin-right: 25mm;
699
- --bg-color: var(--seed-surface);
700
- --surface-color: var(--seed-panel);
701
- --surface-alt: var(--seed-panel-alt);
702
- --text-color: var(--seed-ink);
703
- --heading-color: var(--seed-ink);
704
- --text-muted: var(--seed-ink-muted);
705
- --text-dim: var(--seed-ink-dim);
706
- --link-color: var(--seed-ink);
707
- --accent-color: var(--seed-ink);
708
- --accent-dark: var(--seed-ink);
709
- --accent-light: var(--gray-4);
710
- --selection-bg: rgba(0, 0, 0, 0.12);
711
- --border-color: var(--seed-border);
712
- --blockquote-border: var(--seed-ink);
713
- --hr-color: var(--seed-ink);
714
- --code-bg: var(--gray-3);
715
- --code-color: var(--seed-ink);
716
- --code-block-bg: var(--seed-panel);
717
- --code-block-text: var(--seed-ink);
718
- --code-block-color: var(--seed-ink);
719
- --blockquote-bg: var(--seed-panel-alt);
720
- --table-header-bg: transparent;
721
- --table-header-text: var(--seed-ink);
722
- --table-border: var(--seed-ink);
723
- --scrollbar-thumb: var(--gray-5);
724
- --scrollbar-thumb-hover: var(--gray-6);
725
- --font-body: "SimSun", "Songti SC", "Source Han Serif SC", "Noto Serif SC",
726
- Georgia, "Times New Roman", serif;
727
- --font-heading: "SimHei", "Heiti SC", "Source Han Sans SC", "Noto Sans SC",
728
- "Microsoft YaHei", "Arial", sans-serif;
729
- --font-code: "Courier New", "Consolas", "Source Code Pro", monospace;
730
- --font-mermaid: var(--font-heading);
731
- --mermaid-background: var(--seed-surface);
732
- --mermaid-border-color: var(--gray-5);
733
- --mermaid-border-radius: var(--radius-md);
734
- --mermaid-padding: 20px;
735
- --mermaid-font-family: var(--font-mermaid);
736
- --mermaid-font-size: var(--font-size-mermaid);
737
- --mermaid-node-fill: var(--gray-3);
738
- --mermaid-node-bkg: var(--gray-2);
739
- --mermaid-node-stroke: var(--gray-8);
740
- --mermaid-node-stroke-width: 1px;
741
- --mermaid-node-text: var(--seed-ink);
742
- --mermaid-edge-stroke: var(--gray-8);
743
- --mermaid-edge-stroke-width: 1px;
744
- --mermaid-cluster-fill: var(--gray-1);
745
- --mermaid-cluster-stroke: var(--gray-7);
746
- --mermaid-label-text: var(--seed-ink);
747
- --mermaid-edge-label-text: var(--seed-ink);
748
- --mermaid-edge-label-bg: var(--seed-surface);
749
- --mermaid-title-text: var(--seed-ink);
750
- --mermaid-axis-text: var(--gray-7);
751
- --mermaid-highlight: var(--gray-8);
752
- --mermaid-person-stroke: var(--gray-8);
753
- --mermaid-person-bkg: var(--gray-2);
754
- --mermaid-label-offset-y: 0px;
755
- --mermaid-cscale0: var(--gray-6);
756
- --mermaid-cscale1: var(--gray-7);
757
- --mermaid-cscale2: var(--gray-6);
758
- --mermaid-cscale3: var(--gray-8);
759
- --mermaid-cscale4: var(--gray-6);
760
- --mermaid-cscale5: var(--gray-7);
761
- --mermaid-cscale6: var(--gray-8);
762
- --mermaid-cscale7: var(--gray-6);
763
- --mermaid-cscale8: var(--gray-7);
764
- --mermaid-cscale9: var(--gray-6);
765
- --mermaid-cscale10: var(--gray-8);
766
- --mermaid-cscale11: var(--gray-7);
767
- }
768
-
769
- /* ── 6.1 根元素:字号 + 宋体 + 两端对齐 + 底色 ── */
770
- html { font-size: var(--font-size-root) !important; }
771
- html, body, body.theme-custom {
772
- background: var(--seed-surface) !important;
773
- color: var(--seed-ink) !important;
774
- font-family: var(--font-body) !important;
775
- font-size: var(--font-size-root) !important;
776
- line-height: var(--line-height-body) !important;
777
- text-align: justify !important;
778
- -webkit-print-color-adjust: exact !important;
779
- print-color-adjust: exact !important;
780
- }
781
-
782
- /* ── 6.2 编辑区 ── */
783
- #titlebar, #slides-btn, #agent-dot { display: none !important; }
784
- #editor { height: auto !important; overflow: visible !important; padding: 0 !important; }
785
- #write { max-width: none !important; padding: 0 !important; margin: 0 !important; }
786
-
787
- /* ── 6.3 标题:黑体,GB/T 7713 学术论文规范 ── */
788
- body.theme-custom h1, body.theme-custom h2, body.theme-custom h3,
789
- body.theme-custom h4, body.theme-custom h5, body.theme-custom h6 {
790
- font-family: var(--font-heading) !important;
791
- color: var(--heading-color) !important;
792
- font-weight: 700 !important;
793
- line-height: var(--line-height-heading) !important;
794
- text-indent: 0 !important;
795
- border-bottom: none !important;
796
- padding-bottom: 0 !important;
797
- -webkit-print-color-adjust: exact !important;
798
- print-color-adjust: exact !important;
799
- }
800
-
801
- body.theme-custom h1 {
802
- font-size: calc(var(--font-size-root) * var(--font-scale-h1)) !important;
803
- text-align: center !important;
804
- margin-top: 32px !important;
805
- margin-bottom: 24px !important;
806
- }
807
-
808
- body.theme-custom h2 {
809
- font-size: calc(var(--font-size-root) * var(--font-scale-h2)) !important;
810
- margin-top: 26px !important;
811
- margin-bottom: 14px !important;
812
- }
813
-
814
- body.theme-custom h3 {
815
- font-size: calc(var(--font-size-root) * var(--font-scale-h3)) !important;
816
- margin-top: 18px !important;
817
- margin-bottom: 10px !important;
818
- }
819
-
820
- body.theme-custom h4 {
821
- font-size: calc(var(--font-size-root) * var(--font-scale-h4)) !important;
822
- margin-top: 18px !important;
823
- margin-bottom: 8px !important;
824
- }
825
-
826
- body.theme-custom h5 {
827
- font-size: calc(var(--font-size-root) * var(--font-scale-h5)) !important;
828
- margin-top: 16px !important;
829
- margin-bottom: 6px !important;
830
- }
831
-
832
- body.theme-custom h6 {
833
- font-size: calc(var(--font-size-root) * var(--font-scale-h6)) !important;
834
- color: var(--text-muted) !important;
835
- margin-top: 14px !important;
836
- margin-bottom: 6px !important;
837
- }
838
-
839
- /* ── 6.4 正文:宋体,首行缩进 2em ── */
840
- body.theme-custom p {
841
- font-family: var(--font-body) !important;
842
- color: var(--text-color) !important;
843
- font-size: var(--font-size-root) !important;
844
- text-indent: 2em !important;
845
- line-height: var(--line-height-body) !important;
846
- text-align: justify !important;
847
- margin: 0 !important;
848
- }
849
-
850
- /* ── 6.5 内联强调 ── */
851
- body.theme-custom strong {
852
- color: var(--text-color) !important;
853
- font-weight: 700 !important;
854
- -webkit-print-color-adjust: exact !important;
855
- print-color-adjust: exact !important;
856
- }
857
- body.theme-custom em {
858
- font-style: italic !important;
859
- color: var(--text-color) !important;
860
- }
861
-
862
- /* ── 6.6 链接 ── */
863
- body.theme-custom a {
864
- color: var(--link-color) !important;
865
- text-decoration: none !important;
866
- border-bottom: 1px solid var(--link-color) !important;
867
- }
868
-
869
- /* ── 6.7 引用块 ── */
870
- body.theme-custom blockquote {
871
- background: var(--blockquote-bg) !important;
872
- border-left: 3px solid var(--blockquote-border) !important;
873
- color: var(--text-color) !important;
874
- font-family: var(--font-body) !important;
875
- font-size: 14px !important;
876
- margin: 10px 0 !important;
877
- padding: 10px 16px 10px 20px !important;
878
- -webkit-print-color-adjust: exact !important;
879
- print-color-adjust: exact !important;
880
- }
881
- body.theme-custom blockquote p {
882
- margin: 4px 0 !important;
883
- text-indent: 0 !important;
884
- }
885
-
886
- /* ── 6.8 分割线 ── */
887
- body.theme-custom hr {
888
- border: none !important;
889
- border-top: 1px solid var(--hr-color) !important;
890
- margin: 32px 0 !important;
891
- }
892
-
893
- /* ── 6.9 列表:GB/T 7713 学术论文规范 ── */
894
- body.theme-custom ul, body.theme-custom ol {
895
- margin: 6px 0 6px 2em !important;
896
- padding-left: 1.5em !important;
897
- list-style: none !important;
898
- }
899
- body.theme-custom ul ul, body.theme-custom ul ol,
900
- body.theme-custom ol ul, body.theme-custom ol ol {
901
- margin: 0 !important;
902
- padding-left: 1.5em !important;
903
- list-style: none !important;
904
- }
905
-
906
- body.theme-custom li {
907
- font-family: var(--font-body) !important;
908
- font-size: var(--font-size-root) !important;
909
- line-height: 1.6 !important;
910
- color: var(--text-color) !important;
911
- text-indent: 0 !important;
912
- list-style: none !important;
913
- padding: 2px 0 !important;
914
- }
915
- body.theme-custom li > p {
916
- display: inline !important;
917
- margin: 0 !important;
918
- padding: 0 !important;
919
- text-indent: 0 !important;
920
- }
921
- body.theme-custom li strong {
922
- font-family: inherit !important;
923
- font-weight: 700 !important;
924
- }
925
- body.theme-custom li::before {
926
- display: inline !important;
927
- margin-right: 0.35em !important;
928
- }
929
-
930
- body.theme-custom ol { counter-reset: ol-lv1 !important; }
931
- body.theme-custom ol > li { counter-increment: ol-lv1 !important; }
932
- body.theme-custom ol > li::before { content: counter(ol-lv1) "." !important; }
933
- body.theme-custom ol > li > ol { counter-reset: ol-lv2 !important; }
934
- body.theme-custom ol > li > ol > li { counter-increment: ol-lv2 !important; }
935
- body.theme-custom ol > li > ol > li::before { content: "(" counter(ol-lv2) ")" !important; }
936
- body.theme-custom ol > li > ol > li > ol { counter-reset: ol-lv3 !important; }
937
- body.theme-custom ol > li > ol > li > ol > li { counter-increment: ol-lv3 !important; }
938
- body.theme-custom ol > li > ol > li > ol > li::before { content: counter(ol-lv3, cjk-ideographic) "" !important; }
939
-
940
- body.theme-custom ul { counter-reset: ul-lv1 !important; }
941
- body.theme-custom ul > li { counter-increment: ul-lv1 !important; }
942
- body.theme-custom ul > li::before { content: "\25A0\00A0" !important; }
943
- body.theme-custom ul > li > ul { counter-reset: ul-lv2 !important; }
944
- body.theme-custom ul > li > ul > li { counter-increment: ul-lv2 !important; }
945
- body.theme-custom ul > li > ul > li::before { content: "\25CF\00A0" !important; }
946
- body.theme-custom ul > li > ul > li > ul { counter-reset: ul-lv3 !important; }
947
- body.theme-custom ul > li > ul > li > ul > li { counter-increment: ul-lv3 !important; }
948
- body.theme-custom ul > li > ul > li > ul > li::before { content: "\25CB\00A0" !important; }
949
- body.theme-custom ul ul ul ul > li::before { content: "\25C6\00A0" !important; }
950
-
951
- /* ── 6.10 内联代码 ── */
952
- body.theme-custom code {
953
- background: var(--code-bg) !important;
954
- color: var(--code-color) !important;
955
- border: none !important;
956
- border-radius: 0 !important;
957
- padding: 1px 6px !important;
958
- font-family: var(--font-code) !important;
959
- font-size: 0.88em !important;
960
- -webkit-print-color-adjust: exact !important;
961
- print-color-adjust: exact !important;
962
- }
963
-
964
- /* ── 6.11 代码块 ── */
965
- body.theme-custom pre {
966
- background: var(--code-block-bg) !important;
967
- color: var(--code-block-text) !important;
968
- border: 1px solid var(--border-color) !important;
969
- border-radius: 0 !important;
970
- font-size: 14px !important;
971
- line-height: var(--line-height-code) !important;
972
- font-family: var(--font-code) !important;
973
- padding: 14px 18px !important;
974
- margin: 16px 0 !important;
975
- -webkit-print-color-adjust: exact !important;
976
- print-color-adjust: exact !important;
977
- }
978
- body.theme-custom pre code {
979
- background: transparent !important;
980
- color: inherit !important;
981
- border: none !important;
982
- padding: 0 !important;
983
- margin: 0 !important;
984
- border-radius: 0 !important;
985
- }
986
-
987
- /* ── 6.12 表格:三线表规范 ── */
988
- body.theme-custom table {
989
- width: 100% !important;
990
- border-collapse: collapse !important;
991
- border-top: 2px solid var(--table-border) !important;
992
- border-bottom: 2px solid var(--table-border) !important;
993
- border-left: none !important;
994
- border-right: none !important;
995
- font-size: 14px !important;
996
- line-height: 1.5 !important;
997
- margin: 18px auto !important;
998
- }
999
- body.theme-custom table th {
1000
- border: none !important;
1001
- border-bottom: 2px solid var(--table-border) !important;
1002
- background: var(--table-header-bg) !important;
1003
- -webkit-print-color-adjust: exact !important;
1004
- print-color-adjust: exact !important;
1005
- font-family: var(--font-heading) !important;
1006
- font-size: 14px !important;
1007
- font-weight: 700 !important;
1008
- color: var(--table-header-text) !important;
1009
- padding: 8px 10px !important;
1010
- text-align: center !important;
1011
- text-indent: 0 !important;
1012
- vertical-align: middle !important;
1013
- }
1014
- body.theme-custom table td {
1015
- border: none !important;
1016
- font-family: var(--font-body) !important;
1017
- font-size: 14px !important;
1018
- color: var(--text-color) !important;
1019
- padding: 8px 10px !important;
1020
- text-align: left !important;
1021
- text-indent: 0 !important;
1022
- vertical-align: top !important;
1023
- }
1024
- body.theme-custom table p, body.theme-custom table td p {
1025
- font-family: var(--font-body) !important;
1026
- font-size: 14px !important;
1027
- margin: 0 !important;
1028
- padding: 0 !important;
1029
- text-align: left !important;
1030
- text-indent: 0 !important;
1031
- line-height: 1.4 !important;
1032
- }
1033
- body.theme-custom table strong {
1034
- font-weight: 700 !important;
1035
- font-family: inherit !important;
1036
- }
1037
-
1038
- /* ── 6.13 数学公式 ── */
1039
- body.theme-custom .math-inline, body.theme-custom .math-block {
1040
- color: var(--text-color) !important;
1041
- -webkit-print-color-adjust: exact !important;
1042
- print-color-adjust: exact !important;
1043
- }
1044
-
1045
- /* ── 6.14 Mermaid 图表 ── */
1046
- body.theme-custom .mermaid-block,
1047
- body.theme-custom .mermaid-preview,
1048
- .md-diagram-panel.md-mermaid {
1049
- background: var(--mermaid-background) !important;
1050
- border: 1px solid var(--mermaid-border-color) !important;
1051
- border-radius: 0 !important;
1052
- -webkit-print-color-adjust: exact !important;
1053
- print-color-adjust: exact !important;
1054
- }
1055
- body.theme-custom .mermaid-preview svg,
1056
- body.theme-custom .mermaid-preview svg * {
1057
- -webkit-print-color-adjust: exact !important;
1058
- print-color-adjust: exact !important;
1059
- }
1060
- body.theme-custom .mermaid-block + p {
1061
- font-family: var(--font-body) !important;
1062
- font-size: 14px !important;
1063
- text-align: center !important;
1064
- color: var(--text-color) !important;
1065
- }
1066
-
1067
- /* ── 6.15 脚注 ── */
1068
- body.theme-custom .footnotes {
1069
- border-top: 1px solid var(--border-color) !important;
1070
- font-size: 12px !important;
1071
- }
1072
-
1073
- /* ── 6.16 分页控制 ── */
1074
- body.theme-custom h1 { page-break-before: avoid; }
1075
- body.theme-custom h2, body.theme-custom h3, body.theme-custom h4,
1076
- body.theme-custom h5, body.theme-custom h6 { page-break-after: avoid; }
1077
- body.theme-custom table, body.theme-custom figure, body.theme-custom img { page-break-inside: avoid; }
1078
- body.theme-custom p { orphans: 3; widows: 3; }
1079
-
1080
- /* ── 6.17 防止内容溢出 ── */
1081
- body.theme-custom pre, body.theme-custom .md-fences,
1082
- body.theme-custom .mermaid-block, body.theme-custom .md-diagram-panel {
1083
- overflow: visible !important;
1084
- white-space: pre-wrap !important;
1085
- word-wrap: break-word !important;
1086
- }
1087
- }
1088
-
1089
- /* ── 5.17 滚动条 ── */
1090
- body.theme-custom { scrollbar-width: auto; scrollbar-color: var(--scrollbar-thumb); }
1091
-
1092
- /* ── 5.18 源码编辑模式 ── */
1093
- body.theme-custom #source-editor {
1094
- font-family: var(--font-code);
1095
- font-size: var(--font-size-root);
1096
- line-height: var(--line-height-code);
1097
- background: var(--bg-color);
1098
- color: var(--text-color);
1099
- }
1
+ /*
2
+ * ColaMD Theme: academic-paper
3
+ * 学术论文(GB/T 7713)— 纯白底、近黑正文、宋体正文 + 黑体标题、三线表、直角
4
+ * 契约:ColaMD Extend 2.7(CodeMirror 6 + Pele)
5
+ *
6
+ * 变量一律写在 :root;编辑器里没有 <h1>/<blockquote> 元素,
7
+ * 标题是带类的一行,引用/代码块是每行一个 div(禁止纵向 padding)。
8
+ */
9
+
10
+ :root {
11
+ /* ── 1.1 Seed Palette — 灰度学术色板 ── */
12
+ --seed-accent: #111111;
13
+ --seed-accent-light: #e0e0e0;
14
+ --seed-accent-dark: #111111;
15
+ --seed-surface: #ffffff;
16
+ --seed-panel: #f5f5f5;
17
+ --seed-panel-alt: #eeeeee;
18
+ --seed-ink: #111111;
19
+ --seed-ink-muted: #333333;
20
+ --seed-ink-dim: #666666;
21
+ --seed-border: #cccccc;
22
+ --seed-border-strong: #111111;
23
+
24
+ /* ── 1.2 Semantic Colors(活变量)── */
25
+ --bg-color: var(--seed-surface);
26
+ --text-color: var(--seed-ink);
27
+ --text-secondary: var(--seed-ink-muted);
28
+ --text-muted: var(--seed-ink-dim);
29
+ --border-color: var(--seed-border);
30
+ --link-color: var(--seed-ink); /* 论文链接不漂色,黑字 + 下划线 */
31
+
32
+ --code-bg: var(--seed-panel-alt); /* 行内代码 #eeeeee */
33
+ --code-block-bg: var(--seed-panel); /* 代码块 #f5f5f5 */
34
+ --code-block-text: var(--seed-ink);
35
+
36
+ --blockquote-border: var(--seed-ink);
37
+ --blockquote-bg: #fafafa;
38
+ --table-header-bg: transparent; /* 三线表:表头不上底色 */
39
+
40
+ --selection-bg: rgba(0, 0, 0, 0.12);
41
+ --highlight-bg: var(--seed-accent-light);
42
+
43
+ /* ── 1.3 Typography & Metrics(活变量)── */
44
+ --font-body: "SimSun", "Songti SC", "Source Han Serif SC", "Noto Serif SC",
45
+ Georgia, "Times New Roman", serif;
46
+ --font-mono: "Courier New", "Consolas", "Source Code Pro", monospace;
47
+ --editor-font-size: 16px; /* 小四号 */
48
+ --editor-column-width: 794px; /* A4 版心列宽 */
49
+
50
+ /* ── 1.4 Pele 图表 — 白底黑线灰度,印刷友好 ── */
51
+ --pele-bg: var(--code-block-bg);
52
+ --pele-fg: var(--code-block-text);
53
+ --pele-muted: var(--seed-ink-dim);
54
+ --pele-line: var(--seed-ink);
55
+ --pele-surface: var(--seed-panel-alt);
56
+ --pele-surface-alt: var(--seed-accent-light);
57
+ --pele-border: var(--seed-ink);
58
+ --pele-accent: var(--seed-ink);
59
+ --pele-radius: 0px;
60
+ }
61
+
62
+ /* ═══════════════════════════════════════════════════════════
63
+ SECTION 2 — 编辑器 DOM(#editor .cm-content + .cm-md-*)
64
+ ═══════════════════════════════════════════════════════════ */
65
+
66
+ #editor .cm-content {
67
+ font-family: var(--font-body);
68
+ font-size: var(--editor-font-size);
69
+ line-height: 1.5;
70
+ text-align: justify;
71
+ }
72
+
73
+ /* ── 2.1 标题:黑体,严格层级,直角无装饰线 ── */
74
+ #editor .cm-content .cm-md-atxheading1,
75
+ #editor .cm-content .cm-md-atxheading2,
76
+ #editor .cm-content .cm-md-atxheading3,
77
+ #editor .cm-content .cm-md-atxheading4,
78
+ #editor .cm-content .cm-md-atxheading5,
79
+ #editor .cm-content .cm-md-atxheading6 {
80
+ font-family: "SimHei", "Heiti SC", "Source Han Sans SC", "Noto Sans SC",
81
+ "Microsoft YaHei", Arial, sans-serif;
82
+ color: var(--text-color);
83
+ font-weight: 700;
84
+ line-height: 1.35;
85
+ border-bottom: none;
86
+ padding-bottom: 0;
87
+ }
88
+
89
+ #editor .cm-content .cm-md-atxheading1 { font-size: 1.375em; text-align: center; margin: 32px 0 24px; }
90
+ #editor .cm-content .cm-md-atxheading2 { font-size: 1.125em; margin: 26px 0 14px; }
91
+ #editor .cm-content .cm-md-atxheading3 { font-size: 1em; margin: 18px 0 10px; }
92
+ #editor .cm-content .cm-md-atxheading4 { font-size: 1em; margin: 18px 0 8px; }
93
+ #editor .cm-content .cm-md-atxheading5 { font-size: 0.875em; margin: 16px 0 6px; }
94
+ #editor .cm-content .cm-md-atxheading6 { font-size: 0.875em; color: var(--text-muted); margin: 14px 0 6px; }
95
+
96
+ /* ── 2.2 行内强调 ── */
97
+ #editor .cm-content .cm-md-strong { color: var(--text-color); font-weight: 700; }
98
+ #editor .cm-content .cm-md-em { font-style: italic; }
99
+ #editor .cm-content .cm-md-strike { color: var(--text-muted); text-decoration: line-through; }
100
+ #editor .cm-content .cm-md-highlight { background: var(--highlight-bg); }
101
+
102
+ /* ── 2.3 链接:黑字 + 底横线 ── */
103
+ #editor .cm-content .cm-md-link {
104
+ color: var(--link-color);
105
+ text-decoration: none;
106
+ border-bottom: 1px solid var(--link-color);
107
+ }
108
+ #editor .cm-content .cm-md-url { color: var(--text-muted); }
109
+
110
+ #editor .cm-content .cm-md-inlinecode {
111
+ font-family: var(--font-mono);
112
+ font-size: 0.88em;
113
+ background: var(--code-bg);
114
+ color: var(--text-color);
115
+ border-radius: 0;
116
+ padding: 0 4px;
117
+ }
118
+
119
+ /* 标记字符(#、>、-、围栏)压淡,少抢正文注意力 */
120
+ #editor .cm-content .cm-md-marker,
121
+ #editor .cm-content .cm-md-quotemark,
122
+ #editor .cm-content .cm-md-listmark {
123
+ color: var(--text-muted);
124
+ font-family: var(--font-body);
125
+ }
126
+
127
+ /* ── 2.4 引用块:浅灰底 + 黑色左竖线(每行一个 div,只设左右内边距)── */
128
+ #editor .cm-content .cm-md-blockquote {
129
+ background: var(--blockquote-bg);
130
+ color: var(--text-color);
131
+ font-size: 0.875em;
132
+ border-left: 3px solid var(--blockquote-border);
133
+ padding-left: 20px;
134
+ padding-right: 16px;
135
+ }
136
+
137
+ /* ── 2.5 代码块:浅灰底 + 1px 细框,直角 ── */
138
+ #editor .cm-content .cm-md-codeblock {
139
+ background: var(--code-block-bg);
140
+ color: var(--code-block-text);
141
+ font-family: var(--font-mono);
142
+ font-size: 0.875em;
143
+ border-left: 1px solid var(--border-color);
144
+ border-right: 1px solid var(--border-color);
145
+ padding-left: 18px;
146
+ padding-right: 18px;
147
+ }
148
+ #editor .cm-content .cm-md-codeblock-first {
149
+ border-top: 1px solid var(--border-color);
150
+ border-top-left-radius: 0;
151
+ border-top-right-radius: 0;
152
+ }
153
+ #editor .cm-content .cm-md-codeblock-last {
154
+ border-bottom: 1px solid var(--border-color);
155
+ border-bottom-left-radius: 0;
156
+ border-bottom-right-radius: 0;
157
+ }
158
+
159
+ /* ── 2.6 表格:三线表(顶线 + 表头线 + 底线,无竖线)── */
160
+ #editor .cm-content .cm-md-table-widget table {
161
+ border-collapse: collapse;
162
+ border-top: 2px solid var(--text-color);
163
+ border-bottom: 2px solid var(--text-color);
164
+ }
165
+ #editor .cm-content .cm-md-table-widget th,
166
+ #editor .cm-content .cm-md-table-widget td {
167
+ border-left: none;
168
+ border-right: none;
169
+ font-size: 0.875em;
170
+ line-height: 1.5;
171
+ padding: 8px 10px;
172
+ }
173
+ #editor .cm-content .cm-md-table-widget th {
174
+ background: var(--table-header-bg);
175
+ font-family: "SimHei", "Heiti SC", "Source Han Sans SC", "Noto Sans SC",
176
+ "Microsoft YaHei", Arial, sans-serif;
177
+ font-weight: 700;
178
+ text-align: center;
179
+ border-bottom: 2px solid var(--text-color);
180
+ }
181
+ #editor .cm-content .cm-md-table-widget td { text-align: left; border-bottom: none; }
182
+
183
+ /* ── 2.7 分隔线 ── */
184
+ #editor .cm-content .cm-md-hr { border-top: 1px solid var(--text-color); margin: 32px 0; }
185
+
186
+ /* ── 2.8 中文首行缩进:段落行 2em,其余行归零 ── */
187
+ #editor .cm-content .cm-line { text-indent: 2em; }
188
+
189
+ #editor .cm-content .cm-md-atxheading1,
190
+ #editor .cm-content .cm-md-atxheading2,
191
+ #editor .cm-content .cm-md-atxheading3,
192
+ #editor .cm-content .cm-md-atxheading4,
193
+ #editor .cm-content .cm-md-atxheading5,
194
+ #editor .cm-content .cm-md-atxheading6,
195
+ #editor .cm-content .cm-md-blockquote,
196
+ #editor .cm-content .cm-md-codeblock,
197
+ #editor .cm-content .cm-md-hr,
198
+ #editor .cm-content .cm-md-mermaid,
199
+ #editor .cm-content .cm-md-li-0,
200
+ #editor .cm-content .cm-md-li-1,
201
+ #editor .cm-content .cm-md-li-2,
202
+ #editor .cm-content .cm-md-li-3,
203
+ #editor .cm-content .cm-md-li-4,
204
+ #editor .cm-content .cm-md-li-5,
205
+ #editor .cm-content .cm-md-li-6 {
206
+ text-indent: 0;
207
+ }
208
+
209
+ /* ═══════════════════════════════════════════════════════════
210
+ SECTION 3 — 导出 HTML(.colamd-document,语义标签)
211
+ document.css 负责结构,这里只补学术论文配色与三线表。
212
+ ═══════════════════════════════════════════════════════════ */
213
+
214
+ .colamd-document {
215
+ font-family: var(--font-body);
216
+ font-size: var(--editor-font-size);
217
+ line-height: 1.5;
218
+ text-align: justify;
219
+ }
220
+
221
+ .colamd-document h1,
222
+ .colamd-document h2,
223
+ .colamd-document h3,
224
+ .colamd-document h4,
225
+ .colamd-document h5,
226
+ .colamd-document h6 {
227
+ font-family: "SimHei", "Heiti SC", "Source Han Sans SC", "Noto Sans SC",
228
+ "Microsoft YaHei", Arial, sans-serif;
229
+ color: var(--text-color);
230
+ font-weight: 700;
231
+ line-height: 1.35;
232
+ text-indent: 0;
233
+ }
234
+ .colamd-document h1 { text-align: center; }
235
+ .colamd-document h6 { color: var(--text-muted); }
236
+
237
+ .colamd-document strong { color: var(--text-color); font-weight: 700; }
238
+ .colamd-document em { font-style: italic; }
239
+ .colamd-document del { color: var(--text-muted); text-decoration: line-through; }
240
+ .colamd-document mark { background: var(--highlight-bg); color: var(--text-color); padding: 1px 4px; }
241
+ .colamd-document a {
242
+ color: var(--link-color);
243
+ text-decoration: none;
244
+ border-bottom: 1px solid var(--link-color);
245
+ }
246
+
247
+ .colamd-document code {
248
+ font-family: var(--font-mono);
249
+ font-size: 0.88em;
250
+ background: var(--code-bg);
251
+ color: var(--text-color);
252
+ border-radius: 0;
253
+ padding: 1px 6px;
254
+ }
255
+ .colamd-document pre {
256
+ font-family: var(--font-mono);
257
+ font-size: 0.875em;
258
+ line-height: 1.5;
259
+ background: var(--code-block-bg);
260
+ border: 1px solid var(--border-color);
261
+ border-radius: 0;
262
+ padding: 14px 18px;
263
+ margin: 16px 0;
264
+ overflow-x: auto;
265
+ text-align: left;
266
+ }
267
+ .colamd-document pre code { background: transparent; color: var(--code-block-text); padding: 0; }
268
+
269
+ .colamd-document blockquote {
270
+ margin: 10px 0;
271
+ padding: 10px 16px 10px 20px;
272
+ background: var(--blockquote-bg);
273
+ color: var(--text-color);
274
+ border-left: 3px solid var(--blockquote-border);
275
+ }
276
+ .colamd-document blockquote p { margin: 4px 0; text-indent: 0; }
277
+
278
+ .colamd-document table {
279
+ width: 100%;
280
+ margin: 18px auto;
281
+ border-collapse: collapse;
282
+ border-top: 2px solid var(--text-color);
283
+ border-bottom: 2px solid var(--text-color);
284
+ font-size: 0.875em;
285
+ line-height: 1.5;
286
+ }
287
+ .colamd-document th,
288
+ .colamd-document td {
289
+ border-left: none;
290
+ border-right: none;
291
+ padding: 8px 10px;
292
+ text-indent: 0;
293
+ }
294
+ .colamd-document th {
295
+ background: var(--table-header-bg);
296
+ font-family: "SimHei", "Heiti SC", "Source Han Sans SC", "Noto Sans SC",
297
+ "Microsoft YaHei", Arial, sans-serif;
298
+ font-weight: 700;
299
+ text-align: center;
300
+ vertical-align: middle;
301
+ border-bottom: 2px solid var(--text-color);
302
+ }
303
+ .colamd-document td { text-align: left; vertical-align: top; border-bottom: none; }
304
+
305
+ .colamd-document figure { margin: 16px 0; text-align: center; }
306
+ .colamd-document img { max-width: 100%; border-radius: 0; }
307
+ .colamd-document figcaption,
308
+ .colamd-document caption {
309
+ font-family: var(--font-body);
310
+ font-size: 0.875em;
311
+ line-height: 1.5;
312
+ color: var(--text-color);
313
+ text-align: center;
314
+ text-indent: 0;
315
+ margin-top: 8px;
316
+ }
317
+
318
+ .colamd-document hr { border: none; border-top: 1px solid var(--text-color); margin: 32px 0; }
319
+
320
+ /* 脚注 / 参考文献:小五号,悬挂缩进 */
321
+ .colamd-document .footnotes {
322
+ margin-top: 32px;
323
+ padding-top: 16px;
324
+ border-top: 1px solid var(--border-color);
325
+ font-size: 0.75em;
326
+ }
327
+ .colamd-document .footnotes li { text-indent: -2em; padding-left: 2em; margin-bottom: 6px; }
328
+
329
+ .colamd-document p { margin: 0; text-indent: 2em; text-align: justify; }
330
+ .colamd-document li p,
331
+ .colamd-document td p,
332
+ .colamd-document th p,
333
+ .colamd-document blockquote p,
334
+ .colamd-document figcaption p {
335
+ text-indent: 0;
336
+ }
337
+
338
+ /* ═══════════════════════════════════════════════════════════
339
+ SECTION 4 — 打印(仅保真块)
340
+ ═══════════════════════════════════════════════════════════ */
341
+
342
+ @media print {
343
+ html,
344
+ body {
345
+ background: var(--bg-color);
346
+ color: var(--text-color);
347
+ -webkit-print-color-adjust: exact;
348
+ print-color-adjust: exact;
349
+ }
350
+ }