@bytechain.cn/colamd-themes 0.3.0

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 (108) hide show
  1. package/.claude/skills/colamd-themes-preview.skill.md +333 -0
  2. package/.claude/skills/colamd-themes.skill.md +155 -0
  3. package/.hermes/skills/tools/colamd-themes/SKILL.md +159 -0
  4. package/.openclaw/skills/colamd-themes/SKILL.md +166 -0
  5. package/.opencode/skills/colamd-themes/SKILL.md +162 -0
  6. package/.trae/rules/colamd-themes.md +150 -0
  7. package/CHANGELOG.md +102 -0
  8. package/README.md +373 -0
  9. package/README_CN.md +373 -0
  10. package/RELEASENOTE.md +177 -0
  11. package/dist/cli.d.ts +2 -0
  12. package/dist/cli.js +208 -0
  13. package/dist/cli.js.map +1 -0
  14. package/dist/color-systems.d.ts +17 -0
  15. package/dist/color-systems.js +251 -0
  16. package/dist/color-systems.js.map +1 -0
  17. package/dist/color-utils.d.ts +9 -0
  18. package/dist/color-utils.js +112 -0
  19. package/dist/color-utils.js.map +1 -0
  20. package/dist/contrast.d.ts +15 -0
  21. package/dist/contrast.js +63 -0
  22. package/dist/contrast.js.map +1 -0
  23. package/dist/docx-style-paradigm.d.ts +153 -0
  24. package/dist/docx-style-paradigm.js +640 -0
  25. package/dist/docx-style-paradigm.js.map +1 -0
  26. package/dist/export-cli.d.ts +10 -0
  27. package/dist/export-cli.js +266 -0
  28. package/dist/export-cli.js.map +1 -0
  29. package/dist/extractors/base.d.ts +6 -0
  30. package/dist/extractors/base.js +3 -0
  31. package/dist/extractors/base.js.map +1 -0
  32. package/dist/extractors/docx-extractor.d.ts +52 -0
  33. package/dist/extractors/docx-extractor.js +370 -0
  34. package/dist/extractors/docx-extractor.js.map +1 -0
  35. package/dist/extractors/pdf-extractor.d.ts +66 -0
  36. package/dist/extractors/pdf-extractor.js +430 -0
  37. package/dist/extractors/pdf-extractor.js.map +1 -0
  38. package/dist/extractors/url-extractor.d.ts +104 -0
  39. package/dist/extractors/url-extractor.js +761 -0
  40. package/dist/extractors/url-extractor.js.map +1 -0
  41. package/dist/generator.d.ts +4 -0
  42. package/dist/generator.js +71 -0
  43. package/dist/generator.js.map +1 -0
  44. package/dist/index.d.ts +10 -0
  45. package/dist/index.js +9 -0
  46. package/dist/index.js.map +1 -0
  47. package/dist/mermaid-presets.d.ts +14 -0
  48. package/dist/mermaid-presets.js +122 -0
  49. package/dist/mermaid-presets.js.map +1 -0
  50. package/dist/models.d.ts +106 -0
  51. package/dist/models.js +92 -0
  52. package/dist/models.js.map +1 -0
  53. package/dist/renderer.d.ts +70 -0
  54. package/dist/renderer.js +204 -0
  55. package/dist/renderer.js.map +1 -0
  56. package/dist/templates/template.css +498 -0
  57. package/dist/templates/theme-paradigm.md +658 -0
  58. package/dist/templates/theme-template.hbs +370 -0
  59. package/dist/theme-store.d.ts +37 -0
  60. package/dist/theme-store.js +90 -0
  61. package/dist/theme-store.js.map +1 -0
  62. package/dist/validators.d.ts +26 -0
  63. package/dist/validators.js +144 -0
  64. package/dist/validators.js.map +1 -0
  65. package/package.json +36 -0
  66. package/skills/build-skills.sh +166 -0
  67. package/skills/colamd-themes/SKILL.md +148 -0
  68. package/src/cli.ts +200 -0
  69. package/src/color-systems.ts +289 -0
  70. package/src/color-utils.ts +120 -0
  71. package/src/contrast.ts +66 -0
  72. package/src/docx-style-paradigm.ts +811 -0
  73. package/src/export-cli.ts +301 -0
  74. package/src/extractors/base.ts +8 -0
  75. package/src/extractors/docx-extractor.ts +417 -0
  76. package/src/extractors/pdf-extractor.ts +527 -0
  77. package/src/extractors/url-extractor.ts +927 -0
  78. package/src/generator.ts +88 -0
  79. package/src/index.ts +29 -0
  80. package/src/mermaid-presets.ts +142 -0
  81. package/src/models.ts +212 -0
  82. package/src/renderer.ts +277 -0
  83. package/src/templates/template.css +498 -0
  84. package/src/templates/theme-paradigm.md +658 -0
  85. package/src/templates/theme-template.hbs +370 -0
  86. package/src/theme-store.ts +112 -0
  87. package/src/types/pdf-parse.d.ts +12 -0
  88. package/src/validators.ts +176 -0
  89. package/themes/.gitkeep +0 -0
  90. package/themes/academic-paper-pt.css +1805 -0
  91. package/themes/academic-paper.css +1099 -0
  92. package/themes/academic-style.css +2430 -0
  93. package/themes/colly.css +370 -0
  94. package/themes/elegant.css +671 -0
  95. package/themes/forest-ink.css +664 -0
  96. package/themes/guizang.css +732 -0
  97. package/themes/meeting-minutes.css +370 -0
  98. package/themes/pixso-design.css +1261 -0
  99. package/themes/salvator-blog.css +370 -0
  100. package/themes/swiss-design copy.css +746 -0
  101. package/themes/swiss-design.css +746 -0
  102. package/themes/template.css +498 -0
  103. package/themes/trae-blue.css +737 -0
  104. package/themes-preview/colly-preview.html +623 -0
  105. package/themes-preview/demo-content.md +187 -0
  106. package/themes-preview/meeting-minutes-preview.html +625 -0
  107. package/themes-preview/salvator-blog-preview.html +623 -0
  108. package/tsconfig.json +18 -0
