markloom 0.5.1 → 0.7.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 (73) hide show
  1. package/PACKAGES.md +26 -0
  2. package/README.md +20 -2
  3. package/collab.md +60 -13
  4. package/dist/ai/index.cjs +5 -4
  5. package/dist/ai/index.d.cts +5 -4
  6. package/dist/ai/index.d.ts +5 -4
  7. package/dist/ai/index.js +4 -3
  8. package/dist/ai/theme.css +66 -102
  9. package/dist/{chunk-ZMTLSFLO.js → chunk-4Q7PAR2T.js} +5746 -1341
  10. package/dist/chunk-75EJ4ARB.cjs +642 -0
  11. package/dist/{chunk-JS527FDV.cjs → chunk-BMPCVT3B.cjs} +47 -39
  12. package/dist/{chunk-RLTHVQNQ.js → chunk-EFYT2223.js} +47 -39
  13. package/dist/chunk-HXABDVLZ.cjs +297 -0
  14. package/dist/{chunk-YIFOGP2D.cjs → chunk-I2LDEVLA.cjs} +499 -102
  15. package/dist/chunk-MQLRZQZL.js +642 -0
  16. package/dist/chunk-OVHASRID.cjs +4279 -0
  17. package/dist/chunk-PCSVBPOR.cjs +40 -0
  18. package/dist/{chunk-FCH7LZFI.js → chunk-PSAXWBNM.js} +450 -53
  19. package/dist/chunk-PZRWTLLB.cjs +858 -0
  20. package/dist/chunk-QO7JEZDB.js +4279 -0
  21. package/dist/chunk-WSJUXPAG.js +40 -0
  22. package/dist/{chunk-VXM7Q6P5.cjs → chunk-Y4IXQFWL.cjs} +6026 -1621
  23. package/dist/chunk-YLVSMDIO.js +858 -0
  24. package/dist/chunk-ZL6WT6OY.js +297 -0
  25. package/dist/client-BvvyHjhh.d.ts +250 -0
  26. package/dist/client-Ciy7Fa_k.d.cts +250 -0
  27. package/dist/collab/index.cjs +17 -4
  28. package/dist/collab/index.d.cts +18 -7
  29. package/dist/collab/index.d.ts +18 -7
  30. package/dist/collab/index.js +19 -6
  31. package/dist/{controller-DQITsFhy.d.cts → controller-CHznEhAR.d.cts} +277 -26
  32. package/dist/{controller-BNuuUM3E.d.ts → controller-DLqI8_jm.d.ts} +277 -26
  33. package/dist/index.cjs +119 -7
  34. package/dist/index.d.cts +138 -6
  35. package/dist/index.d.ts +138 -6
  36. package/dist/index.js +130 -18
  37. package/dist/io/index.cjs +1412 -0
  38. package/dist/io/index.d.cts +33 -0
  39. package/dist/io/index.d.ts +33 -0
  40. package/dist/io/index.js +1412 -0
  41. package/dist/react/index.cjs +9 -8
  42. package/dist/react/index.d.cts +5 -4
  43. package/dist/react/index.d.ts +5 -4
  44. package/dist/react/index.js +8 -7
  45. package/dist/{rebase-batch-8rL_aXEE.d.ts → rebase-batch-CSnv8FKp.d.ts} +11 -9
  46. package/dist/{rebase-batch-bYnBJpRO.d.cts → rebase-batch-DO1ygkx9.d.cts} +11 -9
  47. package/dist/types-BkHlmUFL.d.cts +34 -0
  48. package/dist/types-BkHlmUFL.d.ts +34 -0
  49. package/dist/versions-DNFf8zVz.d.cts +51 -0
  50. package/dist/versions-DOkOyh2J.d.ts +51 -0
  51. package/dist/view/index.cjs +259 -17
  52. package/dist/view/index.d.cts +277 -12
  53. package/dist/view/index.d.ts +277 -12
  54. package/dist/view/index.js +256 -14
  55. package/dist/view/theme.css +2093 -1577
  56. package/dist/word-count-BPw9G2Bg.d.ts +130 -0
  57. package/dist/word-count-DNLn1h_t.d.cts +130 -0
  58. package/io.md +38 -0
  59. package/package.json +25 -4
  60. package/dist/chunk-4JSJAHTB.js +0 -255
  61. package/dist/chunk-4TMHVNL6.cjs +0 -2297
  62. package/dist/chunk-ALZ3A5CS.cjs +0 -255
  63. package/dist/chunk-GQ2HHRGI.cjs +0 -16
  64. package/dist/chunk-LA5SBCGQ.js +0 -16
  65. package/dist/chunk-LEYAQNJA.js +0 -220
  66. package/dist/chunk-MFYF2A6U.js +0 -2297
  67. package/dist/chunk-YXQDCW4Y.cjs +0 -220
  68. package/dist/client-6KiH4kGK.d.ts +0 -144
  69. package/dist/client-ZRZj2nkq.d.cts +0 -144
  70. package/dist/comments-DlExS6f-.d.cts +0 -43
  71. package/dist/comments-PhnR7Gkn.d.ts +0 -43
  72. package/dist/step-BrvHIK7O.d.cts +0 -65
  73. package/dist/step-BrvHIK7O.d.ts +0 -65
