@kirigaya/openclaw-onebot 1.0.2 → 1.0.4

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 (43) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +174 -7
  3. package/dist/channel.js +2 -2
  4. package/dist/cli-commands.d.ts +4 -0
  5. package/dist/cli-commands.js +119 -0
  6. package/dist/config.d.ts +15 -0
  7. package/dist/config.js +43 -0
  8. package/dist/connection.d.ts +63 -6
  9. package/dist/connection.js +263 -23
  10. package/dist/handlers/group-increase.d.ts +2 -1
  11. package/dist/handlers/group-increase.js +78 -12
  12. package/dist/handlers/process-inbound.d.ts +18 -0
  13. package/dist/handlers/process-inbound.js +420 -25
  14. package/dist/index.js +5 -1
  15. package/dist/load-script.d.ts +5 -1
  16. package/dist/load-script.js +7 -3
  17. package/dist/markdown-to-html.d.ts +10 -0
  18. package/dist/markdown-to-html.js +111 -0
  19. package/dist/markdown.d.ts +7 -0
  20. package/dist/markdown.js +43 -0
  21. package/dist/message.d.ts +6 -0
  22. package/dist/message.js +45 -5
  23. package/dist/og-image.d.ts +7 -0
  24. package/dist/og-image.js +51 -0
  25. package/dist/reply-context.d.ts +19 -0
  26. package/dist/reply-context.js +54 -0
  27. package/dist/send-debug-log.d.ts +27 -0
  28. package/dist/send-debug-log.js +28 -0
  29. package/dist/send.d.ts +16 -2
  30. package/dist/send.js +65 -8
  31. package/dist/setup.js +58 -5
  32. package/dist/tools.d.ts +3 -1
  33. package/dist/tools.js +60 -7
  34. package/openclaw.plugin.json +59 -4
  35. package/package.json +37 -12
  36. package/skills/onebot-ops/SKILL.md +14 -3
  37. package/skills/onebot-ops/agent-tools.md +116 -0
  38. package/skills/onebot-ops/config.md +71 -55
  39. package/skills/onebot-ops/receive.md +88 -12
  40. package/skills/onebot-ops/send.md +56 -39
  41. package/themes/dust.css +1096 -0
  42. package/dist/gateway-proxy.d.ts +0 -8
  43. package/dist/gateway-proxy.js +0 -36
