Repository navigation
Expand file tree
/
Copy pathstyle.css
More file actions
465 lines (436 loc) · 12.4 KB
/
Copy pathstyle.css
File metadata and controls
465 lines (436 loc) · 12.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
:root {
color-scheme: light;
--bg: #f5f7fa;
--panel: #ffffff;
--ink: #1f2430;
--ink-2: #5b6472;
--line: #e2e6ee;
--accent: #2563eb;
--accent-ink: #ffffff;
--accent-soft: #eaf1ff;
/* 顶部头图渐变:暗色主题覆盖同名变量,避免多处重复书写 */
--header-grad: linear-gradient(120deg, #1d4ed8, #2563eb 55%, #3b82f6);
--mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, Menlo, monospace;
}
/* 手动暗色主题:html[data-theme="dark"](右上角按钮切换,记忆于 localStorage) */
:root[data-theme="dark"] {
color-scheme: dark;
--bg: #0f1420;
--panel: #171d2b;
--ink: #e6eaf2;
--ink-2: #93a0b4;
--line: #27303f;
--accent: #5b8cff;
--accent-ink: #0b1220;
--accent-soft: #1b2740;
--header-grad: linear-gradient(120deg, #16233f, #1e2f55 55%, #233a66);
}
/* 兜底:未手动指定主题时跟随系统深浅色(变量值与上方 data-theme="dark" 保持一致) */
@media (prefers-color-scheme: dark) {
:root:not([data-theme]) {
color-scheme: dark;
--bg: #0f1420;
--panel: #171d2b;
--ink: #e6eaf2;
--ink-2: #93a0b4;
--line: #27303f;
--accent: #5b8cff;
--accent-ink: #0b1220;
--accent-soft: #1b2740;
--header-grad: linear-gradient(120deg, #16233f, #1e2f55 55%, #233a66);
}
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
background: var(--bg);
color: var(--ink);
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Roboto, sans-serif;
font-size: 14px;
line-height: 1.5;
min-height: 100vh;
}
/* 文案应用前的防闪烁遮罩:由 index.html <head> 预置脚本加类、app.js 应用语言后移除(1.5s 兜底) */
html.i18n-pending body { visibility: hidden; }
/* ---------- header ---------- */
.app-header {
background: var(--header-grad);
color: #fff;
}
.header-inner {
max-width: 1240px;
margin: 0 auto;
padding: 20px 24px 16px;
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
flex-wrap: wrap;
}
.app-header h1 {
margin: 0;
font-size: 22px;
letter-spacing: .3px;
display: flex;
align-items: center;
gap: 10px;
}
.app-header h1 .brand-logo {
width: 28px;
height: 28px;
border-radius: 6px; /* 与 SVG 自带的圆角一致,避免二次裁切 */
display: block;
flex: none;
box-shadow: 0 0 0 1px rgba(255, 255, 255, .25);
}
.app-header h1 .sub { font-size: 13px; font-weight: 400; opacity: .85; }
.header-badges { display: flex; gap: 8px; flex-wrap: wrap; }
/* 头部三个徽标(仓库 / 主题 / 语言)共用底色、描边与悬停反馈 */
.badge {
background: rgba(255, 255, 255, .16);
border: 1px solid rgba(255, 255, 255, .28);
border-radius: 999px;
padding: 3px 10px;
color: #fff;
font-size: 12px;
transition: background-color .15s ease, border-color .15s ease;
}
.badge:hover,
.badge:focus-visible {
background: rgba(255, 255, 255, .3);
border-color: rgba(255, 255, 255, .55);
}
.badge-repo {
display: inline-flex;
align-items: center;
justify-content: center;
padding: 6px;
width: 24px;
height: 24px;
box-sizing: border-box;
}
.badge-repo .gh-mark {
width: 14px;
height: 14px;
fill: currentColor;
}
/* 仓库徽标同时作为跳转链接 */
a.badge-repo {
text-decoration: none;
}
a.badge-repo:hover,
a.badge-repo:focus-visible {
text-decoration: underline;
}
/* 亮 / 暗主题切换按钮(与仓库徽标同款圆钮) */
button.badge-theme {
display: inline-flex;
align-items: center;
justify-content: center;
width: 24px;
height: 24px;
padding: 0;
cursor: pointer;
}
.badge-theme svg { width: 14px; height: 14px; fill: currentColor; }
/* 亮色显示“月亮”(点击进入暗色);暗色显示“太阳”(点击回到亮色) */
.theme-icon-sun { display: none; }
html[data-theme="dark"] .theme-icon-moon { display: none; }
html[data-theme="dark"] .theme-icon-sun { display: block; }
/* 界面语言切换(中 / 英):位于主题按钮与仓库徽标之间 */
button.badge-lang {
display: inline-flex;
align-items: center;
gap: 3px;
height: 24px;
padding: 0 9px;
font-family: inherit;
font-size: 11px;
line-height: 1;
letter-spacing: .3px;
cursor: pointer;
}
.badge-lang .lang-opt { opacity: .6; }
.badge-lang .lang-sep { opacity: .45; }
html[data-lang="zh"] .badge-lang .lang-opt[data-lang="zh"],
html[data-lang="en"] .badge-lang .lang-opt[data-lang="en"] { opacity: 1; font-weight: 700; }
.chip {
font-family: var(--mono);
}
/* ---------- layout ---------- */
.app-main { max-width: 1240px; margin: 0 auto; padding: 16px 24px 24px; }
.toolbar {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 14px 18px;
background: var(--panel);
border: 1px solid var(--line);
border-radius: 12px;
padding: 10px 14px;
margin-bottom: 14px;
}
.indent-seg { display: inline-flex; align-items: center; gap: 6px; }
.seg-label { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.chip {
border: 1px solid var(--line);
background: var(--bg);
color: var(--ink-2);
border-radius: 999px;
font-size: 12px;
padding: 4px 12px;
cursor: pointer;
transition: all .12s ease;
}
.chip:hover { color: var(--ink); border-color: var(--accent); }
.chip.active {
background: var(--accent);
border-color: var(--accent);
color: var(--accent-ink);
font-weight: 600;
}
.chip.active:hover { color: var(--accent-ink); filter: brightness(1.06); }
.btn {
border: 1px solid var(--line);
background: var(--panel);
color: var(--ink);
border-radius: 8px;
font-size: 13px;
padding: 6px 14px;
cursor: pointer;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn-primary:hover { color: var(--accent-ink); filter: brightness(1.07); }
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 7px; }
.btn-ghost { color: var(--ink-2); }
/* ---------- columns ---------- */
.columns {
display: grid;
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
gap: 14px;
align-items: stretch;
}
.panel {
background: var(--panel);
border: 1px solid var(--line);
border-radius: 12px;
display: flex;
flex-direction: column;
min-height: 420px;
overflow: hidden;
}
.panel-head {
display: flex;
align-items: center;
gap: 10px;
padding: 10px 14px;
border-bottom: 1px solid var(--line);
flex-wrap: wrap;
}
.panel-head h2 { margin: 0; font-size: 14px; font-weight: 700; }
.head-spacer { flex: 1; }
.hint { color: var(--ink-2); font-size: 12px; font-weight: 400; }
/* 面板头内的弹性分配:
提示文字可收缩并以省略号截断,标题 / 按钮 / 历史按钮 / “预览中”角标不参与收缩。
否则角标一出现(悬停历史条目时)就会挤到换行,把行尾的历史下拉甩到第二行。 */
.panel-head .hint {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.panel-head h2,
.panel-head .btn,
.panel-head .hist-wrap { flex: 0 0 auto; }
.editor-wrap { flex: 1; display: flex; min-height: 0; }
#editor {
flex: 1;
resize: none;
border: 0;
outline: none;
background: transparent;
color: var(--ink);
font-family: var(--mono);
font-size: 13.5px;
line-height: 1.6;
padding: 14px;
white-space: pre;
tab-size: 4;
min-height: 380px;
}
#editor::placeholder { color: var(--ink-2); opacity: .6; }
.editor-foot {
padding: 6px 14px;
border-top: 1px solid var(--line);
color: var(--ink-2);
font-size: 12px;
}
/* ---------- preview tree ---------- */
.tree-scroll {
flex: 1;
overflow: auto;
min-height: 300px;
background: var(--bg);
margin: 10px;
border: 1px solid var(--line);
border-radius: 9px;
}
.tree-rows {
display: block;
width: max-content;
min-width: 100%;
padding: 8px 4px;
font-family: var(--mono);
font-size: 13.5px;
line-height: 1.75;
color: var(--ink);
}
.trow { display: block; white-space: pre; width: max-content; border-radius: 4px; }
.trow:hover { background: var(--accent-soft); }
.tname { cursor: default; border-radius: 3px; }
.tname.folder { cursor: pointer; }
.tname.folder:hover { text-decoration: underline dotted; }
/* 键盘焦点(节点带 tabindex,可用 Tab + Enter/空格 折叠):内描边 + 底纹 */
.tname.folder:focus-visible { background: var(--accent-soft); outline: 1px solid var(--accent); outline-offset: -1px; }
.tname.collapsed { color: var(--accent); opacity: .75; font-style: italic; }
.empty-tip { padding: 60px 20px; text-align: center; color: var(--ink-2); }
.empty-tip p { margin: 4px 0; }
.muted { opacity: .7; }
/* ---------- docs ---------- */
.docs {
margin-top: 16px;
background: var(--panel);
border: 1px solid var(--line);
border-radius: 12px;
padding: 6px 16px;
}
.docs summary {
cursor: pointer;
font-weight: 700;
font-size: 14px;
padding: 10px 0;
user-select: none;
}
.docs-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
gap: 8px 26px;
padding: 4px 0 14px;
}
.docs h3 { margin: 6px 0 4px; font-size: 13px; color: var(--accent); }
.docs ul, .docs ol { margin: 4px 0; padding-left: 20px; }
.docs li { margin: 3px 0; color: var(--ink-2); }
.docs code {
font-family: var(--mono);
background: var(--bg);
border: 1px solid var(--line);
border-radius: 4px;
padding: 0 4px;
font-size: 12px;
}
.app-footer {
text-align: center;
color: var(--ink-2);
font-size: 12px;
padding: 18px 16px 30px;
}
/* ---------- 历史输入下拉 ---------- */
.hist-wrap { position: relative; display: inline-flex; }
.hist-btn { display: inline-flex; align-items: center; gap: 5px; }
.hist-btn .hist-mark,
.hist-btn .hist-caret { width: 13px; height: 13px; fill: currentColor; opacity: .8; }
.hist-caret { transition: transform .15s ease; }
.hist-btn[aria-expanded="true"] .hist-caret { transform: rotate(180deg); }
.hist-menu {
position: absolute;
top: calc(100% + 6px);
right: 0;
z-index: 30;
/* 宽度随最长条目自适应(内容短就窄),上限比原来收窄,窄屏不溢出 */
width: max-content;
min-width: 216px;
max-width: min(384px, calc(100vw - 28px));
max-height: min(360px, 62vh);
overflow: auto;
background: var(--panel);
border: 1px solid var(--line);
border-radius: 10px;
box-shadow: 0 14px 34px rgba(15, 23, 42, .22);
padding: 6px;
}
.hist-menu[hidden] { display: none; }
.hist-head {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
padding: 4px 8px 6px;
font-size: 12px;
color: var(--ink-2);
}
.hist-clear {
border: 0;
background: none;
color: var(--ink-2);
font-family: inherit;
font-size: 12px;
padding: 2px 6px;
border-radius: 6px;
cursor: pointer;
}
.hist-clear:hover { color: var(--accent); background: var(--accent-soft); }
.hist-list { list-style: none; margin: 0; padding: 0; }
.hist-item {
display: flex;
align-items: center;
gap: 8px;
padding: 6px 8px;
border-radius: 7px;
cursor: pointer;
}
.hist-item:hover,
.hist-item:focus-visible { background: var(--accent-soft); outline: none; }
.hist-sum {
flex: 1 1 auto;
min-width: 0;
font-family: var(--mono);
font-size: 12.5px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
/* 该条历史写入时的缩进样式角标 */
.hist-unit {
flex: 0 0 auto;
padding: 1px 7px;
border: 1px solid var(--line);
border-radius: 999px;
font-family: var(--mono);
font-size: 10.5px;
line-height: 1.5;
color: var(--ink-2);
white-space: nowrap;
}
.hist-item:hover .hist-unit,
.hist-item:focus-visible .hist-unit { border-color: var(--accent); color: var(--accent); }
.hist-meta { flex: 0 0 auto; font-size: 11px; color: var(--ink-2); }
.hist-empty { padding: 16px 10px; text-align: center; color: var(--ink-2); font-size: 12.5px; }
/* ---------- 悬停历史条目时的预览状态反馈 ---------- */
/* 两侧面板描边高亮,明确当前看到的是历史预览而非已保存内容 */
.panel.is-preview {
border-color: var(--accent);
box-shadow: 0 0 0 3px var(--accent-soft);
}
.panel.is-preview .panel-head { border-bottom-color: var(--accent); }
/* ---------- responsive ---------- */
@media (max-width: 900px) {
.columns { grid-template-columns: 1fr; }
.editor-wrap #editor { min-height: 260px; }
.tree-scroll { max-height: 480px; }
}
/* 窄屏:面板头横向空间紧张,压缩按钮内边距,避免把历史下拉挤到第二行 */
@media (max-width: 560px) {
.panel-head .btn { padding: 4px 8px; }
}