@@ -0,0 +1,737 @@
1
+ /*
2
+ * ColaMD 主题:Trae Blue(Trae IDE 文档风格)
3
+ * 版本:v1.0
4
+ *
5
+ * 风格来源:docs.trae.cn — Trae IDE 官方文档站
6
+ * 风格特征:
7
+ * - 白底 + Slate 灰阶文字,高可读性技术文档风格
8
+ * - 系统原生无衬线字体,中英文混排自然
9
+ * - 右侧大纲菜单(TOC side menu),层级清晰
10
+ * - 蓝色点缀(#3b82f6),克制且高效
11
+ *
12
+ * 导入:Theme > Import Theme
13
+ */
14
+
15
+ /* ═══════════════════════════════════════════════════════════
16
+ SECTION 1 — 设计令牌 (Design Tokens)
17
+ ═══════════════════════════════════════════════════════════ */
18
+
19
+ body.theme-custom {
20
+
21
+ /* ═══════════════════════════════════════════════════════════
22
+ 1.1 种子色板 — Trae 亮底蓝点缀
23
+ 白底 + 深 slate 文字 + 亮蓝点缀
24
+ ═══════════════════════════════════════════════════════════ */
25
+
26
+ --seed-accent: #3b82f6; /* Trae Blue 主色 */
27
+ --seed-accent-light: #eff6ff; /* 极浅蓝背景 */
28
+ --seed-accent-dark: #2563eb; /* 深蓝 hover */
29
+
30
+ /* 表面色:Slate 亮色层级(Tailwind slate-50/100 体系) */
31
+ --seed-surface: #ffffff; /* L0 页面背景(纯白) */
32
+ --seed-panel: #f8fafc; /* L1 卡片/侧栏背景(极浅灰蓝)*/
33
+ --seed-panel-alt: #f1f5f9; /* L2 代码区/引用块背景 */
34
+
35
+ /* 文字色:Slate 灰阶 — 高可读性,蓝灰调 */
36
+ --seed-ink: #0f172a; /* T0 正文/标题(slate-900) */
37
+ --seed-ink-muted: #475569; /* T1 次要文字(slate-600) */
38
+ --seed-ink-dim: #94a3b8; /* T2 弱化文字(slate-400) */
39
+
40
+ /* 边框色:极淡,仅以微差区分层级 */
41
+ --seed-border: #e2e8f0; /* 淡边框(slate-200) */
42
+ --seed-border-strong: #3b82f6; /* 强调边框 = Trae Blue */
43
+
44
+ /* ═══════════════════════════════════════════════════════════
45
+ 1.2 字体系统 — 思源宋体正文字 + 思源黑体标题
46
+ ═══════════════════════════════════════════════════════════ */
47
+
48
+ --font-body: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun",
49
+ Georgia, "Times New Roman", serif;
50
+
51
+ --font-heading: "Noto Sans SC", "Source Han Sans SC", "YouHei",
52
+ "Heiti SC", "Microsoft YaHei", sans-serif;
53
+
54
+ --font-code: "Cascadia Code", "JetBrains Mono", "Fira Code", "SF Mono", Menlo, Consolas, monospace;
55
+
56
+ --font-mermaid: var(--font-heading);
57
+
58
+ /* ═══════════════════════════════════════════════════════════
59
+ 1.3 字号 & 间距
60
+ ═══════════════════════════════════════════════════════════ */
61
+
62
+ --font-size-root: 15px;
63
+
64
+ --font-scale-h1: 2.0; /* 30px */
65
+ --font-scale-h2: 1.8; /* 22px */
66
+ --font-scale-h3: 1.5; /* 18px */
67
+ --font-scale-h4: 1.2; /* 16px */
68
+ --font-scale-h5: 1.0; /* 15px */
69
+ --font-scale-h6: 0.867; /* 13px */
70
+
71
+ --font-size-mermaid: 12px;
72
+
73
+ --line-height-body: 1.75;
74
+ --line-height-heading: 1.35;
75
+ --line-height-code: 1.6;
76
+
77
+ /* ═══════════════════════════════════════════════════════════
78
+ 1.4 圆角 & 间距
79
+ ═══════════════════════════════════════════════════════════ */
80
+ --radius-sm: 4px;
81
+ --radius-md: 6px;
82
+ --radius-lg: 8px;
83
+ --content-width: 780px;
84
+
85
+ /* ═══════════════════════════════════════════════════════════
86
+ SECTION 2 — 语义映射 (Semantic Mapping)
87
+ ═══════════════════════════════════════════════════════════ */
88
+
89
+ --bg-color: var(--seed-surface);
90
+ --surface-color: var(--seed-panel);
91
+ --surface-alt: var(--seed-panel-alt);
92
+
93
+ --text-color: var(--seed-ink);
94
+ --heading-color: var(--seed-ink);
95
+ --text-muted: var(--seed-ink-muted);
96
+ --text-dim: var(--seed-ink-dim);
97
+
98
+ --link-color: var(--seed-accent);
99
+ --accent-color: var(--seed-accent);
100
+ --accent-dark: var(--seed-accent-dark);
101
+ --accent-light: var(--seed-accent-light);
102
+ --selection-bg: rgba(59, 130, 246, 0.12);
103
+
104
+ --border-color: var(--seed-border);
105
+ --blockquote-border: var(--seed-accent);
106
+ --hr-color: var(--seed-border);
107
+
108
+ --code-bg: #f1f5f9;
109
+ --code-color: var(--seed-accent);
110
+
111
+ --code-block-bg: #f8fafc;
112
+ --code-block-text: var(--seed-ink);
113
+ --code-block-color: var(--seed-ink);
114
+
115
+ --blockquote-bg: var(--seed-panel);
116
+
117
+ --table-header-bg: var(--seed-accent-light);
118
+ --table-border: var(--seed-border);
119
+ --table-header-text: var(--seed-ink);
120
+
121
+ --scrollbar-thumb: var(--seed-border);
122
+ --scrollbar-thumb-hover: var(--seed-ink-muted);
123
+
124
+ /* ═══════════════════════════════════════════════════════════
125
+ SECTION 3 — Mermaid 图表变量
126
+ ═══════════════════════════════════════════════════════════ */
127
+
128
+ --mermaid-background: var(--seed-surface);
129
+ --mermaid-border-color: var(--seed-border);
130
+ --mermaid-border-radius: var(--radius-md);
131
+ --mermaid-padding: 24px;
132
+
133
+ --mermaid-font-family: var(--font-mermaid);
134
+ --mermaid-font-size: var(--font-size-mermaid);
135
+
136
+ --mermaid-node-fill: var(--seed-panel);
137
+ --mermaid-node-stroke: var(--seed-ink-muted);
138
+ --mermaid-node-stroke-width: 1px;
139
+ --mermaid-node-text: var(--seed-ink);
140
+
141
+ --mermaid-edge-stroke: var(--seed-ink-muted);
142
+ --mermaid-edge-stroke-width: 1px;
143
+
144
+ --mermaid-cluster-fill: var(--seed-panel-alt);
145
+ --mermaid-cluster-stroke: var(--seed-border);
146
+
147
+ --mermaid-label-text: var(--seed-ink);
148
+ --mermaid-edge-label-text: var(--seed-ink-muted);
149
+ --mermaid-edge-label-bg: var(--seed-surface);
150
+
151
+ --mermaid-title-text: var(--seed-ink);
152
+ --mermaid-axis-text: var(--seed-ink-muted);
153
+ --mermaid-highlight: var(--seed-accent);
154
+
155
+ --mermaid-person-stroke: var(--seed-ink-muted);
156
+ --mermaid-person-fill: var(--seed-panel);
157
+
158
+ --mermaid-label-offset-y: 0px;
159
+
160
+ /* ═══════════════════════════════════════════════════════════
161
+ SECTION 4 — 排版微调
162
+ ═══════════════════════════════════════════════════════════ */
163
+ --line-height-base: var(--line-height-body);
164
+ }
165
+
166
+ /* ═════════════════════════════════════════════════════════════
167
+ SECTION 5 — 选择器级微调 (Selector Fine-Tuning)
168
+ ═════════════════════════════════════════════════════════════ */
169
+
170
+ /* ── 5.0 全局:白底 + Slate 灰阶文字 ── */
171
+ html { font-size: var(--font-size-root); }
172
+ body.theme-custom, html, body {
173
+ background-color: var(--bg-color);
174
+ color: var(--text-color);
175
+ font-family: var(--font-body);
176
+ font-weight: 300;
177
+ line-height: var(--line-height-body);
178
+ text-align: left;
179
+ -webkit-font-smoothing: antialiased;
180
+ -moz-osx-font-smoothing: grayscale;
181
+ }
182
+
183
+ /* ── 5.1 编辑区:居中留白 ── */
184
+ #write {
185
+ max-width: var(--content-width);
186
+ margin: 0 auto;
187
+ padding: 48px 64px 120px;
188
+ }
189
+
190
+ /* ── 5.1.1 正文段落:首行缩进 ── */
191
+ body.theme-custom p, body.theme-custom #write > p {
192
+ margin: 0;
193
+ line-height: var(--line-height-body);
194
+ text-align: left;
195
+ text-indent: 2em;
196
+ font-size: var(--font-size-root);
197
+ }
198
+ body.theme-custom p + p { margin-top: 0; }
199
+
200
+ /* 重置:列表、表格、引用块、图表中的段落不缩进 */
201
+ body.theme-custom li p,
202
+ body.theme-custom li,
203
+ body.theme-custom td p,
204
+ body.theme-custom th p,
205
+ body.theme-custom blockquote p,
206
+ body.theme-custom .mermaid-block p,
207
+ body.theme-custom figure p,
208
+ body.theme-custom pre p {
209
+ text-indent: 0;
210
+ }
211
+
212
+ /* 列表整体缩进与正文首行对齐 — 直接参考 academic-paper.css §5.7 */
213
+ body.theme-custom ul,
214
+ body.theme-custom ol,
215
+ body.theme-custom li {
216
+ margin: 0;
217
+ padding: 0;
218
+ }
219
+
220
+ body.theme-custom #editor .ProseMirror > ul,
221
+ body.theme-custom #editor .ProseMirror > ol,
222
+ body.theme-custom #write > ul,
223
+ body.theme-custom #write > ol {
224
+ margin: 6px 0 6px 2em;
225
+ padding-left: 1.5em;
226
+ list-style-position: outside;
227
+ }
228
+
229
+ body.theme-custom ul ul,
230
+ body.theme-custom ul ol,
231
+ body.theme-custom ol ul,
232
+ body.theme-custom ol ol {
233
+ margin: 0;
234
+ padding-left: 1.5em;
235
+ }
236
+
237
+ body.theme-custom li {
238
+ line-height: var(--line-height-body);
239
+ font-family: var(--font-body);
240
+ font-size: var(--font-size-root);
241
+ font-weight: normal;
242
+ text-indent: 0;
243
+ padding: 2px 0;
244
+ }
245
+
246
+ body.theme-custom li::before {
247
+ content: none;
248
+ }
249
+
250
+ body.theme-custom #editor .ProseMirror li > p {
251
+ display: inline;
252
+ margin: 0;
253
+ padding: 0;
254
+ text-indent: 0;
255
+ font-size: inherit;
256
+ font-weight: inherit;
257
+ font-family: inherit;
258
+ }
259
+
260
+ /* ── 5.1.2 列表层级颜色:逐级降灰,重点突出 ── */
261
+
262
+ /* 一级列表:正文黑,确保重点可读 */
263
+ body.theme-custom #write > ul > li,
264
+ body.theme-custom #write > ol > li,
265
+ body.theme-custom #editor .ProseMirror > ul > li,
266
+ body.theme-custom #editor .ProseMirror > ol > li {
267
+ color: var(--seed-ink);
268
+ }
269
+
270
+ /* 一级列表内 strong:加深为纯黑,强化重点 */
271
+ body.theme-custom #write > ul > li strong,
272
+ body.theme-custom #write > ol > li strong,
273
+ body.theme-custom #editor .ProseMirror > ul > li strong,
274
+ body.theme-custom #editor .ProseMirror > ol > li strong {
275
+ color: #020617;
276
+ font-weight: 700;
277
+ }
278
+
279
+ /* 一级列表内 a:保持蓝色 */
280
+ body.theme-custom #write > ul > li a,
281
+ body.theme-custom #write > ol > li a {
282
+ color: var(--link-color);
283
+ }
284
+
285
+ /* 二级列表:中灰 slate-600,视觉收缩 */
286
+ body.theme-custom #write > ul > li > ul > li,
287
+ body.theme-custom #write > ul > li > ol > li,
288
+ body.theme-custom #write > ol > li > ul > li,
289
+ body.theme-custom #write > ol > li > ol > li {
290
+ color: var(--seed-ink-muted);
291
+ }
292
+
293
+ /* 三级列表:浅灰 slate-400,辅助收敛 */
294
+ body.theme-custom #write > ul > li > ul > li > ul > li,
295
+ body.theme-custom #write > ul > li > ul > li > ol > li,
296
+ body.theme-custom #write > ul > li > ol > li > ul > li,
297
+ body.theme-custom #write > ul > li > ol > li > ol > li,
298
+ body.theme-custom #write > ol > li > ul > li > ul > li,
299
+ body.theme-custom #write > ol > li > ul > li > ol > li,
300
+ body.theme-custom #write > ol > li > ol > li > ul > li,
301
+ body.theme-custom #write > ol > li > ol > li > ol > li {
302
+ color: var(--seed-ink-dim);
303
+ font-size: calc(var(--font-size-root) * 0.933);
304
+ }
305
+
306
+ /* 四级及更深:保持三级色 */
307
+ body.theme-custom #write ul ul ul ul li,
308
+ body.theme-custom #write ol ol ol ol li {
309
+ color: var(--seed-ink-dim);
310
+ font-size: calc(var(--font-size-root) * 0.9);
311
+ }
312
+
313
+ /* ── 5.2 标题:Trae 文档风 — 蓝底序号 + 紧凑层级 ── */
314
+ body.theme-custom h1, body.theme-custom h2, body.theme-custom h3,
315
+ body.theme-custom h4, body.theme-custom h5, body.theme-custom h6 {
316
+ font-family: var(--font-heading);
317
+ color: var(--heading-color);
318
+ font-weight: 600;
319
+ line-height: var(--line-height-heading);
320
+ text-align: left;
321
+ letter-spacing: -0.015em;
322
+ }
323
+
324
+ body.theme-custom h1 {
325
+ font-size: calc(var(--font-size-root) * var(--font-scale-h1));
326
+ margin-top: 2em;
327
+ margin-bottom: 0.5em;
328
+ padding-bottom: 0.35em;
329
+ border-bottom: 1px solid var(--seed-border);
330
+ }
331
+
332
+ body.theme-custom h2 {
333
+ font-size: calc(var(--font-size-root) * var(--font-scale-h2));
334
+ margin-top: 1.75em;
335
+ margin-bottom: 0.5em;
336
+ padding-left: 0.75em;
337
+ border-left: 3px solid var(--seed-accent);
338
+ }
339
+
340
+ body.theme-custom h3 {
341
+ font-size: calc(var(--font-size-root) * var(--font-scale-h3));
342
+ margin-top: 1.5em;
343
+ margin-bottom: 0.4em;
344
+ }
345
+
346
+ body.theme-custom h4 {
347
+ font-size: calc(var(--font-size-root) * var(--font-scale-h4));
348
+ color: var(--seed-accent);
349
+ margin-top: 1.25em;
350
+ margin-bottom: 0.8em;
351
+ padding-left: 1em;
352
+ }
353
+
354
+ body.theme-custom h5 {
355
+ font-size: calc(var(--font-size-root) * var(--font-scale-h5));
356
+ color: var(--seed-ink-muted);
357
+ }
358
+
359
+ body.theme-custom h6 {
360
+ font-size: calc(var(--font-size-root) * var(--font-scale-h6));
361
+ color: var(--seed-ink-dim);
362
+ }
363
+
364
+ /* ── 5.3 内联强调 ── */
365
+ body.theme-custom strong { color: var(--seed-ink); font-weight: 600; }
366
+ body.theme-custom em { font-style: italic; color: var(--seed-ink-muted); }
367
+
368
+ /* ── 5.4 链接:Trae Blue + 底部横线 ── */
369
+ body.theme-custom a {
370
+ color: var(--link-color);
371
+ text-decoration: none;
372
+ border-bottom: 1px solid var(--link-color);
373
+ }
374
+ body.theme-custom a:hover {
375
+ color: var(--accent-dark);
376
+ border-bottom: 2px solid var(--accent-dark);
377
+ }
378
+
379
+ /* ── 5.5 内联代码 ── */
380
+ body.theme-custom code {
381
+ font-family: var(--font-code);
382
+ font-size: 0.9em;
383
+ background: var(--code-bg);
384
+ color: var(--code-color);
385
+ border-radius: var(--radius-sm);
386
+ padding: 2px 6px;
387
+ }
388
+
389
+ /* ── 5.6 代码块 ── */
390
+ body.theme-custom pre {
391
+ background: var(--code-block-bg);
392
+ font-family: var(--font-code);
393
+ font-size: 13px;
394
+ line-height: var(--line-height-code);
395
+ border-radius: var(--radius-md);
396
+ border: 1px solid var(--seed-border);
397
+ padding: 16px 20px;
398
+ }
399
+ body.theme-custom pre code {
400
+ color: var(--code-block-text);
401
+ background: transparent;
402
+ }
403
+
404
+ /* ── 5.7 引用块 ── */
405
+ body.theme-custom blockquote {
406
+ background: var(--blockquote-bg);
407
+ border-left: 3px solid var(--blockquote-border);
408
+ padding: 12px 20px 12px 24px;
409
+ border-radius: var(--radius-md);
410
+ color: var(--seed-ink-muted);
411
+ }
412
+
413
+ /* ── 5.8 表格 ── */
414
+ body.theme-custom table {
415
+ border-collapse: collapse;
416
+ }
417
+ body.theme-custom table th {
418
+ background: var(--table-header-bg);
419
+ color: var(--table-header-text);
420
+ font-family: var(--font-heading);
421
+ font-weight: 600;
422
+ font-size: 0.875em;
423
+ padding: 10px 14px;
424
+ border: 1px solid var(--seed-border);
425
+ }
426
+ body.theme-custom table td {
427
+ padding: 8px 14px;
428
+ border: 1px solid var(--seed-border);
429
+ color: var(--seed-ink-muted);
430
+ }
431
+
432
+ /* ── 5.9 分割线 ── */
433
+ body.theme-custom hr {
434
+ border: none;
435
+ border-top: 1px solid var(--hr-color);
436
+ margin: 2.5em 0;
437
+ }
438
+
439
+ /* ── 5.10 图片 ── */
440
+ body.theme-custom img { max-width: 100%; border-radius: var(--radius-md); }
441
+
442
+ /* ── 5.11 图表标题 ── */
443
+ body.theme-custom .mermaid-block + p {
444
+ text-align: center;
445
+ font-family: var(--font-heading);
446
+ font-size: 0.875em;
447
+ color: var(--text-muted);
448
+ margin-top: 8px;
449
+ }
450
+
451
+ /* ═════════════════════════════════════════════════════════════
452
+ ── 5.11 右侧菜单:大纲 / TOC 侧栏 — Trae 文档站风格
453
+ 目标:渲染成 Trae docs 右侧导航菜单的效果
454
+ ═════════════════════════════════════════════════════════════ */
455
+
456
+ /* ── 5.11.0 侧栏全局容器 ── */
457
+ body.theme-custom #sidebar,
458
+ body.theme-custom .sidebar-content {
459
+ background: var(--seed-panel);
460
+ border-left: 1px solid var(--seed-border);
461
+ font-family: var(--font-body);
462
+ font-size: 13px;
463
+ color: var(--seed-ink-muted);
464
+ }
465
+
466
+ /* ── 5.11.1 大纲面板:Trae 右侧导航菜单 ── */
467
+ body.theme-custom .outline-content {
468
+ font-size: 13px;
469
+ line-height: 1.6;
470
+ padding: 12px 0;
471
+ }
472
+
473
+ body.theme-custom .outline-item {
474
+ padding: 4px 16px 4px 20px;
475
+ border-left: 2px solid transparent;
476
+ transition: all 0.15s ease;
477
+ cursor: pointer;
478
+ color: var(--seed-ink-muted);
479
+ }
480
+
481
+ body.theme-custom .outline-item:hover {
482
+ color: var(--seed-ink);
483
+ background: var(--seed-panel-alt);
484
+ border-left-color: var(--seed-ink-muted);
485
+ }
486
+
487
+ body.theme-custom .outline-item.outline-active {
488
+ color: var(--seed-accent);
489
+ background: var(--seed-accent-light);
490
+ border-left-color: var(--seed-accent);
491
+ font-weight: 500;
492
+ }
493
+
494
+ /* 大纲层级缩进 */
495
+ body.theme-custom .outline-h1 { padding-left: 20px; font-weight: 600; }
496
+ body.theme-custom .outline-h2 { padding-left: 32px; }
497
+ body.theme-custom .outline-h3 { padding-left: 44px; font-size: 12px; }
498
+ body.theme-custom .outline-h4 { padding-left: 56px; font-size: 12px; color: var(--seed-ink-dim); }
499
+
500
+ /* ── 5.11.2 内联 TOC(文档内目录) ── */
501
+ body.theme-custom .md-toc {
502
+ font-size: 0.9em;
503
+ background: var(--seed-panel);
504
+ border: 1px solid var(--seed-border);
505
+ border-radius: var(--radius-md);
506
+ padding: 16px 20px;
507
+ margin: 16px 0;
508
+ }
509
+
510
+ body.theme-custom .md-toc-content {
511
+ margin-left: 0;
512
+ }
513
+
514
+ body.theme-custom .md-toc-item {
515
+ padding: 3px 0;
516
+ color: var(--seed-ink-muted);
517
+ }
518
+
519
+ body.theme-custom .md-toc-item a {
520
+ color: var(--seed-ink-muted);
521
+ border-bottom: none;
522
+ }
523
+ body.theme-custom .md-toc-item a:hover {
524
+ color: var(--seed-accent);
525
+ border-bottom: none;
526
+ }
527
+
528
+ body.theme-custom .md-toc-h1 .md-toc-inner { font-weight: 600; }
529
+ body.theme-custom .md-toc-h2 .md-toc-inner { padding-left: 12px; }
530
+ body.theme-custom .md-toc-h3 .md-toc-inner { padding-left: 24px; }
531
+
532
+ /* ── 5.11.3 搜索高亮 ── */
533
+ body.theme-custom #write .md-search-hit {
534
+ background: rgba(59, 130, 246, 0.18);
535
+ border-radius: 2px;
536
+ color: var(--seed-ink);
537
+ }
538
+
539
+ /* ── 5.12 响应式 ── */
540
+ @media only screen and (max-width: 768px) {
541
+ #write { padding: 20px; }
542
+ body.theme-custom h1 { font-size: calc(var(--font-size-root) * 1.5); }
543
+ }
544
+
545
+ /* ═════════════════════════════════════════════════════════════
546
+ SECTION 6 — 打印 / 导出
547
+ 屏幕已为亮色方案,打印保持一致。隐藏侧栏菜单。
548
+ ═════════════════════════════════════════════════════════════ */
549
+ @media print {
550
+ @page {
551
+ size: A4;
552
+ margin: 10mm 10mm 10mm 10mm;
553
+ }
554
+
555
+ body.theme-custom {
556
+ --seed-accent: #3b82f6;
557
+ --seed-accent-light: #eff6ff;
558
+ --seed-accent-dark: #2563eb;
559
+ --seed-surface: #ffffff;
560
+ --seed-panel: #f8fafc;
561
+ --seed-panel-alt: #f1f5f9;
562
+ --seed-ink: #0f172a;
563
+ --seed-ink-muted: #475569;
564
+ --seed-ink-dim: #94a3b8;
565
+ --seed-border: #e2e8f0;
566
+ --font-size-root: 15px;
567
+ --line-height-body: 1.75;
568
+ --line-height-heading: 1.35;
569
+ --line-height-code: 1.6;
570
+ --font-scale-h1: 2.0;
571
+ --font-scale-h2: 1.467;
572
+ --font-scale-h3: 1.2;
573
+ --font-scale-h4: 1.2;
574
+ --font-scale-h5: 1.0;
575
+ --font-scale-h6: 0.867;
576
+ --content-width: 780px;
577
+ --font-size-mermaid: 12px;
578
+ --accent-color: var(--seed-accent);
579
+ --accent-dark: var(--seed-accent-dark);
580
+ --code-bg: #f1f5f9;
581
+ --code-color: var(--seed-accent);
582
+ --code-block-bg: #f8fafc;
583
+ --code-block-text: var(--seed-ink);
584
+ --blockquote-bg: var(--seed-panel);
585
+ --table-header-bg: var(--seed-accent-light);
586
+ --table-header-text: var(--seed-ink);
587
+ --border-color: var(--seed-border);
588
+ --hr-color: var(--seed-border);
589
+ --font-body: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun",
590
+ Georgia, "Times New Roman", serif;
591
+ --font-heading: "Noto Sans SC", "Source Han Sans SC", "YouHei",
592
+ "Heiti SC", "Microsoft YaHei", sans-serif;
593
+ --font-code: "Cascadia Code", "JetBrains Mono", "Fira Code", "SF Mono", Menlo, Consolas, monospace;
594
+ }
595
+
596
+ html {
597
+ font-size: var(--font-size-root) !important;
598
+ }
599
+ html, body, body.theme-custom {
600
+ background: var(--seed-surface) !important;
601
+ color: var(--seed-ink) !important;
602
+ font-family: var(--font-body) !important;
603
+ font-weight: 380 !important;
604
+ line-height: var(--line-height-body) !important;
605
+ text-align: left !important;
606
+ -webkit-print-color-adjust: exact !important;
607
+ print-color-adjust: exact !important;
608
+ }
609
+
610
+ #write {
611
+ max-width: var(--content-width) !important;
612
+ margin: 0 auto !important;
613
+ padding: 40px 28px 100px !important;
614
+ }
615
+
616
+ body.theme-custom p, body.theme-custom #write > p {
617
+ margin: 0 !important;
618
+ line-height: var(--line-height-body) !important;
619
+ text-align: left !important;
620
+ text-indent: 2em !important;
621
+ font-size: var(--font-size-root) !important;
622
+ }
623
+ body.theme-custom p + p { margin-top: 0 !important; }
624
+
625
+ body.theme-custom li p,
626
+ body.theme-custom li,
627
+ body.theme-custom td p,
628
+ body.theme-custom th p,
629
+ body.theme-custom blockquote p,
630
+ body.theme-custom .mermaid-block p,
631
+ body.theme-custom figure p,
632
+ body.theme-custom pre p {
633
+ text-indent: 0 !important;
634
+ }
635
+
636
+ body.theme-custom ul, body.theme-custom ol, body.theme-custom li {
637
+ margin: 0 !important;
638
+ padding: 0 !important;
639
+ }
640
+
641
+ body.theme-custom #editor .ProseMirror > ul,
642
+ body.theme-custom #editor .ProseMirror > ol,
643
+ body.theme-custom #write > ul,
644
+ body.theme-custom #write > ol {
645
+ margin: 6px 0 6px 2em !important;
646
+ padding-left: 1.5em !important;
647
+ list-style-position: outside !important;
648
+ }
649
+
650
+ body.theme-custom ul ul, body.theme-custom ul ol,
651
+ body.theme-custom ol ul, body.theme-custom ol ol {
652
+ margin: 0 !important;
653
+ padding-left: 1.5em !important;
654
+ }
655
+
656
+ body.theme-custom li {
657
+ line-height: var(--line-height-body) !important;
658
+ font-family: var(--font-body) !important;
659
+ font-size: var(--font-size-root) !important;
660
+ font-weight: normal !important;
661
+ text-indent: 0 !important;
662
+ padding: 2px 0 !important;
663
+ }
664
+
665
+ body.theme-custom li::before {
666
+ content: none !important;
667
+ }
668
+
669
+ body.theme-custom #editor .ProseMirror li > p {
670
+ display: inline !important;
671
+ margin: 0 !important;
672
+ padding: 0 !important;
673
+ text-indent: 0 !important;
674
+ font-size: inherit !important;
675
+ font-weight: inherit !important;
676
+ font-family: inherit !important;
677
+ }
678
+
679
+ body.theme-custom h1, body.theme-custom h2, body.theme-custom h3,
680
+ body.theme-custom h4, body.theme-custom h5, body.theme-custom h6 {
681
+ font-family: var(--font-heading) !important;
682
+ font-weight: 600 !important;
683
+ line-height: var(--line-height-heading) !important;
684
+ text-align: left !important;
685
+ letter-spacing: -0.015em !important;
686
+ color: var(--seed-ink) !important;
687
+ }
688
+
689
+ body.theme-custom h1 {
690
+ font-size: calc(var(--font-size-root) * var(--font-scale-h1)) !important;
691
+ margin-top: 2em !important;
692
+ margin-bottom: 0.5em !important;
693
+ padding-bottom: 0.35em !important;
694
+ border-bottom: 1px solid var(--seed-border) !important;
695
+ }
696
+
697
+ body.theme-custom h2 {
698
+ font-size: calc(var(--font-size-root) * var(--font-scale-h2)) !important;
699
+ margin-top: 1.75em !important;
700
+ margin-bottom: 0.5em !important;
701
+ padding-left: 0.75em !important;
702
+ border-left: 3px solid var(--seed-accent) !important;
703
+ }
704
+
705
+ body.theme-custom h3 {
706
+ font-size: calc(var(--font-size-root) * var(--font-scale-h3)) !important;
707
+ }
708
+
709
+ body.theme-custom h4 {
710
+ font-size: calc(var(--font-size-root) * var(--font-scale-h4)) !important;
711
+ color: var(--seed-accent) !important;
712
+ margin-top: 1.25em !important;
713
+ margin-bottom: 0.8em !important;
714
+ padding-left: 1em !important;
715
+ }
716
+
717
+ body.theme-custom table th {
718
+ background: var(--table-header-bg) !important;
719
+ color: var(--table-header-text) !important;
720
+ }
721
+
722
+ body.theme-custom code, body.theme-custom pre code {
723
+ color: var(--seed-accent) !important;
724
+ }
725
+
726
+ body.theme-custom a {
727
+ color: var(--link-color) !important;
728
+ border-bottom: 1px solid var(--link-color) !important;
729
+ }
730
+
731
+ /* 打印时隐藏侧栏 TOC 菜单 */
732
+ body.theme-custom #sidebar,
733
+ body.theme-custom .sidebar-content,
734
+ body.theme-custom .outline-content {
735
+ display: none !important;
736
+ }
737
+ }