@@ -0,0 +1,1096 @@
1
+ /**
2
+ * Markdown 渲染样式集合
3
+ * 从 dust-fe 项目迁移而来
4
+ * 包含:基础 Markdown 样式、代码高亮、编辑器样式、链接卡片等
5
+ */
6
+
7
+ /* ==================== CSS 变量定义 ==================== */
8
+ :root {
9
+ /* 主色(青色园林主题) */
10
+ --main-color: #55a2a0;
11
+ --main-color-light: #8bc3c2;
12
+ --shadow-color: #8bc3c2;
13
+ --main-color-light-2: rgba(139, 195, 194, 0.35);
14
+ --main-color-trans-1: rgba(85, 162, 160, 0.08);
15
+ --main-color-trans-2: rgba(85, 162, 160, 0.15);
16
+ --main-color-trans-3: rgba(85, 162, 160, 0.55);
17
+
18
+ /* 背景(画卷/宣纸风) */
19
+ --background: #faf8f2;
20
+ --background-paper: #fdfbf7;
21
+ --background-trans-1: rgba(250, 248, 242, 0.7);
22
+ --background-trans-2: rgba(250, 248, 242, 0.55);
23
+
24
+ --accent-red: #c85540;
25
+ --accent-red-trans: rgba(200, 85, 64, 0.15);
26
+ --accent-red-dark: #b23630;
27
+
28
+ /* 卡片/内容背景 */
29
+ --panel-background: rgba(255, 255, 255, 0.9);
30
+ --panel-background-light: rgba(255, 255, 255, 0.75);
31
+
32
+ /* 边框(淡茶白) */
33
+ --border-color: #e3dfd4;
34
+ --border: 1px solid var(--border-color);
35
+
36
+ /* 字体颜色 */
37
+ --font-main-color: #333333;
38
+ --font-secondary-color: #555555;
39
+ --font-title-color: #4a8e8c;
40
+ --link-color: #55a2a0;
41
+
42
+ /* 字体 */
43
+ --base-font: "Noto Serif SC", "Source Han Serif SC", "Songti SC", serif;
44
+ --title-font: "Noto Serif SC", serif;
45
+ --article-font: "Noto Serif SC", serif;
46
+ --blockquote-font: "Noto Serif SC", serif;
47
+ --monospace-font: "Source Code Pro", Monaco, "sf code", "Lucida Console", monospace;
48
+
49
+ /* 阴影(柔和水墨风) */
50
+ --shadow-color: rgba(0, 0, 0, 0.05);
51
+ --dark-shadow: rgba(0, 0, 0, 0.06) 0px 0px 4px,
52
+ rgba(0, 0, 0, 0.10) 0px 2px 8px;
53
+
54
+ /* 半透明白玻璃(保留现代感) */
55
+ --back-filter: saturate(160%) blur(8px);
56
+ --sidebar-transplate: rgba(255, 255, 255, 0.7);
57
+ --mainTransplate: rgba(255, 255, 255, 0.9);
58
+ --mainTransplate-1: rgba(255, 255, 255, 0.7);
59
+
60
+ /* 分割线 & 引用 */
61
+ --blockquote-color: rgba(80, 80, 80, 0.75);
62
+ --quote-title-font-size: 0.9rem;
63
+ --quote-tag-font-size: 1.1rem;
64
+ --quote-lineheight: 33px;
65
+
66
+ /* 滚动条(青色) */
67
+ --scrollbar-color: #55a2a0;
68
+
69
+ /* 亮度与小点缀 */
70
+ --light-color: rgba(255, 255, 255, 0.65);
71
+ --light-color-2: rgba(255, 255, 255, 0.5);
72
+ --light-color-3: rgba(85, 162, 160, 0.1);
73
+ --slight-light-color: rgba(255, 255, 255, 0.1);
74
+
75
+ /* 动画曲线 */
76
+ --focus-time: .3s;
77
+ --animation-7s: .7s cubic-bezier(0.23, 1, 0.32, 1);
78
+ --animation-5s: .5s cubic-bezier(0.23, 1, 0.32, 1);
79
+ --animation-3s: .3s cubic-bezier(0.23, 1, 0.32, 1);
80
+
81
+ /* 全局前景背景 */
82
+ --foreground: #242424;
83
+ --background-color: white;
84
+
85
+ /* 特殊点缀颜色 */
86
+ --transplant-color: rgba(85, 162, 160, 0.12);
87
+
88
+ /* 代码块:统一淡色背景,提高与文字对比度 */
89
+ --code-block-bg: #f2f0ea;
90
+ --code-block-fg: #2c2824;
91
+ }
92
+
93
+ /* OG 图片页面 body(画卷背景) */
94
+ body {
95
+ background: var(--background);
96
+ color: var(--font-main-color);
97
+ padding: 24px;
98
+ max-width: 800px;
99
+ margin: 0 auto;
100
+ }
101
+
102
+ /* ==================== 基础 Markdown 样式 ==================== */
103
+ .markdown {
104
+ font-family: var(--base-font);
105
+ color: var(--font-main-color);
106
+ line-height: 1.8;
107
+ font-size: 16px;
108
+ }
109
+
110
+ .markdown p {
111
+ margin: 0 0 1.5em 0;
112
+ line-height: 1.8;
113
+ }
114
+
115
+ /* 标题样式 */
116
+ .markdown h1,
117
+ .markdown h2,
118
+ .markdown h3,
119
+ .markdown h4,
120
+ .markdown h5,
121
+ .markdown h6 {
122
+ color: var(--font-title-color);
123
+ font-family: var(--title-font);
124
+ font-weight: 700;
125
+ line-height: 1.5;
126
+ margin: 1.5em 0 0.8em 0;
127
+ }
128
+
129
+ .markdown h1 {
130
+ font-size: 2em;
131
+ border-bottom: 2px solid var(--main-color-trans-3);
132
+ padding-bottom: 0.3em;
133
+ }
134
+
135
+ .markdown h2 {
136
+ font-size: 1.75em;
137
+ border-bottom: 1px solid var(--main-color-trans-2);
138
+ padding-bottom: 0.3em;
139
+ }
140
+
141
+ .markdown h3 {
142
+ font-size: 1.5em;
143
+ }
144
+
145
+ .markdown h4 {
146
+ font-size: 1.25em;
147
+ }
148
+
149
+ .markdown h5 {
150
+ font-size: 1.1em;
151
+ }
152
+
153
+ .markdown h6 {
154
+ font-size: 1em;
155
+ color: var(--font-secondary-color);
156
+ }
157
+
158
+ /* 链接样式 */
159
+ .markdown a {
160
+ color: var(--link-color);
161
+ text-decoration: none;
162
+ border-bottom: 1px solid transparent;
163
+ transition: border-bottom-color 0.2s ease-in-out, color 0.2s ease-in-out;
164
+ }
165
+
166
+ .markdown a:hover {
167
+ border-bottom-color: var(--main-color);
168
+ color: var(--main-color);
169
+ }
170
+
171
+ .markdown a.markdown-link {
172
+ color: var(--link-color);
173
+ }
174
+
175
+ /* 列表样式 */
176
+ .markdown ul,
177
+ .markdown ol {
178
+ margin: 0 0 1.5em 0;
179
+ padding-left: 2em;
180
+ }
181
+
182
+ .markdown ul {
183
+ list-style-type: disc;
184
+ }
185
+
186
+ .markdown ol {
187
+ list-style-type: decimal;
188
+ }
189
+
190
+ .markdown li {
191
+ margin: 0.5em 0;
192
+ line-height: 1.8;
193
+ }
194
+
195
+ .markdown li > ul,
196
+ .markdown li > ol {
197
+ margin: 0.5em 0;
198
+ }
199
+
200
+ /* 引用块样式 */
201
+ .markdown blockquote {
202
+ margin: 1.5em 0;
203
+ padding: 1em 1.5em;
204
+ border-left: 4px solid var(--main-color);
205
+ background-color: var(--main-color-trans-1);
206
+ color: var(--blockquote-color);
207
+ font-family: var(--blockquote-font);
208
+ border-radius: 0 4px 4px 0;
209
+ }
210
+
211
+ .markdown blockquote p {
212
+ margin: 0;
213
+ }
214
+
215
+ .markdown blockquote p:last-child {
216
+ margin-bottom: 0;
217
+ }
218
+
219
+ /* 表格样式 */
220
+ .markdown table {
221
+ width: 100%;
222
+ border-collapse: collapse;
223
+ margin: 1.5em 0;
224
+ overflow-x: auto;
225
+ display: block;
226
+ }
227
+
228
+ .markdown table.markdown-table {
229
+ border: 1px solid var(--border-color);
230
+ }
231
+
232
+ .markdown table th,
233
+ .markdown table td {
234
+ padding: 0.75em 1em;
235
+ border: 1px solid var(--border-color);
236
+ text-align: left;
237
+ }
238
+
239
+ .markdown table th {
240
+ background-color: var(--main-color-trans-1);
241
+ font-weight: 600;
242
+ color: var(--font-title-color);
243
+ }
244
+
245
+ .markdown table tr:nth-child(even) {
246
+ background-color: var(--main-color-trans-1);
247
+ }
248
+
249
+ .markdown table tr:hover {
250
+ background-color: var(--main-color-trans-2);
251
+ }
252
+
253
+ /* 图片样式 */
254
+ .markdown img {
255
+ max-width: 100%;
256
+ height: auto;
257
+ border-radius: 4px;
258
+ display: block;
259
+ margin: 1.5em auto;
260
+ }
261
+
262
+ .markdown img.markdown-image {
263
+ cursor: zoom-in;
264
+ transition: transform 0.3s ease;
265
+ }
266
+
267
+ .markdown img.markdown-image:hover {
268
+ transform: scale(1.02);
269
+ }
270
+
271
+ /* 图片带标题样式 */
272
+ .markdown .image-with-caption {
273
+ margin: 1.5em 0;
274
+ }
275
+
276
+ .markdown .image-with-caption img {
277
+ margin: 0;
278
+ border-radius: 4px 4px 0 0;
279
+ }
280
+
281
+ .markdown .img-caption {
282
+ text-align: center;
283
+ color: var(--font-secondary-color);
284
+ font-size: 0.9em;
285
+ margin-top: 0.5em;
286
+ font-style: italic;
287
+ }
288
+
289
+ /* 分割线样式 */
290
+ .markdown hr {
291
+ border: 0;
292
+ height: 1px;
293
+ background: linear-gradient(to right, transparent, var(--border-color), transparent);
294
+ margin: 2em 0;
295
+ }
296
+
297
+ .markdown hr.major {
298
+ margin: 3em 0;
299
+ }
300
+
301
+ /* ==================== 代码块样式 ==================== */
302
+ .markdown pre {
303
+ position: relative;
304
+ margin: 1.5em 0;
305
+ overflow: visible;
306
+ padding: 1px;
307
+ background: transparent;
308
+ }
309
+
310
+ .markdown pre > code {
311
+ position: relative;
312
+ z-index: 1;
313
+ display: block;
314
+ overflow-x: auto;
315
+ padding: 1.5em 1em;
316
+ border-left: 10px solid var(--main-color);
317
+ box-shadow: -1px 0 0 0 var(--main-color-trans-3), 0 0 0 1px var(--border-color);
318
+ background-color: var(--code-block-bg);
319
+ font-family: var(--monospace-font);
320
+ font-size: 0.9em;
321
+ line-height: 1.5;
322
+ color: var(--code-block-fg);
323
+ tab-size: 4;
324
+ -moz-tab-size: 4;
325
+ -o-tab-size: 4;
326
+ }
327
+
328
+ /* highlight.js 在 .markdown 内:统一淡色背景 + 深色前景,提高对比度 */
329
+ .markdown pre .hljs {
330
+ background: transparent !important;
331
+ color: var(--code-block-fg) !important;
332
+ }
333
+ .markdown pre .hljs-keyword { color: #0d6c6a; font-weight: 600; }
334
+ .markdown pre .hljs-string { color: #b23630; }
335
+ .markdown pre .hljs-number { color: #0d6c6a; }
336
+ .markdown pre .hljs-comment { color: #6b7280; }
337
+ .markdown pre .hljs-function { color: #2c2824; }
338
+ .markdown pre .hljs-title { color: #0d6c6a; font-weight: 600; }
339
+ .markdown pre .hljs-params { color: #4a8e8c; }
340
+ .markdown pre .hljs-built_in { color: #0d6c6a; }
341
+ .markdown pre .hljs-class { color: #0d6c6a; }
342
+ .markdown pre .hljs-variable { color: #2c2824; }
343
+ .markdown pre .hljs-attr { color: #4a8e8c; }
344
+ .markdown pre .hljs-tag { color: #0d6c6a; }
345
+ .markdown pre .hljs-name { color: #0d6c6a; }
346
+ .markdown pre .hljs-meta { color: #6b7280; }
347
+
348
+ .markdown code {
349
+ font-family: var(--monospace-font);
350
+ font-size: 0.9em;
351
+ }
352
+
353
+ .markdown :not(pre) > code {
354
+ position: relative;
355
+ padding: 0.2em 0.4em;
356
+ border-radius: 0.3em;
357
+ color: var(--accent-red);
358
+ border: 1px solid var(--border-color);
359
+ background-color: var(--panel-background);
360
+ white-space: normal;
361
+ }
362
+
363
+ /* 代码块阴影效果 */
364
+ .markdown pre:after,
365
+ .markdown pre:before {
366
+ content: '';
367
+ display: block;
368
+ position: absolute;
369
+ bottom: 0.75em;
370
+ left: 0.18em;
371
+ width: 40%;
372
+ height: 20%;
373
+ max-height: 13em;
374
+ box-shadow: 0 13px 8px var(--shadow-color);
375
+ transform: rotate(-2deg);
376
+ z-index: 0;
377
+ }
378
+
379
+ .markdown pre:after {
380
+ right: 0.75em;
381
+ left: auto;
382
+ transform: rotate(2deg);
383
+ }
384
+
385
+ /* ==================== 代码工具箱样式 ==================== */
386
+ .code-toolbox {
387
+ position: absolute;
388
+ top: 0;
389
+ right: 15px;
390
+ transition: 0.5s ease-out;
391
+ display: flex;
392
+ justify-content: space-around;
393
+ align-items: center;
394
+ z-index: 10;
395
+ }
396
+
397
+ .code-toolbox .expand-button {
398
+ margin: 10px;
399
+ padding: 6px 11px;
400
+ font-size: 15px;
401
+ cursor: pointer;
402
+ font-family: var(--base-font);
403
+ border-radius: 999em;
404
+ background-color: var(--main-color);
405
+ color: white !important;
406
+ transition: 0.5s ease;
407
+ }
408
+
409
+ .code-toolbox .expand-button-click {
410
+ transform: rotate(-180deg);
411
+ background-color: var(--shadow-color);
412
+ }
413
+
414
+ .code-toolbox .copy-button {
415
+ margin: 10px;
416
+ padding: 6px;
417
+ font-size: 15px;
418
+ cursor: pointer;
419
+ font-family: var(--base-font);
420
+ border-radius: 0.8em;
421
+ background-color: var(--main-color);
422
+ color: white !important;
423
+ width: 60px;
424
+ display: flex;
425
+ justify-content: space-around;
426
+ align-items: center;
427
+ transition: 0.5s ease;
428
+ }
429
+
430
+ .code-toolbox .copy-button-hover {
431
+ background-color: #6DC45F;
432
+ width: 150px;
433
+ }
434
+
435
+ .code-toolbox-hidden {
436
+ opacity: 0;
437
+ transition: 1s ease-out;
438
+ }
439
+
440
+ .code-toolbox-display {
441
+ opacity: 1;
442
+ transition: 1s ease-out;
443
+ }
444
+
445
+ .markdown code {
446
+ height: fit-content;
447
+ transition: 0.5s ease-out;
448
+ }
449
+
450
+ .collapse-code {
451
+ height: 20px !important;
452
+ transition: 0.5s ease-out;
453
+ }
454
+
455
+ /* ==================== Prism 语法高亮样式 ==================== */
456
+ code[class*="language-"],
457
+ pre[class*="language-"] {
458
+ color: var(--font-main-color);
459
+ font-family: var(--monospace-font);
460
+ font-size: 1em;
461
+ text-align: left;
462
+ white-space: pre;
463
+ word-spacing: normal;
464
+ word-break: normal;
465
+ word-wrap: normal;
466
+ line-height: 1.5;
467
+ tab-size: 4;
468
+ -moz-tab-size: 4;
469
+ -o-tab-size: 4;
470
+ -webkit-hyphens: none;
471
+ -moz-hyphens: none;
472
+ -ms-hyphens: none;
473
+ hyphens: none;
474
+ }
475
+
476
+ .token.comment,
477
+ .token.prolog,
478
+ .token.doctype,
479
+ .token.cdata {
480
+ color: #7F848E;
481
+ }
482
+
483
+ .token.punctuation {
484
+ color: #D19A66;
485
+ }
486
+
487
+ .token.tag,
488
+ .token.boolean,
489
+ .token.number,
490
+ .token.constant,
491
+ .token.symbol,
492
+ .token.deleted,
493
+ .token.function-name,
494
+ .token.property {
495
+ color: var(--accent-red);
496
+ }
497
+
498
+ .token.number {
499
+ color: var(--accent-red-dark);
500
+ }
501
+
502
+ .token.selector,
503
+ .token.attr-name,
504
+ .token.string,
505
+ .token.char,
506
+ .token.builtin,
507
+ .token.inserted {
508
+ color: var(--main-color);
509
+ }
510
+
511
+ .token.selector {
512
+ color: var(--main-color-light);
513
+ }
514
+
515
+ .token.function {
516
+ color: var(--font-title-color);
517
+ }
518
+
519
+ .token.operator,
520
+ .token.entity,
521
+ .token.url {
522
+ color: var(--main-color-light-3, #8bc3c2);
523
+ opacity: 0.9;
524
+ }
525
+
526
+ .token.variable {
527
+ color: var(--accent-red-dark);
528
+ }
529
+
530
+ .token.atrule,
531
+ .token.attr-value {
532
+ color: var(--main-color);
533
+ }
534
+
535
+ .token.class-name {
536
+ color: var(--font-title-color);
537
+ }
538
+
539
+ .token.keyword {
540
+ color: var(--accent-red);
541
+ }
542
+
543
+ .token.regex,
544
+ .token.important {
545
+ color: var(--accent-red-dark);
546
+ }
547
+
548
+ .token.bold {
549
+ font-weight: 700;
550
+ }
551
+
552
+ .token.italic {
553
+ font-style: italic;
554
+ }
555
+
556
+ .token.entity {
557
+ cursor: help;
558
+ }
559
+
560
+ .token.namespace {
561
+ color: var(--font-title-color);
562
+ opacity: 0.7;
563
+ }
564
+
565
+ /* ==================== Markdown 扩展块样式 ==================== */
566
+ .markdown-ext-block {
567
+ border-radius: 0.6rem;
568
+ border: 1px solid var(--main-color);
569
+ background-color: var(--main-color-trans-1);
570
+ padding: 3px 15px;
571
+ margin-bottom: 25px;
572
+ }
573
+
574
+ .markdown-ext-block .iconfont {
575
+ font-size: 1.2rem;
576
+ margin-right: 0.7rem;
577
+ color: var(--main-color);
578
+ }
579
+
580
+ .markdown-ext-block .title {
581
+ color: var(--main-color);
582
+ font-weight: 700;
583
+ font-size: 1.3rem;
584
+ letter-spacing: unset;
585
+ line-height: unset;
586
+ }
587
+
588
+ .markdown-ext-block .desc {
589
+ color: black;
590
+ font-weight: 700;
591
+ margin-left: 0.7rem;
592
+ }
593
+
594
+ /* ==================== 链接卡片样式 ==================== */
595
+ .link-card {
596
+ display: flex;
597
+ align-items: center;
598
+ gap: 12px;
599
+ padding: 12px 16px;
600
+ margin: 8px 0;
601
+ border-radius: 10px;
602
+ background: var(--card-bg, #f9fafb);
603
+ border: 1px solid var(--card-border, #e5e7eb);
604
+ cursor: pointer;
605
+ transition: all 0.2s ease;
606
+ text-decoration: none;
607
+ color: inherit;
608
+ user-select: none;
609
+ }
610
+
611
+ .link-card:hover {
612
+ background: var(--card-hover-bg, #f3f4f6);
613
+ box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
614
+ }
615
+
616
+ .link-card a {
617
+ flex: 1;
618
+ color: #111827;
619
+ font-weight: 500;
620
+ font-size: 0.95rem;
621
+ text-decoration: none;
622
+ overflow: hidden;
623
+ text-overflow: ellipsis;
624
+ white-space: nowrap;
625
+ }
626
+
627
+ .link-card::before {
628
+ font-size: 1rem;
629
+ opacity: 0.6;
630
+ }
631
+
632
+ /* 详细链接卡片样式 */
633
+ .detail-url-wrapper {
634
+ width: 100%;
635
+ display: flex;
636
+ margin-top: 10px;
637
+ margin-bottom: 10px;
638
+ justify-content: center;
639
+ }
640
+
641
+ .detail-url-container {
642
+ padding: 0px 10px;
643
+ border-radius: 0.8rem;
644
+ background-color: rgba(93, 103, 232, 0.1);
645
+ display: flex;
646
+ align-items: center;
647
+ cursor: pointer;
648
+ transition: var(--animation-5s);
649
+ max-width: 80%;
650
+ }
651
+
652
+ @keyframes loading-mask {
653
+ 0% {
654
+ background-position: 100% 50%;
655
+ }
656
+ 100% {
657
+ background-position: 0 50%;
658
+ }
659
+ }
660
+
661
+ .detail-url-container:hover {
662
+ background: linear-gradient(
663
+ 90deg,
664
+ rgba(203, 129, 218, 0.2) 25%,
665
+ rgba(93, 103, 232, 0.1) 37%,
666
+ rgba(255, 255, 255, 0) 63%
667
+ );
668
+ background-size: 400% 100%;
669
+ animation: loading-mask 1.4s cubic-bezier(0.23, 1, 0.32, 1);
670
+ }
671
+
672
+ .detail-url-container .cover {
673
+ position: relative;
674
+ overflow: hidden;
675
+ height: 40px;
676
+ width: 40px;
677
+ border-radius: 0.6em;
678
+ flex-shrink: 0;
679
+ }
680
+
681
+ .detail-url-container .cover img {
682
+ position: absolute;
683
+ top: 50%;
684
+ height: 100%;
685
+ width: 100%;
686
+ object-fit: cover;
687
+ transform: translateY(-50%);
688
+ }
689
+
690
+ .detail-url-container .main {
691
+ margin: 10px;
692
+ width: 80%;
693
+ min-width: 0;
694
+ }
695
+
696
+ .detail-url-container .title {
697
+ font-size: 1.0rem;
698
+ font-family: var(--base-font);
699
+ margin-bottom: 5px;
700
+ letter-spacing: unset;
701
+ overflow: hidden;
702
+ text-overflow: ellipsis;
703
+ white-space: nowrap;
704
+ }
705
+
706
+ .detail-url-container .desc {
707
+ font-size: 0.9rem;
708
+ color: var(--font-secondary-color);
709
+ overflow: hidden;
710
+ text-overflow: ellipsis;
711
+ white-space: nowrap;
712
+ }
713
+
714
+ /* ==================== 图片展示相关样式 ==================== */
715
+ .markdown-image-display-container {
716
+ cursor: zoom-in;
717
+ object-fit: cover;
718
+ position: fixed;
719
+ left: 0;
720
+ top: 0;
721
+ width: 100%;
722
+ height: 100%;
723
+ backdrop-filter: blur(10px);
724
+ background-color: rgba(20, 20, 20, 0.3);
725
+ z-index: 10000;
726
+ display: flex;
727
+ align-items: center;
728
+ justify-content: space-around;
729
+ }
730
+
731
+ .image-display-arrow {
732
+ width: 90px;
733
+ height: 90px;
734
+ font-size: 55px;
735
+ padding: 10px 30px !important;
736
+ display: flex;
737
+ align-items: center;
738
+ justify-content: center;
739
+ transition: 0.5s ease;
740
+ border-radius: 100%;
741
+ cursor: pointer;
742
+ color: white;
743
+ }
744
+
745
+ .image-display-arrow.left {
746
+ transform: rotate(90deg);
747
+ }
748
+
749
+ .image-display-arrow.right {
750
+ transform: rotate(-90deg);
751
+ }
752
+
753
+ .image-display-arrow:hover {
754
+ box-shadow: 0 0 25px var(--shadow-color), 0 0 25px var(--shadow-color),
755
+ 0 0 25px var(--shadow-color), 0 0 25px var(--shadow-color);
756
+ }
757
+
758
+ .image-display-arrow.disabled {
759
+ opacity: 0.3;
760
+ cursor: not-allowed;
761
+ }
762
+
763
+ /* 图片上传动画 */
764
+ .image-uploading {
765
+ opacity: 0.5;
766
+ animation: flicker 1s infinite alternate;
767
+ }
768
+
769
+ @keyframes flicker {
770
+ from {
771
+ opacity: 0.1;
772
+ }
773
+ to {
774
+ opacity: 0.5;
775
+ }
776
+ }
777
+
778
+ .image-uploaded {
779
+ transition: opacity 0.3s ease;
780
+ opacity: 1;
781
+ }
782
+
783
+ /* ==================== 编辑器相关样式 ==================== */
784
+ .editor-toolbar {
785
+ display: flex;
786
+ flex-wrap: wrap;
787
+ border-bottom: 1px solid #ddd;
788
+ padding: 8px;
789
+ border-radius: 4px 4px 0 0;
790
+ gap: 4px;
791
+ }
792
+
793
+ .editor-container {
794
+ min-height: 60vh;
795
+ position: relative;
796
+ margin-bottom: 100px;
797
+ }
798
+
799
+ .editor {
800
+ min-height: 300px;
801
+ padding: 16px;
802
+ outline: none;
803
+ }
804
+
805
+ .source-editor {
806
+ min-height: 300px;
807
+ outline: none;
808
+ border: none;
809
+ resize: none;
810
+ height: auto;
811
+ width: 100%;
812
+ font-family: 'Courier New', Courier, monospace;
813
+ font-size: 14px;
814
+ line-height: 1.5;
815
+ }
816
+
817
+ /* ProseMirror 默认样式 */
818
+ .ProseMirror {
819
+ outline: none;
820
+ min-height: 300px;
821
+ }
822
+
823
+ .ProseMirror p {
824
+ margin: 0 0 1em 0;
825
+ }
826
+
827
+ .ProseMirror-focused {
828
+ outline: unset;
829
+ border: unset;
830
+ }
831
+
832
+ /* CodeMirror 样式 */
833
+ .markdown-editor .CodeMirror {
834
+ background-color: rgba(255, 255, 255, 0);
835
+ }
836
+
837
+ .markdown-editor .CodeMirror-activeline-gutter {
838
+ background-color: var(--transplant-color);
839
+ }
840
+
841
+ .markdown-editor .CodeMirror-activeline-background {
842
+ background-color: var(--transplant-color);
843
+ }
844
+
845
+ .markdown-editor .CodeMirror-foldgutter {
846
+ display: none;
847
+ }
848
+
849
+ /* ==================== 代码块头部样式 ==================== */
850
+ .code-block-header {
851
+ position: absolute;
852
+ top: 5px;
853
+ right: 5px;
854
+ z-index: 50;
855
+ }
856
+
857
+ .code-block-wrapper {
858
+ position: relative;
859
+ }
860
+
861
+ .code-block-wrapper pre {
862
+ overflow-x: auto;
863
+ tab-size: 4;
864
+ -moz-tab-size: 4;
865
+ -o-tab-size: 4;
866
+ }
867
+
868
+ /* ==================== 文章布局样式 ==================== */
869
+ .dustblog-container {
870
+ display: flex;
871
+ flex-direction: column;
872
+ align-items: center;
873
+ position: relative;
874
+ }
875
+
876
+ .dustblog-title {
877
+ text-align: center;
878
+ }
879
+
880
+ .dustblog-title h1 {
881
+ text-align: left;
882
+ font-size: 30px;
883
+ color: var(--font-title-color);
884
+ }
885
+
886
+ .dustblog-title h2 {
887
+ color: var(--sidebar-color, #6b6b6b);
888
+ font-size: 25px;
889
+ text-align: left;
890
+ text-decoration: underline;
891
+ }
892
+
893
+ .dustblog-cover {
894
+ display: flex;
895
+ justify-content: center;
896
+ align-items: center;
897
+ margin-bottom: 30px;
898
+ width: 100%;
899
+ }
900
+
901
+ .dustblog-body {
902
+ max-width: 1600px;
903
+ margin-bottom: 50px;
904
+ }
905
+
906
+ .dustblog-extra {
907
+ display: flex;
908
+ flex-direction: column;
909
+ justify-content: center;
910
+ align-items: center;
911
+ }
912
+
913
+ /* 标签容器 */
914
+ .icon-container {
915
+ display: flex;
916
+ align-items: center;
917
+ font-size: 25px;
918
+ }
919
+
920
+ .k-tag-container {
921
+ display: flex;
922
+ flex-wrap: wrap;
923
+ justify-content: flex-start;
924
+ height: fit-content;
925
+ }
926
+
927
+ /* 阅读时间 */
928
+ .reading-time {
929
+ font-family: var(--base-font);
930
+ display: flex;
931
+ justify-content: space-between;
932
+ align-items: center;
933
+ color: var(--sidebar-color, #6b6b6b);
934
+ }
935
+
936
+ .reading-time > div {
937
+ display: flex;
938
+ align-items: center;
939
+ }
940
+
941
+ .reading-time .sp {
942
+ margin-right: 5px;
943
+ }
944
+
945
+ .reading-time .underline {
946
+ text-decoration: underline;
947
+ }
948
+
949
+ /* ==================== 响应式布局 ==================== */
950
+ @media screen and (max-width: 3839px) {
951
+ /* 4k screen */
952
+ .dustblog-recommend,
953
+ .dustblog-comment {
954
+ width: 1080px;
955
+ }
956
+
957
+ .dustblog-title,
958
+ .dustblog-body {
959
+ width: 880px;
960
+ }
961
+
962
+ .dustblog-cover {
963
+ max-width: 880px;
964
+ }
965
+ }
966
+
967
+ @media screen and (max-width: 1919px) {
968
+ /* 2k screen */
969
+ .dustblog-title,
970
+ .dustblog-recommend,
971
+ .dustblog-comment,
972
+ .dustblog-body {
973
+ width: 60%;
974
+ }
975
+
976
+ .dustblog-cover {
977
+ max-width: 60%;
978
+ }
979
+ }
980
+
981
+ @media screen and (max-width: 1080px) {
982
+ /* 1k screen */
983
+ .dustblog-title,
984
+ .dustblog-recommend,
985
+ .dustblog-comment,
986
+ .dustblog-body {
987
+ width: 95%;
988
+ }
989
+ }
990
+
991
+ @media screen and (max-width: 736px) {
992
+ /* phone */
993
+ .dustblog-title,
994
+ .dustblog-recommend,
995
+ .dustblog-comment,
996
+ .dustblog-body {
997
+ width: 100%;
998
+ }
999
+
1000
+ .markdown pre:after,
1001
+ .markdown pre:before {
1002
+ bottom: 14px;
1003
+ box-shadow: none;
1004
+ }
1005
+
1006
+ .code-toolbox {
1007
+ opacity: 1 !important;
1008
+ right: 5px;
1009
+ }
1010
+
1011
+ .code-toolbox .copy-button,
1012
+ .code-toolbox .expand-button {
1013
+ margin: 5px;
1014
+ padding: 4px 8px;
1015
+ font-size: 12px;
1016
+ }
1017
+ }
1018
+
1019
+ @media screen and (max-width: 454px) {
1020
+ /* small phone */
1021
+ .dustblog-title,
1022
+ .dustblog-recommend,
1023
+ .dustblog-comment,
1024
+ .dustblog-body {
1025
+ width: 100%;
1026
+ overflow: auto;
1027
+ }
1028
+
1029
+ .dustblog-cover {
1030
+ max-width: 100%;
1031
+ }
1032
+ }
1033
+
1034
+ /* ==================== 其他辅助样式 ==================== */
1035
+ .markdown .no-selection {
1036
+ user-select: none;
1037
+ }
1038
+
1039
+ /* 行号样式 */
1040
+ pre[class*="language-"].line-numbers.line-numbers {
1041
+ padding-left: 0;
1042
+ }
1043
+
1044
+ pre[class*="language-"].line-numbers.line-numbers code {
1045
+ padding-left: 3.8em;
1046
+ }
1047
+
1048
+ pre[class*="language-"].line-numbers.line-numbers .line-numbers-rows {
1049
+ left: 0;
1050
+ }
1051
+
1052
+ /* 高亮行样式 */
1053
+ pre[class*="language-"][data-line] {
1054
+ padding-top: 0;
1055
+ padding-bottom: 0;
1056
+ padding-left: 0;
1057
+ }
1058
+
1059
+ pre[data-line] code {
1060
+ position: relative;
1061
+ padding-left: 4em;
1062
+ }
1063
+
1064
+ pre .line-highlight {
1065
+ margin-top: 0;
1066
+ }
1067
+
1068
+ /* 打印样式 */
1069
+ @media print {
1070
+ .markdown pre > code {
1071
+ white-space: pre-wrap;
1072
+ word-wrap: break-word;
1073
+ }
1074
+
1075
+ .code-toolbox {
1076
+ display: none;
1077
+ }
1078
+ }
1079
+
1080
+ /* 滚动条样式 */
1081
+ .markdown pre::-webkit-scrollbar {
1082
+ height: 8px;
1083
+ }
1084
+
1085
+ .markdown pre::-webkit-scrollbar-track {
1086
+ background: var(--main-color-trans-1);
1087
+ }
1088
+
1089
+ .markdown pre::-webkit-scrollbar-thumb {
1090
+ background: var(--main-color-trans-3);
1091
+ border-radius: 4px;
1092
+ }
1093
+
1094
+ .markdown pre::-webkit-scrollbar-thumb:hover {
1095
+ background: var(--main-color);
1096
+ }