@@ -1,10 +1,24 @@
1
- /* markloom 默认主题 —— 无头编辑器的开箱即用皮肤。
2
- 消费者 import 'markloom/view/theme.css' 即可,不想用可以不导入、自己写。
3
- 变量名与 docsite 同构:--text-a/b/c, --bg-page/side/hover/active。 */
1
+ /* markloom default theme — consumer: import 'markloom/view/theme.css'
2
+ Converted toward Tailwind @apply under existing .markloom-* / data-* hooks.
3
+ note: darkMode class on html; also keep prefers-color-scheme for standalone.
4
4
 
5
- /* 变量兜底(亮色)—— 未定义时用灰阶默认值 */
6
- :root {
7
- --text-a: rgba(0, 0, 0, 0.88);
5
+ RESIDUAL raw CSS (no clean 1:1 @apply / must stay):
6
+ - :root / html.dark CSS tokens (--text-*, --bg-*, --markloom-*)
7
+ - table: border-collapse/separate + border-spacing, freeze sticky + opaque bg, cell focus ring
8
+ - code: focus-visible suppress, calc() lang position, ::after mask icons
9
+ - callout/task/comment: data-variant colors, appearance:none checkbox + SVG tick
10
+ - caret-color hacks for image/table block selection
11
+ - ::before/::after content (placeholder, inv chars, grip ⠿, tc-dot +, stream caret)
12
+ - @keyframes, complex multi-layer box-shadow / gradients
13
+ - TOC shell flex (--markloom-toc-w / --markloom-toc-top); comment rail (--markloom-comment-rail-w)
14
+ */
15
+
16
+ /* ── tokens (light) ──
17
+ 灰阶 + 阅读壳与 note 同源:#171717 暗底、820 栏、Harmony 字栈、细滚动条。
18
+ 宿主只 import theme.css;page / column 类名开箱即用,勿在 docsite 再叠 prose。 */
19
+ :root,
20
+ :host {
21
+ --text-a: #1a1a1a;
8
22
  --text-b: rgba(0, 0, 0, 0.6);
9
23
  --text-c: rgba(0, 0, 0, 0.35);
10
24
  --bg-page: #fff;
@@ -13,25 +27,64 @@
13
27
  --bg-active: rgba(233, 233, 233, 1);
14
28
  --markloom-link: #3370ff;
15
29
  --markloom-link-hover: #245bdb;
30
+ /* 强调色(落点线/选中环等)。勿用 --accent:shadcn 宿主常设 HSL 通道,
31
+ 会盖掉 fallback、蓝线不可见。宿主可覆盖本变量。 */
32
+ --markloom-accent: #3370ff;
33
+ /* slash / mention 浮层 */
34
+ --slash-bg: #fff;
35
+ --slash-border: rgba(0, 0, 0, 0.08);
36
+ --slash-text: #1f2328;
37
+ --slash-section: #9aa0a6;
38
+ --slash-icon: #6b7075;
39
+ --slash-active: rgba(0, 0, 0, 0.05);
40
+ --slash-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
41
+ /* 阅读布局(note EditorHost 同款) */
42
+ --markloom-content-max: 820px;
43
+ --markloom-font-size: 16px;
44
+ --markloom-pad-x: 48px;
45
+ --markloom-pad-bottom: 120px;
46
+ --markloom-font:
47
+ 'HarmonyOS Sans', 'Segoe UI', 'SF Pro Display', -apple-system, BlinkMacSystemFont,
48
+ Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif,
49
+ 'HarmonyOS Sans SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft Yahei UI',
50
+ 'Microsoft Yahei', 'Source Han Sans CN', sans-serif, 'Segoe UI Emoji',
51
+ 'Segoe UI Symbol', 'Apple Color Emoji', 'Twemoji Mozilla', 'Noto Color Emoji',
52
+ 'Android Emoji';
53
+ --markloom-mono: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace;
54
+ /* 分隔线(hr / 细边)— note 旧 horizontalRule: black/20 · white/20 */
55
+ --markloom-line: rgba(0, 0, 0, 0.12);
16
56
  }
17
57
 
18
- /* 行内链接:可见 + 可点(打开逻辑在 editor.onClick) */
19
- .markloom-doc a[data-mark="link"],
20
- .markloom-doc a.markloom-link {
21
- color: var(--markloom-link);
22
- text-decoration: underline;
23
- text-underline-offset: 2px;
24
- text-decoration-thickness: 1px;
25
- cursor: pointer;
26
- }
27
- .markloom-doc a[data-mark="link"]:hover,
28
- .markloom-doc a.markloom-link:hover {
29
- color: var(--markloom-link-hover);
58
+
59
+ /* explicit light (host-controlled theme; beats OS media) */
60
+ html.light,
61
+ :host(.light),
62
+ :host([data-theme='light']) {
63
+ --text-a: #1a1a1a;
64
+ --text-b: rgba(0, 0, 0, 0.6);
65
+ --text-c: rgba(0, 0, 0, 0.35);
66
+ --bg-page: #fff;
67
+ --bg-side: #f9f9f9;
68
+ --bg-hover: rgba(0, 0, 0, 0.06);
69
+ --bg-active: rgba(233, 233, 233, 1);
70
+ --markloom-link: #3370ff;
71
+ --markloom-link-hover: #245bdb;
72
+ --markloom-accent: #3370ff;
73
+ --slash-bg: #fff;
74
+ --slash-border: rgba(0, 0, 0, 0.08);
75
+ --slash-text: #1f2328;
76
+ --slash-section: #9aa0a6;
77
+ --slash-icon: #6b7075;
78
+ --slash-active: rgba(0, 0, 0, 0.05);
79
+ --slash-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
80
+ --markloom-line: rgba(0, 0, 0, 0.12);
30
81
  }
31
82
 
32
- /* 暗色兜底 */
83
+ /* dark tokens: html.dark, or OS when host set neither .dark nor .light.
84
+ Hosts that always own theme (chat) should set .dark / .light so OS media never stomps. */
33
85
  @media (prefers-color-scheme: dark) {
34
- :root {
86
+ html:not(.dark):not(.light),
87
+ :host(:not(.dark):not(.light):not([data-theme='light']):not([data-theme='dark'])) {
35
88
  --text-a: rgba(255, 255, 255, 0.88);
36
89
  --text-b: rgba(255, 255, 255, 0.6);
37
90
  --text-c: rgba(255, 255, 255, 0.35);
@@ -41,107 +94,313 @@
41
94
  --bg-active: rgba(255, 255, 255, 0.12);
42
95
  --markloom-link: #7aafff;
43
96
  --markloom-link-hover: #9bc4ff;
97
+ --markloom-accent: #7aafff;
98
+ --slash-bg: #2b2b2b;
99
+ --slash-border: rgba(255, 255, 255, 0.1);
100
+ --slash-text: rgba(255, 255, 255, 0.9);
101
+ --slash-section: rgba(255, 255, 255, 0.4);
102
+ --slash-icon: rgba(255, 255, 255, 0.55);
103
+ --slash-active: rgba(255, 255, 255, 0.08);
104
+ --slash-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
105
+ --markloom-line: rgba(255, 255, 255, 0.12);
106
+ }
107
+ }
108
+ html.dark,
109
+ :host(.dark),
110
+ :host([data-theme='dark']) {
111
+ --text-a: rgba(255, 255, 255, 0.88);
112
+ --text-b: rgba(255, 255, 255, 0.6);
113
+ --text-c: rgba(255, 255, 255, 0.35);
114
+ --bg-page: #171717;
115
+ --bg-side: #212121;
116
+ --bg-hover: rgba(255, 255, 255, 0.08);
117
+ --bg-active: rgba(255, 255, 255, 0.12);
118
+ --markloom-link: #7aafff;
119
+ --markloom-link-hover: #9bc4ff;
120
+ --markloom-accent: #7aafff;
121
+ --slash-bg: #2b2b2b;
122
+ --slash-border: rgba(255, 255, 255, 0.1);
123
+ --slash-text: rgba(255, 255, 255, 0.9);
124
+ --slash-section: rgba(255, 255, 255, 0.4);
125
+ --slash-icon: rgba(255, 255, 255, 0.55);
126
+ --slash-active: rgba(255, 255, 255, 0.08);
127
+ --slash-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
128
+ --markloom-line: rgba(255, 255, 255, 0.12);
129
+ }
130
+
131
+ /* ── page shell(note 暗色画布)──
132
+ .markloom-page = 整页底色/字色/字栈/抗锯齿
133
+ .markloom-column = CE 命中面:吃满写作区(宽+min-height),不限 820
134
+ .markloom-doc = 版心:max-width 820 + 左右留白
135
+ 细滚动条跟随主题。宿主(lab / note / docsite)只加 class,不再自写排版。 */
136
+ .markloom-page {
137
+ min-height: 100%;
138
+ background: var(--bg-page);
139
+ color: var(--text-a);
140
+ font-family: var(--markloom-font);
141
+ font-size: var(--markloom-font-size, 16px);
142
+ -webkit-font-smoothing: antialiased;
143
+ -moz-osx-font-smoothing: grayscale;
144
+ }
145
+ .markloom-page--fill {
146
+ height: 100%;
147
+ overflow: auto;
148
+ overscroll-behavior: none;
149
+ }
150
+ /* CE 根:占满可写区域;点空白即进编辑,版心约束在 .markloom-doc */
151
+ .markloom-column {
152
+ box-sizing: border-box;
153
+ width: 100%;
154
+ min-height: 100%;
155
+ font-size: var(--markloom-font-size, 16px);
156
+ outline: none;
157
+ -webkit-user-select: text;
158
+ user-select: text;
159
+ }
160
+
161
+ /* 正文根 = 版心:字栈 + 强文本层级 + 阅读宽
162
+ min-width:0:在 flex 栏内可收缩,宽原子(代码/表)在栏内横滚,不撑破页 */
163
+ .markloom-doc {
164
+ box-sizing: border-box;
165
+ width: 100%;
166
+ max-width: var(--markloom-content-max, 820px);
167
+ margin-inline: auto;
168
+ padding: 12px var(--markloom-pad-x, 48px) var(--markloom-pad-bottom, 120px);
169
+ font-family: var(--markloom-font);
170
+ color: var(--text-a);
171
+ caret-color: var(--text-a);
172
+ min-width: 0;
173
+ }
174
+ @media (max-width: 720px) {
175
+ .markloom-doc {
176
+ padding: 28px 20px 80px;
177
+ }
178
+ }
179
+ .markloom-doc strong,
180
+ .markloom-doc b {
181
+ color: var(--text-a);
182
+ font-weight: 600;
183
+ }
184
+ .markloom-doc code,
185
+ .markloom-doc kbd,
186
+ .markloom-doc pre {
187
+ font-family: var(--markloom-mono);
188
+ }
189
+ /* 无 shiki 壳的裸 pre:同样栏内横滚 */
190
+ .markloom-doc > pre[data-block-id] {
191
+ @apply max-w-full overflow-x-auto;
192
+ }
193
+
194
+ /* 细滚动条:挂在实际滚轴上(page / fill pane / toc),暗底用更亮的 thumb */
195
+ .markloom-page,
196
+ .markloom-page--fill,
197
+ .markloom-editor-pane,
198
+ .markloom-toc-host,
199
+ .markloom-toc-nav {
200
+ scrollbar-width: thin;
201
+ scrollbar-color: rgba(0, 0, 0, 0.28) transparent;
202
+ }
203
+ .markloom-page::-webkit-scrollbar,
204
+ .markloom-page--fill::-webkit-scrollbar,
205
+ .markloom-editor-pane::-webkit-scrollbar,
206
+ .markloom-toc-host::-webkit-scrollbar,
207
+ .markloom-toc-nav::-webkit-scrollbar {
208
+ width: 8px;
209
+ height: 8px;
210
+ }
211
+ .markloom-page::-webkit-scrollbar-track,
212
+ .markloom-page--fill::-webkit-scrollbar-track,
213
+ .markloom-editor-pane::-webkit-scrollbar-track,
214
+ .markloom-toc-host::-webkit-scrollbar-track,
215
+ .markloom-toc-nav::-webkit-scrollbar-track {
216
+ background: transparent;
217
+ }
218
+ .markloom-page::-webkit-scrollbar-thumb,
219
+ .markloom-page--fill::-webkit-scrollbar-thumb,
220
+ .markloom-editor-pane::-webkit-scrollbar-thumb,
221
+ .markloom-toc-host::-webkit-scrollbar-thumb,
222
+ .markloom-toc-nav::-webkit-scrollbar-thumb {
223
+ border-radius: 8px;
224
+ background: rgba(0, 0, 0, 0.22);
225
+ }
226
+ .markloom-page::-webkit-scrollbar-thumb:hover,
227
+ .markloom-page--fill::-webkit-scrollbar-thumb:hover,
228
+ .markloom-editor-pane::-webkit-scrollbar-thumb:hover,
229
+ .markloom-toc-host::-webkit-scrollbar-thumb:hover,
230
+ .markloom-toc-nav::-webkit-scrollbar-thumb:hover {
231
+ background: rgba(0, 0, 0, 0.38);
232
+ }
233
+ @media (prefers-color-scheme: dark) {
234
+ html:not(.light) .markloom-page,
235
+ html:not(.light) .markloom-page--fill,
236
+ html:not(.light) .markloom-editor-pane,
237
+ html:not(.light) .markloom-toc-host,
238
+ html:not(.light) .markloom-toc-nav {
239
+ scrollbar-color: rgba(255, 255, 255, 0.38) transparent;
240
+ }
241
+ html:not(.light) .markloom-page::-webkit-scrollbar-thumb,
242
+ html:not(.light) .markloom-page--fill::-webkit-scrollbar-thumb,
243
+ html:not(.light) .markloom-editor-pane::-webkit-scrollbar-thumb,
244
+ html:not(.light) .markloom-toc-host::-webkit-scrollbar-thumb,
245
+ html:not(.light) .markloom-toc-nav::-webkit-scrollbar-thumb {
246
+ background: rgba(255, 255, 255, 0.32);
247
+ }
248
+ html:not(.light) .markloom-page::-webkit-scrollbar-thumb:hover,
249
+ html:not(.light) .markloom-page--fill::-webkit-scrollbar-thumb:hover,
250
+ html:not(.light) .markloom-editor-pane::-webkit-scrollbar-thumb:hover,
251
+ html:not(.light) .markloom-toc-host::-webkit-scrollbar-thumb:hover,
252
+ html:not(.light) .markloom-toc-nav::-webkit-scrollbar-thumb:hover {
253
+ background: rgba(255, 255, 255, 0.48);
254
+ }
255
+ }
256
+ html.dark .markloom-page,
257
+ html.dark .markloom-page--fill,
258
+ html.dark .markloom-editor-pane,
259
+ html.dark .markloom-toc-host,
260
+ html.dark .markloom-toc-nav {
261
+ scrollbar-color: rgba(255, 255, 255, 0.38) transparent;
262
+ }
263
+ html.dark .markloom-page::-webkit-scrollbar-thumb,
264
+ html.dark .markloom-page--fill::-webkit-scrollbar-thumb,
265
+ html.dark .markloom-editor-pane::-webkit-scrollbar-thumb,
266
+ html.dark .markloom-toc-host::-webkit-scrollbar-thumb,
267
+ html.dark .markloom-toc-nav::-webkit-scrollbar-thumb {
268
+ background: rgba(255, 255, 255, 0.32);
269
+ }
270
+ html.dark .markloom-page::-webkit-scrollbar-thumb:hover,
271
+ html.dark .markloom-page--fill::-webkit-scrollbar-thumb:hover,
272
+ html.dark .markloom-editor-pane::-webkit-scrollbar-thumb:hover,
273
+ html.dark .markloom-toc-host::-webkit-scrollbar-thumb:hover,
274
+ html.dark .markloom-toc-nav::-webkit-scrollbar-thumb:hover {
275
+ background: rgba(255, 255, 255, 0.48);
276
+ }
277
+
278
+ /* ── links ── */
279
+ .markloom-doc a[data-mark="link"],
280
+ .markloom-doc a.markloom-link {
281
+ @apply underline underline-offset-2 decoration-1 cursor-pointer;
282
+ color: var(--markloom-link);
283
+ }
284
+ .markloom-doc a[data-mark="link"]:hover,
285
+ .markloom-doc a.markloom-link:hover {
286
+ color: var(--markloom-link-hover);
287
+ }
288
+
289
+ /* ── selection / caret / 荧光高亮 ── */
290
+ .markloom-doc ::selection {
291
+ background: rgba(51, 112, 255, 0.22);
292
+ color: inherit;
293
+ }
294
+ .markloom-doc ::-moz-selection {
295
+ background: rgba(51, 112, 255, 0.22);
296
+ color: inherit;
297
+ }
298
+ /* <mark> / highlight:浅琥珀,暗色半透明金,别用浏览器默认刺眼黄 */
299
+ .markloom-doc mark,
300
+ .markloom-doc [data-mark="highlight"] {
301
+ background: #faf1d1;
302
+ color: inherit;
303
+ border-radius: 2px;
304
+ padding: 0 0.12em;
305
+ }
306
+ @media (prefers-color-scheme: dark) {
307
+ .markloom-doc ::selection,
308
+ .markloom-doc ::-moz-selection {
309
+ background: rgba(76, 139, 245, 0.38);
310
+ color: inherit;
44
311
  }
312
+ .markloom-doc mark,
313
+ .markloom-doc [data-mark="highlight"] {
314
+ background: rgba(250, 204, 21, 0.28);
315
+ color: rgba(255, 255, 255, 0.92);
316
+ box-shadow: inset 0 0 0 1px rgba(250, 204, 21, 0.12);
317
+ }
318
+ }
319
+ html.dark .markloom-doc ::selection,
320
+ html.dark .markloom-doc ::-moz-selection {
321
+ background: rgba(76, 139, 245, 0.38);
322
+ color: inherit;
323
+ }
324
+ html.dark .markloom-doc mark,
325
+ html.dark .markloom-doc [data-mark="highlight"] {
326
+ background: rgba(250, 204, 21, 0.28);
327
+ color: rgba(255, 255, 255, 0.92);
328
+ box-shadow: inset 0 0 0 1px rgba(250, 204, 21, 0.12);
45
329
  }
46
330
 
47
- /* ─── 表格 ─── */
48
- /* 横向滚动壳:列宽之和超容器时表格在壳内横滚,不把整页撑宽(飞书式)。
49
- margin 移到壳上(原在 table),间距不变;data-pass 让 selection 穿透,table 仍是结构直接子。 */
331
+ /* ── table scroll shell ──
332
+ 壳限宽 + overflow-x;列宽恒像素 colgroup + fixed,输入不重排;总宽超壳则横滚 */
50
333
  .markloom-table-scroll {
51
- margin: 1rem 0;
52
- max-width: 100%;
53
- overflow-x: auto;
54
- /* 网格线独立令牌:分隔线是「结构」;抄 note 的 border-black/10(暗 white/20);宿主可覆盖。 */
334
+ @apply my-4 max-w-full min-w-0 overflow-x-auto rounded;
55
335
  --markloom-table-line: rgba(0, 0, 0, 0.1);
56
336
  }
57
337
  @media (prefers-color-scheme: dark) {
58
338
  .markloom-table-scroll { --markloom-table-line: rgba(255, 255, 255, 0.2); }
59
339
  }
340
+ html.dark .markloom-table-scroll { --markloom-table-line: rgba(255, 255, 255, 0.2); }
60
341
 
61
342
  .markloom-table {
62
- margin: 0;
63
- border-radius: 4px;
343
+ @apply m-0;
64
344
  border: 1px solid var(--markloom-table-line);
65
- overflow: hidden;
66
- /* separate(非 collapse):collapse 会让引擎忽略 border-radius,圆角失效;
67
- separate + border-spacing:0 让 overflow:hidden 能裁出真圆角。格只挂 right+bottom 边、
68
- 表挂外框,分隔线仍各画一次不重叠。 */
69
345
  border-collapse: separate;
70
346
  border-spacing: 0;
71
- table-layout: fixed; /* colgroup>col 的 px 宽精确生效——不拉伸,colWidths 即真实列宽 */
347
+ border-radius: inherit;
348
+ /* 固定列宽:宽度由 colgroup 像素 + inline 总宽决定,内容增减不重算列 */
349
+ table-layout: fixed;
72
350
  }
73
351
 
74
352
  .markloom-cell {
75
- padding: 0.5rem 0.75rem;
76
- font-size: 14px;
77
- line-height: 1.5;
353
+ @apply px-3 py-2 text-[14px] leading-normal outline-none align-top;
78
354
  color: var(--text-a);
79
355
  background-color: var(--bg-page);
80
356
  border-right: 1px solid var(--markloom-table-line);
81
357
  border-bottom: 1px solid var(--markloom-table-line);
82
- outline: none;
83
- vertical-align: top;
84
- transition: background-color 0.12s;
358
+ /* normal 会把「仅空格 / 前导空格」压成 0 宽 → 空单元格敲空格像没输入 */
359
+ white-space: pre-wrap;
360
+ /* fixed 下列不随内容撑开,长词在格内折行 */
361
+ overflow-wrap: anywhere;
362
+ word-break: break-word;
85
363
  }
86
364
 
87
- /* 表头(首行 th)——飞书式:浅灰底 + 半粗,与体行区隔。左对齐默认。
88
- 不复用 --bg-side(#f9f9f9 压在 #fff 上仅差 6 阶,表头几乎看不出),改用 rgba 叠色——
89
- 两种配色都成立(亮色压深一点、暗色提亮一点),视觉权重 = 语义权重。 */
90
- .markloom-table thead .markloom-cell {
365
+ .markloom-table thead .markloom-cell,
366
+ .markloom-table tbody th.markloom-cell {
367
+ @apply font-semibold text-left;
91
368
  background-color: rgba(0, 0, 0, 0.035);
92
- font-weight: 600;
93
369
  color: var(--text-a);
94
- text-align: left;
95
370
  }
96
371
  @media (prefers-color-scheme: dark) {
97
- .markloom-table thead .markloom-cell {
98
- background-color: rgba(255, 255, 255, 0.05);
99
- }
372
+ .markloom-table thead .markloom-cell,
373
+ .markloom-table tbody th.markloom-cell { background-color: rgba(255, 255, 255, 0.05); }
100
374
  }
375
+ html.dark .markloom-table thead .markloom-cell,
376
+ html.dark .markloom-table tbody th.markloom-cell { background-color: rgba(255, 255, 255, 0.05); }
101
377
 
102
- /* 最后一列/最后一行去掉重复边框(外框已由 .markloom-table border 提供) */
103
- .markloom-table tr > .markloom-cell:last-child {
104
- border-right: none;
105
- }
106
- .markloom-table tbody tr:last-child > .markloom-cell {
107
- border-bottom: none;
108
- }
378
+ .markloom-table tr > .markloom-cell:last-child { border-right: none; }
379
+ .markloom-table tbody tr:last-child > .markloom-cell { border-bottom: none; }
109
380
 
110
- /* 格内替换元素受格宽约束:table-layout:fixed 下,img 以自然宽渲染会溢出格边界。
111
- max-width:100% 把它压回格内,height:auto 保原比例。图片仍横向滚不了,交给格内换行。 */
112
381
  .markloom-doc .markloom-cell img,
113
382
  .markloom-doc .markloom-cell video,
114
383
  .markloom-doc .markloom-cell canvas {
115
- max-width: 100%;
116
- height: auto;
384
+ @apply max-w-full h-auto;
117
385
  }
118
386
 
119
- /* 正文图片压回列宽内(避免大图溢出)。 */
120
387
  .markloom-doc img[data-atom="image"] {
121
- max-width: 100%;
122
- height: auto;
123
- /* 块级图上下间距 12px:比段落(0.5rem=8px)略宽给图一点呼吸感,又不像浏览器默认 2rem 那么孤立。 */
124
- margin: 12px 0;
388
+ @apply max-w-full h-auto my-3;
125
389
  }
126
390
 
127
- /* 格内段落零外边距:.markloom-doc p(0.5rem 外边距)同特异度但靠后会盖过 .markloom-cell p,
128
- 需把格内段落拉到 .markloom-doc .markloom-cell p 才稳赢。首段还要去掉顶距,垂直 align:top 才贴顶。 */
129
391
  .markloom-doc .markloom-cell p {
130
- margin: 0;
131
- line-height: 1.5;
392
+ @apply m-0 leading-normal;
393
+ white-space: pre-wrap;
132
394
  }
133
395
  .markloom-doc .markloom-cell p + p {
134
- margin-top: 4px;
396
+ @apply mt-1;
135
397
  }
136
398
 
137
- /* 行列联动(同行或同列的 cell 浅色底)—— 飞书式:选中格的整行整列淡色提示。
138
- .markloom-table 前缀拉高特异度,压过表头底色(thead .markloom-cell),表头格联动时也变蓝。 */
139
399
  .markloom-table .markloom-cell[data-highlight-row],
140
400
  .markloom-table .markloom-cell[data-highlight-col] {
141
401
  background-color: rgba(59, 130, 246, 0.07);
142
402
  }
143
403
 
144
- /* 整行/整列选中(点控制柄)—— 抄 note:selectedCell = blue-100 底 + blue-200 double 描边 */
145
404
  .markloom-table .markloom-cell[data-selected] {
146
405
  background-color: #dbeafe;
147
406
  box-shadow: inset 0 0 0 1px #bfdbfe;
@@ -152,59 +411,49 @@
152
411
  box-shadow: inset 0 0 0 1px rgba(147, 197, 253, 0.2);
153
412
  }
154
413
  }
414
+ html.dark .markloom-table .markloom-cell[data-selected] {
415
+ background-color: rgba(59, 130, 246, 0.1);
416
+ box-shadow: inset 0 0 0 1px rgba(147, 197, 253, 0.2);
417
+ }
155
418
 
156
- /* 冻结行/列 —— .markloom-table-scroll 是横竖滚动容器,冻结格 position:sticky 锚在容器边。
157
- render 给锚点行 <freezeRows 的格挂 data-freeze-row、列 <freezeCols 挂 data-freeze-col。
158
- sticky 需不透明底(否则滚动内容透上来),故给白/深底盖住;z 抬起压过普通格。 */
419
+ /* freeze: sticky + opaque bg (residual) */
159
420
  .markloom-table .markloom-cell[data-freeze-row] {
160
- position: sticky;
161
- top: 0;
162
- z-index: 2;
421
+ @apply sticky top-0 z-[2];
163
422
  background-color: #fff;
164
423
  }
165
424
  .markloom-table .markloom-cell[data-freeze-col] {
166
- position: sticky;
167
- left: 0;
168
- z-index: 2;
425
+ @apply sticky left-0 z-[2];
169
426
  background-color: #fff;
170
427
  }
171
428
  .markloom-table .markloom-cell[data-freeze-row][data-freeze-col] {
172
- z-index: 3; /* 行列交叉角:压过单向冻结格 */
429
+ z-index: 3;
173
430
  }
174
431
  @media (prefers-color-scheme: dark) {
175
432
  .markloom-table .markloom-cell[data-freeze-row],
176
- .markloom-table .markloom-cell[data-freeze-col] {
177
- background-color: #1a1a1a;
178
- }
433
+ .markloom-table .markloom-cell[data-freeze-col] { background-color: #1a1a1a; }
179
434
  }
435
+ html.dark .markloom-table .markloom-cell[data-freeze-row],
436
+ html.dark .markloom-table .markloom-cell[data-freeze-col] { background-color: #1a1a1a; }
180
437
 
181
- /* 聚焦格 —— 行列联动之上再压一层,2px 蓝描边盖过相邻边框(z-index 抬起)*/
182
438
  .markloom-table .markloom-cell:focus {
183
- background-color: rgba(59, 130, 246, 0.12);
184
- box-shadow: inset 0 0 0 2px rgb(59, 130, 246);
185
- position: relative;
186
- z-index: 1;
439
+ @apply relative z-[1];
440
+ background-color: rgba(59, 130, 246, 0.08);
441
+ box-shadow: inset 0 0 0 1px var(--markloom-accent, rgb(59, 130, 246));
187
442
  }
188
-
189
- /* 暗色 */
190
443
  @media (prefers-color-scheme: dark) {
191
444
  .markloom-table .markloom-cell[data-highlight-row],
192
- .markloom-table .markloom-cell[data-highlight-col] {
193
- background-color: rgba(59, 130, 246, 0.1);
194
- }
195
- .markloom-table .markloom-cell:focus {
196
- background-color: rgba(59, 130, 246, 0.18);
197
- }
445
+ .markloom-table .markloom-cell[data-highlight-col] { background-color: rgba(59, 130, 246, 0.1); }
446
+ .markloom-table .markloom-cell:focus { background-color: rgba(59, 130, 246, 0.18); }
198
447
  }
448
+ html.dark .markloom-table .markloom-cell[data-highlight-row],
449
+ html.dark .markloom-table .markloom-cell[data-highlight-col] { background-color: rgba(59, 130, 246, 0.1); }
450
+ html.dark .markloom-table .markloom-cell:focus { background-color: rgba(59, 130, 246, 0.18); }
199
451
 
200
- /* ─── 代码块 ─── */
452
+ /* ── code block ──
453
+ 壳 max-width:100% 才能让 pre 的 overflow-x 形成滚动口(父被长行撑开时 auto 永不滚) */
201
454
  [data-code-block] {
202
- position: relative;
203
- margin: 0.5rem 0;
204
- outline: none;
205
- box-shadow: none;
455
+ @apply relative my-5 max-w-full min-w-0 outline-none shadow-none;
206
456
  }
207
- /* 聚焦时不要 outline / focus ring(浏览器/宿主 :focus-visible 常画一圈) */
208
457
  [data-code-block]:focus,
209
458
  [data-code-block]:focus-within,
210
459
  [data-code-block]:focus-visible,
@@ -220,146 +469,271 @@
220
469
  .markloom-doc > pre[data-block-id]:focus,
221
470
  .markloom-doc > pre[data-block-id]:focus-within,
222
471
  .markloom-doc > pre[data-block-id]:focus-visible {
223
- outline: none;
224
- box-shadow: none;
472
+ @apply outline-none shadow-none;
473
+ }
474
+
475
+ [data-code-block] [data-code-hl] {
476
+ @apply max-w-full min-w-0 overflow-x-auto;
225
477
  }
226
478
 
227
479
  [data-code-block] pre {
228
- margin: 0;
229
- padding: 1rem 1.25rem;
230
- border-radius: 12px;
231
- background-color: var(--bg-side) !important;
232
- font-size: 13px;
233
- line-height: 1.6;
234
- overflow-x: auto;
480
+ @apply m-0 max-w-full px-5 py-4 rounded-xl border-0 text-[13px] leading-relaxed overflow-x-auto;
481
+ background-color: #f6f7f9 !important;
482
+ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
483
+ font-feature-settings: "liga" 0;
484
+ tab-size: 2;
485
+ }
486
+
487
+ /* Shiki dual-theme:只切字色,背景统一由壳控制(避免 github 脏灰岛) */
488
+ @media (prefers-color-scheme: dark) {
489
+ .shiki,
490
+ .shiki span {
491
+ color: var(--shiki-dark) !important;
492
+ background-color: transparent !important;
493
+ }
494
+ [data-code-block] pre,
495
+ [data-code-block] pre.shiki {
496
+ background-color: #1c1c1e !important;
497
+ }
498
+ }
499
+ html.dark .shiki,
500
+ html.dark .shiki span {
501
+ color: var(--shiki-dark) !important;
502
+ background-color: transparent !important;
503
+ }
504
+ html.dark [data-code-block] pre,
505
+ html.dark [data-code-block] pre.shiki {
506
+ background-color: #1c1c1e !important;
235
507
  }
236
508
 
237
- /* 语言标签(右上,排在复制按钮左侧:复制按钮宽 28px + top/right 0.5rem,留 6px 间隔) */
238
509
  [data-code-block] [data-code-lang] {
239
- position: absolute;
240
- top: 0.5rem;
510
+ @apply absolute top-2.5 z-10 px-2 py-0.5 border-0 rounded-md text-xs cursor-pointer opacity-0;
241
511
  right: calc(0.5rem + 28px + 6px);
242
- z-index: 10;
243
- padding: 2px 8px;
244
- border: none;
245
- border-radius: 6px;
246
- background-color: var(--bg-hover);
512
+ background-color: rgba(0, 0, 0, 0.05);
247
513
  color: var(--text-c);
248
- font-size: 12px;
249
514
  line-height: 18px;
250
- cursor: pointer;
251
- opacity: 0;
252
- transition: opacity 0.15s, color 0.15s, background-color 0.15s;
253
- }
254
-
255
- [data-code-block]:hover [data-code-lang] {
256
- opacity: 1;
515
+ font: 500 11px/18px system-ui, -apple-system, 'Segoe UI', sans-serif;
516
+ letter-spacing: 0.02em;
257
517
  }
258
-
518
+ [data-code-block]:hover [data-code-lang] { @apply opacity-100; }
259
519
  [data-code-block] [data-code-lang]:hover {
260
520
  color: var(--text-a);
261
- background-color: var(--bg-active);
521
+ background-color: rgba(0, 0, 0, 0.08);
522
+ }
523
+ @media (prefers-color-scheme: dark) {
524
+ [data-code-block] [data-code-lang] {
525
+ background-color: rgba(255, 255, 255, 0.08);
526
+ color: rgba(255, 255, 255, 0.45);
527
+ }
528
+ [data-code-block] [data-code-lang]:hover {
529
+ color: rgba(255, 255, 255, 0.88);
530
+ background-color: rgba(255, 255, 255, 0.12);
531
+ }
532
+ }
533
+ html.dark [data-code-block] [data-code-lang] {
534
+ background-color: rgba(255, 255, 255, 0.08);
535
+ color: rgba(255, 255, 255, 0.45);
536
+ }
537
+ html.dark [data-code-block] [data-code-lang]:hover {
538
+ color: rgba(255, 255, 255, 0.88);
539
+ background-color: rgba(255, 255, 255, 0.12);
262
540
  }
263
541
 
264
- /* 复制按钮 */
265
542
  [data-code-block] [data-copy] {
266
- position: absolute;
267
- top: 0.5rem;
268
- right: 0.5rem;
269
- z-index: 10;
270
- display: flex;
271
- align-items: center;
272
- justify-content: center;
273
- width: 28px;
274
- height: 28px;
275
- border: none;
276
- border-radius: 6px;
277
- background-color: var(--bg-hover);
543
+ @apply absolute top-2.5 right-2.5 z-10 flex items-center justify-center w-7 h-7 border-0 rounded-md cursor-pointer opacity-0;
544
+ background-color: rgba(0, 0, 0, 0.05);
278
545
  color: var(--text-b);
279
- cursor: pointer;
280
- opacity: 0;
281
- transition: opacity 0.15s, color 0.15s, background-color 0.15s;
282
- }
283
-
284
- [data-code-block]:hover [data-copy] {
285
- opacity: 1;
286
546
  }
287
-
547
+ [data-code-block]:hover [data-copy] { @apply opacity-100; }
288
548
  [data-code-block] [data-copy]:hover {
289
549
  color: var(--text-a);
290
- background-color: var(--bg-active);
550
+ background-color: rgba(0, 0, 0, 0.08);
551
+ }
552
+ @media (prefers-color-scheme: dark) {
553
+ [data-code-block] [data-copy] {
554
+ background-color: rgba(255, 255, 255, 0.08);
555
+ color: rgba(255, 255, 255, 0.55);
556
+ }
557
+ [data-code-block] [data-copy]:hover {
558
+ color: rgba(255, 255, 255, 0.9);
559
+ background-color: rgba(255, 255, 255, 0.12);
560
+ }
561
+ }
562
+ html.dark [data-code-block] [data-copy] {
563
+ background-color: rgba(255, 255, 255, 0.08);
564
+ color: rgba(255, 255, 255, 0.55);
565
+ }
566
+ html.dark [data-code-block] [data-copy]:hover {
567
+ color: rgba(255, 255, 255, 0.9);
568
+ background-color: rgba(255, 255, 255, 0.12);
291
569
  }
292
570
 
293
- /* 复制图标 */
294
571
  [data-code-block] [data-copy]::after {
295
572
  content: '';
296
- display: block;
297
- width: 14px;
298
- height: 14px;
573
+ @apply block w-3.5 h-3.5;
299
574
  background-color: currentColor;
300
575
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='13' height='13' rx='2'/%3E%3Cpath d='M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1'/%3E%3C/svg%3E") center / contain no-repeat;
301
576
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='13' height='13' rx='2'/%3E%3Cpath d='M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1'/%3E%3C/svg%3E") center / contain no-repeat;
302
577
  }
303
-
304
- /* 复制成功 */
305
578
  [data-code-block] [data-copy][data-copied] {
306
- opacity: 1;
307
- transition: none; /* 打勾要瞬切,不让 color/bg 过渡把勾从灰色淡入 */
579
+ @apply opacity-100;
580
+ transition: none;
308
581
  }
309
-
310
582
  [data-code-block] [data-copy][data-copied]::after {
311
583
  transition: none;
312
584
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
313
585
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
314
586
  }
315
587
 
316
- /* ─── 引用块 ─── */
588
+ /* ── hr(note 旧 horizontalRule 内化)──
589
+ 浏览器默认 inset 双边在暗底上发脏光;note 是 border-0 + border-t black/20|white/20 + my-8。
590
+ 选中/hover 高亮留给编辑器 data 态叠,读态 SSG 只吃这条。 */
591
+ .markloom-doc hr {
592
+ @apply my-8 border-0;
593
+ height: 0;
594
+ border-top: 1px solid var(--markloom-line);
595
+ background: transparent;
596
+ }
597
+ /* 编辑态点选 hr:note 的 ProseMirror-selectednode 同构 */
598
+ .markloom-doc hr[data-selected],
599
+ .markloom-doc hr:focus {
600
+ outline: none;
601
+ box-shadow: 0 0 0 4px var(--bg-hover);
602
+ border-top-color: var(--text-c);
603
+ }
604
+
605
+ /* ── blockquote / callout ── */
317
606
  .markloom-doc blockquote {
318
- margin: 0.5rem 0;
319
- padding-left: 1rem;
607
+ @apply my-4 pl-4;
320
608
  border-left: 3px solid var(--bg-active);
321
- color: var(--text-b);
609
+ color: var(--text-a);
322
610
  }
323
611
 
324
- /* ─── 高亮块 callout(飞书/Notion 提示框)─── */
325
- /* 容器盒:左粗边框 + 浅背景,四 variant 各配一对(border 深 / bg 浅)。图标略——颜色已表达语义。 */
326
612
  .markloom-doc .markloom-callout {
327
- margin: 0.5rem 0;
328
- padding: 0.75rem 1rem;
613
+ @apply relative my-2.5 pl-4 pr-14 py-3 rounded-lg;
329
614
  border-left: 3px solid;
330
- border-radius: 4px;
331
- position: relative;
332
615
  }
333
- /* 芯片在右上角,contentEditable=false 不吞光标;点它循环四色。 */
334
616
  .markloom-doc .markloom-callout > .markloom-callout-chip {
335
- position: absolute;
336
- top: 0.4rem;
337
- right: 0.5rem;
338
- padding: 0 6px;
617
+ @apply absolute cursor-pointer select-none rounded-md border-0 px-1.5;
618
+ top: 0.55rem;
619
+ right: 0.55rem;
339
620
  height: 20px;
340
- border: 1px solid transparent;
341
- border-radius: 4px;
342
- background: rgba(0, 0, 0, 0.04);
343
- color: var(--text-b);
344
- font: 500 11px/20px system-ui, sans-serif;
345
- cursor: pointer;
346
- user-select: none;
621
+ font: 500 11px/20px system-ui, -apple-system, 'Segoe UI', sans-serif;
622
+ letter-spacing: 0.02em;
623
+ opacity: 0.92;
347
624
  }
348
625
  .markloom-doc .markloom-callout > .markloom-callout-chip:hover {
349
- background: rgba(0, 0, 0, 0.08);
626
+ opacity: 1;
627
+ filter: brightness(1.05);
628
+ }
629
+ .markloom-doc .markloom-callout > :not(.markloom-callout-chip):first-of-type { @apply mt-0; }
630
+ .markloom-doc .markloom-callout > :last-child { @apply mb-0; }
631
+
632
+ /* light — 飞书系:浅底 + 同色左边条 + 同色 chip */
633
+ .markloom-doc .markloom-callout[data-variant="info"] {
634
+ border-color: #3370ff;
635
+ background: #edf3ff;
636
+ }
637
+ .markloom-doc .markloom-callout[data-variant="info"] > .markloom-callout-chip {
638
+ color: #245bdb;
639
+ background: rgba(51, 112, 255, 0.12);
640
+ }
641
+ .markloom-doc .markloom-callout[data-variant="warn"] {
642
+ border-color: #dc9b04;
643
+ background: #fff8e8;
644
+ }
645
+ .markloom-doc .markloom-callout[data-variant="warn"] > .markloom-callout-chip {
646
+ color: #b47804;
647
+ background: rgba(220, 155, 4, 0.14);
648
+ }
649
+ .markloom-doc .markloom-callout[data-variant="success"] {
650
+ border-color: #2ea121;
651
+ background: #eef9ee;
652
+ }
653
+ .markloom-doc .markloom-callout[data-variant="success"] > .markloom-callout-chip {
654
+ color: #237b1a;
655
+ background: rgba(46, 161, 33, 0.12);
656
+ }
657
+ .markloom-doc .markloom-callout[data-variant="danger"] {
658
+ border-color: #f54a45;
659
+ background: #feeeee;
660
+ }
661
+ .markloom-doc .markloom-callout[data-variant="danger"] > .markloom-callout-chip {
662
+ color: #d83931;
663
+ background: rgba(245, 74, 69, 0.12);
350
664
  }
351
- .markloom-doc .markloom-callout > :not(.markloom-callout-chip):first-of-type { margin-top: 0; }
352
- .markloom-doc .markloom-callout > :last-child { margin-bottom: 0; }
353
- .markloom-doc .markloom-callout[data-variant="info"] { border-color: #1456f0; background: rgba(20, 86, 240, 0.06); }
354
- .markloom-doc .markloom-callout[data-variant="warn"] { border-color: #d97706; background: rgba(217, 119, 6, 0.08); }
355
- .markloom-doc .markloom-callout[data-variant="success"] { border-color: #16a34a; background: rgba(22, 163, 74, 0.08); }
356
- .markloom-doc .markloom-callout[data-variant="danger"] { border-color: #dc2626; background: rgba(220, 38, 38, 0.07); }
357
665
 
358
- /* ─── 标题 ─── 选中浅蓝;折叠态 data-collapsed;三角在 hover 操作栏 */
666
+ /* dark — 同色相、略提饱和,避免脏灰底 */
667
+ @media (prefers-color-scheme: dark) {
668
+ .markloom-doc .markloom-callout[data-variant="info"] {
669
+ border-color: #7aafff;
670
+ background: rgba(122, 175, 255, 0.12);
671
+ }
672
+ .markloom-doc .markloom-callout[data-variant="info"] > .markloom-callout-chip {
673
+ color: #9bc4ff;
674
+ background: rgba(122, 175, 255, 0.18);
675
+ }
676
+ .markloom-doc .markloom-callout[data-variant="warn"] {
677
+ border-color: #f0b429;
678
+ background: rgba(240, 180, 41, 0.12);
679
+ }
680
+ .markloom-doc .markloom-callout[data-variant="warn"] > .markloom-callout-chip {
681
+ color: #f5c84c;
682
+ background: rgba(240, 180, 41, 0.18);
683
+ }
684
+ .markloom-doc .markloom-callout[data-variant="success"] {
685
+ border-color: #62d26f;
686
+ background: rgba(98, 210, 111, 0.12);
687
+ }
688
+ .markloom-doc .markloom-callout[data-variant="success"] > .markloom-callout-chip {
689
+ color: #7dde88;
690
+ background: rgba(98, 210, 111, 0.18);
691
+ }
692
+ .markloom-doc .markloom-callout[data-variant="danger"] {
693
+ border-color: #f98981;
694
+ background: rgba(249, 137, 129, 0.12);
695
+ }
696
+ .markloom-doc .markloom-callout[data-variant="danger"] > .markloom-callout-chip {
697
+ color: #fba9a3;
698
+ background: rgba(249, 137, 129, 0.18);
699
+ }
700
+ }
701
+ html.dark .markloom-doc .markloom-callout[data-variant="info"] {
702
+ border-color: #7aafff;
703
+ background: rgba(122, 175, 255, 0.12);
704
+ }
705
+ html.dark .markloom-doc .markloom-callout[data-variant="info"] > .markloom-callout-chip {
706
+ color: #9bc4ff;
707
+ background: rgba(122, 175, 255, 0.18);
708
+ }
709
+ html.dark .markloom-doc .markloom-callout[data-variant="warn"] {
710
+ border-color: #f0b429;
711
+ background: rgba(240, 180, 41, 0.12);
712
+ }
713
+ html.dark .markloom-doc .markloom-callout[data-variant="warn"] > .markloom-callout-chip {
714
+ color: #f5c84c;
715
+ background: rgba(240, 180, 41, 0.18);
716
+ }
717
+ html.dark .markloom-doc .markloom-callout[data-variant="success"] {
718
+ border-color: #62d26f;
719
+ background: rgba(98, 210, 111, 0.12);
720
+ }
721
+ html.dark .markloom-doc .markloom-callout[data-variant="success"] > .markloom-callout-chip {
722
+ color: #7dde88;
723
+ background: rgba(98, 210, 111, 0.18);
724
+ }
725
+ html.dark .markloom-doc .markloom-callout[data-variant="danger"] {
726
+ border-color: #f98981;
727
+ background: rgba(249, 137, 129, 0.12);
728
+ }
729
+ html.dark .markloom-doc .markloom-callout[data-variant="danger"] > .markloom-callout-chip {
730
+ color: #fba9a3;
731
+ background: rgba(249, 137, 129, 0.18);
732
+ }
733
+
734
+ /* ── heading focus / fold ── */
359
735
  .markloom-doc .markloom-heading {
360
- position: relative;
361
- border-radius: 4px;
362
- transition: background 0.1s ease;
736
+ @apply relative rounded transition-colors duration-100;
363
737
  }
364
738
  .markloom-doc .markloom-heading:focus-within {
365
739
  background: rgba(51, 112, 255, 0.08);
@@ -368,89 +742,42 @@
368
742
  display: none !important;
369
743
  }
370
744
 
371
- /* ─── 块左侧 hover 操作栏(飞书):H2 · 六点 · 三角 同一容器 ─── */
745
+ /* ── block bar (drag / fold / kind) ── */
746
+ /* 左侧 gutter 全高 hit 只用来画占位;必须 none,否则手柄下方窄条吃住 wheel,
747
+ 滚不到 note 的 overflow-auto(同 image-overlay 的教训)。真正接指针的是 bar 按钮。 */
372
748
  .markloom-drag-hit {
373
- position: fixed;
374
- z-index: 64;
375
- pointer-events: auto;
749
+ @apply fixed z-[64] pointer-events-none;
376
750
  }
377
751
  .markloom-block-bar {
378
- position: fixed;
379
- z-index: 65;
380
- display: inline-flex;
381
- align-items: center;
382
- justify-content: flex-end;
383
- gap: 2px;
384
- height: 22px;
385
- padding: 0 2px;
386
- box-sizing: border-box;
387
- user-select: none;
388
- /* top/left 由 JS: 首行垂直居中 + 右缘贴块左(translateX -100%) */
752
+ @apply fixed z-[65] inline-flex items-center justify-end gap-0.5 h-[22px] px-0.5 box-border select-none;
389
753
  }
390
754
  .markloom-block-kind {
391
- display: inline-flex;
392
- align-items: center;
393
- justify-content: center;
394
- min-width: 22px;
395
- height: 20px;
396
- padding: 0 5px;
397
- border-radius: 4px;
755
+ @apply inline-flex items-center justify-center min-w-[22px] h-5 px-[5px] rounded box-border shrink-0 pointer-events-none;
398
756
  background: #eff0f1;
399
757
  color: #646a73;
400
758
  font: 500 11px/20px system-ui, -apple-system, 'Segoe UI', sans-serif;
401
759
  letter-spacing: 0.02em;
402
- pointer-events: none;
403
- box-sizing: border-box;
404
- flex: none;
405
760
  line-height: 20px;
406
761
  }
407
762
  .markloom-block-bar .markloom-drag-handle,
408
763
  .markloom-block-bar .markloom-add-handle,
409
764
  .markloom-block-bar .markloom-heading-fold {
410
- position: static;
411
- z-index: auto;
412
- flex: none;
413
- width: 18px;
414
- height: 20px;
415
- margin: 0;
416
- padding: 0;
417
- display: inline-flex;
418
- align-items: center;
419
- justify-content: center;
420
- box-sizing: border-box;
765
+ @apply static z-auto shrink-0 w-[18px] h-5 m-0 p-0 inline-flex items-center justify-center box-border;
421
766
  }
422
767
  .markloom-block-bar .markloom-heading-fold {
423
- border: none;
424
- border-radius: 3px;
425
- background: transparent;
426
- cursor: pointer;
427
- color: #000;
768
+ @apply border-0 rounded-sm bg-transparent cursor-pointer text-black origin-center;
428
769
  transition: background 0.1s ease, transform 0.15s ease;
429
- transform-origin: center center;
430
770
  }
431
771
  .markloom-block-bar .markloom-heading-fold svg {
432
- display: block;
433
- width: 14px;
434
- height: 14px;
435
- }
436
- .markloom-block-bar .markloom-heading-fold path {
437
- fill: #000;
438
- }
439
- .markloom-block-bar .markloom-heading-fold.is-collapsed {
440
- transform: rotate(-90deg);
441
- }
442
- .markloom-block-bar .markloom-heading-fold:hover {
443
- background: rgba(0, 0, 0, 0.06);
772
+ @apply block w-3.5 h-3.5;
444
773
  }
445
- /* H{n} 也是拖拽手柄;聚焦/菜单开时蓝框(飞书选中态) */
774
+ .markloom-block-bar .markloom-heading-fold path { fill: #000; }
775
+ .markloom-block-bar .markloom-heading-fold.is-collapsed { @apply -rotate-90; }
776
+ .markloom-block-bar .markloom-heading-fold:hover { background: rgba(0, 0, 0, 0.06); }
446
777
  .markloom-block-bar .markloom-block-kind {
447
- pointer-events: auto;
448
- border: 1px solid transparent;
449
- cursor: grab;
450
- }
451
- .markloom-block-bar .markloom-block-kind:active {
452
- cursor: grabbing;
778
+ @apply pointer-events-auto border border-transparent cursor-grab;
453
779
  }
780
+ .markloom-block-bar .markloom-block-kind:active { @apply cursor-grabbing; }
454
781
  .markloom-block-bar .markloom-block-kind.is-on {
455
782
  color: #3370ff;
456
783
  background: #fff;
@@ -458,83 +785,72 @@
458
785
  box-shadow: 0 0 0 1px rgba(51, 112, 255, 0.12);
459
786
  }
460
787
  @media (prefers-color-scheme: dark) {
788
+ .markloom-block-kind {
789
+ background: rgba(255, 255, 255, 0.1);
790
+ color: rgba(255, 255, 255, 0.65);
791
+ }
792
+ .markloom-block-bar .markloom-heading-fold {
793
+ color: rgba(255, 255, 255, 0.75);
794
+ }
795
+ .markloom-block-bar .markloom-heading-fold path { fill: rgba(255, 255, 255, 0.75); }
796
+ .markloom-block-bar .markloom-heading-fold:hover { background: rgba(255, 255, 255, 0.1); }
461
797
  .markloom-block-bar .markloom-block-kind.is-on {
462
798
  color: #7aafff;
463
799
  background: var(--bg-page, #2a2a2a);
464
800
  border-color: #4c8bf5;
465
801
  }
466
802
  }
803
+ html.dark .markloom-block-kind {
804
+ background: rgba(255, 255, 255, 0.1);
805
+ color: rgba(255, 255, 255, 0.65);
806
+ }
807
+ html.dark .markloom-block-bar .markloom-heading-fold {
808
+ color: rgba(255, 255, 255, 0.75);
809
+ }
810
+ html.dark .markloom-block-bar .markloom-heading-fold path { fill: rgba(255, 255, 255, 0.75); }
811
+ html.dark .markloom-block-bar .markloom-heading-fold:hover { background: rgba(255, 255, 255, 0.1); }
812
+ html.dark .markloom-block-bar .markloom-block-kind.is-on {
813
+ color: #7aafff;
814
+ background: var(--bg-page, #2a2a2a);
815
+ border-color: #4c8bf5;
816
+ }
467
817
 
468
- /* 手柄悬停 → 块格式弹层(类型 / 加粗 / 颜色 / 对齐)
469
- z 须高于 app 壳侧栏(~80),否则贴左时被笔记列表盖住 */
470
818
  .markloom-block-menu {
471
- position: fixed;
472
- z-index: 100;
473
- min-width: 200px;
474
- padding: 6px;
475
- border-radius: 10px;
819
+ @apply fixed z-[100] min-w-[200px] p-1.5 rounded-[10px] flex flex-col gap-1 select-none;
476
820
  border: 1px solid rgba(0, 0, 0, 0.06);
477
821
  background: #fff;
478
822
  box-shadow:
479
823
  0 0 0 0.5px rgba(0, 0, 0, 0.02),
480
824
  0 8px 28px rgba(0, 0, 0, 0.1),
481
825
  0 2px 6px rgba(0, 0, 0, 0.04);
482
- display: flex;
483
- flex-direction: column;
484
- gap: 4px;
485
- user-select: none;
486
826
  }
487
827
  .markloom-block-menu-row {
488
- display: flex;
489
- flex-wrap: wrap;
490
- align-items: center;
491
- gap: 2px;
828
+ @apply flex flex-wrap items-center gap-0.5;
492
829
  }
493
830
  .markloom-block-menu-sep {
494
- height: 1px;
495
- margin: 2px 4px;
831
+ @apply h-px mx-1 my-0.5;
496
832
  background: rgba(0, 0, 0, 0.06);
497
833
  }
498
834
  .markloom-block-menu-btn {
499
- min-width: 28px;
500
- height: 28px;
501
- padding: 0 7px;
502
- border: none;
503
- border-radius: 6px;
504
- background: transparent;
835
+ @apply min-w-7 h-7 px-[7px] border-0 rounded-md bg-transparent cursor-pointer;
505
836
  color: var(--text-a, rgba(0, 0, 0, 0.82));
506
837
  font: 500 12px/1 system-ui, -apple-system, 'Segoe UI', sans-serif;
507
- cursor: pointer;
508
838
  transition: background 0.1s ease, color 0.1s ease;
509
839
  }
510
- .markloom-block-menu-btn:hover {
511
- background: rgba(0, 0, 0, 0.05);
512
- }
840
+ .markloom-block-menu-btn:hover { background: rgba(0, 0, 0, 0.05); }
513
841
  .markloom-block-menu-btn.is-on {
514
842
  background: rgba(51, 112, 255, 0.1);
515
- color: var(--accent, #3370ff);
516
- }
517
- .markloom-block-menu-mark[data-mark="bold"] {
518
- font-weight: 700;
519
- }
520
- .markloom-block-menu-mark[data-mark="italic"] {
521
- font-style: italic;
522
- }
523
- .markloom-block-menu-colors {
524
- padding: 2px 4px 4px;
525
- gap: 6px;
843
+ color: var(--markloom-accent);
526
844
  }
845
+ .markloom-block-menu-mark[data-mark="bold"] { @apply font-bold; }
846
+ .markloom-block-menu-mark[data-mark="italic"] { @apply italic; }
847
+ .markloom-block-menu-colors { @apply px-1 pb-1 pt-0.5 gap-1.5; }
527
848
  .markloom-block-menu-swatch {
528
- width: 16px;
529
- height: 16px;
530
- padding: 0;
849
+ @apply w-4 h-4 p-0 rounded-full cursor-pointer box-border;
531
850
  border: 1px solid rgba(0, 0, 0, 0.1);
532
- border-radius: 50%;
533
- cursor: pointer;
534
- box-sizing: border-box;
535
851
  }
536
852
  .markloom-block-menu-swatch:hover {
537
- transform: scale(1.12);
853
+ @apply scale-110;
538
854
  box-shadow: 0 0 0 2px rgba(51, 112, 255, 0.25);
539
855
  }
540
856
  @media (prefers-color-scheme: dark) {
@@ -543,463 +859,579 @@
543
859
  border-color: rgba(255, 255, 255, 0.08);
544
860
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
545
861
  }
546
- .markloom-block-menu-sep {
547
- background: rgba(255, 255, 255, 0.1);
862
+ .markloom-block-menu-sep { background: rgba(255, 255, 255, 0.1); }
863
+ .markloom-block-menu-btn { color: var(--text-a, rgba(255, 255, 255, 0.88)); }
864
+ .markloom-block-menu-btn:hover { background: rgba(255, 255, 255, 0.08); }
865
+ .markloom-block-menu-btn.is-on { background: rgba(76, 139, 245, 0.2); color: #7aafff; }
866
+ .markloom-block-menu-swatch { border-color: rgba(255, 255, 255, 0.2); }
867
+ }
868
+ html.dark .markloom-block-menu {
869
+ background: var(--bg-page, #2a2a2a);
870
+ border-color: rgba(255, 255, 255, 0.08);
871
+ box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
872
+ }
873
+ html.dark .markloom-block-menu-sep { background: rgba(255, 255, 255, 0.1); }
874
+ html.dark .markloom-block-menu-btn { color: var(--text-a, rgba(255, 255, 255, 0.88)); }
875
+ html.dark .markloom-block-menu-btn:hover { background: rgba(255, 255, 255, 0.08); }
876
+ html.dark .markloom-block-menu-btn.is-on { background: rgba(76, 139, 245, 0.2); color: #7aafff; }
877
+ html.dark .markloom-block-menu-swatch { border-color: rgba(255, 255, 255, 0.2); }
878
+
879
+ /* ── lists / headings / p / code ──
880
+ 列表 = 有序 / 无序 / 任务 同一节奏(模型都是 list > list_item;task 只换 checkbox)。
881
+
882
+ 垂直唯一轴 --markloom-list-gap(勿再给 li 写 my-*):
883
+ · 兄弟:li + li { margin-top: gap }
884
+ · 嵌套:li > ul/ol { margin-top: gap } ← 与兄弟同值,Tab 二级不跳
885
+ margin 折叠在「兄弟 li」与「父 p→子 ol」上不对称,用单边 top gap 才能两边相等。
886
+
887
+ 水平:不用原生 outside/inside marker(outside 左顶白边;inside+块级 p 序号单独占行)。
888
+ 改为 list-style:none + li::before 计数/圆点,与正文 flex 同行、左缘=段落左缘
889
+ →「1.␣」「-␣」触发转列表时字形 x 不变。嵌套只 padding-left 加一档。
890
+ li 内 p 压掉 my-4,否则项间距≈段间距。 */
891
+ .markloom-doc {
892
+ --markloom-list-gap: 0.35em;
893
+ --markloom-list-indent: 1.5rem;
894
+ }
895
+ .markloom-doc ul,
896
+ .markloom-doc ol {
897
+ margin-top: 0.5rem;
898
+ margin-bottom: 0.5rem;
899
+ padding-left: 0;
900
+ list-style: none;
901
+ }
902
+ .markloom-doc ol { counter-reset: markloom-ol; }
903
+ .markloom-doc li {
904
+ margin: 0;
905
+ padding: 0;
906
+ color: var(--text-a);
907
+ display: flex;
908
+ flex-wrap: wrap;
909
+ align-items: baseline;
910
+ column-gap: 0; /* 空格写在 ::before 里,与敲「1.␣」同形 */
911
+ }
912
+ /* 兄弟项间距(有序/无序/任务共用) */
913
+ .markloom-doc li + li {
914
+ margin-top: var(--markloom-list-gap);
915
+ }
916
+ /* 有序/无序 marker:左缘=段落左缘;后缀一普通空格 ≈ 触发用的那次 space */
917
+ .markloom-doc ol > li {
918
+ counter-increment: markloom-ol;
919
+ }
920
+ .markloom-doc ol > li::before {
921
+ content: counter(markloom-ol) ". ";
922
+ color: var(--markloom-accent);
923
+ flex: 0 0 auto;
924
+ white-space: pre;
925
+ }
926
+ /* 序号样式:用 data-list-type 选,不用 [type]——HTML 的 type 属性值不分大小写,[type="A"] 会连 type="a" 一起选中(真浏览器里 a 画成了 A)。list-marker.ts 的 LIST_TYPE_CSS 是同一张表 */
927
+ .markloom-doc ol[data-list-type="a"] > li::before { content: counter(markloom-ol, lower-alpha) ". "; }
928
+ .markloom-doc ol[data-list-type="A"] > li::before { content: counter(markloom-ol, upper-alpha) ". "; }
929
+ .markloom-doc ol[data-list-type="i"] > li::before { content: counter(markloom-ol, lower-roman) ". "; }
930
+ .markloom-doc ol[data-list-type="I"] > li::before { content: counter(markloom-ol, upper-roman) ". "; }
931
+ .markloom-doc ul > li::before {
932
+ content: "• ";
933
+ color: var(--markloom-accent);
934
+ flex: 0 0 auto;
935
+ white-space: pre;
936
+ font-size: 1.45em;
937
+ line-height: 1;
938
+ }
939
+ .markloom-doc li > p {
940
+ margin-top: 0;
941
+ margin-bottom: 0;
942
+ flex: 1 1 0;
943
+ min-width: 0;
944
+ }
945
+ .markloom-doc li > p + p {
946
+ margin-top: 0.25rem;
947
+ /* 续段与首行正文齐平(marker≈1.5ch + 空格) */
948
+ flex-basis: 100%;
949
+ padding-left: 1.75em;
950
+ }
951
+ /* 嵌套:与兄弟同一 gap;只加水平缩进;折行占满宽 */
952
+ .markloom-doc li > ul,
953
+ .markloom-doc li > ol {
954
+ margin-top: var(--markloom-list-gap);
955
+ margin-bottom: 0;
956
+ padding-left: var(--markloom-list-indent);
957
+ flex: 1 1 100%;
958
+ min-width: 0;
959
+ box-sizing: border-box;
960
+ }
961
+
962
+ /* ── task:同一 gap/indent,只换 marker → checkbox ── */
963
+ .markloom-doc ul:has(> li[data-task]),
964
+ .markloom-doc ol:has(> li[data-task]) {
965
+ list-style: none;
966
+ }
967
+ /* 关掉共享 ul/ol 的 • / 数字 ::before,改 checkbox */
968
+ .markloom-doc li[data-task]::before {
969
+ content: none !important;
970
+ }
971
+ .markloom-doc li[data-task] {
972
+ list-style: none;
973
+ display: flex;
974
+ flex-wrap: wrap;
975
+ align-items: flex-start;
976
+ margin-left: 0;
977
+ border-radius: 0.5rem;
978
+ box-sizing: border-box;
979
+ column-gap: 0.625rem;
980
+ row-gap: 0;
981
+ transition: background 0.12s ease;
982
+ }
983
+ /* 兄弟间距仍走 li+li;勿在 task 上另写 my */
984
+ .markloom-doc li[data-task]:hover { background: rgba(0, 0, 0, 0.03); }
985
+ .markloom-doc li[data-task]:focus-within { background: rgba(0, 0, 0, 0.04); }
986
+ .markloom-doc li[data-task] > [data-task-check] {
987
+ appearance: none;
988
+ -webkit-appearance: none;
989
+ flex-shrink: 0;
990
+ width: 1.25rem;
991
+ height: 1.25rem;
992
+ padding: 0;
993
+ border-radius: 5px;
994
+ cursor: pointer;
995
+ box-sizing: border-box;
996
+ position: relative;
997
+ background: #fff;
998
+ margin-top: calc((1.75em - 1.25rem) / 2);
999
+ border: 1px solid #1f2329;
1000
+ transition: border-color 0.12s, box-shadow 0.12s, background 0.12s;
1001
+ }
1002
+ .markloom-doc li[data-task] > [data-task-check]:hover {
1003
+ border-color: #3370ff;
1004
+ box-shadow: 0 0 0 3px rgba(51, 112, 255, 0.12);
1005
+ }
1006
+ .markloom-doc li[data-task] > [data-task-check]:checked {
1007
+ border-color: #1f2329;
1008
+ background: #fff;
1009
+ }
1010
+ .markloom-doc li[data-task] > [data-task-check]:checked::after {
1011
+ content: '';
1012
+ position: absolute;
1013
+ inset: 0;
1014
+ background: center / 12px 12px no-repeat
1015
+ url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3.2 8.2l3.2 3.2 6.4-6.8' stroke='%233370ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
1016
+ }
1017
+ .markloom-doc li[data-task] > :not([data-task-check]):not(ul):not(ol) {
1018
+ flex: 1 1 0%;
1019
+ min-width: 0;
1020
+ margin: 0;
1021
+ }
1022
+ /* 嵌套折行占满;gap/indent 走共享 li>ul/ol */
1023
+ .markloom-doc li[data-task] > ul,
1024
+ .markloom-doc li[data-task] > ol {
1025
+ flex: 1 1 100%;
1026
+ width: 100%;
1027
+ min-width: 0;
1028
+ box-sizing: border-box;
1029
+ }
1030
+ .markloom-doc li[data-task][data-checked="true"] > :not([data-task-check]):not(ul):not(ol) {
1031
+ color: rgba(0, 0, 0, 0.35);
1032
+ text-decoration: line-through;
1033
+ text-decoration-color: rgba(0, 0, 0, 0.28);
1034
+ }
1035
+ .markloom-doc li[data-task][data-checked="true"] > :not([data-task-check]):not(ul):not(ol) * {
1036
+ color: inherit;
1037
+ }
1038
+ @media (prefers-color-scheme: dark) {
1039
+ .markloom-doc li[data-task]:hover,
1040
+ .markloom-doc li[data-task]:focus-within { background: rgba(255, 255, 255, 0.06); }
1041
+ .markloom-doc li[data-task] > [data-task-check] {
1042
+ border-color: rgba(255, 255, 255, 0.55);
1043
+ background: rgba(255, 255, 255, 0.06);
548
1044
  }
549
- .markloom-block-menu-btn {
550
- color: var(--text-a, rgba(255, 255, 255, 0.88));
1045
+ .markloom-doc li[data-task] > [data-task-check]:hover {
1046
+ border-color: #7aafff;
1047
+ box-shadow: 0 0 0 3px rgba(76, 139, 245, 0.18);
551
1048
  }
552
- .markloom-block-menu-btn:hover {
553
- background: rgba(255, 255, 255, 0.08);
1049
+ .markloom-doc li[data-task] > [data-task-check]:checked {
1050
+ border-color: rgba(255, 255, 255, 0.7);
1051
+ background: rgba(255, 255, 255, 0.06);
554
1052
  }
555
- .markloom-block-menu-btn.is-on {
556
- background: rgba(76, 139, 245, 0.2);
557
- color: #7aafff;
1053
+ .markloom-doc li[data-task] > [data-task-check]:checked::after {
1054
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3.2 8.2l3.2 3.2 6.4-6.8' stroke='%237aafff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
558
1055
  }
559
- .markloom-block-menu-swatch {
560
- border-color: rgba(255, 255, 255, 0.2);
1056
+ .markloom-doc li[data-task][data-checked="true"] > :not([data-task-check]):not(ul):not(ol) {
1057
+ color: rgba(255, 255, 255, 0.35);
1058
+ text-decoration-color: rgba(255, 255, 255, 0.28);
561
1059
  }
562
1060
  }
563
-
564
- /* ─── 列表 ─── */
565
- /* marker 蓝(抄 note tailwind prose --tw-prose-bullets/counters = #1456f0);正文仍走 --text-b。 */
566
- .markloom-doc ul {
567
- margin: 0.5rem 0;
568
- padding-left: 1.5rem;
569
- list-style: disc;
1061
+ html.dark .markloom-doc li[data-task]:hover,
1062
+ html.dark .markloom-doc li[data-task]:focus-within { background: rgba(255, 255, 255, 0.06); }
1063
+ html.dark .markloom-doc li[data-task] > [data-task-check] {
1064
+ border-color: rgba(255, 255, 255, 0.55);
1065
+ background: rgba(255, 255, 255, 0.06);
570
1066
  }
571
-
572
- .markloom-doc ol {
573
- margin: 0.5rem 0;
574
- padding-left: 1.5rem;
575
- list-style: decimal;
1067
+ html.dark .markloom-doc li[data-task] > [data-task-check]:hover {
1068
+ border-color: #7aafff;
1069
+ box-shadow: 0 0 0 3px rgba(76, 139, 245, 0.18);
576
1070
  }
577
-
578
- .markloom-doc li {
579
- margin: 0.25rem 0;
580
- color: var(--text-b);
1071
+ html.dark .markloom-doc li[data-task] > [data-task-check]:checked {
1072
+ border-color: rgba(255, 255, 255, 0.7);
1073
+ background: rgba(255, 255, 255, 0.06);
581
1074
  }
582
-
583
- .markloom-doc li::marker {
584
- color: #1456f0;
1075
+ html.dark .markloom-doc li[data-task] > [data-task-check]:checked::after {
1076
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3.2 8.2l3.2 3.2 6.4-6.8' stroke='%237aafff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
1077
+ }
1078
+ html.dark .markloom-doc li[data-task][data-checked="true"] > :not([data-task-check]):not(ul):not(ol) {
1079
+ color: rgba(255, 255, 255, 0.35);
1080
+ text-decoration-color: rgba(255, 255, 255, 0.28);
585
1081
  }
586
1082
 
587
- /* ─── 标题 ─── */
588
- .markloom-doc h1, .markloom-doc h2, .markloom-doc h3, .markloom-doc h4, .markloom-doc h5, .markloom-doc h6 {
589
- margin: 1rem 0 0.5rem;
590
- font-weight: 600;
1083
+ .markloom-doc h1, .markloom-doc h2, .markloom-doc h3,
1084
+ .markloom-doc h4, .markloom-doc h5, .markloom-doc h6 {
1085
+ @apply font-semibold leading-snug;
591
1086
  color: var(--text-a);
592
- line-height: 1.3;
593
1087
  }
1088
+ .markloom-doc h1 { @apply mt-12 mb-5 text-[1.75rem]; }
1089
+ .markloom-doc h2 { @apply mt-10 mb-4 text-2xl; }
1090
+ .markloom-doc h3 { @apply mt-8 mb-3 text-xl; }
1091
+ .markloom-doc h4 { @apply mt-6 mb-2.5 text-lg; }
1092
+ .markloom-doc h5, .markloom-doc h6 { @apply mt-5 mb-2 text-base; }
1093
+ /* 文首标题不顶出大块空白 */
1094
+ .markloom-doc > :first-child { margin-top: 0; }
594
1095
 
595
- .markloom-doc h1 { font-size: 1.75rem; }
596
- .markloom-doc h2 { font-size: 1.5rem; }
597
- .markloom-doc h3 { font-size: 1.25rem; }
598
-
599
- /* ─── 段落 ─── */
600
1096
  .markloom-doc p {
601
- margin: 0.5rem 0;
602
- line-height: 1.6;
603
- color: var(--text-b);
1097
+ @apply my-4 leading-[1.75];
1098
+ color: var(--text-a);
1099
+ }
1100
+
1101
+ /* 行尾/行首/连续的空格:normal 会把它们压成 0 宽,敲了空格光标不动(markloom 自己插空格,不像原生 CE 插 nbsp)。
1102
+ pre-wrap 保住它们,折行照旧。 */
1103
+ .markloom-doc :is(p, h1, h2, h3, h4, h5, h6) {
1104
+ white-space: pre-wrap;
604
1105
  }
605
1106
 
606
- /* ─── 行内代码 ─── */
607
1107
  .markloom-doc code:not(pre code) {
608
- padding: 0.15em 0.4em;
609
- border-radius: 4px;
1108
+ @apply px-[0.4em] py-[0.15em] rounded text-[0.9em];
610
1109
  background-color: var(--bg-side);
611
- font-size: 0.9em;
612
1110
  }
613
1111
 
614
- /* ─── 表格控制柄浮层 ─── */
615
- /* overlay 挂 document.body,fixed 子元素按视口坐标定位;本身不拦事件,子元素各自 auto。 */
1112
+ /* ── table controls overlay ── */
616
1113
  .markloom-table-overlay {
617
- position: fixed;
618
- inset: 0;
619
- z-index: 50;
620
- pointer-events: none;
1114
+ @apply fixed inset-0 z-50 pointer-events-none;
621
1115
  }
622
1116
  .markloom-table-overlay .markloom-tc > * {
623
- pointer-events: auto;
1117
+ @apply pointer-events-auto;
624
1118
  }
625
1119
 
626
- /* 行/列控制柄:灰条,hover/选中变蓝(抄 note grip-column/row)。
627
- base black/5、hover black/10、selected blue-600;first/last 挂 2px 小圆角。 */
628
1120
  .markloom-tc-handle {
629
- position: fixed;
1121
+ @apply fixed cursor-grab;
630
1122
  background-color: rgba(0, 0, 0, 0.05);
631
- cursor: grab;
632
1123
  transition: background-color 0.12s;
633
1124
  }
634
- .markloom-tc-handle:hover {
635
- background-color: rgba(0, 0, 0, 0.1);
636
- }
637
- .markloom-tc-handle.is-selected {
638
- background-color: #2563eb;
639
- }
1125
+ .markloom-tc-handle:hover { background-color: rgba(0, 0, 0, 0.1); }
1126
+ .markloom-tc-handle.is-selected { background-color: #2563eb; }
640
1127
  @media (prefers-color-scheme: dark) {
641
1128
  .markloom-tc-handle { background-color: rgba(255, 255, 255, 0.1); }
642
1129
  .markloom-tc-handle:hover { background-color: rgba(255, 255, 255, 0.2); }
643
1130
  .markloom-tc-handle.is-selected { background-color: rgba(255, 255, 255, 0.3); }
644
1131
  }
645
- /* 圆角贴 note:列柄首段上左角、末段上右角;行柄首段上左角、末段下左角;全选柄上左角。
646
- 首末段由 JS 打 is-first/is-last(序列两端),不靠 :first-of-type(混排 div 不可靠)。 */
1132
+ html.dark .markloom-tc-handle { background-color: rgba(255, 255, 255, 0.1); }
1133
+ html.dark .markloom-tc-handle:hover { background-color: rgba(255, 255, 255, 0.2); }
1134
+ html.dark .markloom-tc-handle.is-selected { background-color: rgba(255, 255, 255, 0.3); }
1135
+
647
1136
  .markloom-tc-col.is-first { border-top-left-radius: 2px; }
648
1137
  .markloom-tc-col.is-last { border-top-right-radius: 2px; }
649
1138
  .markloom-tc-row.is-first { border-top-left-radius: 2px; }
650
1139
  .markloom-tc-row.is-last { border-bottom-left-radius: 2px; }
651
1140
  .markloom-tc-all { border-top-left-radius: 2px; }
652
1141
 
653
- /* 整表抓柄:表 focused(caret 在表内)或整表选中时,悬在表左上角外的 ⠿ 抓手。
654
- 点=选中整表,拖=移动整表到文档别处。命脉:它是唯一直观入口——表边框 <1px 点不中,必须有可见抓手。 */
655
1142
  .markloom-tc-grip {
656
- position: fixed;
657
- display: flex;
658
- align-items: center;
659
- justify-content: center;
660
- width: 18px;
661
- height: 18px;
662
- border-radius: 4px;
1143
+ @apply fixed flex items-center justify-center w-[18px] h-[18px] rounded text-xs leading-none cursor-grab z-[3];
663
1144
  background-color: rgba(0, 0, 0, 0.05);
664
1145
  color: #9ca3af;
665
- font-size: 12px;
666
- line-height: 1;
667
- cursor: grab;
668
- z-index: 3;
669
1146
  transition: background-color 0.12s, color 0.12s;
670
1147
  }
671
- .markloom-tc-grip::after {
672
- content: '⠿';
673
- }
674
- .markloom-tc-grip:hover {
675
- background-color: rgba(0, 0, 0, 0.1);
676
- color: #6b7280;
677
- }
678
- .markloom-tc-grip.is-selected {
679
- background-color: #2563eb;
680
- color: #fff;
681
- }
1148
+ .markloom-tc-grip::after { content: '⠿'; }
1149
+ .markloom-tc-grip:hover { background-color: rgba(0, 0, 0, 0.1); color: #6b7280; }
1150
+ .markloom-tc-grip.is-selected { background-color: #2563eb; color: #fff; }
682
1151
  @media (prefers-color-scheme: dark) {
683
1152
  .markloom-tc-grip { background-color: rgba(255, 255, 255, 0.1); color: #9ca3af; }
684
1153
  .markloom-tc-grip:hover { background-color: rgba(255, 255, 255, 0.2); color: #d1d5db; }
685
1154
  .markloom-tc-grip.is-selected { background-color: #2563eb; color: #fff; }
686
1155
  }
1156
+ html.dark .markloom-tc-grip { background-color: rgba(255, 255, 255, 0.1); color: #9ca3af; }
1157
+ html.dark .markloom-tc-grip:hover { background-color: rgba(255, 255, 255, 0.2); color: #d1d5db; }
1158
+ html.dark .markloom-tc-grip.is-selected { background-color: #2563eb; color: #fff; }
687
1159
 
688
- /* 列/行边界插入点:两态(抄 note AddColumnButton)。底盒 24px 固定,margin -12 使圆心正落 JS 坐标点(边界线上);
689
- 默认 scale(0.15)≈3.6px 灰点 + ⊕ 藏起(font-size 0),克制常驻;hover scale(1) 长成 24px 蓝圆 + 白 ⊕。200ms ease-out。 */
690
- /* 容器 = 24px 常驻命中区(抄 note w-6 group):承 click + hover。位置/尺寸由 JS 内联。 */
691
1160
  .markloom-tc-ins {
692
- position: fixed;
693
- cursor: pointer;
694
- pointer-events: auto;
695
- z-index: 2;
1161
+ @apply fixed cursor-pointer pointer-events-auto z-[2];
696
1162
  }
697
- /* 视觉圆点:填满容器,纯展示(不夺事件)。静止 scale(.15)≈3.6px 灰点 + ⊕ 藏起;
698
- 容器 hover 时(:hover 在 24px 容器上,不在缩小的点上)长成 24px 蓝圆 + 白 ⊕。 */
699
1163
  .markloom-tc-dot {
700
- position: absolute;
701
- inset: 0;
702
- display: flex;
703
- align-items: center;
704
- justify-content: center;
705
- border-radius: 50%;
1164
+ @apply absolute inset-0 flex items-center justify-center rounded-full text-white font-semibold pointer-events-none origin-center;
706
1165
  background-color: #d1d5db;
707
- color: #fff;
708
1166
  font-size: 0;
709
1167
  line-height: 1;
710
- font-weight: 600;
711
- pointer-events: none;
712
1168
  transform: scale(0.15);
713
- transform-origin: center;
714
1169
  transition: transform 0.2s ease-out, background-color 0.2s ease-out, font-size 0.2s ease-out;
715
1170
  }
716
- .markloom-tc-dot::after {
717
- content: '+';
718
- }
1171
+ .markloom-tc-dot::after { content: '+'; }
719
1172
  .markloom-tc-ins:hover .markloom-tc-dot {
720
1173
  transform: scale(1);
721
1174
  background-color: #2563eb;
722
1175
  font-size: 20px;
723
1176
  }
724
1177
 
725
- /* 插入引导线:容器 hover 时,从表边贯穿表身(col 竖线×表高、row 横线×表宽),预示落点。
726
- 线 position:fixed + JS 视口坐标,独立于容器定位;pointer-events:none 不夺 hover。 */
727
1178
  .markloom-tc-guide {
728
- position: fixed;
1179
+ @apply fixed opacity-0 pointer-events-none z-[1];
729
1180
  background-color: #2563eb;
730
- opacity: 0;
731
- pointer-events: none;
732
1181
  transition: opacity 0.2s ease-out;
733
- z-index: 1;
734
- }
735
- .markloom-tc-guide-col {
736
- width: 2px;
737
- margin-left: -1px;
738
- }
739
- .markloom-tc-guide-row {
740
- height: 2px;
741
- margin-top: -1px;
742
- }
743
- .markloom-tc-ins:hover .markloom-tc-guide {
744
- opacity: 1;
745
1182
  }
1183
+ .markloom-tc-guide-col { @apply w-0.5 -ml-px; }
1184
+ .markloom-tc-guide-row { @apply h-0.5 -mt-px; }
1185
+ .markloom-tc-ins:hover .markloom-tc-guide { @apply opacity-100; }
746
1186
 
747
- /* 列宽 resize handle:列右边界,hover 出竖线(抄 note column-resize-handle 的 1px black/20 观感,保 6px 命中区) */
748
1187
  .markloom-tc-resize {
749
- position: fixed;
750
- width: 6px;
751
- cursor: col-resize;
752
- z-index: 1;
753
- background-color: transparent;
1188
+ @apply fixed w-1.5 cursor-col-resize z-[1] bg-transparent;
754
1189
  transition: background-color 0.12s;
755
1190
  }
756
- .markloom-tc-resize:hover {
757
- background-color: rgba(0, 0, 0, 0.2);
758
- }
1191
+ .markloom-tc-resize:hover { background-color: rgba(0, 0, 0, 0.2); }
759
1192
  @media (prefers-color-scheme: dark) {
760
1193
  .markloom-tc-resize:hover { background-color: rgba(255, 255, 255, 0.2); }
761
1194
  }
1195
+ html.dark .markloom-tc-resize:hover { background-color: rgba(255, 255, 255, 0.2); }
762
1196
 
763
- /* 拖拽重排时的落点指示线 */
764
1197
  .markloom-tc-drop {
765
- position: fixed;
1198
+ @apply fixed z-[3] pointer-events-none;
766
1199
  background-color: rgb(59, 130, 246);
767
- z-index: 3;
768
- pointer-events: none;
769
- }
770
- .markloom-tc-drop-col {
771
- width: 2px;
772
- margin-left: -1px;
773
- }
774
- .markloom-tc-drop-row {
775
- height: 2px;
776
- margin-top: -1px;
777
1200
  }
1201
+ .markloom-tc-drop-col { @apply w-0.5 -ml-px; }
1202
+ .markloom-tc-drop-row { @apply h-0.5 -mt-px; }
778
1203
 
779
- /* 柄菜单:增删行列 */
780
1204
  .markloom-tc-menu {
781
- position: fixed;
782
- z-index: 4;
783
- min-width: 120px;
784
- padding: 4px;
785
- border-radius: 8px;
1205
+ @apply fixed z-[4] min-w-[120px] p-1 rounded-lg;
786
1206
  background-color: var(--bg-page);
787
1207
  border: 1px solid var(--bg-active);
788
1208
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
789
1209
  }
790
1210
  .markloom-tc-menu button {
791
- display: block;
792
- width: 100%;
793
- padding: 6px 10px;
794
- border: none;
795
- border-radius: 4px;
796
- background: none;
1211
+ @apply block w-full px-2.5 py-1.5 border-0 rounded bg-transparent text-[13px] text-left cursor-pointer;
797
1212
  color: var(--text-a);
798
- font-size: 13px;
799
- text-align: left;
800
- cursor: pointer;
801
- }
802
- .markloom-tc-menu button:hover {
803
- background-color: var(--bg-hover);
804
1213
  }
1214
+ .markloom-tc-menu button:hover { background-color: var(--bg-hover); }
805
1215
 
806
- /* ─── 图片交互浮层(选中/四角改尺寸/放大)─── */
807
- /* 结构同表格浮层:overlay 挂 body、fixed 按视口坐标定位,子元素各自 auto。 */
1216
+ /* ── image controls ── */
1217
+ /* overlay 挂 body:只能让手柄/工具条/灯箱接指针;选中框必须 none,
1218
+ 否则盖住整图后 wheel 落在 fixed 层,滚不到笔记 overflow-auto 容器。 */
808
1219
  .markloom-image-overlay {
809
- position: fixed;
810
- inset: 0;
811
- z-index: 50;
812
- pointer-events: none;
1220
+ @apply fixed inset-0 z-50 pointer-events-none;
813
1221
  }
814
- .markloom-image-overlay .markloom-ic > * {
815
- pointer-events: auto;
816
- }
817
- /* 选中图外框:蓝色描边。点选 / 跨块选区共用同一框(图片组件自身选中态)。 */
818
1222
  .markloom-ic-box {
819
- position: fixed;
820
- border: 1px solid #2563eb;
821
- pointer-events: none;
1223
+ @apply fixed pointer-events-none border border-blue-600;
822
1224
  }
823
- /* 四角改尺寸手柄:小白方块蓝边,圆心落 JS 坐标点(margin 负半宽居中)。 */
824
1225
  .markloom-ic-handle {
825
- position: fixed;
826
- width: 10px;
827
- height: 10px;
1226
+ @apply fixed w-2.5 h-2.5 bg-white border border-blue-600 rounded-sm pointer-events-auto;
828
1227
  margin: -5px 0 0 -5px;
829
- background-color: #fff;
830
- border: 1px solid #2563eb;
831
- border-radius: 1px;
832
1228
  }
833
- .markloom-ic-nw, .markloom-ic-se { cursor: nwse-resize; }
834
- .markloom-ic-ne, .markloom-ic-sw { cursor: nesw-resize; }
835
- /* 图工具条:图上方浮一排(对齐三钮 + 图注开关),同气泡菜单风格。图注开输入框第二行。 */
836
- .markloom-ic-tb {
837
- position: fixed;
838
- display: flex;
839
- flex-direction: column;
840
- gap: 4px;
841
- padding: 4px;
842
- background-color: var(--bg, #fff);
843
- border: 1px solid var(--border, #e2e2e2);
1229
+ .markloom-ic-nw, .markloom-ic-se { @apply cursor-nwse-resize; }
1230
+ .markloom-ic-ne, .markloom-ic-sw { @apply cursor-nesw-resize; }
1231
+ /* 图片右上角预览:对齐 note ActionBtn(图标钮 / 无描边底) */
1232
+ .markloom-ic-preview {
1233
+ @apply fixed z-[1] border-0 pointer-events-auto cursor-default select-none
1234
+ inline-flex items-center justify-center font-bold;
1235
+ min-width: 28px;
1236
+ min-height: 28px;
1237
+ padding: 4px 8px;
844
1238
  border-radius: 6px;
845
- box-shadow: 0 2px 8px rgb(0 0 0 / 12%);
1239
+ color: rgba(0, 0, 0, 0.6);
1240
+ background: transparent;
1241
+ transition:
1242
+ color 600ms cubic-bezier(0.215, 0.61, 0.355, 1),
1243
+ background-color 100ms cubic-bezier(0.215, 0.61, 0.355, 1);
1244
+ }
1245
+ .markloom-ic-preview:hover {
1246
+ color: rgba(0, 0, 0, 0.9);
1247
+ background-color: rgba(0, 0, 0, 0.06);
1248
+ }
1249
+ .markloom-ic-preview:active {
1250
+ color: rgba(0, 0, 0, 0.9);
1251
+ background-color: rgba(0, 0, 0, 0.1);
846
1252
  }
847
- .markloom-ic-tb-row { display: flex; gap: 2px; }
1253
+ .markloom-ic-preview .markloom-icon {
1254
+ @apply block shrink-0 pointer-events-none;
1255
+ transition: transform 400ms cubic-bezier(0.215, 0.61, 0.355, 1);
1256
+ }
1257
+ .markloom-ic-preview:active .markloom-icon {
1258
+ transform: scale(0.8);
1259
+ }
1260
+ .markloom-ic-tb {
1261
+ @apply fixed flex flex-col gap-1 p-1 rounded-md pointer-events-auto;
1262
+ background-color: var(--slash-bg, #fff);
1263
+ border: 1px solid var(--slash-border, rgba(0, 0, 0, 0.08));
1264
+ box-shadow: var(--slash-shadow, 0 2px 8px rgb(0 0 0 / 12%));
1265
+ color: var(--slash-text, #1f2328);
1266
+ }
1267
+ .markloom-ic-tb-row { @apply flex gap-0.5; }
848
1268
  .markloom-ic-tb button {
849
- width: 28px;
850
- height: 28px;
851
- border: none;
852
- border-radius: 4px;
853
- background: none;
854
- cursor: pointer;
855
- font-size: 14px;
1269
+ @apply w-7 h-7 border-0 rounded bg-transparent cursor-pointer text-sm inline-flex items-center justify-center;
1270
+ color: var(--slash-icon, #6b7075);
1271
+ }
1272
+ .markloom-ic-tb button:hover {
1273
+ background-color: var(--slash-active, rgba(0, 0, 0, 0.05));
1274
+ color: var(--slash-text, #1f2328);
1275
+ }
1276
+ .markloom-ic-tb button[data-active] {
1277
+ background-color: rgba(51, 112, 255, 0.14);
1278
+ color: var(--markloom-accent, #3370ff);
856
1279
  }
857
- .markloom-ic-tb button:hover { background-color: var(--bg-hover, #f0f0f0); }
858
- .markloom-ic-tb button[data-active] { background-color: var(--bg-active, #dbeafe); }
859
1280
  .markloom-ic-tb-caption {
860
- width: 180px;
861
- padding: 4px 6px;
862
- border: 1px solid var(--border, #e2e2e2);
863
- border-radius: 4px;
864
- font-size: 13px;
1281
+ @apply w-[180px] px-1.5 py-1 rounded text-[13px] outline-none;
1282
+ border: 1px solid var(--slash-border, rgba(0, 0, 0, 0.08));
1283
+ background-color: var(--bg-page, #fff);
1284
+ color: var(--text-a, rgba(0, 0, 0, 0.88));
1285
+ }
1286
+ .markloom-ic-tb-caption::placeholder {
1287
+ color: var(--text-c, rgba(0, 0, 0, 0.35));
1288
+ }
1289
+ @media (prefers-color-scheme: dark) {
1290
+ .markloom-ic-tb {
1291
+ background-color: #2b2b2b;
1292
+ border-color: rgba(255, 255, 255, 0.1);
1293
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
1294
+ color: rgba(255, 255, 255, 0.9);
1295
+ }
1296
+ .markloom-ic-tb button { color: rgba(255, 255, 255, 0.7); }
1297
+ .markloom-ic-tb button:hover {
1298
+ background-color: rgba(255, 255, 255, 0.08);
1299
+ color: rgba(255, 255, 255, 0.9);
1300
+ }
1301
+ .markloom-ic-tb button[data-active] {
1302
+ background-color: rgba(76, 139, 245, 0.16);
1303
+ color: #7aafff;
1304
+ }
1305
+ .markloom-ic-tb-caption {
1306
+ background-color: #1f1f1f;
1307
+ border-color: rgba(255, 255, 255, 0.12);
1308
+ color: rgba(255, 255, 255, 0.9);
1309
+ }
1310
+ .markloom-ic-tb-caption::placeholder { color: rgba(255, 255, 255, 0.35); }
1311
+ .markloom-ic-handle {
1312
+ background-color: #2b2b2b;
1313
+ border-color: #7aafff;
1314
+ }
1315
+ .markloom-ic-preview {
1316
+ color: rgba(255, 255, 255, 0.7);
1317
+ background: transparent;
1318
+ }
1319
+ .markloom-ic-preview:hover {
1320
+ color: rgba(255, 255, 255, 0.9);
1321
+ background-color: rgba(255, 255, 255, 0.1);
1322
+ }
1323
+ .markloom-ic-preview:active {
1324
+ color: rgba(255, 255, 255, 0.9);
1325
+ background-color: rgba(255, 255, 255, 0.18);
1326
+ }
1327
+ }
1328
+ html.dark .markloom-ic-tb {
1329
+ background-color: #2b2b2b;
1330
+ border-color: rgba(255, 255, 255, 0.1);
1331
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
1332
+ color: rgba(255, 255, 255, 0.9);
1333
+ }
1334
+ html.dark .markloom-ic-tb button { color: rgba(255, 255, 255, 0.7); }
1335
+ html.dark .markloom-ic-tb button:hover {
1336
+ background-color: rgba(255, 255, 255, 0.08);
1337
+ color: rgba(255, 255, 255, 0.9);
1338
+ }
1339
+ html.dark .markloom-ic-tb button[data-active] {
1340
+ background-color: rgba(76, 139, 245, 0.16);
1341
+ color: #7aafff;
1342
+ }
1343
+ html.dark .markloom-ic-tb-caption {
1344
+ background-color: #1f1f1f;
1345
+ border-color: rgba(255, 255, 255, 0.12);
1346
+ color: rgba(255, 255, 255, 0.9);
1347
+ }
1348
+ html.dark .markloom-ic-tb-caption::placeholder { color: rgba(255, 255, 255, 0.35); }
1349
+ html.dark .markloom-ic-handle {
1350
+ background-color: #2b2b2b;
1351
+ border-color: #7aafff;
1352
+ }
1353
+ html.dark .markloom-ic-preview {
1354
+ color: rgba(255, 255, 255, 0.7);
1355
+ background: transparent;
865
1356
  }
866
- /* 代码块语言下拉(host wireCodeLang 建,挂 body):竖排一列语言,同气泡菜单风格。 */
1357
+ html.dark .markloom-ic-preview:hover {
1358
+ color: rgba(255, 255, 255, 0.9);
1359
+ background-color: rgba(255, 255, 255, 0.1);
1360
+ }
1361
+ html.dark .markloom-ic-preview:active {
1362
+ color: rgba(255, 255, 255, 0.9);
1363
+ background-color: rgba(255, 255, 255, 0.18);
1364
+ }
1365
+
867
1366
  .markloom-code-lang-menu {
868
- display: flex;
869
- flex-direction: column;
870
- max-height: 260px;
871
- overflow-y: auto;
872
- padding: 4px;
1367
+ @apply flex flex-col max-h-[260px] overflow-y-auto p-1 rounded-md;
873
1368
  background-color: var(--bg, #fff);
874
1369
  border: 1px solid var(--border, #e2e2e2);
875
- border-radius: 6px;
876
1370
  box-shadow: 0 2px 8px rgb(0 0 0 / 12%);
877
1371
  }
878
1372
  .markloom-code-lang-menu button {
879
- padding: 4px 12px;
880
- border: none;
881
- border-radius: 4px;
882
- background: none;
1373
+ @apply px-3 py-1 border-0 rounded bg-transparent text-[13px] text-left cursor-pointer;
883
1374
  color: var(--text-a, #222);
884
- font-size: 13px;
885
- text-align: left;
886
- cursor: pointer;
887
1375
  }
888
1376
  .markloom-code-lang-menu button:hover { background-color: var(--bg-hover, #f0f0f0); }
889
- /* 图注:figure 宽随 img(fit-content,见 render style),勿默认 100% 把选中框撑满行。 */
1377
+
890
1378
  .markloom-figure {
891
- margin: 0;
892
- width: fit-content;
893
- max-width: 100%;
1379
+ @apply m-0 w-fit max-w-full;
894
1380
  }
895
1381
  .markloom-figure > img {
896
- display: block;
897
- max-width: 100%;
1382
+ @apply block max-w-full h-auto;
1383
+ height: auto;
1384
+ }
1385
+ .markloom-doc img[data-atom="image"] {
898
1386
  height: auto;
899
1387
  }
900
1388
  .markloom-figure figcaption {
901
- margin-top: 4px;
1389
+ @apply mt-1 text-center text-[13px];
902
1390
  color: var(--text-dim, #888);
903
- font-size: 13px;
904
- }
905
- /* 加载中/失败占位:失败画虚线框 + alt(attr() 显示替代文字)。加载中弱化(半透明)。 */
906
- .markloom-doc img[data-atom="image"][data-load="loading"] {
907
- opacity: 0.6;
908
1391
  }
1392
+
1393
+ .markloom-doc img[data-atom="image"][data-load="loading"] { @apply opacity-60; }
909
1394
  .markloom-doc img[data-atom="image"][data-load="error"] {
910
- min-width: 120px;
911
- min-height: 48px;
912
- opacity: 1;
1395
+ @apply min-w-[120px] min-h-12 opacity-100 rounded;
913
1396
  border: 1px dashed var(--bg-active);
914
- border-radius: 4px;
915
1397
  background-color: var(--bg-hover);
916
1398
  }
917
- /* 选中框统一由 overlay 的 .markloom-ic-box 出(与四角手柄同源坐标一致);此处不再叠 outline(重复焦点信号)。 */
918
- /* 图选中态藏掉文本竖线:选中态 DOM 选区仍在(保 beforeinput/keydown 发事件、键盘响应),
919
- 但 contentEditable 有焦点+塌缩选区时浏览器必渲染 caret 竖线——与选中框成两个焦点信号打架。
920
- caret-color:transparent 只藏竖线不动选区,唯一焦点回到选中框。:has 命中「内含选中图的可编辑宿主」。 */
921
- [contenteditable="true"]:has([data-atom="image"][data-selected]) {
922
- caret-color: transparent;
923
- }
924
- /* 整表选中态(两段删第一段):同图片——选中框由 overlay 的 .markloom-ic-box 出,此处只藏塌缩到表后的 caret 竖线。
925
- data-block-selected 只作状态标记不叠 outline,唯一焦点回到选中框(避免双焦点信号)。 */
1399
+
1400
+ /* caret suppress when block-selected image/table */
1401
+ [contenteditable="true"]:has([data-atom="image"][data-selected]),
926
1402
  [contenteditable="true"]:has(.markloom-table[data-block-selected]) {
927
1403
  caret-color: transparent;
928
1404
  }
929
- /* 点击放大:全屏半透明背景 + 居中大图,点背景关。 */
930
- .markloom-lightbox {
931
- position: fixed;
932
- inset: 0;
933
- z-index: 60;
934
- display: flex;
935
- align-items: center;
936
- justify-content: center;
937
- background-color: rgba(0, 0, 0, 0.7);
938
- cursor: zoom-out;
939
- }
940
- .markloom-lightbox img {
941
- max-width: 90vw;
942
- max-height: 90vh;
943
- box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
944
- }
945
- /* 飞书式气泡 — 清爽:浅边、轻影、灰字、蓝只表选中 */
1405
+
1406
+ /* ── bubble menu ── */
946
1407
  .markloom-bubble {
947
- position: fixed;
948
- display: flex;
949
- flex-direction: column;
950
- align-items: stretch;
951
- padding: 4px 6px;
952
- border-radius: 8px;
1408
+ @apply fixed flex flex-col items-stretch px-1.5 py-1 rounded-lg z-[100] select-none opacity-0;
953
1409
  border: 1px solid #dee0e3;
954
1410
  background: #fff;
955
1411
  box-shadow: 0 1px 4px rgba(31, 35, 41, 0.08), 0 4px 12px rgba(31, 35, 41, 0.06);
956
- z-index: 100;
957
- user-select: none;
958
- opacity: 0;
959
1412
  transition: opacity 0.1s ease;
960
1413
  }
961
- .markloom-bubble.is-in {
962
- opacity: 1;
963
- }
1414
+ .markloom-bubble.is-in { @apply opacity-100; }
964
1415
  .markloom-bb-row {
965
- display: flex;
966
- align-items: center;
967
- flex-wrap: wrap;
968
- gap: 2px;
1416
+ @apply flex items-center flex-wrap gap-0.5;
969
1417
  max-width: min(96vw, 720px);
970
1418
  }
971
1419
  .markloom-bb-dd-wrap {
972
- position: relative;
973
- display: inline-flex;
974
- align-items: center;
1420
+ @apply relative inline-flex items-center;
975
1421
  }
976
1422
  .markloom-bubble .markloom-bb-row > button,
977
1423
  .markloom-bb-dd-wrap > button {
978
- position: relative;
979
- min-width: 28px;
980
- height: 28px;
981
- padding: 0 4px;
982
- border: none;
983
- border-radius: 6px;
984
- background: transparent;
1424
+ @apply relative min-w-7 h-7 px-1 border-0 rounded-md bg-transparent cursor-pointer inline-flex items-center justify-center gap-0.5;
985
1425
  color: #646a73;
986
1426
  font: 500 13px/1 system-ui, -apple-system, 'Segoe UI', sans-serif;
987
- cursor: pointer;
988
- display: inline-flex;
989
- align-items: center;
990
- justify-content: center;
991
- gap: 2px;
992
1427
  }
993
1428
  .markloom-bubble .markloom-bb-row > button > .markloom-icon,
994
1429
  .markloom-bb-dd-wrap > button > .markloom-icon {
995
- width: 16px;
996
- height: 16px;
1430
+ @apply w-4 h-4;
997
1431
  stroke-width: 1.75;
998
1432
  }
999
1433
  .markloom-icon {
1000
- display: block;
1001
- flex: none;
1002
- pointer-events: none;
1434
+ @apply block shrink-0 pointer-events-none;
1003
1435
  }
1004
1436
  .markloom-bubble .markloom-bb-row > button:hover,
1005
1437
  .markloom-bb-dd-wrap > button:hover,
@@ -1011,12 +1443,8 @@
1011
1443
  color: #3370ff;
1012
1444
  }
1013
1445
  .markloom-bubble-sep {
1014
- width: 1px;
1015
- height: 14px;
1016
- align-self: center;
1017
- margin: 0 4px;
1446
+ @apply w-px h-3.5 self-center mx-1 shrink-0;
1018
1447
  background: #dee0e3;
1019
- flex: none;
1020
1448
  }
1021
1449
  .markloom-bb-dd {
1022
1450
  padding: 0 2px 0 6px !important;
@@ -1028,18 +1456,15 @@
1028
1456
  color: #1f2329;
1029
1457
  }
1030
1458
  .markloom-bb-chev {
1031
- opacity: 0.45;
1032
- color: #8f959e;
1459
+ @apply opacity-[0.55];
1460
+ color: currentColor;
1033
1461
  transition: transform 0.22s ease;
1034
1462
  }
1035
1463
  .markloom-bubble .markloom-bb-row > button > .markloom-icon.markloom-bb-chev,
1036
1464
  .markloom-bb-dd-wrap > button > .markloom-icon.markloom-bb-chev {
1037
- width: 12px;
1038
- height: 12px;
1039
- }
1040
- .markloom-bb-dd-wrap.is-open .markloom-bb-chev {
1041
- transform: rotate(180deg);
1465
+ @apply w-3 h-3;
1042
1466
  }
1467
+ .markloom-bb-dd-wrap.is-open .markloom-bb-chev { @apply rotate-180; }
1043
1468
  .markloom-bb-mark {
1044
1469
  font-family: Georgia, 'Times New Roman', serif !important;
1045
1470
  font-size: 14px !important;
@@ -1048,143 +1473,87 @@
1048
1473
  color: #1f2329;
1049
1474
  font-weight: 600 !important;
1050
1475
  }
1476
+ .markloom-bubble button[data-clear-format]:disabled { opacity: 0.35; cursor: default; pointer-events: none; }
1051
1477
  .markloom-bb-bold { font-weight: 700 !important; }
1052
1478
  .markloom-bb-italic { font-style: italic !important; font-weight: 500 !important; }
1053
- .markloom-bb-under { text-decoration: underline; text-underline-offset: 2px; }
1054
- .markloom-bb-strike { text-decoration: line-through; font-weight: 500 !important; }
1479
+ .markloom-bb-under { @apply underline underline-offset-2; }
1480
+ .markloom-bb-strike { @apply line-through; font-weight: 500 !important; }
1055
1481
  .markloom-bb-color .markloom-bb-a {
1056
- display: inline-flex;
1057
- align-items: center;
1058
- justify-content: center;
1059
- min-width: 18px;
1060
- height: 18px;
1061
- padding: 0 2px;
1062
- border-radius: 3px;
1482
+ @apply inline-flex items-center justify-center min-w-[18px] h-[18px] px-0.5 rounded-sm;
1063
1483
  font: 600 13px/1 Georgia, serif;
1484
+ /* 无内联色时的兜底(内联 color 优先);勿写死浅色黑 */
1485
+ color: var(--text-a, #1f2329);
1064
1486
  }
1065
- /* 格式栏 AI 钮(图标+文案,显眼) */
1066
1487
  .markloom-bb-ai {
1067
- color: #3370ff !important;
1488
+ color: var(--markloom-accent) !important;
1068
1489
  min-width: auto !important;
1069
1490
  padding: 0 8px !important;
1070
1491
  gap: 4px !important;
1071
1492
  font: 500 12px/1 system-ui, -apple-system, 'Segoe UI', sans-serif !important;
1072
1493
  }
1073
1494
  .markloom-bb-ai:hover {
1074
- background: rgba(51, 112, 255, 0.12) !important;
1075
- }
1076
- .markloom-bb-ai-lab {
1077
- letter-spacing: 0.02em;
1495
+ background: rgba(51, 112, 255, 0.1) !important;
1496
+ color: var(--markloom-accent) !important;
1078
1497
  }
1498
+ .markloom-bb-ai-lab { letter-spacing: 0.02em; }
1079
1499
  .markloom-bb-ai > .markloom-icon {
1080
1500
  width: 14px !important;
1081
1501
  height: 14px !important;
1502
+ color: inherit;
1503
+ stroke: currentColor;
1082
1504
  }
1083
- /* tip:轻量、晚出现,不抢戏 */
1505
+
1084
1506
  .markloom-bubble-tip {
1085
- display: none;
1086
- position: absolute;
1087
- left: 50%;
1507
+ @apply hidden absolute left-1/2 z-[2] max-w-[200px] px-2 py-1.5 rounded-md text-white pointer-events-none whitespace-nowrap;
1088
1508
  bottom: calc(100% + 6px);
1089
1509
  transform: translateX(-50%);
1090
- z-index: 2;
1091
1510
  min-width: max-content;
1092
- max-width: 200px;
1093
- padding: 6px 8px;
1094
- border-radius: 6px;
1095
1511
  background: rgba(31, 35, 41, 0.88);
1096
- color: #fff;
1097
1512
  font: 400 12px/1.4 system-ui, sans-serif;
1098
- pointer-events: none;
1099
- white-space: nowrap;
1100
- }
1101
- .markloom-bubble-tip::after { display: none; }
1102
- .markloom-bubble-tip-t { font-weight: 400; }
1103
- .markloom-bubble-tip-md {
1104
- margin-top: 2px;
1105
- opacity: 0.65;
1106
- font-size: 11px;
1107
1513
  }
1514
+ .markloom-bubble-tip::after { @apply hidden; }
1515
+ .markloom-bubble-tip-t { @apply font-normal; }
1516
+ .markloom-bubble-tip-md { @apply mt-0.5 opacity-[0.65] text-[11px]; }
1108
1517
  .markloom-bubble .markloom-bb-row > button:hover > .markloom-bubble-tip,
1109
1518
  .markloom-bb-dd-wrap > button:hover > .markloom-bubble-tip {
1110
- display: block;
1519
+ @apply block;
1111
1520
  }
1112
1521
  .markloom-bb-dd-wrap.is-open > button > .markloom-bubble-tip {
1113
1522
  display: none !important;
1114
1523
  }
1115
- /* 下拉:轻边轻影,自上淡入 */
1524
+
1116
1525
  .markloom-bb-menu {
1117
- display: flex;
1118
- position: absolute;
1526
+ @apply flex absolute left-0 z-[5] flex-col gap-px p-1.5 min-w-[200px] rounded-lg opacity-0 invisible pointer-events-none -translate-y-1;
1119
1527
  top: calc(100% + 4px);
1120
- left: 0;
1121
- z-index: 5;
1122
- flex-direction: column;
1123
- gap: 1px;
1124
- padding: 6px;
1125
- min-width: 200px;
1126
- border-radius: 8px;
1127
1528
  border: 1px solid #dee0e3;
1128
1529
  background: #fff;
1129
1530
  box-shadow: 0 2px 8px rgba(31, 35, 41, 0.08), 0 8px 24px rgba(31, 35, 41, 0.08);
1130
- opacity: 0;
1131
- visibility: hidden;
1132
- pointer-events: none;
1133
- transform: translateY(-4px);
1134
1531
  transition: opacity 0.12s ease, transform 0.14s ease, visibility 0s linear 0.14s;
1135
1532
  }
1136
1533
  .markloom-bb-menu.is-open {
1137
- opacity: 1;
1138
- visibility: visible;
1139
- pointer-events: auto;
1140
- transform: translateY(0);
1534
+ @apply opacity-100 visible pointer-events-auto translate-y-0;
1141
1535
  transition: opacity 0.12s ease, transform 0.14s ease, visibility 0s;
1142
1536
  }
1143
1537
  .markloom-bb-menu-item {
1144
- display: flex;
1145
- align-items: center;
1146
- gap: 10px;
1147
- width: 100%;
1148
- min-height: 36px;
1149
- padding: 6px 10px;
1150
- border: none;
1151
- border-radius: 6px;
1152
- background: transparent;
1538
+ @apply flex items-center gap-2.5 w-full min-h-9 px-2.5 py-1.5 border-0 rounded-md bg-transparent cursor-pointer text-left;
1153
1539
  color: #1f2329;
1154
1540
  font: 400 14px/1.2 system-ui, -apple-system, 'Segoe UI', sans-serif;
1155
- cursor: pointer;
1156
- text-align: left;
1157
- }
1158
- .markloom-bb-menu-item:hover {
1159
- background: #eff0f1;
1160
- }
1161
- .markloom-bb-menu-item.is-on {
1162
- color: #3370ff;
1163
- background: transparent;
1164
- }
1165
- .markloom-bb-menu-item.is-on:hover {
1166
- background: #eff0f1;
1167
1541
  }
1542
+ .markloom-bb-menu-item:hover { background: #eff0f1; }
1543
+ .markloom-bb-menu-item.is-on { color: #3370ff; background: transparent; }
1544
+ .markloom-bb-menu-item.is-on:hover { background: #eff0f1; }
1168
1545
  .markloom-bb-menu-ico {
1169
- width: 20px;
1170
- display: inline-flex;
1171
- align-items: center;
1172
- justify-content: center;
1173
- flex: none;
1546
+ @apply w-5 inline-flex items-center justify-center shrink-0;
1174
1547
  color: #646a73;
1175
1548
  }
1176
- .markloom-bb-menu-item.is-on .markloom-bb-menu-ico {
1177
- color: #3370ff;
1178
- }
1179
- .markloom-bb-menu-lab { flex: 1; }
1549
+ .markloom-bb-menu-item.is-on .markloom-bb-menu-ico { color: #3370ff; }
1550
+ .markloom-bb-menu-lab { @apply flex-1; }
1180
1551
  .markloom-bb-menu-check {
1181
- width: 16px;
1182
- display: inline-flex;
1552
+ @apply w-4 inline-flex;
1183
1553
  color: #3370ff;
1184
1554
  }
1185
1555
  .markloom-bb-menu-sep {
1186
- height: 1px;
1187
- margin: 4px 8px;
1556
+ @apply h-px mx-2 my-1;
1188
1557
  background: #eff0f1;
1189
1558
  }
1190
1559
  .markloom-bb-hico {
@@ -1192,63 +1561,40 @@
1192
1561
  letter-spacing: -0.02em;
1193
1562
  }
1194
1563
  .markloom-bb-hico sub {
1195
- font-size: 9px;
1196
- vertical-align: baseline;
1197
- position: relative;
1198
- top: 0.2em;
1564
+ @apply text-[9px] align-baseline relative top-[0.2em];
1199
1565
  }
1200
- /* 色板 */
1566
+
1201
1567
  .markloom-bb-menu-color {
1202
- left: auto;
1203
- right: 0;
1204
- min-width: 260px;
1205
- padding: 12px;
1206
- gap: 0;
1568
+ @apply left-auto right-0 p-3 gap-0;
1569
+ min-width: 248px;
1207
1570
  }
1208
1571
  .markloom-bb-color-sec {
1209
- font: 400 13px/1 system-ui, sans-serif;
1572
+ font: 400 12px/1 system-ui, sans-serif;
1210
1573
  color: #8f959e;
1211
- margin: 0 0 8px;
1574
+ @apply m-0 mb-2;
1212
1575
  }
1213
1576
  .markloom-bb-color-sec + .markloom-bb-swatches + .markloom-bb-color-sec {
1214
- margin-top: 12px;
1577
+ @apply mt-3;
1215
1578
  }
1216
1579
  .markloom-bb-swatches {
1217
- display: flex;
1218
- flex-wrap: wrap;
1219
- gap: 8px;
1220
- }
1221
- .markloom-bb-font-row {
1580
+ display: grid;
1581
+ grid-template-columns: repeat(8, 26px);
1222
1582
  gap: 6px;
1223
1583
  }
1224
1584
  .markloom-bb-font-a {
1225
- width: 26px;
1226
- height: 26px;
1227
- border-radius: 4px;
1228
- border: 1px solid #dee0e3;
1585
+ @apply w-[26px] h-[26px] rounded border p-0 cursor-pointer inline-flex items-center justify-center;
1586
+ border-color: #dee0e3;
1229
1587
  background: #fff;
1230
- padding: 0;
1231
- cursor: pointer;
1232
1588
  font: 600 13px/1 Georgia, 'Times New Roman', serif;
1233
- display: inline-flex;
1234
- align-items: center;
1235
- justify-content: center;
1236
- }
1237
- .markloom-bb-font-a:hover {
1238
- border-color: #c9cdd4;
1239
1589
  }
1590
+ .markloom-bb-font-a:hover { border-color: #c9cdd4; }
1240
1591
  .markloom-bb-font-a.is-on {
1241
1592
  border-color: #3370ff;
1242
1593
  box-shadow: inset 0 0 0 1px #3370ff;
1243
1594
  }
1244
1595
  .markloom-bb-swatch {
1245
- width: 26px;
1246
- height: 26px;
1247
- border-radius: 4px;
1248
- border: none;
1249
- padding: 0;
1250
- cursor: pointer;
1251
- background: #fff;
1596
+ @apply w-[26px] h-[26px] rounded border-0 p-0 cursor-pointer;
1597
+ background: transparent;
1252
1598
  }
1253
1599
  .markloom-bb-swatch.is-on {
1254
1600
  box-shadow: 0 0 0 1.5px #fff, 0 0 0 3px #3370ff;
@@ -1263,7 +1609,7 @@
1263
1609
  box-shadow: none;
1264
1610
  }
1265
1611
  .markloom-bb-swatch-none {
1266
- position: relative;
1612
+ @apply relative;
1267
1613
  background:
1268
1614
  linear-gradient(
1269
1615
  to top right,
@@ -1274,19 +1620,14 @@
1274
1620
  #fff;
1275
1621
  }
1276
1622
  .markloom-bb-reset {
1277
- width: 100%;
1278
- margin-top: 12px;
1279
- height: 32px;
1623
+ @apply w-full mt-3 h-8 rounded-md cursor-pointer;
1280
1624
  border: 1px solid #dee0e3;
1281
- border-radius: 6px;
1282
1625
  background: #fff;
1283
1626
  color: #1f2329;
1284
- font: 400 14px/1 system-ui, -apple-system, 'Segoe UI', sans-serif;
1285
- cursor: pointer;
1286
- }
1287
- .markloom-bb-reset:hover {
1288
- background: #f5f6f7;
1627
+ font: 400 13px/1 system-ui, -apple-system, 'Segoe UI', sans-serif;
1289
1628
  }
1629
+ .markloom-bb-reset:hover { background: #f5f6f7; }
1630
+
1290
1631
  @media (prefers-color-scheme: dark) {
1291
1632
  .markloom-bubble {
1292
1633
  background: #2b2b2b;
@@ -1294,16 +1635,12 @@
1294
1635
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
1295
1636
  }
1296
1637
  .markloom-bubble .markloom-bb-row > button,
1297
- .markloom-bb-dd-wrap > button {
1298
- color: rgba(255, 255, 255, 0.65);
1299
- }
1638
+ .markloom-bb-dd-wrap > button { color: rgba(255, 255, 255, 0.78); }
1300
1639
  .markloom-bb-t,
1301
- .markloom-bb-mark { color: rgba(255, 255, 255, 0.88); }
1640
+ .markloom-bb-mark { color: rgba(255, 255, 255, 0.9); }
1302
1641
  .markloom-bubble .markloom-bb-row > button:hover,
1303
1642
  .markloom-bb-dd-wrap > button:hover,
1304
- .markloom-bb-dd-wrap.is-open > button {
1305
- background: rgba(255, 255, 255, 0.08);
1306
- }
1643
+ .markloom-bb-dd-wrap.is-open > button { background: rgba(255, 255, 255, 0.08); }
1307
1644
  .markloom-bubble .markloom-bb-row > button[data-active] {
1308
1645
  background: rgba(76, 139, 245, 0.16);
1309
1646
  color: #7aafff;
@@ -1316,10 +1653,7 @@
1316
1653
  }
1317
1654
  .markloom-bb-menu-item { color: rgba(255, 255, 255, 0.88); }
1318
1655
  .markloom-bb-menu-item:hover { background: rgba(255, 255, 255, 0.06); }
1319
- .markloom-bb-menu-item.is-on {
1320
- color: #7aafff;
1321
- background: transparent;
1322
- }
1656
+ .markloom-bb-menu-item.is-on { color: #7aafff; background: transparent; }
1323
1657
  .markloom-bb-menu-ico { color: rgba(255, 255, 255, 0.55); }
1324
1658
  .markloom-bb-menu-item.is-on .markloom-bb-menu-ico { color: #7aafff; }
1325
1659
  .markloom-bb-menu-sep { background: rgba(255, 255, 255, 0.08); }
@@ -1328,10 +1662,16 @@
1328
1662
  background: #1f1f1f;
1329
1663
  border-color: rgba(255, 255, 255, 0.12);
1330
1664
  }
1331
- .markloom-bb-swatch-none,
1332
- .markloom-bb-swatch[data-edge] {
1333
- border-color: rgba(255, 255, 255, 0.14);
1665
+ .markloom-bb-font-a:hover { border-color: rgba(255, 255, 255, 0.22); }
1666
+ .markloom-bb-font-a.is-on {
1667
+ border-color: #4c8bf5;
1668
+ box-shadow: inset 0 0 0 1px #4c8bf5;
1334
1669
  }
1670
+ .markloom-bb-swatch.is-on {
1671
+ box-shadow: 0 0 0 1.5px #2b2b2b, 0 0 0 3px #4c8bf5;
1672
+ }
1673
+ .markloom-bb-swatch-none,
1674
+ .markloom-bb-swatch[data-edge] { border-color: rgba(255, 255, 255, 0.14); }
1335
1675
  .markloom-bb-swatch-none {
1336
1676
  background:
1337
1677
  linear-gradient(
@@ -1342,65 +1682,121 @@
1342
1682
  ),
1343
1683
  #1f1f1f;
1344
1684
  }
1685
+ .markloom-bb-swatch-none.is-on,
1686
+ .markloom-bb-swatch[data-edge].is-on {
1687
+ border-color: #4c8bf5;
1688
+ box-shadow: none;
1689
+ }
1345
1690
  .markloom-bb-reset {
1346
1691
  background: transparent;
1347
1692
  border-color: rgba(255, 255, 255, 0.12);
1348
1693
  color: rgba(255, 255, 255, 0.88);
1349
1694
  }
1350
1695
  .markloom-bb-reset:hover { background: rgba(255, 255, 255, 0.06); }
1696
+ .markloom-bb-ai { color: #7aafff !important; }
1697
+ .markloom-bb-ai:hover {
1698
+ background: rgba(122, 175, 255, 0.14) !important;
1699
+ color: #9bc4ff !important;
1700
+ }
1701
+ .markloom-bb-color .markloom-bb-a { color: rgba(255, 255, 255, 0.88); }
1702
+ }
1703
+ html.dark .markloom-bubble {
1704
+ background: #2b2b2b;
1705
+ border-color: rgba(255, 255, 255, 0.1);
1706
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
1707
+ }
1708
+ html.dark .markloom-bubble .markloom-bb-row > button,
1709
+ html.dark .markloom-bb-dd-wrap > button { color: rgba(255, 255, 255, 0.78); }
1710
+ html.dark .markloom-bb-t,
1711
+ html.dark .markloom-bb-mark { color: rgba(255, 255, 255, 0.9); }
1712
+ html.dark .markloom-bubble .markloom-bb-row > button:hover,
1713
+ html.dark .markloom-bb-dd-wrap > button:hover,
1714
+ html.dark .markloom-bb-dd-wrap.is-open > button { background: rgba(255, 255, 255, 0.08); }
1715
+ html.dark .markloom-bubble .markloom-bb-row > button[data-active] {
1716
+ background: rgba(76, 139, 245, 0.16);
1717
+ color: #7aafff;
1718
+ }
1719
+ html.dark .markloom-bubble-sep { background: rgba(255, 255, 255, 0.1); }
1720
+ html.dark .markloom-bb-menu {
1721
+ background: #2b2b2b;
1722
+ border-color: rgba(255, 255, 255, 0.1);
1723
+ box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
1724
+ }
1725
+ html.dark .markloom-bb-menu-item { color: rgba(255, 255, 255, 0.88); }
1726
+ html.dark .markloom-bb-menu-item:hover { background: rgba(255, 255, 255, 0.06); }
1727
+ html.dark .markloom-bb-menu-item.is-on { color: #7aafff; background: transparent; }
1728
+ html.dark .markloom-bb-menu-ico { color: rgba(255, 255, 255, 0.55); }
1729
+ html.dark .markloom-bb-menu-item.is-on .markloom-bb-menu-ico { color: #7aafff; }
1730
+ html.dark .markloom-bb-menu-sep { background: rgba(255, 255, 255, 0.08); }
1731
+ html.dark .markloom-bb-color-sec { color: rgba(255, 255, 255, 0.45); }
1732
+ html.dark .markloom-bb-font-a {
1733
+ background: #1f1f1f;
1734
+ border-color: rgba(255, 255, 255, 0.12);
1735
+ }
1736
+ html.dark .markloom-bb-font-a:hover { border-color: rgba(255, 255, 255, 0.22); }
1737
+ html.dark .markloom-bb-font-a.is-on {
1738
+ border-color: #4c8bf5;
1739
+ box-shadow: inset 0 0 0 1px #4c8bf5;
1740
+ }
1741
+ html.dark .markloom-bb-swatch.is-on {
1742
+ box-shadow: 0 0 0 1.5px #2b2b2b, 0 0 0 3px #4c8bf5;
1743
+ }
1744
+ html.dark .markloom-bb-swatch-none,
1745
+ html.dark .markloom-bb-swatch[data-edge] { border-color: rgba(255, 255, 255, 0.14); }
1746
+ html.dark .markloom-bb-swatch-none {
1747
+ background:
1748
+ linear-gradient(
1749
+ to top right,
1750
+ transparent calc(50% - 0.5px),
1751
+ #f54a45 50%,
1752
+ transparent calc(50% + 0.5px)
1753
+ ),
1754
+ #1f1f1f;
1351
1755
  }
1352
- /* 操作栏内:拖柄 / + (尺寸统一 18×20, 与 H 胶囊同高对齐中) */
1353
- .markloom-drag-handle {
1354
- display: inline-flex;
1355
- align-items: center;
1356
- justify-content: center;
1357
- width: 18px;
1358
- height: 20px;
1359
- padding: 0;
1360
- border: none;
1361
- border-radius: 4px;
1756
+ html.dark .markloom-bb-swatch-none.is-on,
1757
+ html.dark .markloom-bb-swatch[data-edge].is-on {
1758
+ border-color: #4c8bf5;
1759
+ box-shadow: none;
1760
+ }
1761
+ html.dark .markloom-bb-reset {
1362
1762
  background: transparent;
1363
- color: #8f959e;
1364
- cursor: grab;
1365
- user-select: none;
1763
+ border-color: rgba(255, 255, 255, 0.12);
1764
+ color: rgba(255, 255, 255, 0.88);
1366
1765
  }
1367
- .markloom-drag-handle svg {
1368
- display: block;
1766
+ html.dark .markloom-bb-reset:hover { background: rgba(255, 255, 255, 0.06); }
1767
+ html.dark .markloom-bb-ai { color: #7aafff !important; }
1768
+ html.dark .markloom-bb-ai:hover {
1769
+ background: rgba(122, 175, 255, 0.14) !important;
1770
+ color: #9bc4ff !important;
1771
+ }
1772
+ html.dark .markloom-bb-color .markloom-bb-a { color: rgba(255, 255, 255, 0.88); }
1773
+
1774
+ /* ── drag / add handles ── */
1775
+ .markloom-drag-handle {
1776
+ @apply inline-flex items-center justify-center w-[18px] h-5 p-0 border-0 rounded bg-transparent cursor-grab select-none;
1777
+ color: #8f959e;
1369
1778
  }
1779
+ .markloom-drag-handle svg { @apply block; }
1370
1780
  .markloom-drag-handle:hover {
1371
1781
  background: rgba(31, 35, 41, 0.06);
1372
1782
  color: #646a73;
1373
1783
  }
1374
1784
  .markloom-drag-handle:active {
1375
- cursor: grabbing;
1785
+ @apply cursor-grabbing;
1376
1786
  background: rgba(31, 35, 41, 0.1);
1377
1787
  }
1378
1788
  .markloom-add-handle {
1379
- display: inline-flex;
1380
- align-items: center;
1381
- justify-content: center;
1382
- width: 18px;
1383
- height: 20px;
1384
- padding: 0;
1385
- border: none;
1386
- border-radius: 4px;
1387
- background: transparent;
1789
+ @apply inline-flex items-center justify-center w-[18px] h-5 p-0 border-0 rounded bg-transparent cursor-pointer select-none;
1388
1790
  color: #8f959e;
1389
1791
  font: 500 15px/20px system-ui, sans-serif;
1390
- cursor: pointer;
1391
- user-select: none;
1392
1792
  }
1393
1793
  .markloom-add-handle:hover {
1394
1794
  background: rgba(31, 35, 41, 0.06);
1395
1795
  color: #646a73;
1396
1796
  }
1397
1797
  .markloom-drag-drop {
1398
- position: fixed;
1399
- height: 2px;
1400
- background: var(--accent, #3370ff);
1401
- border-radius: 1px;
1402
- pointer-events: none;
1403
- z-index: 66;
1798
+ @apply fixed h-0.5 rounded-sm pointer-events-none z-[66];
1799
+ background: var(--markloom-accent);
1404
1800
  }
1405
1801
  @media (prefers-color-scheme: dark) {
1406
1802
  .markloom-block-kind {
@@ -1408,115 +1804,153 @@
1408
1804
  color: rgba(255, 255, 255, 0.55);
1409
1805
  }
1410
1806
  .markloom-drag-handle,
1411
- .markloom-add-handle {
1412
- color: rgba(255, 255, 255, 0.4);
1413
- }
1807
+ .markloom-add-handle { color: rgba(255, 255, 255, 0.4); }
1414
1808
  .markloom-drag-handle:hover,
1415
1809
  .markloom-add-handle:hover {
1416
1810
  background: rgba(255, 255, 255, 0.08);
1417
1811
  color: rgba(255, 255, 255, 0.7);
1418
1812
  }
1419
- .markloom-doc .markloom-heading:focus-within {
1420
- background: rgba(76, 139, 245, 0.12);
1421
- }
1422
- .markloom-block-bar .markloom-heading-fold path {
1423
- fill: #fff;
1424
- }
1425
- .markloom-block-bar .markloom-heading-fold:hover {
1426
- background: rgba(255, 255, 255, 0.1);
1427
- }
1428
- }
1429
- /* ─── 飞书式链接浮层:选区旁 输入+确认,无遮罩 ─── */
1813
+ .markloom-doc .markloom-heading:focus-within { background: rgba(76, 139, 245, 0.12); }
1814
+ .markloom-block-bar .markloom-heading-fold path { fill: #fff; }
1815
+ .markloom-block-bar .markloom-heading-fold:hover { background: rgba(255, 255, 255, 0.1); }
1816
+ }
1817
+ html.dark .markloom-block-kind {
1818
+ background: rgba(255, 255, 255, 0.1);
1819
+ color: rgba(255, 255, 255, 0.55);
1820
+ }
1821
+ html.dark .markloom-drag-handle,
1822
+ html.dark .markloom-add-handle { color: rgba(255, 255, 255, 0.4); }
1823
+ html.dark .markloom-drag-handle:hover,
1824
+ html.dark .markloom-add-handle:hover {
1825
+ background: rgba(255, 255, 255, 0.08);
1826
+ color: rgba(255, 255, 255, 0.7);
1827
+ }
1828
+ html.dark .markloom-doc .markloom-heading:focus-within { background: rgba(76, 139, 245, 0.12); }
1829
+ html.dark .markloom-block-bar .markloom-heading-fold path { fill: #fff; }
1830
+ html.dark .markloom-block-bar .markloom-heading-fold:hover { background: rgba(255, 255, 255, 0.1); }
1831
+
1832
+ /* ── ask / link popover(飞书式轻量浮层:链接·公式·嵌入) ── */
1833
+ .markloom-ask-pop-host,
1430
1834
  .markloom-link-pop-host {
1431
- position: fixed;
1432
- left: 0;
1433
- top: 0;
1434
- z-index: 120;
1435
- pointer-events: none;
1835
+ @apply fixed left-0 top-0 z-[120] pointer-events-none;
1436
1836
  }
1837
+ .markloom-ask-pop,
1437
1838
  .markloom-link-pop {
1438
- position: fixed;
1439
- display: flex;
1440
- align-items: center;
1441
- gap: 10px;
1442
- padding: 12px 14px;
1443
- border-radius: 8px;
1839
+ @apply fixed flex items-center gap-2.5 px-3 py-2.5 rounded-[10px] pointer-events-auto opacity-0 -translate-y-1;
1444
1840
  border: 1px solid #dee0e3;
1445
1841
  background: #fff;
1446
1842
  box-shadow: 0 2px 8px rgba(31, 35, 41, 0.08), 0 8px 24px rgba(31, 35, 41, 0.08);
1447
- pointer-events: auto;
1448
- opacity: 0;
1449
- transform: translateY(-4px);
1450
- animation: markloom-link-pop-in 0.14s ease forwards;
1843
+ animation: markloom-ask-pop-in 0.14s ease forwards;
1844
+ }
1845
+ .markloom-ask-pop.is-multi {
1846
+ @apply flex-col items-stretch gap-2 px-3 pt-3 pb-2.5;
1847
+ }
1848
+ @keyframes markloom-ask-pop-in {
1849
+ to { opacity: 1; transform: translateY(0); }
1451
1850
  }
1452
1851
  @keyframes markloom-link-pop-in {
1453
1852
  to { opacity: 1; transform: translateY(0); }
1454
1853
  }
1854
+ .markloom-ask-pop-input,
1455
1855
  .markloom-link-pop-input {
1456
- width: 280px;
1856
+ @apply box-border m-0 px-3 rounded-md outline-none;
1457
1857
  height: 36px;
1458
- box-sizing: border-box;
1459
- margin: 0;
1460
- padding: 0 12px;
1461
1858
  border: 1px solid #3370ff;
1462
- border-radius: 6px;
1463
1859
  background: #fff;
1464
1860
  color: #1f2329;
1465
1861
  font: 400 14px/1 system-ui, -apple-system, 'Segoe UI', sans-serif;
1466
- outline: none;
1467
1862
  box-shadow: 0 0 0 2px rgba(51, 112, 255, 0.12);
1468
1863
  }
1469
- .markloom-link-pop-input::placeholder {
1864
+ .markloom-ask-pop.is-multi .markloom-ask-pop-input {
1865
+ @apply w-full h-auto py-2 resize-y;
1866
+ min-height: 72px;
1867
+ line-height: 1.45;
1868
+ }
1869
+ .markloom-ask-pop-input.is-mono {
1870
+ font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
1871
+ font-size: 13px;
1872
+ }
1873
+ .markloom-ask-pop-input.is-err {
1874
+ border-color: #e11d48 !important;
1875
+ box-shadow: 0 0 0 2px rgba(225, 29, 72, 0.14) !important;
1876
+ }
1877
+ .markloom-ask-pop-input::placeholder,
1878
+ .markloom-link-pop-input::placeholder { color: #8f959e; }
1879
+ .markloom-ask-pop-err {
1880
+ @apply text-xs -mt-0.5;
1881
+ color: #e11d48;
1882
+ }
1883
+ .markloom-ask-pop-ft {
1884
+ @apply flex items-center justify-end gap-2.5;
1885
+ }
1886
+ .markloom-ask-pop:not(.is-multi) .markloom-ask-pop-ft {
1887
+ @apply shrink-0;
1888
+ }
1889
+ .markloom-ask-pop-hint {
1890
+ @apply mr-auto text-[11px];
1470
1891
  color: #8f959e;
1892
+ font: 400 11px/1 system-ui, sans-serif;
1471
1893
  }
1894
+ .markloom-ask-pop-ok,
1472
1895
  .markloom-link-pop-ok {
1473
- flex: none;
1474
- height: 36px;
1475
- min-width: 72px;
1476
- padding: 0 16px;
1477
- border: none;
1478
- border-radius: 6px;
1896
+ @apply shrink-0 h-9 min-w-[68px] px-3.5 border-0 rounded-md text-white cursor-not-allowed;
1479
1897
  background: #bbbfc4;
1480
- color: #fff;
1481
- font: 500 14px/1 system-ui, -apple-system, 'Segoe UI', sans-serif;
1482
- cursor: not-allowed;
1483
- }
1484
- .markloom-link-pop-ok.is-ready {
1485
- background: #3370ff;
1486
- cursor: pointer;
1487
- }
1488
- .markloom-link-pop-ok.is-ready:hover {
1489
- background: #2b5fd9;
1898
+ font: 500 13px/1 system-ui, -apple-system, 'Segoe UI', sans-serif;
1490
1899
  }
1900
+ .markloom-ask-pop-ok.is-ready,
1901
+ .markloom-link-pop-ok.is-ready { background: #3370ff; cursor: pointer; }
1902
+ .markloom-ask-pop-ok.is-ready:hover,
1903
+ .markloom-link-pop-ok.is-ready:hover { background: #2b5fd9; }
1491
1904
  @media (prefers-color-scheme: dark) {
1905
+ .markloom-ask-pop,
1492
1906
  .markloom-link-pop {
1493
1907
  background: #2b2b2b;
1494
1908
  border-color: rgba(255, 255, 255, 0.1);
1495
1909
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
1496
1910
  }
1911
+ .markloom-ask-pop-input,
1497
1912
  .markloom-link-pop-input {
1498
1913
  background: #1f1f1f;
1499
1914
  color: rgba(255, 255, 255, 0.9);
1500
1915
  border-color: #4c8bf5;
1501
1916
  box-shadow: 0 0 0 2px rgba(76, 139, 245, 0.2);
1502
1917
  }
1503
- .markloom-link-pop-input::placeholder {
1504
- color: rgba(255, 255, 255, 0.4);
1505
- }
1918
+ .markloom-ask-pop-input::placeholder,
1919
+ .markloom-link-pop-input::placeholder { color: rgba(255, 255, 255, 0.4); }
1920
+ .markloom-ask-pop-hint { color: rgba(255, 255, 255, 0.35); }
1921
+ .markloom-ask-pop-ok,
1506
1922
  .markloom-link-pop-ok { background: #5c5c5c; }
1923
+ .markloom-ask-pop-ok.is-ready,
1507
1924
  .markloom-link-pop-ok.is-ready { background: #4c8bf5; }
1925
+ .markloom-ask-pop-ok.is-ready:hover,
1508
1926
  .markloom-link-pop-ok.is-ready:hover { background: #3d7ae0; }
1509
1927
  }
1928
+ html.dark .markloom-ask-pop,
1929
+ html.dark .markloom-link-pop {
1930
+ background: #2b2b2b;
1931
+ border-color: rgba(255, 255, 255, 0.1);
1932
+ box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
1933
+ }
1934
+ html.dark .markloom-ask-pop-input,
1935
+ html.dark .markloom-link-pop-input {
1936
+ background: #1f1f1f;
1937
+ color: rgba(255, 255, 255, 0.9);
1938
+ border-color: #4c8bf5;
1939
+ box-shadow: 0 0 0 2px rgba(76, 139, 245, 0.2);
1940
+ }
1941
+ html.dark .markloom-ask-pop-input::placeholder,
1942
+ html.dark .markloom-link-pop-input::placeholder { color: rgba(255, 255, 255, 0.4); }
1943
+ html.dark .markloom-ask-pop-hint { color: rgba(255, 255, 255, 0.35); }
1944
+ html.dark .markloom-ask-pop-ok,
1945
+ html.dark .markloom-link-pop-ok { background: #5c5c5c; }
1946
+ html.dark .markloom-ask-pop-ok.is-ready,
1947
+ html.dark .markloom-link-pop-ok.is-ready { background: #4c8bf5; }
1948
+ html.dark .markloom-ask-pop-ok.is-ready:hover,
1949
+ html.dark .markloom-link-pop-ok.is-ready:hover { background: #3d7ae0; }
1510
1950
 
1511
- /* ─── 输入弹层(替代 window.prompt):公式·色号·表样式 ─── */
1951
+ /* ── prompt dialog ── */
1512
1952
  .markloom-prompt-mask {
1513
- position: fixed;
1514
- inset: 0;
1515
- z-index: 200;
1516
- display: flex;
1517
- align-items: center;
1518
- justify-content: center;
1519
- padding: 24px;
1953
+ @apply fixed inset-0 z-[200] flex items-center justify-center p-6;
1520
1954
  background: rgba(15, 17, 21, 0.45);
1521
1955
  backdrop-filter: blur(2px);
1522
1956
  animation: markloom-prompt-in 0.12s ease-out;
@@ -1526,9 +1960,7 @@
1526
1960
  to { opacity: 1; }
1527
1961
  }
1528
1962
  .markloom-prompt-card {
1529
- width: min(400px, 100%);
1530
- padding: 20px 20px 16px;
1531
- border-radius: 12px;
1963
+ @apply w-full max-w-[400px] px-5 pt-5 pb-4 rounded-xl;
1532
1964
  border: 1px solid rgba(0, 0, 0, 0.06);
1533
1965
  background: var(--bg-page, #fff);
1534
1966
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.06);
@@ -1543,30 +1975,22 @@
1543
1975
  .markloom-prompt-title {
1544
1976
  font: 600 16px/1.3 system-ui, sans-serif;
1545
1977
  color: var(--text-a, #1f2328);
1546
- margin: 0 0 6px;
1978
+ @apply m-0 mb-1.5;
1547
1979
  }
1548
1980
  .markloom-prompt-desc {
1549
- font-size: 13px;
1981
+ @apply text-[13px] m-0 mb-3.5;
1550
1982
  color: var(--text-b, rgba(0, 0, 0, 0.55));
1551
- margin: 0 0 14px;
1552
1983
  }
1553
1984
  .markloom-prompt-input {
1554
- display: block;
1555
- width: 100%;
1556
- box-sizing: border-box;
1557
- margin: 0 0 8px;
1558
- padding: 10px 12px;
1985
+ @apply block w-full box-border m-0 mb-2 px-3 py-2.5 rounded-lg outline-none resize-y;
1559
1986
  border: 1px solid rgba(0, 0, 0, 0.12);
1560
- border-radius: 8px;
1561
1987
  background: var(--bg-side, #f7f7f8);
1562
1988
  color: var(--text-a, #1f2328);
1563
1989
  font: 400 14px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
1564
- outline: none;
1565
- resize: vertical;
1566
1990
  transition: border-color 0.12s, box-shadow 0.12s, background 0.12s;
1567
1991
  }
1568
1992
  .markloom-prompt-input:focus {
1569
- border-color: var(--accent, #3370ff);
1993
+ border-color: var(--markloom-accent);
1570
1994
  background: #fff;
1571
1995
  box-shadow: 0 0 0 3px rgba(51, 112, 255, 0.15);
1572
1996
  }
@@ -1575,39 +1999,27 @@
1575
1999
  box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.12) !important;
1576
2000
  }
1577
2001
  .markloom-prompt-err {
1578
- font-size: 12px;
2002
+ @apply text-xs -mt-0.5 mb-2;
1579
2003
  color: #e11d48;
1580
- margin: -2px 0 8px;
1581
2004
  }
1582
2005
  .markloom-prompt-ft {
1583
- display: flex;
1584
- justify-content: flex-end;
1585
- gap: 8px;
1586
- margin-top: 12px;
2006
+ @apply flex justify-end gap-2 mt-3;
1587
2007
  }
1588
2008
  .markloom-prompt-btn {
1589
- height: 34px;
1590
- padding: 0 16px;
1591
- border-radius: 8px;
1592
- border: none;
2009
+ @apply h-[34px] px-4 rounded-lg border-0 cursor-pointer;
1593
2010
  font: 500 13px/1 system-ui, sans-serif;
1594
- cursor: pointer;
1595
2011
  }
1596
2012
  .markloom-prompt-btn-primary {
1597
- background: var(--accent, #3370ff);
1598
- color: #fff;
1599
- }
1600
- .markloom-prompt-btn-primary:hover {
1601
- filter: brightness(1.06);
2013
+ background: var(--markloom-accent);
2014
+ @apply text-white;
1602
2015
  }
2016
+ .markloom-prompt-btn-primary:hover { filter: brightness(1.06); }
1603
2017
  .markloom-prompt-btn-ghost {
1604
- background: transparent;
2018
+ @apply bg-transparent;
1605
2019
  color: var(--text-b, rgba(0, 0, 0, 0.55));
1606
2020
  border: 1px solid rgba(0, 0, 0, 0.1);
1607
2021
  }
1608
- .markloom-prompt-btn-ghost:hover {
1609
- background: var(--bg-hover, rgba(0, 0, 0, 0.04));
1610
- }
2022
+ .markloom-prompt-btn-ghost:hover { background: var(--bg-hover, rgba(0, 0, 0, 0.04)); }
1611
2023
  @media (prefers-color-scheme: dark) {
1612
2024
  .markloom-prompt-mask { background: rgba(0, 0, 0, 0.55); }
1613
2025
  .markloom-prompt-card {
@@ -1621,318 +2033,274 @@
1621
2033
  .markloom-prompt-input:focus { background: var(--bg-page, #2a2a2a); }
1622
2034
  .markloom-prompt-btn-ghost { border-color: rgba(255, 255, 255, 0.12); }
1623
2035
  }
2036
+ html.dark .markloom-prompt-mask { background: rgba(0, 0, 0, 0.55); }
2037
+ html.dark .markloom-prompt-card {
2038
+ border-color: rgba(255, 255, 255, 0.08);
2039
+ box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
2040
+ }
2041
+ html.dark .markloom-prompt-input {
2042
+ border-color: rgba(255, 255, 255, 0.12);
2043
+ background: var(--bg-side, #212121);
2044
+ }
2045
+ html.dark .markloom-prompt-input:focus { background: var(--bg-page, #2a2a2a); }
2046
+ html.dark .markloom-prompt-btn-ghost { border-color: rgba(255, 255, 255, 0.12); }
1624
2047
 
1625
- /* 斜杠命令菜单:行首打 `/` 浮出块类型列表(fixed,place 算坐标)。分组标头 + 单色线性图标 + label。 */
2048
+ /* ── slash menu ── */
1626
2049
  .markloom-slash {
1627
- position: fixed;
1628
- display: flex;
1629
- flex-direction: column;
1630
- min-width: 240px;
1631
- max-height: 380px;
1632
- overflow-y: auto;
1633
- padding: 8px;
1634
- border-radius: 14px;
1635
- border: 1px solid var(--slash-border, rgba(0, 0, 0, 0.08));
1636
- background: var(--slash-bg, #fff);
1637
- box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
1638
- z-index: 100;
1639
- user-select: none;
2050
+ @apply fixed flex flex-col min-w-[240px] max-h-[380px] overflow-y-auto p-2 rounded-[14px] z-[100] select-none;
2051
+ border: 1px solid var(--slash-border);
2052
+ background: var(--slash-bg);
2053
+ box-shadow: var(--slash-shadow);
1640
2054
  }
1641
2055
  .markloom-slash-section {
1642
- padding: 10px 12px 4px;
2056
+ @apply px-3 pt-2.5 pb-1 uppercase;
1643
2057
  font: 600 11px/1 system-ui, sans-serif;
1644
2058
  letter-spacing: 0.08em;
1645
- color: var(--slash-section, #9aa0a6);
1646
- text-transform: uppercase;
2059
+ color: var(--slash-section);
1647
2060
  }
1648
2061
  .markloom-slash button {
1649
- display: flex;
1650
- align-items: center;
1651
- gap: 12px;
1652
- padding: 8px 12px;
1653
- border: none;
1654
- border-radius: 8px;
1655
- background: transparent;
1656
- color: var(--slash-text, #1f2328);
2062
+ @apply flex items-center gap-3 px-3 py-2 border-0 rounded-lg bg-transparent text-left cursor-pointer;
2063
+ color: var(--slash-text);
1657
2064
  font: 500 15px/1.2 system-ui, sans-serif;
1658
- text-align: left;
1659
- cursor: pointer;
1660
2065
  }
1661
2066
  .markloom-slash button:hover,
1662
2067
  .markloom-slash button[data-active] {
1663
- background: var(--slash-active, rgba(0, 0, 0, 0.05));
2068
+ background: var(--slash-active);
1664
2069
  }
1665
2070
  .markloom-slash-icon {
1666
- flex: none;
1667
- width: 22px;
1668
- display: flex;
1669
- align-items: center;
1670
- justify-content: center;
1671
- color: var(--slash-icon, #6b7075);
2071
+ @apply shrink-0 w-[22px] flex items-center justify-center;
2072
+ color: var(--slash-icon);
1672
2073
  }
1673
2074
  .markloom-slash-htxt {
1674
2075
  font: 700 14px/1 system-ui, sans-serif;
2076
+ color: inherit;
1675
2077
  }
1676
2078
  .markloom-slash-htxt sub {
1677
- font-size: 9px;
1678
- font-weight: 700;
2079
+ @apply text-[9px] font-bold;
1679
2080
  }
1680
- /* 公式:行内 atom。默认展示 $latex$ 源文;host 注入 KaTeX 后为渲染结果。 */
2081
+
2082
+ /* ── math / embed / mention ── */
1681
2083
  .markloom-math {
2084
+ @apply px-0.5 rounded-sm cursor-pointer whitespace-nowrap;
1682
2085
  font-family: 'Latin Modern Math', 'Cambria Math', 'Times New Roman', serif;
1683
- padding: 0 2px;
1684
- border-radius: 3px;
1685
2086
  background: var(--math-bg, rgba(0, 0, 0, 0.04));
1686
- cursor: pointer;
1687
- white-space: nowrap;
1688
2087
  }
1689
2088
  .markloom-math-block {
1690
- display: block;
1691
- text-align: center;
1692
- padding: 0.6em 0.4em;
1693
- margin: 0.4em 0;
1694
- white-space: normal;
1695
- overflow-x: auto;
2089
+ @apply block text-center py-[0.6em] px-[0.4em] my-[0.4em] whitespace-normal overflow-x-auto;
1696
2090
  }
1697
2091
 
1698
- /* 嵌入块:youtube/twitch iframe · audio · file */
1699
2092
  .markloom-embed {
1700
- margin: 0.75rem 0;
1701
- border-radius: 8px;
1702
- overflow: hidden;
2093
+ @apply my-3 rounded-lg overflow-hidden;
1703
2094
  background: var(--bg-side, #f5f5f5);
1704
2095
  }
1705
2096
  .markloom-embed[data-selected] {
1706
- outline: 2px solid var(--accent, #1456f0);
2097
+ outline: 2px solid var(--markloom-accent);
1707
2098
  outline-offset: 2px;
1708
2099
  }
1709
2100
  .markloom-embed-frame {
1710
- display: block;
1711
- width: 100%;
1712
- aspect-ratio: 16 / 9;
1713
- border: 0;
1714
- background: #000;
2101
+ @apply block w-full aspect-video border-0 bg-black;
1715
2102
  }
1716
2103
  .markloom-embed-audio {
1717
- display: block;
1718
- width: 100%;
1719
- padding: 8px;
2104
+ @apply block w-full p-2;
1720
2105
  }
1721
2106
  .markloom-embed-file {
1722
- padding: 10px 14px;
2107
+ @apply px-3.5 py-2.5;
1723
2108
  border: 1px solid var(--markloom-table-line, rgba(0, 0, 0, 0.1));
1724
2109
  }
1725
2110
  .markloom-embed-file-link {
2111
+ @apply no-underline inline-flex items-center gap-1.5;
1726
2112
  color: var(--text-a, inherit);
1727
- text-decoration: none;
1728
2113
  font: 500 14px/1.4 system-ui, sans-serif;
1729
- display: inline-flex;
1730
- align-items: center;
1731
- gap: 6px;
1732
- }
1733
- .markloom-embed-file-link:hover {
1734
- text-decoration: underline;
1735
- }
1736
- .markloom-embed-file-ico {
1737
- flex: none;
1738
2114
  }
2115
+ .markloom-embed-file-link:hover { @apply underline; }
2116
+ .markloom-embed-file-ico { @apply shrink-0; }
1739
2117
 
1740
- /* @mention 行内 atom:文本流里的高亮 chip(contentEditable=false,占 1 字符位)。 */
2118
+ /* @提及 / @日期 — 飞书胶囊:浅色实底、暗色半透明同色相 */
1741
2119
  .markloom-mention {
1742
- color: var(--mention-text, #1a56db);
1743
- background: var(--mention-bg, rgba(26, 86, 219, 0.08));
1744
- border-radius: 4px;
1745
- padding: 0 3px;
1746
- cursor: pointer;
1747
- white-space: nowrap;
1748
- display: inline-flex;
1749
- align-items: center;
1750
- gap: 2px;
1751
- vertical-align: baseline;
2120
+ @apply rounded-md px-1.5 cursor-pointer whitespace-nowrap inline-flex items-center gap-0.5 align-baseline;
2121
+ color: var(--mention-text, #245bdb);
2122
+ background: var(--mention-bg, #edf3ff);
2123
+ font-weight: 500;
1752
2124
  }
1753
2125
  .markloom-mention-ico {
1754
- display: inline-block;
1755
- flex: none;
1756
- vertical-align: -0.1em;
2126
+ @apply inline-block shrink-0;
2127
+ vertical-align: -0.12em;
2128
+ opacity: 0.9;
1757
2129
  }
1758
- /* @日期:同 mention 的行内 atom,绿色胶囊区分 person。 */
1759
2130
  .markloom-mention-date {
1760
- color: var(--mention-date-text, #15803d);
1761
- background: var(--mention-date-bg, rgba(22, 163, 74, 0.1));
2131
+ color: var(--mention-date-text, #237b1a);
2132
+ background: var(--mention-date-bg, #eef9ee);
2133
+ }
2134
+ @media (prefers-color-scheme: dark) {
2135
+ .markloom-mention {
2136
+ color: var(--mention-text, #9bc4ff);
2137
+ background: var(--mention-bg, rgba(122, 175, 255, 0.16));
2138
+ }
2139
+ .markloom-mention-date {
2140
+ color: var(--mention-date-text, #7dde88);
2141
+ background: var(--mention-date-bg, rgba(98, 210, 111, 0.16));
2142
+ }
2143
+ }
2144
+ html.dark .markloom-mention {
2145
+ color: var(--mention-text, #9bc4ff);
2146
+ background: var(--mention-bg, rgba(122, 175, 255, 0.16));
2147
+ }
2148
+ html.dark .markloom-mention-date {
2149
+ color: var(--mention-date-text, #7dde88);
2150
+ background: var(--mention-date-bg, rgba(98, 210, 111, 0.16));
1762
2151
  }
1763
2152
 
1764
- /* 员工名片(点 @人):飞书式轻卡 */
1765
- .markloom-profile-card {
1766
- padding: 16px;
1767
- border-radius: 12px;
1768
- border: 1px solid rgba(0, 0, 0, 0.06);
2153
+ /* ── 脚注:上标引用 / 文末定义(带回跳)/ 悬停卡 ── */
2154
+ .markloom-fnref {
2155
+ @apply cursor-pointer select-none;
2156
+ font-size: 0.75em;
2157
+ line-height: 0;
2158
+ }
2159
+ .markloom-fnref a {
2160
+ @apply no-underline;
2161
+ color: var(--markloom-accent, #3370ff);
2162
+ }
2163
+ .markloom-fnref a::before { content: '['; }
2164
+ .markloom-fnref a::after { content: ']'; }
2165
+ .markloom-footnote-def {
2166
+ @apply flex items-baseline gap-2 text-[0.9em] rounded-md;
2167
+ color: var(--markloom-muted, #646a73);
2168
+ transition: background-color 0.3s ease;
2169
+ }
2170
+ .markloom-footnote-def > :not(.markloom-footnote-head) { @apply flex-1 min-w-0 m-0; }
2171
+ .markloom-footnote-head { @apply shrink-0 inline-flex items-baseline gap-1 select-none; }
2172
+ .markloom-footnote-label { font-weight: 600; }
2173
+ .markloom-footnote-label::before { content: '['; }
2174
+ .markloom-footnote-label::after { content: ']'; }
2175
+ .markloom-footnote-back {
2176
+ @apply no-underline cursor-pointer;
2177
+ color: var(--markloom-accent, #3370ff);
2178
+ }
2179
+ .markloom-fn-flash,
2180
+ .markloom-fnref.markloom-fn-flash {
2181
+ background: var(--markloom-accent-soft, rgba(51, 112, 255, 0.16));
2182
+ }
2183
+ .markloom-footnote-card {
2184
+ @apply fixed left-0 top-0 z-[110] max-w-[360px] px-3 py-2 rounded-lg pointer-events-none whitespace-pre-wrap break-words;
2185
+ border: 1px solid #dee0e3;
1769
2186
  background: #fff;
1770
- box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.04);
1771
- font: 400 13px/1.45 system-ui, -apple-system, 'Segoe UI', sans-serif;
1772
- color: var(--text-a, #1f2328);
1773
- user-select: text;
2187
+ color: #1f2329;
2188
+ box-shadow: 0 2px 8px rgba(31, 35, 41, 0.08), 0 8px 24px rgba(31, 35, 41, 0.08);
2189
+ font: 400 13px/1.5 system-ui, -apple-system, 'Segoe UI', sans-serif;
2190
+ }
2191
+ .markloom-footnote-card.is-missing { color: #8f959e; }
2192
+ @media (prefers-color-scheme: dark) {
2193
+ .markloom-footnote-card { background: #2b2f36; color: #e6e8eb; border-color: #3f444d; }
2194
+ }
2195
+ html.dark .markloom-footnote-card { background: #2b2f36; color: #e6e8eb; border-color: #3f444d; }
2196
+
2197
+ /* ── profile card / date picker(与 ask-pop 同系:轻浮层、飞书蓝) ── */
2198
+ .markloom-mention-pop-host {
2199
+ @apply fixed left-0 top-0 z-[110] pointer-events-none;
2200
+ }
2201
+ .markloom-profile-card,
2202
+ .markloom-date-picker {
2203
+ @apply pointer-events-auto select-none opacity-0 -translate-y-1;
2204
+ border: 1px solid #dee0e3;
2205
+ background: #fff;
2206
+ box-shadow: 0 2px 8px rgba(31, 35, 41, 0.08), 0 8px 24px rgba(31, 35, 41, 0.08);
2207
+ font: 400 13px/1.4 system-ui, -apple-system, 'Segoe UI', sans-serif;
2208
+ color: #1f2329;
2209
+ animation: markloom-ask-pop-in 0.14s ease forwards;
2210
+ }
2211
+ .markloom-profile-card {
2212
+ @apply p-3.5 rounded-[10px] select-text;
1774
2213
  }
1775
2214
  .markloom-profile-head {
1776
- display: flex;
1777
- gap: 12px;
1778
- align-items: center;
2215
+ @apply flex gap-2.5 items-center;
1779
2216
  }
1780
2217
  .markloom-profile-avatar {
1781
- width: 48px;
1782
- height: 48px;
1783
- border-radius: 50%;
1784
- flex: none;
1785
- object-fit: cover;
2218
+ @apply w-10 h-10 rounded-full shrink-0 object-cover;
1786
2219
  }
1787
2220
  .markloom-profile-avatar-fallback {
1788
- display: flex;
1789
- align-items: center;
1790
- justify-content: center;
1791
- background: linear-gradient(135deg, #7c6cf0, #5b8def);
1792
- color: #fff;
1793
- font: 600 18px/1 system-ui, sans-serif;
2221
+ @apply flex items-center justify-center text-white;
2222
+ background: #3370ff;
2223
+ font: 600 15px/1 system-ui, sans-serif;
1794
2224
  }
1795
2225
  .markloom-profile-name {
1796
- font: 600 15px/1.3 system-ui, sans-serif;
1797
- color: var(--text-a, #1f2328);
2226
+ font: 600 14px/1.3 system-ui, sans-serif;
2227
+ color: #1f2329;
1798
2228
  }
1799
2229
  .markloom-profile-title,
1800
2230
  .markloom-profile-dept {
1801
- font-size: 12px;
1802
- color: var(--text-b, rgba(0, 0, 0, 0.55));
1803
- margin-top: 2px;
2231
+ @apply text-[12px] mt-0.5;
2232
+ color: #8f959e;
1804
2233
  }
1805
2234
  .markloom-profile-meta {
1806
- margin-top: 14px;
1807
- padding-top: 12px;
1808
- border-top: 1px solid rgba(0, 0, 0, 0.06);
1809
- display: flex;
1810
- flex-direction: column;
1811
- gap: 8px;
2235
+ @apply mt-3 pt-2.5 flex flex-col gap-1.5;
2236
+ border-top: 1px solid #eff0f1;
1812
2237
  }
1813
2238
  .markloom-profile-row {
1814
- display: flex;
1815
- gap: 12px;
1816
- align-items: baseline;
2239
+ @apply flex gap-2.5 items-baseline;
1817
2240
  }
1818
2241
  .markloom-profile-k {
1819
- flex: none;
1820
- width: 36px;
1821
- font-size: 12px;
1822
- color: var(--text-c, #999);
2242
+ @apply shrink-0 w-8 text-[11px];
2243
+ color: #8f959e;
1823
2244
  }
1824
2245
  .markloom-profile-v {
1825
- font-size: 13px;
1826
- color: var(--text-a, #1f2328);
1827
- word-break: break-all;
2246
+ @apply text-[12.5px] break-all;
2247
+ color: #1f2329;
1828
2248
  }
1829
2249
  .markloom-profile-link {
1830
- color: var(--accent, #3370ff);
1831
- text-decoration: none;
2250
+ @apply no-underline;
2251
+ color: #3370ff;
1832
2252
  }
1833
- .markloom-profile-link:hover { text-decoration: underline; }
2253
+ .markloom-profile-link:hover { @apply underline; }
1834
2254
 
1835
- /* 日期选择器(点 @日期) */
1836
2255
  .markloom-date-picker {
1837
- padding: 12px 14px 10px;
1838
- border-radius: 12px;
1839
- border: 1px solid rgba(0, 0, 0, 0.06);
1840
- background: #fff;
1841
- box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.04);
1842
- font: 400 13px/1.4 system-ui, -apple-system, 'Segoe UI', sans-serif;
1843
- color: var(--text-a, #1f2328);
1844
- user-select: none;
2256
+ @apply px-3 pt-2.5 pb-2.5 rounded-[10px];
1845
2257
  }
1846
2258
  .markloom-date-hd {
1847
- display: flex;
1848
- align-items: center;
1849
- justify-content: space-between;
1850
- margin-bottom: 10px;
2259
+ @apply flex items-center justify-between mb-2;
1851
2260
  }
1852
2261
  .markloom-date-label {
1853
- font: 600 14px/1 system-ui, sans-serif;
2262
+ font: 600 13px/1 system-ui, sans-serif;
2263
+ color: #1f2329;
1854
2264
  }
1855
2265
  .markloom-date-nav {
1856
- width: 28px;
1857
- height: 28px;
1858
- border: none;
1859
- border-radius: 6px;
1860
- background: transparent;
1861
- color: var(--text-b, #666);
1862
- font-size: 18px;
1863
- line-height: 1;
1864
- cursor: pointer;
2266
+ @apply w-7 h-7 border-0 rounded-md bg-transparent text-base leading-none cursor-pointer;
2267
+ color: #646a73;
1865
2268
  }
1866
- .markloom-date-nav:hover { background: rgba(0, 0, 0, 0.05); }
2269
+ .markloom-date-nav:hover { background: rgba(31, 35, 41, 0.06); }
1867
2270
  .markloom-date-week {
1868
- display: grid;
1869
- grid-template-columns: repeat(7, 1fr);
1870
- gap: 2px;
1871
- margin-bottom: 4px;
1872
- text-align: center;
1873
- font-size: 11px;
1874
- color: var(--text-c, #999);
2271
+ @apply grid grid-cols-7 gap-0.5 mb-0.5 text-center text-[11px];
2272
+ color: #8f959e;
1875
2273
  }
1876
2274
  .markloom-date-grid {
1877
- display: grid;
1878
- grid-template-columns: repeat(7, 1fr);
1879
- gap: 2px;
2275
+ @apply grid grid-cols-7 gap-0.5;
1880
2276
  }
1881
2277
  .markloom-date-cell {
1882
- height: 32px;
1883
- border: none;
1884
- border-radius: 6px;
1885
- background: transparent;
1886
- color: var(--text-a, #1f2328);
1887
- font: 400 13px/32px system-ui, sans-serif;
1888
- text-align: center;
1889
- cursor: pointer;
1890
- padding: 0;
1891
- }
1892
- .markloom-date-cell:hover:not(.markloom-date-empty) {
1893
- background: rgba(0, 0, 0, 0.05);
2278
+ @apply h-[30px] border-0 rounded-md bg-transparent text-center cursor-pointer p-0;
2279
+ color: #1f2329;
2280
+ font: 400 13px/30px system-ui, sans-serif;
1894
2281
  }
1895
- .markloom-date-empty { cursor: default; }
2282
+ .markloom-date-cell:hover:not(.markloom-date-empty) { background: rgba(31, 35, 41, 0.06); }
2283
+ .markloom-date-empty { @apply cursor-default; }
1896
2284
  .markloom-date-today {
1897
- color: var(--accent, #3370ff);
1898
- font-weight: 600;
2285
+ color: #3370ff;
2286
+ @apply font-semibold;
1899
2287
  }
1900
2288
  .markloom-date-selected {
1901
- background: var(--accent, #3370ff) !important;
2289
+ background: #3370ff !important;
1902
2290
  color: #fff !important;
1903
2291
  font-weight: 600;
1904
2292
  }
1905
2293
  .markloom-time-row {
1906
- display: flex;
1907
- align-items: flex-end;
1908
- justify-content: center;
1909
- gap: 6px;
1910
- margin-top: 12px;
1911
- padding-top: 12px;
1912
- border-top: 1px solid rgba(0, 0, 0, 0.05);
1913
- }
1914
- .markloom-time-field {
1915
- display: flex;
1916
- flex-direction: column;
1917
- align-items: center;
1918
- gap: 4px;
1919
- }
1920
- .markloom-time-field-lab {
1921
- font-size: 11px;
1922
- color: var(--text-c, #999);
2294
+ @apply flex items-center justify-center gap-1 mt-2.5 pt-2.5;
2295
+ border-top: 1px solid #eff0f1;
1923
2296
  }
1924
2297
  .markloom-time-input {
1925
- width: 48px;
1926
- height: 34px;
1927
- padding: 0 4px;
1928
- border: 1px solid rgba(0, 0, 0, 0.1);
1929
- border-radius: 6px;
1930
- background: var(--bg-side, #f7f7f8);
1931
- color: var(--text-a, #1f2328);
1932
- font: 500 14px/34px ui-monospace, SFMono-Regular, Menlo, monospace;
1933
- text-align: center;
1934
- outline: none;
1935
- /* 藏掉 number 箭头在部分浏览器仍可用滚轮/键入 */
2298
+ @apply w-11 h-8 px-1 rounded-md text-center outline-none;
2299
+ border: 1px solid #dee0e3;
2300
+ background: #f5f6f7;
2301
+ color: #1f2329;
2302
+ font: 500 13px/32px ui-monospace, SFMono-Regular, Menlo, monospace;
2303
+ font-variant-numeric: tabular-nums;
1936
2304
  -moz-appearance: textfield;
1937
2305
  }
1938
2306
  .markloom-time-input::-webkit-outer-spin-button,
@@ -1941,122 +2309,145 @@
1941
2309
  margin: 0;
1942
2310
  }
1943
2311
  .markloom-time-input:focus {
1944
- border-color: var(--accent, #3370ff);
2312
+ border-color: #3370ff;
1945
2313
  background: #fff;
1946
2314
  box-shadow: 0 0 0 2px rgba(51, 112, 255, 0.12);
1947
2315
  }
1948
2316
  .markloom-time-colon {
1949
- font: 600 16px/34px system-ui, sans-serif;
1950
- color: var(--text-b, #666);
1951
- padding-bottom: 2px;
2317
+ font: 600 13px/1 system-ui, sans-serif;
2318
+ color: #8f959e;
1952
2319
  }
1953
2320
  .markloom-date-preview {
1954
- margin-top: 10px;
1955
- text-align: center;
1956
- font: 500 13px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
1957
- color: var(--text-b, #555);
2321
+ @apply mt-2 text-center;
2322
+ font: 500 12px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
2323
+ color: #646a73;
1958
2324
  font-variant-numeric: tabular-nums;
1959
2325
  }
1960
2326
  .markloom-date-ft {
1961
- display: flex;
1962
- align-items: center;
1963
- justify-content: space-between;
1964
- margin-top: 12px;
1965
- padding-top: 10px;
1966
- border-top: 1px solid rgba(0, 0, 0, 0.05);
2327
+ @apply flex items-center justify-between mt-2 pt-2;
2328
+ border-top: 1px solid #eff0f1;
1967
2329
  }
1968
2330
  .markloom-date-today-btn {
1969
- border: none;
1970
- background: transparent;
1971
- color: var(--accent, #3370ff);
1972
- font: 500 13px/1 system-ui, sans-serif;
1973
- cursor: pointer;
1974
- padding: 6px 0;
2331
+ @apply border-0 bg-transparent cursor-pointer py-1 px-0;
2332
+ color: #3370ff;
2333
+ font: 500 12.5px/1 system-ui, sans-serif;
1975
2334
  }
1976
- .markloom-date-today-btn:hover { opacity: 0.85; }
2335
+ .markloom-date-today-btn:hover { @apply opacity-[0.85]; }
1977
2336
  .markloom-date-ok {
1978
- height: 30px;
1979
- padding: 0 16px;
1980
- border: none;
1981
- border-radius: 6px;
1982
- background: var(--accent, #3370ff);
1983
- color: #fff;
1984
- font: 500 13px/1 system-ui, sans-serif;
1985
- cursor: pointer;
2337
+ @apply h-7 min-w-[60px] px-3.5 border-0 rounded-md text-white cursor-pointer;
2338
+ background: #3370ff;
2339
+ font: 500 12.5px/1 system-ui, sans-serif;
1986
2340
  }
1987
- .markloom-date-ok:hover { filter: brightness(1.05); }
2341
+ .markloom-date-ok:hover { background: #2b5fd9; }
1988
2342
  @media (prefers-color-scheme: dark) {
1989
2343
  .markloom-profile-card,
1990
2344
  .markloom-date-picker {
1991
- background: var(--bg-page, #2a2a2a);
1992
- border-color: rgba(255, 255, 255, 0.08);
1993
- box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
2345
+ background: #2b2b2b;
2346
+ border-color: rgba(255, 255, 255, 0.1);
2347
+ box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
2348
+ color: rgba(255, 255, 255, 0.9);
1994
2349
  }
2350
+ .markloom-profile-name,
2351
+ .markloom-date-label,
2352
+ .markloom-date-cell,
2353
+ .markloom-profile-v { color: rgba(255, 255, 255, 0.9); }
2354
+ .markloom-profile-title,
2355
+ .markloom-profile-dept,
2356
+ .markloom-profile-k,
2357
+ .markloom-date-week,
2358
+ .markloom-time-colon,
2359
+ .markloom-date-preview { color: rgba(255, 255, 255, 0.4); }
1995
2360
  .markloom-profile-meta,
1996
2361
  .markloom-date-ft,
1997
2362
  .markloom-time-row { border-top-color: rgba(255, 255, 255, 0.08); }
1998
- .markloom-date-cell:hover:not(.markloom-date-empty) { background: rgba(255, 255, 255, 0.08); }
2363
+ .markloom-date-cell:hover:not(.markloom-date-empty),
1999
2364
  .markloom-date-nav:hover { background: rgba(255, 255, 255, 0.08); }
2365
+ .markloom-date-nav { color: rgba(255, 255, 255, 0.55); }
2366
+ .markloom-date-today { color: #7aafff; }
2367
+ .markloom-date-selected { background: #4c8bf5 !important; }
2000
2368
  .markloom-time-input {
2001
- border-color: rgba(255, 255, 255, 0.12);
2002
- background: var(--bg-side, #212121);
2369
+ border-color: rgba(255, 255, 255, 0.1);
2370
+ background: #1f1f1f;
2371
+ color: rgba(255, 255, 255, 0.9);
2003
2372
  }
2004
- .markloom-time-input:focus { background: var(--bg-page, #2a2a2a); }
2005
- }
2006
- /* @mention 候选菜单:与 slash 同视觉语言(独立 overlay)。 */
2373
+ .markloom-time-input:focus {
2374
+ border-color: #4c8bf5;
2375
+ background: #1a1a1a;
2376
+ box-shadow: 0 0 0 2px rgba(76, 139, 245, 0.2);
2377
+ }
2378
+ .markloom-date-today-btn { color: #7aafff; }
2379
+ .markloom-date-ok { background: #4c8bf5; }
2380
+ .markloom-date-ok:hover { background: #3d7ae0; }
2381
+ .markloom-profile-avatar-fallback { background: #4c8bf5; }
2382
+ .markloom-profile-link { color: #7aafff; }
2383
+ }
2384
+ html.dark .markloom-profile-card,
2385
+ html.dark .markloom-date-picker {
2386
+ background: #2b2b2b;
2387
+ border-color: rgba(255, 255, 255, 0.1);
2388
+ box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
2389
+ color: rgba(255, 255, 255, 0.9);
2390
+ }
2391
+ html.dark .markloom-profile-name,
2392
+ html.dark .markloom-date-label,
2393
+ html.dark .markloom-date-cell,
2394
+ html.dark .markloom-profile-v { color: rgba(255, 255, 255, 0.9); }
2395
+ html.dark .markloom-profile-title,
2396
+ html.dark .markloom-profile-dept,
2397
+ html.dark .markloom-profile-k,
2398
+ html.dark .markloom-date-week,
2399
+ html.dark .markloom-time-colon,
2400
+ html.dark .markloom-date-preview { color: rgba(255, 255, 255, 0.4); }
2401
+ html.dark .markloom-profile-meta,
2402
+ html.dark .markloom-date-ft,
2403
+ html.dark .markloom-time-row { border-top-color: rgba(255, 255, 255, 0.08); }
2404
+ html.dark .markloom-date-cell:hover:not(.markloom-date-empty),
2405
+ html.dark .markloom-date-nav:hover { background: rgba(255, 255, 255, 0.08); }
2406
+ html.dark .markloom-date-nav { color: rgba(255, 255, 255, 0.55); }
2407
+ html.dark .markloom-date-today { color: #7aafff; }
2408
+ html.dark .markloom-date-selected { background: #4c8bf5 !important; }
2409
+ html.dark .markloom-time-input {
2410
+ border-color: rgba(255, 255, 255, 0.1);
2411
+ background: #1f1f1f;
2412
+ color: rgba(255, 255, 255, 0.9);
2413
+ }
2414
+ html.dark .markloom-time-input:focus {
2415
+ border-color: #4c8bf5;
2416
+ background: #1a1a1a;
2417
+ box-shadow: 0 0 0 2px rgba(76, 139, 245, 0.2);
2418
+ }
2419
+ html.dark .markloom-date-today-btn { color: #7aafff; }
2420
+ html.dark .markloom-date-ok { background: #4c8bf5; }
2421
+ html.dark .markloom-date-ok:hover { background: #3d7ae0; }
2422
+ html.dark .markloom-profile-avatar-fallback { background: #4c8bf5; }
2423
+ html.dark .markloom-profile-link { color: #7aafff; }
2424
+
2425
+ /* ── mention menu ── */
2007
2426
  .markloom-mention-menu {
2008
- position: fixed;
2009
- display: flex;
2010
- flex-direction: column;
2011
- min-width: 200px;
2012
- max-height: 300px;
2013
- overflow-y: auto;
2014
- padding: 6px;
2015
- border-radius: 12px;
2016
- border: 1px solid var(--slash-border, rgba(0, 0, 0, 0.08));
2017
- background: var(--slash-bg, #fff);
2018
- box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
2019
- z-index: 100;
2020
- user-select: none;
2427
+ @apply fixed flex flex-col min-w-[200px] max-h-[300px] overflow-y-auto p-1.5 rounded-xl z-[100] select-none;
2428
+ border: 1px solid var(--slash-border);
2429
+ background: var(--slash-bg);
2430
+ box-shadow: var(--slash-shadow);
2021
2431
  }
2022
2432
  .markloom-mention-menu button {
2023
- padding: 7px 10px;
2024
- border: none;
2025
- border-radius: 8px;
2026
- background: transparent;
2027
- color: var(--slash-text, #1f2328);
2433
+ @apply px-2.5 py-[7px] border-0 rounded-lg bg-transparent flex items-center gap-1.5 text-left cursor-pointer;
2434
+ color: var(--slash-text);
2028
2435
  font: 500 14px/1.2 system-ui, sans-serif;
2029
- display: flex;
2030
- align-items: center;
2031
- gap: 6px;
2032
- text-align: left;
2033
- cursor: pointer;
2034
2436
  }
2035
2437
  .markloom-mention-menu button:hover,
2036
2438
  .markloom-mention-menu button[data-active] {
2037
- background: var(--slash-active, rgba(0, 0, 0, 0.05));
2439
+ background: var(--slash-active);
2038
2440
  }
2039
2441
 
2040
- /* 空块提示:paragraph → slash 引导;heading → H1…H6。::before 灰字,不占位、不进选区 */
2442
+ /* ── placeholder ── */
2041
2443
  .markloom-doc [data-placeholder] {
2042
- position: relative;
2444
+ @apply relative;
2043
2445
  }
2044
2446
  .markloom-doc [data-placeholder]::before {
2045
2447
  content: attr(data-placeholder);
2046
- position: absolute;
2047
- left: 0;
2048
- top: 0;
2049
- right: 0;
2448
+ @apply absolute left-0 top-0 right-0 font-normal not-italic pointer-events-none select-none whitespace-nowrap overflow-hidden text-ellipsis;
2050
2449
  color: #b0b3b8;
2051
- font-weight: 400;
2052
- font-style: normal;
2053
- pointer-events: none;
2054
- user-select: none;
2055
- white-space: nowrap;
2056
- overflow: hidden;
2057
- text-overflow: ellipsis;
2058
2450
  }
2059
- /* 空标题:字号/字重跟标题本身,灰字占位 H1… */
2060
2451
  .markloom-doc .markloom-heading[data-placeholder]::before {
2061
2452
  font-size: inherit;
2062
2453
  font-weight: inherit;
@@ -2065,70 +2456,102 @@
2065
2456
  color: #c0c3c8;
2066
2457
  }
2067
2458
  @media (prefers-color-scheme: dark) {
2068
- .markloom-doc [data-placeholder]::before {
2069
- color: rgba(255, 255, 255, 0.35);
2070
- }
2071
- .markloom-doc .markloom-heading[data-placeholder]::before {
2072
- color: rgba(255, 255, 255, 0.28);
2073
- }
2459
+ .markloom-doc [data-placeholder]::before { color: rgba(255, 255, 255, 0.35); }
2460
+ .markloom-doc .markloom-heading[data-placeholder]::before { color: rgba(255, 255, 255, 0.28); }
2074
2461
  }
2462
+ html.dark .markloom-doc [data-placeholder]::before { color: rgba(255, 255, 255, 0.35); }
2463
+ html.dark .markloom-doc .markloom-heading[data-placeholder]::before { color: rgba(255, 255, 255, 0.28); }
2075
2464
 
2076
- /* ─── 目录(飞书式:H1–H6 自动索引,与正文同底、无分割线) ─── */
2077
- /* 定位:--markloom-toc-left / --markloom-toc-right / --markloom-toc-top 让出 app 壳。
2078
- 默认贴左(--markloom-toc-left:0)。贴右:--markloom-toc-left:auto; --markloom-toc-right:0;
2079
- 留白:--markloom-toc-pad-start / --markloom-toc-pad-end(默认 start=栏宽,end=0;贴右时对调) */
2080
- .markloom-toc-rail {
2081
- position: fixed;
2082
- top: var(--markloom-toc-top, 0px);
2083
- left: var(--markloom-toc-left, 0px);
2084
- right: var(--markloom-toc-right, auto);
2085
- bottom: 0;
2465
+ /* ─── 目录(飞书式:H1–H6 自动索引) ───
2466
+ shell(flex) = editor-pane | toc-host。普通流,不用 fixed。
2467
+ --markloom-toc-w 宽;--markloom-toc-top 页滚时 sticky 顶距。 */
2468
+ /* shell 在 flex 列宿主里 flex:1 吃满;min-height:100% 仅对 height 明确的父级生效 */
2469
+ .markloom-shell {
2470
+ display: flex;
2471
+ flex-direction: row;
2472
+ align-items: stretch;
2473
+ flex: 1 1 auto;
2474
+ width: 100%;
2475
+ min-width: 0;
2476
+ min-height: 100%;
2477
+ }
2478
+ .markloom-editor-pane {
2479
+ flex: 1 1 auto;
2480
+ min-width: 0;
2481
+ min-height: 100%;
2482
+ }
2483
+ /* 目录 host 宽常驻(open 时 has-toc);内容可空,宽度不随条目有无变化 */
2484
+ .markloom-toc-host {
2485
+ display: none;
2486
+ flex: 0 0 var(--markloom-toc-w, 220px);
2086
2487
  width: var(--markloom-toc-w, 220px);
2087
- z-index: 70;
2488
+ min-width: var(--markloom-toc-w, 220px);
2489
+ position: sticky;
2490
+ top: var(--markloom-toc-top, 0px);
2491
+ align-self: flex-start;
2492
+ max-height: calc(100vh - var(--markloom-toc-top, 0px));
2493
+ overflow-x: hidden;
2494
+ overflow-y: auto;
2495
+ padding-top: 24px;
2496
+ background: var(--bg-page, #fff);
2497
+ z-index: 5;
2498
+ box-sizing: border-box;
2499
+ }
2500
+ .markloom-shell-has-toc > .markloom-toc-host {
2501
+ display: block;
2502
+ }
2503
+ /* 父级是滚动容器:shell 吃满高度,正文在 pane 内滚,侧栏钉死 */
2504
+ .markloom-toc-scroll-host {
2505
+ overflow: hidden !important;
2088
2506
  display: flex;
2089
2507
  flex-direction: column;
2090
- background: var(--bg-page, #fff);
2091
- border: none;
2508
+ }
2509
+ .markloom-toc-scroll-host > .markloom-shell {
2510
+ flex: 1 1 auto;
2511
+ min-height: 0;
2512
+ height: 100%;
2513
+ }
2514
+ .markloom-shell-fill {
2515
+ align-items: stretch;
2516
+ height: 100%;
2517
+ }
2518
+ .markloom-shell-fill > .markloom-editor-pane {
2519
+ overflow: auto;
2520
+ height: 100%;
2521
+ min-height: 0;
2522
+ overscroll-behavior: contain;
2523
+ }
2524
+ .markloom-shell-fill > .markloom-toc-host {
2525
+ position: relative;
2526
+ top: auto;
2527
+ align-self: stretch;
2528
+ max-height: none;
2529
+ height: auto;
2530
+ }
2531
+ .markloom-toc-rail {
2532
+ display: flex;
2533
+ flex-direction: column;
2534
+ width: 100%;
2535
+ border: 0;
2092
2536
  font: 400 13px/1.4 system-ui, -apple-system, 'Segoe UI', sans-serif;
2093
2537
  color: var(--text-a, #1f2328);
2094
2538
  }
2095
- /* 留白:优先落在滚动容器(.markloom-toc-open 在 note-body / lab-root);全页 lab 时在 html */
2096
- html.markloom-toc-open,
2097
- .markloom-toc-open {
2098
- padding-left: var(--markloom-toc-pad-start, var(--markloom-toc-w, 220px));
2099
- padding-right: var(--markloom-toc-pad-end, 0px);
2100
- box-sizing: border-box;
2101
- }
2102
2539
  .markloom-toc-hd {
2103
- flex: none;
2104
- padding: 20px 16px 10px;
2540
+ /* 标题和条目文字同一条左边线:条目是 nav 的 px-1 (4px) + 条目自己的 6px = 10px */
2541
+ @apply shrink-0 pl-2 pr-2.5 pt-5 pb-2.5;
2105
2542
  font: 600 13px/1.2 system-ui, sans-serif;
2106
2543
  color: var(--text-b, rgba(0, 0, 0, 0.55));
2107
2544
  letter-spacing: 0.02em;
2108
2545
  }
2109
2546
  .markloom-toc-nav {
2110
- flex: 1;
2111
- overflow-y: auto;
2112
- padding: 4px 8px 24px;
2113
- display: flex;
2114
- flex-direction: column;
2115
- gap: 1px;
2547
+ @apply flex-1 overflow-y-auto px-1 pt-1 pb-6 flex flex-col gap-px;
2116
2548
  }
2117
2549
  .markloom-toc-item {
2118
- display: block;
2119
- width: 100%;
2120
- box-sizing: border-box;
2121
- padding: 6px 10px 6px 12px;
2122
- border: none;
2123
- border-radius: 6px;
2124
- background: transparent;
2550
+ @apply block w-full box-border px-1.5 py-1 border-0 rounded-md bg-transparent text-left cursor-pointer;
2125
2551
  color: var(--text-b, rgba(0, 0, 0, 0.65));
2126
2552
  font: 400 13px/1.35 system-ui, -apple-system, 'Segoe UI', sans-serif;
2127
- text-align: left;
2128
- cursor: pointer;
2129
- overflow: hidden;
2130
- text-overflow: ellipsis;
2131
- white-space: nowrap;
2553
+ white-space: normal;
2554
+ word-break: break-word;
2132
2555
  transition: background 0.1s, color 0.1s;
2133
2556
  }
2134
2557
  .markloom-toc-item:hover {
@@ -2137,39 +2560,41 @@ html.markloom-toc-open,
2137
2560
  }
2138
2561
  .markloom-toc-item-active {
2139
2562
  background: rgba(51, 112, 255, 0.08);
2140
- color: var(--accent, #3370ff);
2141
- font-weight: 500;
2142
- }
2143
- .markloom-toc-item-active:hover {
2144
- background: rgba(51, 112, 255, 0.12);
2563
+ color: var(--markloom-accent);
2145
2564
  }
2565
+ .markloom-toc-item-active:hover { background: rgba(51, 112, 255, 0.12); }
2146
2566
  .markloom-toc-empty {
2147
- padding: 16px 12px;
2148
- font-size: 12px;
2567
+ @apply px-3 py-4 text-xs;
2149
2568
  color: var(--text-c, #999);
2150
2569
  }
2151
2570
  @media (prefers-color-scheme: dark) {
2152
- .markloom-toc-rail {
2153
- background: var(--bg-page, #171717);
2154
- }
2571
+ .markloom-toc-host { background: var(--bg-page, #171717); }
2155
2572
  .markloom-toc-item:hover { background: rgba(255, 255, 255, 0.06); }
2156
2573
  .markloom-toc-item-active {
2157
2574
  background: rgba(76, 139, 245, 0.15);
2158
2575
  color: #7aafff;
2159
2576
  }
2160
2577
  }
2578
+ html.dark .markloom-toc-host { background: var(--bg-page, #171717); }
2579
+ html.dark .markloom-toc-item:hover { background: rgba(255, 255, 255, 0.06); }
2580
+ html.dark .markloom-toc-item-active {
2581
+ background: rgba(76, 139, 245, 0.15);
2582
+ color: #7aafff;
2583
+ }
2584
+ @media (max-width: 1024px) {
2585
+ .markloom-shell-has-toc > .markloom-toc-host {
2586
+ display: none;
2587
+ }
2588
+ }
2161
2589
 
2162
- /* ─── 评论/批注(飞书式:正文琥珀高亮 + 文档右侧常驻栏) ─── */
2590
+ /* ── comments ── */
2163
2591
  .markloom-comment {
2592
+ @apply rounded-sm cursor-pointer;
2164
2593
  background: rgba(255, 198, 50, 0.28);
2165
2594
  border-bottom: 1.5px solid rgba(230, 160, 20, 0.55);
2166
- border-radius: 2px;
2167
- cursor: pointer;
2168
2595
  transition: background 0.12s ease;
2169
2596
  }
2170
- .markloom-comment:hover {
2171
- background: rgba(255, 198, 50, 0.42);
2172
- }
2597
+ .markloom-comment:hover { background: rgba(255, 198, 50, 0.42); }
2173
2598
  .markloom-comment-active {
2174
2599
  background: rgba(255, 180, 20, 0.5);
2175
2600
  border-bottom-color: rgba(210, 140, 0, 0.85);
@@ -2190,149 +2615,88 @@ html.markloom-toc-open,
2190
2615
  border-bottom-color: rgba(255, 255, 255, 0.2);
2191
2616
  }
2192
2617
  }
2618
+ html.dark .markloom-comment {
2619
+ background: rgba(255, 198, 50, 0.18);
2620
+ border-bottom-color: rgba(255, 190, 60, 0.45);
2621
+ }
2622
+ html.dark .markloom-comment:hover { background: rgba(255, 198, 50, 0.28); }
2623
+ html.dark .markloom-comment-active { background: rgba(255, 190, 40, 0.36); }
2624
+ html.dark .markloom-comment-resolved {
2625
+ background: rgba(255, 255, 255, 0.06);
2626
+ border-bottom-color: rgba(255, 255, 255, 0.2);
2627
+ }
2193
2628
 
2194
- /* 右侧评论:与正文同一滚动容器(absolute 挂 scroll parent);滚动条在栏右侧外缘 */
2195
2629
  .markloom-comment-overlay {
2196
- position: absolute;
2197
- top: 0;
2198
- right: 0;
2199
- bottom: auto;
2630
+ @apply absolute top-0 right-0 bottom-auto min-h-full pointer-events-none z-[80];
2200
2631
  width: var(--markloom-comment-rail-w, 320px);
2201
- min-height: 100%;
2202
- pointer-events: none; /* 空处点穿;卡/钮再开 */
2203
- z-index: 80;
2204
2632
  }
2205
2633
  .markloom-comment-rail {
2206
- position: relative;
2207
- width: 100%;
2208
- min-height: 100%;
2209
- display: flex;
2210
- flex-direction: column;
2634
+ @apply relative w-full min-h-full flex flex-col pointer-events-auto box-border;
2211
2635
  background: var(--bg-page, #fff);
2212
2636
  border-left: 1px solid rgba(0, 0, 0, 0.06);
2213
2637
  font: 400 13px/1.45 system-ui, -apple-system, 'Segoe UI', sans-serif;
2214
2638
  color: var(--text-a, #1f2328);
2215
- pointer-events: auto;
2216
- box-sizing: border-box;
2217
2639
  }
2218
- /* 滚动容器右留栏宽;scrollbar 仍在容器最右(评论栏右侧) */
2219
2640
  .markloom-comment-rail-open {
2220
- position: relative;
2641
+ @apply relative box-border;
2221
2642
  padding-right: var(--markloom-comment-rail-w, 320px);
2222
- box-sizing: border-box;
2223
2643
  }
2224
2644
  .markloom-comment-rail-hd {
2225
- display: flex;
2226
- align-items: center;
2227
- justify-content: space-between;
2228
- gap: 8px;
2229
- flex: none;
2230
- padding: 16px 16px 12px;
2645
+ @apply flex items-center justify-between gap-2 shrink-0 px-4 pt-4 pb-3 sticky top-0 z-[2];
2231
2646
  background: var(--bg-page, #fff);
2232
2647
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
2233
- position: sticky;
2234
- top: 0;
2235
- z-index: 2;
2236
2648
  }
2237
2649
  .markloom-comment-rail-title {
2238
2650
  font: 500 14px/1.2 system-ui, sans-serif;
2239
2651
  color: var(--text-a, #1f2328);
2240
2652
  }
2241
- .markloom-comment-rail-acts {
2242
- display: flex;
2243
- gap: 2px;
2244
- }
2653
+ .markloom-comment-rail-acts { @apply flex gap-0.5; }
2245
2654
  .markloom-comment-rail-body {
2246
- position: relative;
2247
- flex: 1 0 auto;
2248
- overflow: visible; /* 不单独出滚动条,跟正文共滚 */
2249
- padding: 12px 14px 24px;
2655
+ @apply relative flex-1 grow overflow-visible px-3.5 pt-3 pb-6;
2250
2656
  }
2251
2657
  .markloom-comment-empty {
2252
- position: absolute;
2253
- left: 0;
2254
- right: 0;
2255
- text-align: center;
2658
+ @apply absolute left-0 right-0 text-center text-[13px];
2256
2659
  color: var(--text-c, #999);
2257
- font-size: 13px;
2258
2660
  }
2259
2661
 
2260
- /* 卡:绝对定位贴高亮 y;顶琥珀条 */
2261
2662
  .markloom-comment-card {
2262
- position: absolute;
2263
- left: 14px;
2264
- right: 14px;
2265
- display: flex;
2266
- flex-direction: column;
2267
- gap: 10px;
2268
- padding: 12px 14px 12px;
2269
- border-radius: 8px;
2663
+ @apply absolute left-3.5 right-3.5 flex flex-col gap-2.5 px-3.5 py-3 rounded-lg cursor-pointer select-text overflow-hidden;
2270
2664
  border: 1px solid rgba(0, 0, 0, 0.06);
2271
2665
  background: #fff;
2272
2666
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06), 0 0 1px rgba(0, 0, 0, 0.04);
2273
- cursor: pointer;
2274
- user-select: text;
2275
- overflow: hidden;
2276
2667
  }
2277
2668
  .markloom-comment-accent {
2278
- position: absolute;
2279
- top: 0;
2280
- left: 0;
2281
- right: 0;
2282
- height: 3px;
2669
+ @apply absolute top-0 left-0 right-0 h-[3px] pointer-events-none;
2283
2670
  background: linear-gradient(90deg, #f5b942, #f0c14b);
2284
- pointer-events: none;
2285
- }
2286
- .markloom-comment-card:hover {
2287
- box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
2288
2671
  }
2672
+ .markloom-comment-card:hover { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08); }
2289
2673
  .markloom-comment-card-active {
2290
- cursor: default;
2674
+ @apply cursor-default;
2291
2675
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.1);
2292
2676
  }
2293
- .markloom-comment-card-compose {
2294
- cursor: default;
2295
- }
2296
- .markloom-comment-card-resolved {
2297
- opacity: 0.78;
2298
- }
2677
+ .markloom-comment-card-compose { @apply cursor-default; }
2678
+ .markloom-comment-card-resolved { @apply opacity-[0.78]; }
2299
2679
  .markloom-comment-quote {
2300
- margin: 2px 0 0;
2301
- padding: 0 0 0 8px;
2680
+ @apply m-0 mt-0.5 pl-2 overflow-hidden text-ellipsis whitespace-nowrap;
2302
2681
  border-left: 2px solid rgba(0, 0, 0, 0.12);
2303
2682
  color: var(--text-b, #666);
2304
2683
  font: 400 12px/1.4 system-ui, sans-serif;
2305
- overflow: hidden;
2306
- text-overflow: ellipsis;
2307
- white-space: nowrap;
2308
2684
  }
2309
2685
  .markloom-comment-card-hd {
2310
- display: flex;
2311
- align-items: flex-start;
2312
- justify-content: space-between;
2313
- gap: 8px;
2314
- min-width: 0;
2686
+ @apply flex items-start justify-between gap-2 min-w-0;
2315
2687
  }
2316
2688
  .markloom-comment-card-hd .markloom-comment-quote {
2317
- flex: 1;
2318
- min-width: 0;
2689
+ @apply flex-1 min-w-0;
2319
2690
  }
2320
2691
  .markloom-comment-card-acts {
2321
- display: flex;
2322
- gap: 2px;
2323
- flex: none;
2692
+ @apply flex gap-0.5 shrink-0;
2324
2693
  margin: -4px -4px 0 0;
2325
2694
  }
2326
2695
  .markloom-comment-icon {
2327
- width: 26px;
2328
- height: 26px;
2329
- padding: 0;
2330
- border: none;
2331
- border-radius: 6px;
2332
- background: transparent;
2696
+ /* 最小 26px 的方块;里面是文字(过滤钮「开/Unresolved」)时宽度跟着字走,英文不溢出 */
2697
+ @apply min-w-[26px] h-[26px] px-1 border-0 rounded-md bg-transparent cursor-pointer whitespace-nowrap;
2333
2698
  color: var(--text-b, rgba(0, 0, 0, 0.45));
2334
2699
  font: 500 14px/1 system-ui, sans-serif;
2335
- cursor: pointer;
2336
2700
  }
2337
2701
  .markloom-comment-icon:hover {
2338
2702
  background: var(--bg-hover, rgba(0, 0, 0, 0.06));
@@ -2343,122 +2707,79 @@ html.markloom-toc-open,
2343
2707
  color: var(--text-a, #1f2328);
2344
2708
  }
2345
2709
  .markloom-comment-preview {
2346
- display: flex;
2347
- flex-direction: column;
2348
- gap: 6px;
2710
+ @apply flex flex-col gap-1.5;
2349
2711
  }
2350
2712
  .markloom-comment-more {
2351
- font-size: 12px;
2713
+ @apply text-xs pl-[38px];
2352
2714
  color: var(--text-c, #999);
2353
- padding-left: 38px;
2354
2715
  }
2355
2716
  .markloom-comment-msgs {
2356
- display: flex;
2357
- flex-direction: column;
2358
- gap: 12px;
2717
+ @apply flex flex-col gap-3;
2359
2718
  }
2360
2719
  .markloom-comment-msg {
2361
- display: flex;
2362
- gap: 10px;
2363
- align-items: flex-start;
2720
+ @apply flex gap-2.5 items-start;
2364
2721
  }
2365
2722
  .markloom-comment-avatar {
2366
- width: 28px;
2367
- height: 28px;
2368
- border-radius: 50%;
2369
- flex: none;
2370
- object-fit: cover;
2723
+ @apply w-7 h-7 rounded-full shrink-0 object-cover;
2371
2724
  }
2372
2725
  .markloom-comment-avatar-fallback {
2373
- display: flex;
2374
- align-items: center;
2375
- justify-content: center;
2726
+ @apply flex items-center justify-center text-white;
2376
2727
  background: linear-gradient(135deg, #7c6cf0, #5b8def);
2377
- color: #fff;
2378
2728
  font: 600 12px/1 system-ui, sans-serif;
2379
2729
  }
2380
2730
  .markloom-comment-msg-body {
2381
- min-width: 0;
2382
- flex: 1;
2731
+ @apply min-w-0 flex-1;
2383
2732
  }
2384
2733
  .markloom-comment-msg-meta {
2385
- display: flex;
2386
- align-items: baseline;
2387
- gap: 8px;
2388
- margin-bottom: 2px;
2734
+ @apply flex items-baseline gap-2 mb-0.5;
2389
2735
  }
2390
2736
  .markloom-comment-author {
2391
- font-weight: 600;
2392
- font-size: 13px;
2737
+ @apply font-semibold text-[13px];
2393
2738
  color: var(--text-a, #1f2328);
2394
2739
  }
2395
2740
  .markloom-comment-time {
2396
- font-size: 11px;
2741
+ @apply text-[11px];
2397
2742
  color: var(--text-c, rgba(0, 0, 0, 0.35));
2398
2743
  }
2399
2744
  .markloom-comment-text {
2400
- font-size: 13px;
2401
- line-height: 1.5;
2745
+ @apply text-[13px] leading-normal whitespace-pre-wrap break-words;
2402
2746
  color: var(--text-a, #1f2328);
2403
- white-space: pre-wrap;
2404
- word-break: break-word;
2405
2747
  }
2406
2748
  .markloom-comment-reply {
2407
- display: flex;
2408
- flex-direction: column;
2409
- gap: 8px;
2410
- padding-top: 4px;
2749
+ @apply flex flex-col gap-2 pt-1;
2411
2750
  border-top: 1px solid rgba(0, 0, 0, 0.06);
2412
2751
  }
2413
2752
  .markloom-comment-input {
2414
- width: 100%;
2415
- min-height: 36px;
2416
- padding: 8px 10px;
2753
+ @apply w-full min-h-9 px-2.5 py-2 rounded-md resize-y outline-none box-border;
2417
2754
  border: 1px solid rgba(0, 0, 0, 0.12);
2418
- border-radius: 6px;
2419
2755
  background: #fff;
2420
2756
  color: var(--text-a, #1f2328);
2421
2757
  font: 400 13px/1.45 system-ui, sans-serif;
2422
- resize: vertical;
2423
- outline: none;
2424
- box-sizing: border-box;
2425
2758
  }
2426
2759
  .markloom-comment-input:focus {
2427
- border-color: var(--accent, #1456f0);
2760
+ border-color: var(--markloom-accent);
2428
2761
  box-shadow: 0 0 0 2px rgba(20, 86, 240, 0.12);
2429
2762
  }
2430
- .markloom-comment-input-sm {
2431
- min-height: 36px;
2432
- }
2763
+ .markloom-comment-input-sm { @apply min-h-9; }
2433
2764
  .markloom-comment-card-ft {
2434
- display: flex;
2435
- justify-content: flex-end;
2436
- gap: 8px;
2765
+ @apply flex justify-end gap-2;
2437
2766
  }
2438
2767
  .markloom-comment-btn,
2439
2768
  .markloom-comment-btn-ghost {
2440
- height: 30px;
2441
- padding: 0 14px;
2442
- border-radius: 6px;
2443
- border: none;
2769
+ @apply h-[30px] px-3.5 rounded-md border-0 cursor-pointer;
2444
2770
  font: 500 13px/1 system-ui, sans-serif;
2445
- cursor: pointer;
2446
2771
  }
2447
2772
  .markloom-comment-btn {
2448
- background: var(--accent, #3370ff);
2449
- color: #fff;
2450
- }
2451
- .markloom-comment-btn:hover {
2452
- filter: brightness(1.05);
2773
+ background: var(--markloom-accent);
2774
+ @apply text-white;
2453
2775
  }
2776
+ .markloom-comment-btn:hover { filter: brightness(1.05); }
2454
2777
  .markloom-comment-btn-ghost {
2455
- background: transparent;
2778
+ @apply bg-transparent;
2456
2779
  color: var(--text-b, rgba(0, 0, 0, 0.55));
2457
2780
  border: 1px solid rgba(0, 0, 0, 0.1);
2458
2781
  }
2459
- .markloom-comment-btn-ghost:hover {
2460
- background: var(--bg-hover, rgba(0, 0, 0, 0.04));
2461
- }
2782
+ .markloom-comment-btn-ghost:hover { background: var(--bg-hover, rgba(0, 0, 0, 0.04)); }
2462
2783
  @media (prefers-color-scheme: dark) {
2463
2784
  .markloom-comment-rail {
2464
2785
  background: var(--bg-page, #171717);
@@ -2479,221 +2800,416 @@ html.markloom-toc-open,
2479
2800
  border-color: rgba(255, 255, 255, 0.12);
2480
2801
  background: var(--bg-side, #212121);
2481
2802
  }
2482
- .markloom-comment-btn-ghost {
2483
- border-color: rgba(255, 255, 255, 0.12);
2484
- }
2803
+ .markloom-comment-btn-ghost { border-color: rgba(255, 255, 255, 0.12); }
2804
+ }
2805
+ html.dark .markloom-comment-rail {
2806
+ background: var(--bg-page, #171717);
2807
+ border-left-color: rgba(255, 255, 255, 0.08);
2485
2808
  }
2809
+ html.dark .markloom-comment-rail-hd {
2810
+ background: transparent;
2811
+ border-bottom-color: rgba(255, 255, 255, 0.06);
2812
+ }
2813
+ html.dark .markloom-comment-card {
2814
+ background: var(--bg-page, #2a2a2a);
2815
+ border-color: rgba(255, 255, 255, 0.08);
2816
+ box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
2817
+ }
2818
+ html.dark .markloom-comment-quote { border-left-color: rgba(255, 255, 255, 0.2); }
2819
+ html.dark .markloom-comment-reply { border-top-color: rgba(255, 255, 255, 0.08); }
2820
+ html.dark .markloom-comment-input {
2821
+ border-color: rgba(255, 255, 255, 0.12);
2822
+ background: var(--bg-side, #212121);
2823
+ }
2824
+ html.dark .markloom-comment-btn-ghost { border-color: rgba(255, 255, 255, 0.12); }
2486
2825
 
2487
- /* 显隐符(opt-in):.markloom-doc.markloom-invisible 下生效。伪元素/旁注不进 textContent,选区 offset 不漂。 */
2826
+ /* ── invisible characters ── */
2488
2827
  .markloom-invisible .markloom-inv-space,
2489
2828
  .markloom-invisible .markloom-inv-nbsp,
2490
2829
  .markloom-invisible .markloom-inv-tab {
2491
- position: relative;
2830
+ @apply relative;
2492
2831
  }
2493
2832
  .markloom-invisible .markloom-inv-space::before,
2494
2833
  .markloom-invisible .markloom-inv-nbsp::before,
2495
2834
  .markloom-invisible .markloom-inv-tab::before {
2496
- position: absolute;
2497
- left: 50%;
2498
- top: 50%;
2499
- transform: translate(-50%, -50%);
2835
+ @apply absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 font-normal leading-none pointer-events-none opacity-[0.85];
2500
2836
  color: var(--text-c, #9aa0a6);
2501
- pointer-events: none;
2502
- font-weight: 400;
2503
- line-height: 1;
2504
- opacity: 0.85;
2505
2837
  }
2506
2838
  .markloom-invisible .markloom-inv-space::before { content: '·'; }
2507
2839
  .markloom-invisible .markloom-inv-nbsp::before { content: '°'; }
2508
2840
  .markloom-invisible .markloom-inv-tab::before { content: '→'; }
2509
- /* 硬换行旁注:与 <br data-atom=hard_break> 并排,无 data-leaf,不占结构子序号。 */
2510
2841
  .markloom-invisible .markloom-inv-break {
2842
+ @apply text-[0.85em] select-none pointer-events-none ml-[0.1em];
2511
2843
  color: var(--text-c, #9aa0a6);
2512
- font-size: 0.85em;
2513
- user-select: none;
2514
- pointer-events: none;
2515
- margin-left: 0.1em;
2516
2844
  }
2517
- /* 段末 ¶(仅 paragraph;heading/list 不标,避免噪音)。 */
2518
2845
  .markloom-invisible > p[data-block-id]::after,
2519
2846
  .markloom-invisible [data-block-id] > p[data-block-id]::after {
2520
2847
  content: '¶';
2848
+ @apply ml-[0.15em] text-[0.85em] select-none pointer-events-none;
2521
2849
  color: var(--text-c, #9aa0a6);
2522
- margin-left: 0.15em;
2523
- font-size: 0.85em;
2524
- user-select: none;
2525
- pointer-events: none;
2526
2850
  }
2527
- /* ─── 任务列表(飞书式) ─── 大 checkbox、行高、勾选删除线、hover 浅底 */
2528
- .markloom-doc ul:has(> li[data-task]),
2529
- .markloom-doc ol:has(> li[data-task]) {
2530
- list-style: none;
2531
- padding-left: 0;
2532
- margin: 0.35rem 0;
2851
+
2852
+ /* ── collab presence(飞书:并排圆头像 + 右下角实色点 + 溢出 +N)── */
2853
+ /* 默认:正文内 sticky 顶; .is-chrome:应用壳顶栏,不进文档流 */
2854
+ .markloom-collab-rail {
2855
+ @apply sticky top-0 z-40 flex justify-end pointer-events-none px-0 pt-1 pb-1 mb-0;
2533
2856
  }
2534
- .markloom-doc li[data-task] {
2535
- list-style: none;
2536
- display: flex;
2537
- align-items: flex-start;
2538
- gap: 10px;
2539
- margin: 2px 0;
2540
- margin-left: 0;
2541
- padding: 8px 12px 8px 10px;
2542
- border-radius: 8px;
2543
- min-height: 36px;
2857
+ .markloom-collab-rail.is-chrome {
2858
+ @apply static m-0 p-0;
2859
+ position: static;
2860
+ }
2861
+ .markloom-collab-avatars {
2862
+ @apply flex flex-row items-center gap-1.5 pointer-events-auto;
2863
+ }
2864
+ /* 28px 圆;浅描边;不叠压 */
2865
+ .markloom-collab-avatar {
2866
+ @apply relative w-7 h-7 rounded-full text-[12px] font-semibold text-center cursor-default select-none shrink-0;
2867
+ background: var(--collab-c, #D6EBFF);
2868
+ color: rgba(0, 0, 0, 0.78);
2869
+ line-height: 28px;
2870
+ box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
2871
+ }
2872
+ html.dark .markloom-collab-avatar {
2873
+ box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
2874
+ }
2875
+ @media (prefers-color-scheme: dark) {
2876
+ html:not(.light) .markloom-collab-avatar {
2877
+ box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
2878
+ }
2879
+ }
2880
+ /* 右下角实色点:压在圆边上,白/深底描边 */
2881
+ .markloom-collab-pip {
2882
+ position: absolute;
2883
+ right: 0;
2884
+ bottom: 0;
2885
+ width: 9px;
2886
+ height: 9px;
2887
+ border-radius: 50%;
2888
+ background: #3B82F6;
2889
+ border: 1.5px solid #fff;
2544
2890
  box-sizing: border-box;
2545
- transition: background 0.12s ease;
2891
+ pointer-events: none;
2892
+ transform: translate(15%, 15%);
2546
2893
  }
2547
- .markloom-doc li[data-task]:hover {
2548
- background: rgba(0, 0, 0, 0.03);
2894
+ html.dark .markloom-collab-pip { border-color: #171717; }
2895
+ @media (prefers-color-scheme: dark) {
2896
+ .markloom-collab-pip { border-color: #171717; }
2549
2897
  }
2550
- .markloom-doc li[data-task]:focus-within {
2551
- background: rgba(0, 0, 0, 0.04);
2898
+ .markloom-collab-pip.is-connecting { background: #ffc60a; }
2899
+ .markloom-collab-pip.is-closed { background: #f54a45; }
2900
+ .markloom-collab-pip.is-resyncing {
2901
+ background: #3370ff;
2902
+ animation: markloom-collab-pulse 1s ease-in-out infinite;
2552
2903
  }
2553
- /* 飞书式 checkbox:白底 + 深描边圆角方框;勾选后仍白底 + 蓝色对勾 */
2554
- .markloom-doc li[data-task] > [data-task-check] {
2555
- appearance: none;
2556
- -webkit-appearance: none;
2557
- flex: none;
2558
- width: 20px;
2559
- height: 20px;
2560
- margin: 2px 0 0;
2561
- padding: 0;
2562
- border: 1px solid #1f2329;
2563
- border-radius: 5px;
2564
- background: #fff;
2565
- cursor: pointer;
2904
+ .markloom-collab-pip.is-auth-error { background: #f54a45; }
2905
+ .markloom-collab-pip.is-conflict { background: #f54a45; }
2906
+ /* 溢出人数 +N(飞书灰底圆) */
2907
+ .markloom-collab-more {
2908
+ @apply relative w-7 h-7 rounded-full text-[11px] font-medium text-center cursor-default select-none shrink-0;
2909
+ background: rgba(0, 0, 0, 0.06);
2910
+ color: rgba(0, 0, 0, 0.55);
2911
+ line-height: 28px;
2912
+ box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
2913
+ }
2914
+ html.dark .markloom-collab-more {
2915
+ background: rgba(255, 255, 255, 0.1);
2916
+ color: rgba(255, 255, 255, 0.65);
2917
+ box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
2918
+ }
2919
+ @keyframes markloom-collab-pulse {
2920
+ 0%, 100% { opacity: 1; }
2921
+ 50% { opacity: 0.35; }
2922
+ }
2923
+ .markloom-collab-carets {
2924
+ @apply absolute inset-0 pointer-events-none z-[35] overflow-visible;
2925
+ }
2926
+ .markloom-collab-caret {
2927
+ @apply absolute pointer-events-none rounded-sm;
2928
+ width: 2.5px;
2929
+ background: var(--collab-c, #2f5ff0);
2930
+ transform: translateX(-1px);
2931
+ box-shadow:
2932
+ 0 0 0 1px rgba(255, 255, 255, 0.95),
2933
+ 0 0 2px rgba(0, 0, 0, 0.18);
2934
+ }
2935
+ .markloom-collab-caret-lab {
2936
+ @apply absolute left-0 max-w-[120px] overflow-hidden text-ellipsis whitespace-nowrap px-1.5 text-[11px] font-semibold text-white pointer-events-none;
2937
+ top: -18px;
2938
+ border-radius: 3px 3px 3px 0;
2939
+ background: var(--collab-lab, var(--collab-c, #3b6ff5));
2940
+ line-height: 16px;
2941
+ padding-top: 1px;
2942
+ padding-bottom: 1px;
2943
+ box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
2944
+ }
2945
+
2946
+ /* 查找替换栏(opts.search) */
2947
+ .markloom-source {
2948
+ display: block;
2566
2949
  box-sizing: border-box;
2567
- position: relative;
2568
- transition: border-color 0.12s, box-shadow 0.12s, background 0.12s;
2950
+ width: 100%;
2951
+ max-width: var(--markloom-content-max, 820px);
2952
+ min-height: 100%;
2953
+ margin-inline: auto;
2954
+ padding: 12px var(--markloom-pad-x, 48px) var(--markloom-pad-bottom, 120px);
2955
+ border: 0;
2956
+ outline: none;
2957
+ resize: none;
2958
+ overflow: hidden;
2959
+ background: transparent;
2960
+ color: var(--text-a);
2961
+ caret-color: var(--text-a);
2962
+ font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
2963
+ font-size: 0.92em;
2964
+ line-height: 1.7;
2965
+ tab-size: 4;
2966
+ white-space: pre-wrap;
2967
+ overflow-wrap: break-word;
2569
2968
  }
2570
- .markloom-doc li[data-task] > [data-task-check]:hover {
2571
- border-color: #3370ff;
2572
- box-shadow: 0 0 0 3px rgba(51, 112, 255, 0.12);
2969
+ .markloom-search {
2970
+ @apply sticky top-0 z-[45] pointer-events-none;
2573
2971
  }
2574
- .markloom-doc li[data-task] > [data-task-check]:checked {
2575
- border-color: #1f2329;
2576
- background: #fff;
2972
+ .markloom-search[hidden] {
2973
+ display: none !important;
2577
2974
  }
2578
- /* 蓝色对勾:SVG 铺满格居中(不用 border+rotate 歪心) */
2579
- .markloom-doc li[data-task] > [data-task-check]:checked::after {
2580
- content: '';
2581
- position: absolute;
2582
- inset: 0;
2583
- background: center / 12px 12px no-repeat
2584
- url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3.2 8.2l3.2 3.2 6.4-6.8' stroke='%233370ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
2975
+ .markloom-search-bar {
2976
+ @apply pointer-events-auto flex flex-wrap items-center gap-1.5 px-2.5 py-2 text-sm;
2977
+ background: var(--bg-page);
2978
+ border-bottom: 1px solid var(--bg-active);
2979
+ box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
2585
2980
  }
2586
- .markloom-doc li[data-task] > :not([data-task-check]) {
2587
- flex: 1;
2588
- min-width: 0;
2589
- margin: 0;
2590
- padding: 0;
2591
- line-height: 1.55;
2592
- font-size: 15px;
2981
+ .markloom-search-bar input[type='text'] {
2982
+ @apply rounded-md px-2 py-1 min-w-[7rem] max-w-[12rem];
2983
+ border: 1px solid var(--bg-active);
2984
+ background: var(--bg-side);
2985
+ color: var(--text-a);
2986
+ outline: none;
2593
2987
  }
2594
- /* 已完成:正文灰 + 删除线(飞书) */
2595
- .markloom-doc li[data-task][data-checked="true"] > :not([data-task-check]) {
2596
- color: rgba(0, 0, 0, 0.35);
2597
- text-decoration: line-through;
2598
- text-decoration-color: rgba(0, 0, 0, 0.28);
2988
+ .markloom-search-bar input[type='text']:focus {
2989
+ border-color: var(--markloom-accent);
2599
2990
  }
2600
- .markloom-doc li[data-task][data-checked="true"] > :not([data-task-check]) * {
2601
- color: inherit;
2991
+ .markloom-search-case {
2992
+ @apply inline-flex items-center gap-1 px-1 text-xs cursor-pointer select-none;
2993
+ color: var(--text-b);
2994
+ }
2995
+ .markloom-search-count {
2996
+ @apply text-xs tabular-nums min-w-[2.5rem] text-center;
2997
+ color: var(--text-c);
2998
+ }
2999
+ .markloom-search-bar button {
3000
+ @apply rounded-md px-2 py-1 text-xs font-medium cursor-pointer;
3001
+ border: 1px solid transparent;
3002
+ background: var(--bg-hover);
3003
+ color: var(--text-a);
3004
+ }
3005
+ .markloom-search-bar button:hover {
3006
+ background: var(--bg-active);
3007
+ }
3008
+ .markloom-search-x {
3009
+ @apply !ml-auto;
3010
+ color: var(--text-c) !important;
3011
+ }
3012
+
3013
+ /* 命名版本栏(opts.versions) */
3014
+ .markloom-versions {
3015
+ @apply sticky top-0 z-[44] pointer-events-none;
3016
+ }
3017
+ .markloom-versions[hidden] {
3018
+ display: none !important;
3019
+ }
3020
+ .markloom-versions-bar {
3021
+ @apply pointer-events-auto flex flex-wrap items-center gap-1.5 px-2.5 py-2 text-sm;
3022
+ background: var(--bg-page);
3023
+ border-bottom: 1px solid var(--bg-active);
3024
+ box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
3025
+ }
3026
+ .markloom-versions-title {
3027
+ @apply text-xs font-semibold uppercase tracking-wide;
3028
+ color: var(--text-c);
3029
+ }
3030
+ .markloom-versions-list {
3031
+ @apply flex flex-wrap items-center gap-1 max-w-[28rem] overflow-x-auto;
3032
+ }
3033
+ .markloom-versions-empty {
3034
+ @apply text-xs;
3035
+ color: var(--text-c);
3036
+ }
3037
+ .markloom-versions-row {
3038
+ @apply inline-flex items-center rounded-md;
3039
+ border: 1px solid var(--bg-active);
3040
+ background: var(--bg-side);
3041
+ }
3042
+ .markloom-versions-name {
3043
+ @apply px-2 py-0.5 text-xs cursor-pointer border-0 bg-transparent;
3044
+ color: var(--text-a);
3045
+ }
3046
+ .markloom-versions-name:hover { background: var(--bg-hover); }
3047
+ .markloom-versions-x {
3048
+ @apply px-1.5 py-0.5 text-xs cursor-pointer border-0 bg-transparent;
3049
+ color: var(--text-c);
3050
+ }
3051
+ .markloom-versions-save,
3052
+ .markloom-versions-close {
3053
+ @apply rounded-md px-2 py-1 text-xs font-medium cursor-pointer;
3054
+ border: 1px solid transparent;
3055
+ background: var(--bg-hover);
3056
+ color: var(--text-a);
3057
+ }
3058
+ .markloom-versions-close { @apply ml-auto; color: var(--text-c); }
3059
+
3060
+ /* 修订/建议(opts.suggest) */
3061
+ .markloom-suggest {
3062
+ @apply sticky top-0 z-[44] pointer-events-none;
3063
+ }
3064
+ .markloom-suggest[hidden] {
3065
+ display: none !important;
3066
+ }
3067
+ .markloom-suggest-bar {
3068
+ @apply pointer-events-auto flex flex-wrap items-center gap-1.5 px-2.5 py-2 text-sm;
3069
+ background: var(--bg-page);
3070
+ border-bottom: 1px solid var(--bg-active);
3071
+ box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
3072
+ }
3073
+ .markloom-suggest-track {
3074
+ @apply inline-flex items-center gap-1 text-xs cursor-pointer select-none;
3075
+ color: var(--text-b);
3076
+ }
3077
+ .markloom-suggest-count {
3078
+ @apply text-xs tabular-nums;
3079
+ color: var(--text-c);
3080
+ }
3081
+ .markloom-suggest-list {
3082
+ @apply flex flex-wrap items-center gap-1 max-w-[32rem];
3083
+ }
3084
+ .markloom-suggest-row {
3085
+ @apply inline-flex items-center gap-0.5 rounded-md px-1 text-xs;
3086
+ border: 1px solid var(--bg-active);
3087
+ background: var(--bg-side);
3088
+ }
3089
+ .markloom-suggest-row.is-insert { border-color: rgba(52, 199, 36, 0.45); }
3090
+ .markloom-suggest-row.is-delete { border-color: rgba(245, 74, 69, 0.45); }
3091
+ .markloom-suggest-kind {
3092
+ @apply font-bold w-3 text-center;
3093
+ }
3094
+ .markloom-suggest-row.is-insert .markloom-suggest-kind { color: #34c724; }
3095
+ .markloom-suggest-row.is-delete .markloom-suggest-kind { color: #f54a45; }
3096
+ .markloom-suggest-quote {
3097
+ @apply max-w-[8rem] overflow-hidden text-ellipsis whitespace-nowrap;
3098
+ color: var(--text-a);
3099
+ }
3100
+ .markloom-suggest-ok,
3101
+ .markloom-suggest-no,
3102
+ .markloom-suggest-bar > button {
3103
+ @apply rounded px-1.5 py-0.5 text-xs cursor-pointer border-0;
3104
+ background: var(--bg-hover);
3105
+ color: var(--text-a);
3106
+ }
3107
+ .markloom-suggest-ok:hover { background: rgba(52, 199, 36, 0.18); color: #1a9a10; }
3108
+ .markloom-suggest-no:hover { background: rgba(245, 74, 69, 0.18); color: #c42b26; }
3109
+ .markloom-suggest-close { @apply ml-auto; color: var(--text-c); }
3110
+
3111
+ /* 正文 suggest mark */
3112
+ .markloom-suggest-mark.is-insert {
3113
+ background: rgba(52, 199, 36, 0.18);
3114
+ text-decoration: none;
3115
+ border-bottom: 1px solid rgba(52, 199, 36, 0.55);
3116
+ }
3117
+ .markloom-suggest-mark.is-delete {
3118
+ background: rgba(245, 74, 69, 0.12);
3119
+ text-decoration: line-through;
3120
+ color: var(--text-b);
2602
3121
  }
2603
3122
  @media (prefers-color-scheme: dark) {
2604
- .markloom-doc li[data-task]:hover,
2605
- .markloom-doc li[data-task]:focus-within {
2606
- background: rgba(255, 255, 255, 0.06);
2607
- }
2608
- .markloom-doc li[data-task] > [data-task-check] {
2609
- border-color: rgba(255, 255, 255, 0.55);
2610
- background: rgba(255, 255, 255, 0.06);
2611
- }
2612
- .markloom-doc li[data-task] > [data-task-check]:hover {
2613
- border-color: #7aafff;
2614
- box-shadow: 0 0 0 3px rgba(76, 139, 245, 0.18);
2615
- }
2616
- .markloom-doc li[data-task] > [data-task-check]:checked {
2617
- border-color: rgba(255, 255, 255, 0.7);
2618
- background: rgba(255, 255, 255, 0.06);
2619
- }
2620
- .markloom-doc li[data-task] > [data-task-check]:checked::after {
2621
- background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3.2 8.2l3.2 3.2 6.4-6.8' stroke='%237aafff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
2622
- }
2623
- .markloom-doc li[data-task][data-checked="true"] > :not([data-task-check]) {
2624
- color: rgba(255, 255, 255, 0.35);
2625
- text-decoration-color: rgba(255, 255, 255, 0.28);
2626
- }
3123
+ .markloom-suggest-mark.is-insert { background: rgba(52, 199, 36, 0.22); }
3124
+ .markloom-suggest-mark.is-delete { background: rgba(245, 74, 69, 0.18); }
2627
3125
  }
3126
+ html.dark .markloom-suggest-mark.is-insert { background: rgba(52, 199, 36, 0.22); }
3127
+ html.dark .markloom-suggest-mark.is-delete { background: rgba(245, 74, 69, 0.18); }
2628
3128
 
2629
- /* ── 协作在场(飞书式头像条 + 远端彩光标) ── */
2630
- .markloom-collab-rail {
2631
- position: sticky;
2632
- top: 0;
2633
- z-index: 40;
2634
- display: flex;
2635
- justify-content: flex-end;
2636
- pointer-events: none;
2637
- padding: 8px 12px 0;
2638
- margin: 0 0 4px;
3129
+ /* 查找命中:文档里每一处命中着色,当前这一处更深(Editor 行内装饰,不进文档) */
3130
+ .markloom-doc .markloom-hit { background-color: rgba(255, 200, 0, 0.35); border-radius: 2px; }
3131
+ .markloom-doc .markloom-hit-current { background-color: rgba(255, 140, 0, 0.55); }
3132
+
3133
+ /* ── 图表围栏(```mermaid):源码块 + 一张只读的图 ──
3134
+ 画好了且光标不在里面 = 只看图,源码折成零高度(不用 display:none:方向键还能走进去,走进去就展开)。
3135
+ 光标在里面 / 画不出来 / 还在画 = 看得到源码。图不吃选区(contentEditable=false),点它由 Editor 把光标放进源码。 */
3136
+ .markloom-diagram[data-state='ok']:not([data-editing]) > [data-code-block],
3137
+ .markloom-diagram[data-state='ok']:not([data-editing]) > pre {
3138
+ height: 0 !important;
3139
+ margin: 0 !important;
3140
+ padding: 0 !important;
3141
+ border: 0 !important;
3142
+ overflow: hidden;
3143
+ opacity: 0;
2639
3144
  }
2640
- .markloom-collab-avatars {
2641
- display: flex;
2642
- flex-direction: row;
2643
- align-items: center;
2644
- pointer-events: auto;
3145
+ .markloom-diagram[data-state='ok']:not([data-editing]) > [data-code-block] > * {
3146
+ height: 0;
3147
+ padding: 0 !important;
3148
+ margin: 0;
3149
+ overflow: hidden;
2645
3150
  }
2646
- .markloom-collab-avatar {
2647
- width: 28px;
2648
- height: 28px;
2649
- border-radius: 50%;
2650
- background: var(--collab-c, #3370ff);
2651
- color: #fff;
2652
- font-size: 12px;
2653
- font-weight: 600;
2654
- line-height: 28px;
2655
- text-align: center;
2656
- border: 2px solid var(--bg-page, #fff);
2657
- box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
2658
- margin-left: -8px;
2659
- cursor: default;
2660
- user-select: none;
2661
- }
2662
- .markloom-collab-avatar:first-child {
2663
- margin-left: 0;
3151
+ .markloom-diagram[data-state='ok'][data-editing] > .markloom-diagram-fig {
3152
+ display: none;
2664
3153
  }
2665
- .markloom-collab-avatar.is-self {
2666
- box-shadow: 0 0 0 2px var(--collab-c, #3370ff), 0 1px 2px rgba(0, 0, 0, 0.12);
3154
+ .markloom-diagram-fig {
3155
+ @apply my-5 flex justify-center overflow-x-auto rounded-xl p-3 cursor-pointer;
3156
+ background-color: #f6f7f9;
2667
3157
  }
2668
- .markloom-collab-carets {
2669
- position: absolute;
2670
- inset: 0;
2671
- pointer-events: none;
2672
- z-index: 35;
2673
- overflow: visible;
3158
+ .markloom-diagram-fig svg {
3159
+ height: auto;
3160
+ max-width: 100%;
2674
3161
  }
2675
- .markloom-collab-caret {
2676
- position: absolute;
2677
- width: 2px;
2678
- background: var(--collab-c, #3370ff);
2679
- border-radius: 1px;
2680
- transform: translateX(-1px);
2681
- pointer-events: none;
3162
+ html.dark .markloom-diagram-fig {
3163
+ background-color: #1c1c1e;
2682
3164
  }
2683
- .markloom-collab-caret-lab {
2684
- position: absolute;
2685
- left: 0;
2686
- top: -18px;
2687
- max-width: 120px;
3165
+ .markloom-diagram-error {
3166
+ @apply -mt-3 mb-5 px-1 text-xs select-text;
3167
+ color: #dc2626;
3168
+ opacity: 0.85;
3169
+ }
3170
+
3171
+ /* ── YAML front matter ──
3172
+ 等宽的源码块;光标不在里面(没有 data-current)时折叠成「元数据 · 第一行」一行摘要。文字一直在 DOM 里(只是高 0),所以选区、复制、查找照常。 */
3173
+ .markloom-doc .markloom-frontmatter {
3174
+ position: relative;
3175
+ margin: 0 0 1.25em;
3176
+ padding: 8px 14px;
3177
+ border-radius: 8px;
3178
+ background: var(--markloom-frontmatter-bg, rgba(127, 127, 127, 0.1));
3179
+ color: var(--text-b, inherit);
3180
+ font-family: var(--markloom-mono);
3181
+ font-size: 0.85em;
3182
+ line-height: 1.6;
3183
+ white-space: pre-wrap;
3184
+ overflow-wrap: anywhere;
3185
+ }
3186
+ .markloom-doc .markloom-frontmatter:not([data-current]) {
3187
+ cursor: pointer;
3188
+ }
3189
+ .markloom-doc .markloom-frontmatter:not([data-current])::before {
3190
+ content: attr(data-label) ' · ' attr(data-summary);
3191
+ display: block;
3192
+ opacity: 0.7;
3193
+ white-space: nowrap;
2688
3194
  overflow: hidden;
2689
3195
  text-overflow: ellipsis;
2690
- white-space: nowrap;
2691
- padding: 1px 6px;
2692
- border-radius: 3px 3px 3px 0;
2693
- background: var(--collab-c, #3370ff);
2694
- color: #fff;
2695
- font-size: 11px;
2696
- font-weight: 500;
2697
- line-height: 16px;
2698
- pointer-events: none;
3196
+ }
3197
+ .markloom-doc .markloom-frontmatter:not([data-current]) > [data-leaf] {
3198
+ display: block;
3199
+ height: 0;
3200
+ overflow: hidden;
3201
+ }
3202
+
3203
+ /* ── 专注模式 / 打字机模式(view/writing-modes.ts)──
3204
+ 专注:非当前块淡出,当前块(data-current)原样;只动 opacity,不改布局。 */
3205
+ .markloom-focus-mode .markloom-doc > :not([data-current]) {
3206
+ opacity: 0.32;
3207
+ transition: opacity 0.18s ease;
3208
+ }
3209
+ .markloom-focus-mode .markloom-doc > [data-current] {
3210
+ transition: opacity 0.18s ease;
3211
+ }
3212
+ /* 打字机:补半屏底 padding,最后一行才能滚到中线 */
3213
+ .markloom-typewriter .markloom-doc {
3214
+ padding-bottom: 50vh;
2699
3215
  }