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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@font-face {
|
2 |
+
font-family: 'Dank Mono';
|
3 |
+
src: url('../assets/fonts/DankMono-Regular.woff2') format('woff2');
|
4 |
+
font-display: swap;
|
5 |
+
font-style: normal;
|
6 |
+
}
|
7 |
+
|
8 |
+
@font-face {
|
9 |
+
font-family: 'Dank Mono';
|
10 |
+
src: url('../assets/fonts/DankMono-Italic.woff2') format('woff2');
|
11 |
+
font-display: swap;
|
12 |
+
font-style: italic;
|
13 |
+
}
|
14 |
+
|
15 |
+
@font-face {
|
16 |
+
font-family: 'JinBuTi';
|
17 |
+
src: url('../assets/fonts/DingTalk-JinBuTi.woff2') format('woff2');
|
18 |
+
font-display: swap;
|
19 |
+
}
|
20 |
+
|
21 |
+
html {
|
22 |
+
scroll-behavior: smooth;
|
23 |
+
}
|
24 |
+
|
25 |
+
body {
|
26 |
+
font-family: 'JinBuTi', -apple-system, BlinkMacSystemFont, sans-serif;
|
27 |
+
}
|
28 |
+
|
29 |
+
/* 代码块容器样式 */
|
30 |
+
.language-javascript, [class*="language-"] {
|
31 |
+
background: #f6f8fa !important;
|
32 |
+
border-radius: 10px !important;
|
33 |
+
box-shadow: 0 10px 30px 0 rgba(0, 0, 0, 0.1) !important;
|
34 |
+
position: relative;
|
35 |
+
margin: 1.2em 0;
|
36 |
+
}
|
37 |
+
|
38 |
+
.dark .language-javascript, .dark [class*="language-"] {
|
39 |
+
background: #282c34 !important;
|
40 |
+
box-shadow: 0 10px 30px 0 rgba(0, 0, 0, .4) !important;
|
41 |
+
}
|
42 |
+
|
43 |
+
/* 代码块顶部栏 */
|
44 |
+
.sticky.top-8 {
|
45 |
+
background: #e1e4e8 !important;
|
46 |
+
height: 40px !important;
|
47 |
+
display: flex;
|
48 |
+
align-items: center;
|
49 |
+
border-radius: 10px 10px 0 0;
|
50 |
+
padding: 0 15px !important;
|
51 |
+
margin-bottom: -59px !important;
|
52 |
+
}
|
53 |
+
|
54 |
+
.dark .sticky.top-8 {
|
55 |
+
background: #21252b !important;
|
56 |
+
}
|
57 |
+
|
58 |
+
/* 语言标识 */
|
59 |
+
.text-text-300 {
|
60 |
+
position: absolute;
|
61 |
+
left: 60px;
|
62 |
+
top: 2px;
|
63 |
+
color: #abb2bf !important;
|
64 |
+
font-size: 17px !important;
|
65 |
+
font-weight: 500 !important;
|
66 |
+
z-index: 11;
|
67 |
+
}
|
68 |
+
|
69 |
+
.dark .text-text-300 {
|
70 |
+
color: #586069 !important;
|
71 |
+
}
|
72 |
+
|
73 |
+
/* 顶部按钮样式优化 */
|
74 |
+
.save-code-button, .copy-code-button, .run-code-button {
|
75 |
+
background: #f8f9fa !important;
|
76 |
+
color: #333 !important;
|
77 |
+
border: 1px solid #d1d5da !important;
|
78 |
+
font-size: 12px !important;
|
79 |
+
padding: 4px 12px !important;
|
80 |
+
border-radius: 4px !important;
|
81 |
+
transition: all 0.2s ease-in-out !important;
|
82 |
+
}
|
83 |
+
|
84 |
+
.dark .save-code-button, .dark .copy-code-button, .dark .run-code-button {
|
85 |
+
background: #323842 !important;
|
86 |
+
color: #abb2bf !important;
|
87 |
+
border: 1px solid #3e4451 !important;
|
88 |
+
}
|
89 |
+
|
90 |
+
.save-code-button:hover, .copy-code-button:hover {
|
91 |
+
background: #e9ecef !important;
|
92 |
+
color: #222 !important;
|
93 |
+
}
|
94 |
+
|
95 |
+
.dark .save-code-button:hover, .dark .copy-code-button:hover {
|
96 |
+
background: #3e4451 !important;
|
97 |
+
color: #fff !important;
|
98 |
+
}
|
99 |
+
|
100 |
+
/* 代码块顶部装饰圆点 */
|
101 |
+
.language-javascript::before, [class*="language-"]::before {
|
102 |
+
content: " ";
|
103 |
+
position: absolute;
|
104 |
+
border-radius: 50%;
|
105 |
+
background: #ff5f56;
|
106 |
+
width: 12px;
|
107 |
+
height: 12px;
|
108 |
+
left: 15px;
|
109 |
+
top: 14px;
|
110 |
+
box-shadow: 20px 0 #ffbd2e, 40px 0 #27c93f;
|
111 |
+
z-index: 10;
|
112 |
+
}
|
113 |
+
|
114 |
+
.dakr .language-javascript::before, .dakr [class*="language-"]::before {
|
115 |
+
background: #fc625d;
|
116 |
+
box-shadow: 20px 0 #fdbc40, 40px 0 #35cd4b;
|
117 |
+
}
|
118 |
+
|
119 |
+
/* 代码内容区域 */
|
120 |
+
.cm-content {
|
121 |
+
font-family: 'Dank Mono', -apple-system, BlinkMacSystemFont, Inter, ui-sans-serif, system-ui, 'Segoe UI', Roboto, Ubuntu, Cantarell, 'Noto Sans', sans-serif, 'Helvetica Neue', Arial, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
|
122 |
+
font-size: 15px !important;
|
123 |
+
line-height: 1.6em !important;
|
124 |
+
padding: 20px 1.4em 1em 30px !important;
|
125 |
+
color: #24292e !important;
|
126 |
+
}
|
127 |
+
|
128 |
+
.dark .cm-content {
|
129 |
+
color: #abb2bf !important;
|
130 |
+
}
|
131 |
+
|
132 |
+
/* 代码语法高亮 */
|
133 |
+
.cm-line .ͼb {
|
134 |
+
/* 关键字 */
|
135 |
+
color: #d73a49 !important;
|
136 |
+
}
|
137 |
+
|
138 |
+
.dark .cm-line .ͼb {
|
139 |
+
color: #c678dd !important;
|
140 |
+
}
|
141 |
+
|
142 |
+
.cm-line .ͼd {
|
143 |
+
/* 数字 */
|
144 |
+
color: #a29bfe !important;
|
145 |
+
}
|
146 |
+
|
147 |
+
.dakr .cm-line .ͼd {
|
148 |
+
color: #e5c07b !important;
|
149 |
+
}
|
150 |
+
|
151 |
+
.cm-line .ͼe {
|
152 |
+
/* 字符串 */
|
153 |
+
color: #6a89cc !important;
|
154 |
+
}
|
155 |
+
|
156 |
+
.dakr .cm-line .ͼe {
|
157 |
+
color: #98c379 !important;
|
158 |
+
}
|
159 |
+
|
160 |
+
.cm-line .ͼg {
|
161 |
+
/* 变量 */
|
162 |
+
color: #2ca9e1 !important;
|
163 |
+
font-style: italic;
|
164 |
+
}
|
165 |
+
|
166 |
+
.dakr .cm-line .ͼg {
|
167 |
+
color: #e3adb9 !important;
|
168 |
+
}
|
169 |
+
|
170 |
+
/* 代码语法高亮 - 扩展 */
|
171 |
+
.cm-comment {
|
172 |
+
/* 注释 */
|
173 |
+
color: #7f848e !important;
|
174 |
+
font-style: italic;
|
175 |
+
}
|
176 |
+
|
177 |
+
.cm-property {
|
178 |
+
color: #61afef !important;
|
179 |
+
}
|
180 |
+
|
181 |
+
cm-tag {
|
182 |
+
color: #e06c75 !important;
|
183 |
+
}
|
184 |
+
|
185 |
+
.cm-attribute {
|
186 |
+
color: #d19a66 !important;
|
187 |
+
}
|
188 |
+
|
189 |
+
.cm-string {
|
190 |
+
color: #98c379 !important;
|
191 |
+
}
|
192 |
+
|
193 |
+
.cm-operator {
|
194 |
+
color: #56b6c2 !important;
|
195 |
+
}
|
196 |
+
|
197 |
+
span.ͼc {
|
198 |
+
color: #7d5fff !important;
|
199 |
+
}
|
200 |
+
|
201 |
+
span.ͼl {
|
202 |
+
color: #6bddcd !important;
|
203 |
+
}
|
204 |
+
|
205 |
+
span.ͼt {
|
206 |
+
/* 暗色模式下的逗号 */
|
207 |
+
color: #ddb078 !important;
|
208 |
+
;
|
209 |
+
font-style: italic;
|
210 |
+
}
|
211 |
+
|
212 |
+
span.ͼr {
|
213 |
+
/* 暗色模式下的函数名 */
|
214 |
+
font-style: italic;
|
215 |
+
}
|
216 |
+
|
217 |
+
span.ͼf {
|
218 |
+
/* 亮色模式下奇怪的符号 */
|
219 |
+
color: #70a1ff;
|
220 |
+
}
|
221 |
+
|
222 |
+
span.ͼm {
|
223 |
+
/* 亮色模式下的注释 */
|
224 |
+
color: #f29a76;
|
225 |
+
font-style: italic;
|
226 |
+
}
|
227 |
+
|
228 |
+
span.ͼw {
|
229 |
+
/* 暗色模式下的注释 */
|
230 |
+
font-style: italic;
|
231 |
+
}
|
232 |
+
|
233 |
+
/* 滚动条样式 */
|
234 |
+
.cm-scroller::-webkit-scrollbar {
|
235 |
+
height: 10px !important;
|
236 |
+
width: 10px !important;
|
237 |
+
background-color: #f6f8fa !important;
|
238 |
+
}
|
239 |
+
|
240 |
+
.dark .cm-scroller::-webkit-scrollbar {
|
241 |
+
background-color: #282c34 !important;
|
242 |
+
}
|
243 |
+
|
244 |
+
.cm-scroller::-webkit-scrollbar-track {
|
245 |
+
box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.1) !important;
|
246 |
+
border-radius: 10px !important;
|
247 |
+
background-color: #f6f8fa !important;
|
248 |
+
}
|
249 |
+
|
250 |
+
.dark .cm-scroller::-webkit-scrollbar-track {
|
251 |
+
box-shadow: inset 0 0 6px rgba(0, 0, 0, .3) !important;
|
252 |
+
background-color: #282c34 !important;
|
253 |
+
}
|
254 |
+
|
255 |
+
.cm-scroller::-webkit-scrollbar-thumb {
|
256 |
+
border-radius: 10px !important;
|
257 |
+
box-shadow: inset 0 0 6px rgba(0, 0, 0, .2) !important;
|
258 |
+
background-color: #d1d5da !important;
|
259 |
+
}
|
260 |
+
|
261 |
+
.dark .cm-scroller::-webkit-scrollbar-thumb {
|
262 |
+
box-shadow: inset 0 0 6px rgba(0, 0, 0, .5) !important;
|
263 |
+
background-color: #3e4451 !important;
|
264 |
+
}
|
265 |
+
|
266 |
+
/* 行号栏样式 */
|
267 |
+
.cm-gutters {
|
268 |
+
background: #f6f8fa !important;
|
269 |
+
border-right: 1px solid #d1d5da !important;
|
270 |
+
color: #586069 !important;
|
271 |
+
padding-right: 10px !important;
|
272 |
+
font-family: "Dank Mono";
|
273 |
+
}
|
274 |
+
|
275 |
+
.dark .cm-gutters {
|
276 |
+
background: #282c34 !important;
|
277 |
+
border-right: 1px solid #3e4451 !important;
|
278 |
+
color: #495162 !important;
|
279 |
+
}
|
280 |
+
|
281 |
+
/* 当前行高亮 */
|
282 |
+
.cm-activeLine {
|
283 |
+
background: #6699ff0b !important;
|
284 |
+
}
|
285 |
+
|
286 |
+
.cm-gutterElement.cm-activeLineGutter {
|
287 |
+
background-color: #f9d3e3;
|
288 |
+
}
|
289 |
+
|
290 |
+
.dark .cm-gutterElement.cm-activeLineGutter {
|
291 |
+
background-color: #dd7694;
|
292 |
+
}
|
293 |
+
|
294 |
+
/* 添加代码选中样式 */
|
295 |
+
.cm-selectionBackground, .cm-content ::selection {
|
296 |
+
background-color: rgba(122, 129, 255, 0.2) !important;
|
297 |
+
}
|
298 |
+
|
299 |
+
.cm-line.cm-selected {
|
300 |
+
background-color: rgba(122, 129, 255, 0.2) !important;
|
301 |
+
}
|
302 |
+
|
303 |
+
/* 选中时的文本颜色保持原样,确保可读性 */
|
304 |
+
.cm-content ::selection {
|
305 |
+
color: rgba(62, 158, 111, 0.9) !important;
|
306 |
+
}
|
307 |
+
|
308 |
+
.dark .cm-content ::selection {
|
309 |
+
color: rgba(245, 177, 255, 0.9) !important;
|
310 |
+
}
|
311 |
+
|
312 |
+
/* 匹配相同结果时的颜色 */
|
313 |
+
.cm-selectionMatch {
|
314 |
+
background-color: #9c88ff5a !important;
|
315 |
+
}
|
316 |
+
|
317 |
+
/* 当有多行选中时的样式 */
|
318 |
+
.cm-selectionLayer>.cm-selectionBackground {
|
319 |
+
background-color: rgba(122, 129, 255, 0.2) !important;
|
320 |
+
}
|
321 |
+
|
322 |
+
/* 代码块折叠/展开样式添加与修改 */
|
323 |
+
.cm-scroller {
|
324 |
+
background-color: #f6f8fa;
|
325 |
+
}
|
326 |
+
|
327 |
+
#collapsed>.cm-scroller, #expanded>.cm-scroller {
|
328 |
+
padding-bottom: 40px;
|
329 |
+
}
|
330 |
+
|
331 |
+
.dark .cm-scroller {
|
332 |
+
background-color: #282c34;
|
333 |
+
}
|
334 |
+
|
335 |
+
.cm-scroller {
|
336 |
+
overflow: auto !important;
|
337 |
+
}
|
338 |
+
|
339 |
+
.cm-editor {
|
340 |
+
transition: height 1s cubic-bezier(0.4, 0, 0.2, 1);
|
341 |
+
overflow: hidden !important;
|
342 |
+
}
|
343 |
+
|
344 |
+
/* 只给超高的代码块添加最大高度和内边距 */
|
345 |
+
.cm-editor#collapsed {
|
346 |
+
height: 400px;
|
347 |
+
}
|
348 |
+
|
349 |
+
/* .cm-editor#expanded { padding-bottom: 40px; } */
|
350 |
+
.code-expand-btn {
|
351 |
+
position: absolute;
|
352 |
+
bottom: 10px;
|
353 |
+
left: 50%;
|
354 |
+
transform: translateX(-50%);
|
355 |
+
display: flex;
|
356 |
+
justify-content: center;
|
357 |
+
align-items: center;
|
358 |
+
padding: 6px 15px;
|
359 |
+
border-radius: 15px;
|
360 |
+
font-size: 12px;
|
361 |
+
cursor: pointer;
|
362 |
+
border: none;
|
363 |
+
color: #666;
|
364 |
+
background: rgba(255, 255, 255, 0.6);
|
365 |
+
backdrop-filter: blur(8px);
|
366 |
+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
367 |
+
-webkit-backdrop-filter: blur(8px);
|
368 |
+
z-index: 11;
|
369 |
+
transition: all 0.3s ease;
|
370 |
+
}
|
371 |
+
|
372 |
+
.dark .code-expand-btn {
|
373 |
+
background: rgba(45, 45, 45, 0.6);
|
374 |
+
color: #fff;
|
375 |
+
}
|
376 |
+
|
377 |
+
.code-expand-btn:hover {
|
378 |
+
background: rgba(255, 255, 255, 0.8);
|
379 |
+
backdrop-filter: blur(12px);
|
380 |
+
-webkit-backdrop-filter: blur(12px);
|
381 |
+
transform: translateX(-50%) translateY(-2px);
|
382 |
+
box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
|
383 |
+
}
|
384 |
+
|
385 |
+
.dark .code-expand-btn:hover {
|
386 |
+
background: rgba(45, 45, 45, 0.8);
|
387 |
+
}
|
388 |
+
|
389 |
+
.code-expand-btn:active {
|
390 |
+
transform: translateX(-50%) translateY(0);
|
391 |
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
392 |
+
}
|
393 |
+
|
394 |
+
.code-expand-btn::before {
|
395 |
+
content: "⌄";
|
396 |
+
display: inline-block;
|
397 |
+
margin-right: 4px;
|
398 |
+
font-size: 14px;
|
399 |
+
transition: transform 0.3s ease;
|
400 |
+
}
|
401 |
+
|
402 |
+
.code-expand-btn#expanded::before {
|
403 |
+
transform: rotate(180deg);
|
404 |
+
}
|
405 |
+
|
406 |
+
.code-expand-btn::after {
|
407 |
+
content: "展开代码";
|
408 |
+
}
|
409 |
+
|
410 |
+
.code-expand-btn#expanded::after {
|
411 |
+
content: "收起代码";
|
412 |
+
}
|
413 |
+
|
414 |
+
/* 渐变遮罩 */
|
415 |
+
.cm-editor#collapsed::after {
|
416 |
+
content: '';
|
417 |
+
position: absolute;
|
418 |
+
bottom: 0;
|
419 |
+
left: 0;
|
420 |
+
right: 0;
|
421 |
+
height: 100px;
|
422 |
+
background: linear-gradient(transparent 0%, rgba(255, 255, 255, 0.3) 40%, rgba(255, 255, 255, 0.6) 80%, rgba(255, 255, 255, 0.8) 100%);
|
423 |
+
pointer-events: none;
|
424 |
+
opacity: 0;
|
425 |
+
transition: opacity 0.3s ease;
|
426 |
+
z-index: 10;
|
427 |
+
/* 确保遮罩层覆盖到滚动条 */
|
428 |
+
width: calc(100% + 17px);
|
429 |
+
/* 17px是标准滚动条宽度 */
|
430 |
+
}
|
431 |
+
|
432 |
+
.dark .cm-editor#collapsed::after {
|
433 |
+
background: linear-gradient(transparent 0%, rgba(45, 45, 45, 0.3) 40%, rgba(45, 45, 45, 0.6) 80%, rgba(45, 45, 45, 0.8) 100%);
|
434 |
+
}
|
435 |
+
|
436 |
+
/* 只在折叠状态显示渐变遮罩 */
|
437 |
+
.cm-editor#collapsed::after {
|
438 |
+
opacity: 1;
|
439 |
+
}
|
440 |
+
|
441 |
+
/* 隐藏原始的折叠按钮 */
|
442 |
+
div.flex.items-center.gap-0\.5 button.flex.gap-1.items-center:not(.run-code-button) {
|
443 |
+
display: none;
|
444 |
+
}
|