finch-shell-go 0.0.0-stage → 0.1.1

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.
@@ -0,0 +1,1357 @@
1
+ /* 终端面板:一个终端区、一条 tab 栏,没有状态栏。配色全部走 --yicode-* 变量。 *//* Finch 小程序通用基础样式:重置、控件、弹框、滚动条。
2
+ 用法:面板 CSS 先 @import 这一份,再写自己的业务样式。
3
+
4
+ 主题变量全部在 variable.css 里(官方 1:1 映射 + 我们的语义层),这里不再定义任何颜色,
5
+ 业务样式用 --yicode-bg / --yicode-text / --yicode-border 这一层即可,不要直接写 var(--finch-*)。 *//* Finch 主题变量的唯一入口。三层结构,顺序不能颠倒:
6
+
7
+ 一、官方变量 1:1 同名映射(31 个,全量,一个不漏)
8
+ 官方 --finch-bg-root → 我们的 --yicode-bg-root
9
+ 右侧兜底值 = 从运行中的面板读出来的真实值(见下表),不是猜的。
10
+ 暗色那套在 @media (prefers-color-scheme: dark) 里覆盖同名变量。
11
+
12
+ 二、我们自己的语义变量
13
+ 在官方映射之上再缩一层(--yicode-bg / --yicode-text / --yicode-gap …),
14
+ 业务样式只用这一层,换官方变量或换兜底值都不用改业务代码。
15
+
16
+ 三、业务样式
17
+ 面板里禁止直接写 var(--finch-*),也禁止硬编码色值。
18
+
19
+ 真实值来源:shellGo 启动时把 getComputedStyle 读到的 --finch-* 全量报给宿主,
20
+ 日志里 `阶段: palette` 那条就是。亮色 / 暗色各录一次,换皮肤后重录即可。 */
21
+
22
+ /* ── 一、官方变量 1:1 映射 · 亮色 ─────────────────────────────── */
23
+ :root {
24
+ /* 背景 */
25
+ --yicode-bg-root: var(--finch-bg-root, #fff);
26
+ --yicode-bg-main: var(--finch-bg-main, #fff);
27
+ --yicode-bg-elevated: var(--finch-bg-elevated, #fafafa);
28
+ --yicode-bg-hover: var(--finch-bg-hover, #cdcdcdb3);
29
+ --yicode-bg-active: var(--finch-bg-active, #d2d2d2e6);
30
+
31
+ /* 文字 */
32
+ --yicode-text-primary: var(--finch-text-primary, #1f2933);
33
+ --yicode-text-secondary: var(--finch-text-secondary, #5d6774);
34
+ --yicode-text-tertiary: var(--finch-text-tertiary, #8d96a0);
35
+
36
+ /* 强调色:官方给的是 color-mix 表达式,兜底写成它的等值纯色 */
37
+ --yicode-accent: var(--finch-accent, #0dc169);
38
+ --yicode-accent-hover: var(--finch-accent-hover, #2ac87b);
39
+ --yicode-accent-dim: var(--finch-accent-dim, #edf0ef);
40
+
41
+ /* 边框:官方带透明度,能叠在任何底色上 */
42
+ --yicode-border: var(--finch-border, #23312d1f);
43
+ --yicode-border-subtle: var(--finch-border-subtle, #23312d0f);
44
+ --yicode-border-strong: var(--finch-border-strong, #23312d33);
45
+
46
+ /* 状态色:只表达结果,不当装饰 */
47
+ --yicode-positive: var(--finch-positive, #6f9f55);
48
+ --yicode-warning: var(--finch-warning, #ff8a4c);
49
+ --yicode-danger: var(--finch-danger, #c46a5e);
50
+ --yicode-info: var(--finch-info, #5fafc9);
51
+
52
+ /* 圆角与阴影 */
53
+ --yicode-radius-sm: var(--finch-radius-sm, 6px);
54
+ --yicode-radius-md: var(--finch-radius-md, 10px);
55
+ --yicode-radius-lg: var(--finch-radius-lg, 14px);
56
+ --yicode-radius-full: var(--finch-radius-full, 999px);
57
+ --yicode-shadow-sm: var(--finch-shadow-sm, 0 10px 24px #121c2612);
58
+ --yicode-shadow-md: var(--finch-shadow-md, 0 18px 42px #121c261c);
59
+
60
+ /* 字体与字号 */
61
+ --yicode-font-body: var(--finch-font-body, "Inter", -apple-system, "Segoe UI", system-ui, sans-serif);
62
+ --yicode-font-mono: var(--finch-font-mono, "Cascadia Code", ui-monospace, "Consolas", "SF Mono");
63
+ --yicode-message-font-size: var(--finch-message-font-size, 16px);
64
+ --yicode-message-line-height: var(--finch-message-line-height, 27px);
65
+ --yicode-code-font-size: var(--finch-code-font-size, 14px);
66
+ --yicode-code-line-height: var(--finch-code-line-height, 22px);
67
+
68
+ /* 当前主题:要按浅深分支写样式时用它,别自己猜 */
69
+ --yicode-theme-mode: var(--finch-theme-mode, light);
70
+ }
71
+
72
+ /* ── 一、官方变量 1:1 映射 · 暗色兜底 ─────────────────────────── */
73
+ /* Finch 注入时以注入值为准,这里只在「浏览器直开 / 旧版本没注入」时生效。 */
74
+ @media (prefers-color-scheme: dark) {
75
+ :root {
76
+ --yicode-bg-root: var(--finch-bg-root, #191919);
77
+ --yicode-bg-main: var(--finch-bg-main, #191919);
78
+ --yicode-bg-elevated: var(--finch-bg-elevated, #222);
79
+ --yicode-bg-hover: var(--finch-bg-hover, #3c3c3cb3);
80
+ --yicode-bg-active: var(--finch-bg-active, #505050b3);
81
+
82
+ --yicode-text-primary: var(--finch-text-primary, #e6eaf0);
83
+ --yicode-text-secondary: var(--finch-text-secondary, #9ba6b2);
84
+ --yicode-text-tertiary: var(--finch-text-tertiary, #7d8794);
85
+
86
+ --yicode-accent: var(--finch-accent, #269d71);
87
+ --yicode-accent-hover: var(--finch-accent-hover, #45ab85);
88
+ --yicode-accent-dim: var(--finch-accent-dim, #1b2022);
89
+
90
+ --yicode-border: var(--finch-border, #ffffff1f);
91
+ --yicode-border-subtle: var(--finch-border-subtle, #ffffff09);
92
+ --yicode-border-strong: var(--finch-border-strong, #fff3);
93
+
94
+ --yicode-positive: var(--finch-positive, #7fb8a4);
95
+ --yicode-warning: var(--finch-warning, #b57e59);
96
+ --yicode-danger: var(--finch-danger, #c97b72);
97
+ --yicode-info: var(--finch-info, #7ba3bf);
98
+
99
+ --yicode-shadow-sm: var(--finch-shadow-sm, 0 2px 8px #0003);
100
+ --yicode-shadow-md: var(--finch-shadow-md, 0 8px 24px #00000047);
101
+
102
+ --yicode-theme-mode: var(--finch-theme-mode, dark);
103
+ }
104
+ }
105
+
106
+ /* ── 二、我们自己的语义变量 ───────────────────────────────────── */
107
+ /* 业务样式只用这一层。改官方映射或兜底值,这里不用动。 */
108
+ :root {
109
+ --yicode-bg: var(--yicode-bg-root);
110
+ --yicode-bg-soft: var(--yicode-bg-elevated);
111
+ /* 面板底色:官方不暴露侧栏变量,用 main 与 elevated 按 40% 混合,
112
+ 深色正好落在 #1d1d1d、浅色 #fcfcfc,跟 Finch 左侧栏一致,终端也用它 */
113
+ --yicode-bg-panel: color-mix(in srgb, var(--yicode-bg-elevated) 40%, var(--yicode-bg-main));
114
+ /* 不透明版:把半透明层压在不透明的 main 上,得到「看到的效果一样、但挡得住下面文字」的实底色。
115
+ 浮在内容之上的元素必须用它,否则底下的文字会透上来(tab 上的三点按钮、更多按钮就踩过这个坑)。 */
116
+ --yicode-bg-panel-solid: linear-gradient(var(--yicode-bg-panel), var(--yicode-bg-panel)) var(--yicode-bg-main);
117
+ --yicode-bg-elevated-solid: linear-gradient(var(--yicode-bg-elevated), var(--yicode-bg-elevated)), linear-gradient(var(--yicode-bg-panel), var(--yicode-bg-panel)) var(--yicode-bg-main);
118
+ --yicode-bg-hover-solid: linear-gradient(var(--yicode-bg-hover), var(--yicode-bg-hover)), linear-gradient(var(--yicode-bg-elevated), var(--yicode-bg-elevated)), linear-gradient(var(--yicode-bg-panel), var(--yicode-bg-panel)) var(--yicode-bg-main);
119
+ --yicode-text: var(--yicode-text-primary);
120
+ --yicode-muted: var(--yicode-text-secondary);
121
+ --yicode-faint: var(--yicode-text-tertiary);
122
+ --yicode-radius: var(--yicode-radius-md);
123
+ --yicode-mono: var(--yicode-font-mono);
124
+
125
+ /* 间距:名字就是像素值,只走这几个档,业务样式里不写零散数字 */
126
+ --yicode-space-1: 1px;
127
+ --yicode-space-2: 2px;
128
+ --yicode-space-3: 3px;
129
+ --yicode-space-4: 4px;
130
+ --yicode-space-6: 6px;
131
+ --yicode-space-8: 8px;
132
+ --yicode-space-10: 10px;
133
+ --yicode-space-12: 12px;
134
+ --yicode-space-16: 16px;
135
+ --yicode-space-24: 24px;
136
+ --yicode-space-62: 62px;
137
+ /* 面板里所有纵向间隙只用一个值,免得一块紧一块松 */
138
+ --yicode-gap: var(--yicode-space-12);
139
+
140
+ /* 字号:同样按像素值命名 */
141
+ --yicode-font-size-11: 11px;
142
+ --yicode-font-size-12: 12px;
143
+ --yicode-font-size-13: 13px;
144
+ --yicode-font-size-14: 14px;
145
+ --yicode-font-size-15: 15px;
146
+ --yicode-font-size-16: 16px;
147
+ --yicode-line-height-tight: 1.4;
148
+ --yicode-line-height: 1.45;
149
+
150
+ /* 控件尺寸 */
151
+ --yicode-control-h: 26px;
152
+ --yicode-control-h-sm: 20px;
153
+ /* 固定尺寸:点、滚动条、文本域高度、列表高度上限,名字就是像素值 */
154
+ --yicode-size-6: 6px;
155
+ --yicode-size-8: 8px;
156
+ --yicode-size-7: 7px;
157
+ --yicode-size-10: 10px;
158
+ --yicode-size-12: 12px;
159
+ --yicode-size-14: 14px;
160
+ --yicode-size-16: 16px;
161
+ --yicode-size-18: 18px;
162
+ --yicode-size-20: 20px;
163
+ --yicode-size-22: 22px;
164
+ --yicode-size-24: 24px;
165
+ --yicode-size-28: 28px;
166
+ --yicode-size-30: 30px;
167
+ --yicode-size-32: 32px;
168
+ --yicode-size-40: 40px;
169
+ --yicode-size-44: 44px;
170
+ --yicode-size-56: 56px;
171
+ --yicode-size-84: 84px;
172
+ --yicode-size-96: 96px;
173
+ --yicode-size-125: 125px;
174
+ --yicode-size-140: 140px;
175
+ --yicode-size-180: 180px;
176
+ --yicode-size-200: 200px;
177
+ --yicode-size-220: 220px;
178
+ --yicode-size-240: 240px;
179
+ --yicode-size-300: 300px;
180
+ /* 弹框与窄栏的断点、宽度上限 */
181
+ --yicode-size-360: 360px;
182
+ --yicode-size-420: 420px;
183
+ --yicode-size-560: 560px;
184
+ /* 描边、聚焦环都只用这几个线宽 */
185
+ --yicode-border-width: 1px;
186
+ --yicode-border-width-thick: 2px;
187
+ --yicode-focus-width: 1px;
188
+
189
+ /* 装饰:遮罩、弹框阴影这类不跟主题走的固定层 */
190
+ --yicode-mask-bg: rgb(0 0 0 / 55%);
191
+ --yicode-mask-blur: 3px;
192
+ --yicode-shadow-dialog: 0 18px 48px rgb(0 0 0 / 45%);
193
+ --yicode-shadow-thumb: inset 0 0 0 1px var(--yicode-border-subtle);
194
+ /* 反色文字:强调色底上的字 */
195
+ --yicode-on-accent: #fff;
196
+ /* 圆角补充档:控件用 xs,标签用 2xs */
197
+ --yicode-radius-2xs: 3px;
198
+ --yicode-radius-xs: 4px;
199
+ --yicode-radius-control: 8px;
200
+ /* 正圆:状态点这类,用百分比而不是固定值,宽高不等时也是圆的 */
201
+ --yicode-radius-circle: 50%;
202
+ /* 层级 */
203
+ --yicode-z-mask: 10;
204
+ --yicode-z-popover: 20;
205
+ }
206
+ /* 公共滚动条:与 Finch 自己的观感一致。
207
+ 用法:给滚动容器加 class="yicode-scroll",再在页面里调 wireScrollbars()。
208
+
209
+ 三条要点(这是与官方对齐的关键,不是随手写的数值):
210
+ 1. 静止时滑块透明,悬停或正在滚动才显形;几何始终保留,所以不会因为出现/消失而抖一下宽度。
211
+ 2. 8px 轨道、滑块带 2px 透明边框并按 padding-box 裁切,视觉上是一条细圆条,不是一整块灰。
212
+ 3. xterm 有两种滚动条实现:原生 viewport 的,和它自己画在 .xterm-scrollable-element 里的。
213
+ 两种都要管,否则终端里会出现又粗又亮的默认条。 */
214
+
215
+ .yicode-scroll,
216
+ .yicode-scroll .xterm-viewport {
217
+ --yicode-scrollbar-thumb: transparent;
218
+ /* 预留滚动条宽度,出现时内容不横移 */
219
+ scrollbar-gutter: stable;
220
+ }
221
+
222
+ .yicode-scroll:hover,
223
+ .yicode-scroll.is-scrolling,
224
+ .yicode-scroll .xterm-viewport:hover,
225
+ .yicode-scroll .xterm-viewport.is-scrolling {
226
+ --yicode-scrollbar-thumb: color-mix(in srgb, var(--yicode-text-tertiary) 55%, transparent);
227
+ }
228
+
229
+ @supports selector(::-webkit-scrollbar) {
230
+ .yicode-scroll::-webkit-scrollbar,
231
+ .yicode-scroll .xterm-viewport::-webkit-scrollbar {
232
+ width: 8px;
233
+ height: 8px;
234
+ }
235
+
236
+ .yicode-scroll::-webkit-scrollbar-track,
237
+ .yicode-scroll::-webkit-scrollbar-corner,
238
+ .yicode-scroll .xterm-viewport::-webkit-scrollbar-track,
239
+ .yicode-scroll .xterm-viewport::-webkit-scrollbar-corner {
240
+ background: transparent;
241
+ }
242
+
243
+ .yicode-scroll::-webkit-scrollbar-thumb,
244
+ .yicode-scroll .xterm-viewport::-webkit-scrollbar-thumb {
245
+ border: 2px solid transparent;
246
+ border-radius: var(--yicode-radius-full);
247
+ background-color: var(--yicode-scrollbar-thumb);
248
+ background-clip: padding-box;
249
+ transition: background-color 160ms ease;
250
+ }
251
+
252
+ /* 上下箭头一律不显示,但保留零尺寸占位 */
253
+ .yicode-scroll::-webkit-scrollbar-button,
254
+ .yicode-scroll .xterm-viewport::-webkit-scrollbar-button {
255
+ display: none;
256
+ width: 0;
257
+ height: 0;
258
+ }
259
+ }
260
+
261
+ /* 不支持 ::-webkit-scrollbar 的浏览器(Firefox)退到标准属性 */
262
+ @supports not selector(::-webkit-scrollbar) {
263
+ .yicode-scroll,
264
+ .yicode-scroll .xterm-viewport {
265
+ scrollbar-width: thin;
266
+ scrollbar-color: var(--yicode-scrollbar-thumb) transparent;
267
+ }
268
+ }
269
+
270
+ /* xterm 自绘滚动条:默认完全隐藏,滚动时淡入 */
271
+ .yicode-scroll .xterm-scrollable-element > .scrollbar {
272
+ width: 8px !important;
273
+ margin: 3px -3px 3px 0;
274
+ border-radius: var(--yicode-radius-full);
275
+ background: transparent !important;
276
+ opacity: 0 !important;
277
+ transition: opacity 160ms ease !important;
278
+ }
279
+
280
+ .yicode-scroll.is-scrolling .xterm-scrollable-element > .scrollbar {
281
+ opacity: 0.72 !important;
282
+ }
283
+
284
+ .yicode-scroll.is-scrolling .xterm-scrollable-element > .scrollbar:hover {
285
+ opacity: 1 !important;
286
+ }
287
+
288
+ .yicode-scroll .xterm-scrollable-element > .scrollbar > div {
289
+ border: 0 !important;
290
+ border-radius: var(--yicode-radius-full) !important;
291
+ background: var(--yicode-scrollbar-thumb) !important;
292
+ }
293
+
294
+ /* 预览标尺那根细线在面板里是噪声,直接藏掉 */
295
+ .yicode-scroll .xterm-decoration-overview-ruler {
296
+ display: none !important;
297
+ }
298
+
299
+ @media (prefers-reduced-motion: reduce) {
300
+ .yicode-scroll::-webkit-scrollbar-thumb,
301
+ .yicode-scroll .xterm-viewport::-webkit-scrollbar-thumb,
302
+ .yicode-scroll .xterm-scrollable-element > .scrollbar {
303
+ transition: none !important;
304
+ }
305
+ }
306
+
307
+ * {
308
+ box-sizing: border-box;
309
+ }
310
+ body {
311
+ margin: 0;
312
+ height: 100vh;
313
+ display: flex;
314
+ flex-direction: column;
315
+ background: var(--yicode-bg);
316
+ color: var(--yicode-text);
317
+ font: var(--yicode-message-font-size) / var(--yicode-message-line-height) var(--yicode-font-body);
318
+ -webkit-font-smoothing: antialiased;
319
+ }
320
+ button {
321
+ height: var(--yicode-control-h);
322
+ padding: 0 var(--yicode-space-10);
323
+ font: inherit;
324
+ /* 字号跟表单控件对齐;font 简写会把字号重置,所以写在它后面。 */
325
+ font-size: var(--yicode-font-size-12);
326
+ border-radius: var(--yicode-radius-control);
327
+ border: var(--yicode-border-width) solid var(--yicode-border);
328
+ /* 次要按钮用 elevated 底色,否则跟弹框背景粘成一片。 */
329
+ background: var(--yicode-bg-soft);
330
+ color: var(--yicode-text);
331
+ cursor: pointer;
332
+ /* 窄栏下按钮绝不能自己折成两行,宁可整组换行。 */
333
+ white-space: nowrap;
334
+ }
335
+ button:hover {
336
+ background: var(--yicode-bg-hover);
337
+ }
338
+ button.primary {
339
+ background: var(--yicode-accent);
340
+ border-color: var(--yicode-accent);
341
+ color: var(--yicode-on-accent);
342
+ }
343
+ button.primary:hover {
344
+ filter: brightness(1.06);
345
+ }
346
+ button.danger {
347
+ color: var(--yicode-danger);
348
+ border-color: color-mix(in srgb, var(--yicode-danger) 40%, var(--yicode-border));
349
+ }
350
+ button.ghost {
351
+ background: transparent;
352
+ }
353
+ .link-accent {
354
+ color: var(--yicode-accent);
355
+ }
356
+ .link-muted {
357
+ color: var(--yicode-muted);
358
+ }
359
+ .link-danger {
360
+ color: var(--yicode-danger);
361
+ }
362
+ input,
363
+ select,
364
+ textarea {
365
+ width: 100%;
366
+ font: inherit;
367
+ font-size: var(--yicode-font-size-12);
368
+ color: var(--yicode-text);
369
+ background: var(--yicode-bg-soft);
370
+ border: var(--yicode-border-width) solid var(--yicode-border);
371
+ border-radius: var(--yicode-radius-control);
372
+ padding: 0 var(--yicode-space-8);
373
+ }
374
+ input,
375
+ select {
376
+ height: var(--yicode-control-h);
377
+ }
378
+ textarea {
379
+ min-height: var(--yicode-size-56);
380
+ padding: var(--yicode-space-6) var(--yicode-space-8);
381
+ resize: vertical;
382
+ font-family: var(--yicode-mono);
383
+ font-size: var(--yicode-font-size-12);
384
+ }
385
+ label {
386
+ display: block;
387
+ font-size: var(--yicode-font-size-12);
388
+ color: var(--yicode-muted);
389
+ margin-bottom: var(--yicode-space-3);
390
+ }
391
+ .label-row {
392
+ display: flex;
393
+ align-items: baseline;
394
+ gap: var(--yicode-space-8);
395
+ margin-bottom: var(--yicode-space-3);
396
+ }
397
+ .label-row label {
398
+ flex: 0 0 auto;
399
+ margin-bottom: 0;
400
+ }
401
+ /* 提示靠右;栏宽不够时截断,完整文字在悬停提示里。 */
402
+ .aside {
403
+ flex: 1 1 auto;
404
+ min-width: 0;
405
+ text-align: right;
406
+ color: var(--yicode-faint);
407
+ font-size: var(--yicode-font-size-11);
408
+ white-space: nowrap;
409
+ overflow: hidden;
410
+ text-overflow: ellipsis;
411
+ }
412
+ .hint {
413
+ color: var(--yicode-faint);
414
+ font-size: var(--yicode-font-size-11);
415
+ margin-top: var(--yicode-space-3);
416
+ }
417
+ .error {
418
+ color: var(--yicode-danger);
419
+ font-size: var(--yicode-font-size-12);
420
+ margin-top: var(--yicode-space-10);
421
+ white-space: pre-wrap;
422
+ }
423
+ /* 表单按行分组:一行放几个字段由这一行自己决定,比整体两列好对齐。 */
424
+ .grid {
425
+ display: grid;
426
+ gap: var(--yicode-space-10);
427
+ }
428
+ .row {
429
+ display: grid;
430
+ gap: var(--yicode-space-10);
431
+ }
432
+ .row.two {
433
+ grid-template-columns: 1fr 1fr;
434
+ }
435
+ .row.three {
436
+ grid-template-columns: 1.6fr var(--yicode-size-84) 1fr;
437
+ }
438
+ /* 断点用字面值:@media 里不能用 var(),媒体查询在变量解析之前就求值了 */
439
+ @media (max-width: 420px) {
440
+ .row.two,
441
+ .row.three {
442
+ grid-template-columns: 1fr;
443
+ }
444
+ }
445
+ /* 弹框:顶部对齐而不是居中,内容长短不一时位置才不会跳。 */
446
+ .mask {
447
+ position: fixed;
448
+ inset: 0;
449
+ display: flex;
450
+ align-items: flex-start;
451
+ justify-content: center;
452
+ padding: var(--yicode-space-62) var(--yicode-gap) var(--yicode-gap);
453
+ background: var(--yicode-mask-bg);
454
+ backdrop-filter: blur(var(--yicode-mask-blur));
455
+ z-index: var(--yicode-z-mask);
456
+ }
457
+ .mask.center {
458
+ align-items: center;
459
+ padding: var(--yicode-gap);
460
+ }
461
+ .dialog {
462
+ display: flex;
463
+ flex-direction: column;
464
+ width: min(var(--yicode-size-560), 100%);
465
+ max-height: min(80vh, 100%);
466
+ overflow: hidden;
467
+ background: var(--yicode-bg);
468
+ border: var(--yicode-border-width) solid var(--yicode-border);
469
+ border-radius: var(--yicode-radius);
470
+ padding: var(--yicode-space-16);
471
+ box-shadow: var(--yicode-shadow-dialog);
472
+ }
473
+ .dialog.confirm {
474
+ width: min(var(--yicode-size-360), 100%);
475
+ }
476
+ .dialog-head,
477
+ .dialog-actions,
478
+ .dialog > .error {
479
+ flex: 0 0 auto;
480
+ }
481
+ .dialog > .grid {
482
+ flex: 1 1 auto;
483
+ min-height: 0;
484
+ overflow-y: auto;
485
+ }
486
+ .dialog-head {
487
+ display: flex;
488
+ align-items: flex-start;
489
+ justify-content: space-between;
490
+ gap: var(--yicode-gap);
491
+ margin-bottom: var(--yicode-space-12);
492
+ }
493
+ .dialog-head h2 {
494
+ margin: 0;
495
+ font-size: var(--yicode-font-size-15);
496
+ }
497
+ .dialog-close {
498
+ display: flex;
499
+ height: auto;
500
+ padding: 0;
501
+ border: 0;
502
+ background: none;
503
+ color: var(--yicode-faint);
504
+ }
505
+ .dialog-close:hover {
506
+ background: none;
507
+ color: var(--yicode-text);
508
+ }
509
+ .dialog-actions {
510
+ display: flex;
511
+ flex-wrap: wrap;
512
+ justify-content: flex-end;
513
+ gap: var(--yicode-gap);
514
+ margin-top: var(--yicode-gap);
515
+ }
516
+ .dialog-actions .left {
517
+ margin-right: auto;
518
+ }
519
+ .confirm-text {
520
+ margin: 0;
521
+ font-size: var(--yicode-font-size-12);
522
+ line-height: 1.6;
523
+ color: var(--yicode-muted);
524
+ }
525
+ .empty {
526
+ padding: var(--yicode-space-24) var(--yicode-gap);
527
+ color: var(--yicode-faint);
528
+ text-align: center;
529
+ }
530
+ [hidden] {
531
+ display: none !important;
532
+ }
533
+ /* 滚动条按 Finch 自己的观感调:细、圆角、无轨道底色、无上下箭头。 */
534
+ ::-webkit-scrollbar {
535
+ width: var(--yicode-size-10);
536
+ height: var(--yicode-size-10);
537
+ }
538
+ ::-webkit-scrollbar-track {
539
+ background: transparent;
540
+ }
541
+ ::-webkit-scrollbar-thumb {
542
+ border: var(--yicode-border-width-thick) solid transparent;
543
+ border-radius: var(--yicode-radius-full);
544
+ background: color-mix(in srgb, var(--yicode-text) 20%, transparent);
545
+ background-clip: content-box;
546
+ }
547
+ ::-webkit-scrollbar-thumb:hover {
548
+ background: color-mix(in srgb, var(--yicode-text) 32%, transparent);
549
+ background-clip: content-box;
550
+ }
551
+ ::-webkit-scrollbar-corner {
552
+ background: transparent;
553
+ }
554
+ ::-webkit-scrollbar-button {
555
+ display: none;
556
+ height: 0;
557
+ }
558
+ /**
559
+ * Copyright (c) 2014 The xterm.js authors. All rights reserved.
560
+ * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
561
+ * https://github.com/chjj/term.js
562
+ * @license MIT
563
+ *
564
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
565
+ * of this software and associated documentation files (the "Software"), to deal
566
+ * in the Software without restriction, including without limitation the rights
567
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
568
+ * copies of the Software, and to permit persons to whom the Software is
569
+ * furnished to do so, subject to the following conditions:
570
+ *
571
+ * The above copyright notice and this permission notice shall be included in
572
+ * all copies or substantial portions of the Software.
573
+ *
574
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
575
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
576
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
577
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
578
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
579
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
580
+ * THE SOFTWARE.
581
+ *
582
+ * Originally forked from (with the author's permission):
583
+ * Fabrice Bellard's javascript vt100 for jslinux:
584
+ * http://bellard.org/jslinux/
585
+ * Copyright (c) 2011 Fabrice Bellard
586
+ * The original design remains. The terminal itself
587
+ * has been extended to include xterm CSI codes, among
588
+ * other features.
589
+ */
590
+
591
+ /**
592
+ * Default styles for xterm.js
593
+ */
594
+
595
+ .xterm {
596
+ cursor: text;
597
+ position: relative;
598
+ user-select: none;
599
+ -ms-user-select: none;
600
+ -webkit-user-select: none;
601
+ }
602
+
603
+ .xterm.focus,
604
+ .xterm:focus {
605
+ outline: none;
606
+ }
607
+
608
+ .xterm .xterm-helpers {
609
+ position: absolute;
610
+ top: 0;
611
+ /**
612
+ * The z-index of the helpers must be higher than the canvases in order for
613
+ * IMEs to appear on top.
614
+ */
615
+ z-index: 5;
616
+ }
617
+
618
+ .xterm .xterm-helper-textarea {
619
+ padding: 0;
620
+ border: 0;
621
+ margin: 0;
622
+ /* Move textarea out of the screen to the far left, so that the cursor is not visible */
623
+ position: absolute;
624
+ opacity: 0;
625
+ left: -9999em;
626
+ top: 0;
627
+ width: 0;
628
+ height: 0;
629
+ z-index: -5;
630
+ /** Prevent wrapping so the IME appears against the textarea at the correct position */
631
+ white-space: nowrap;
632
+ overflow: hidden;
633
+ resize: none;
634
+ }
635
+
636
+ .xterm .composition-view {
637
+ /* TODO: Composition position got messed up somewhere */
638
+ background: #000;
639
+ color: #FFF;
640
+ display: none;
641
+ position: absolute;
642
+ white-space: nowrap;
643
+ z-index: 1;
644
+ }
645
+
646
+ .xterm .composition-view.active {
647
+ display: block;
648
+ }
649
+
650
+ .xterm .xterm-viewport {
651
+ /* On OS X this is required in order for the scroll bar to appear fully opaque */
652
+ background-color: #000;
653
+ overflow-y: scroll;
654
+ cursor: default;
655
+ position: absolute;
656
+ right: 0;
657
+ left: 0;
658
+ top: 0;
659
+ bottom: 0;
660
+ }
661
+
662
+ .xterm .xterm-screen {
663
+ position: relative;
664
+ }
665
+
666
+ .xterm .xterm-screen canvas {
667
+ position: absolute;
668
+ left: 0;
669
+ top: 0;
670
+ }
671
+
672
+ .xterm-char-measure-element {
673
+ display: inline-block;
674
+ visibility: hidden;
675
+ position: absolute;
676
+ top: 0;
677
+ left: -9999em;
678
+ line-height: normal;
679
+ }
680
+
681
+ .xterm.enable-mouse-events {
682
+ /* When mouse events are enabled (eg. tmux), revert to the standard pointer cursor */
683
+ cursor: default;
684
+ }
685
+
686
+ .xterm.xterm-cursor-pointer,
687
+ .xterm .xterm-cursor-pointer {
688
+ cursor: pointer;
689
+ }
690
+
691
+ .xterm.column-select.focus {
692
+ /* Column selection mode */
693
+ cursor: crosshair;
694
+ }
695
+
696
+ .xterm .xterm-accessibility:not(.debug),
697
+ .xterm .xterm-message {
698
+ position: absolute;
699
+ left: 0;
700
+ top: 0;
701
+ bottom: 0;
702
+ right: 0;
703
+ z-index: 10;
704
+ color: transparent;
705
+ pointer-events: none;
706
+ }
707
+
708
+ .xterm .xterm-accessibility-tree:not(.debug) *::selection {
709
+ color: transparent;
710
+ }
711
+
712
+ .xterm .xterm-accessibility-tree {
713
+ font-family: monospace;
714
+ user-select: text;
715
+ white-space: pre;
716
+ }
717
+
718
+ .xterm .xterm-accessibility-tree > div {
719
+ transform-origin: left;
720
+ width: fit-content;
721
+ }
722
+
723
+ .xterm .live-region {
724
+ position: absolute;
725
+ left: -9999px;
726
+ width: 1px;
727
+ height: 1px;
728
+ overflow: hidden;
729
+ }
730
+
731
+ .xterm-dim {
732
+ /* Dim should not apply to background, so the opacity of the foreground color is applied
733
+ * explicitly in the generated class and reset to 1 here */
734
+ opacity: 1 !important;
735
+ }
736
+
737
+ .xterm-underline-1 { text-decoration: underline; }
738
+ .xterm-underline-2 { text-decoration: double underline; }
739
+ .xterm-underline-3 { text-decoration: wavy underline; }
740
+ .xterm-underline-4 { text-decoration: dotted underline; }
741
+ .xterm-underline-5 { text-decoration: dashed underline; }
742
+
743
+ .xterm-overline {
744
+ text-decoration: overline;
745
+ }
746
+
747
+ .xterm-overline.xterm-underline-1 { text-decoration: overline underline; }
748
+ .xterm-overline.xterm-underline-2 { text-decoration: overline double underline; }
749
+ .xterm-overline.xterm-underline-3 { text-decoration: overline wavy underline; }
750
+ .xterm-overline.xterm-underline-4 { text-decoration: overline dotted underline; }
751
+ .xterm-overline.xterm-underline-5 { text-decoration: overline dashed underline; }
752
+
753
+ .xterm-strikethrough {
754
+ text-decoration: line-through;
755
+ }
756
+
757
+ .xterm-screen .xterm-decoration-container .xterm-decoration {
758
+ z-index: 6;
759
+ position: absolute;
760
+ }
761
+
762
+ .xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer {
763
+ z-index: 7;
764
+ }
765
+
766
+ .xterm-decoration-overview-ruler {
767
+ z-index: 8;
768
+ position: absolute;
769
+ top: 0;
770
+ right: 0;
771
+ pointer-events: none;
772
+ }
773
+
774
+ .xterm-decoration-top {
775
+ z-index: 2;
776
+ position: relative;
777
+ }
778
+
779
+
780
+
781
+ /* Derived from vs/base/browser/ui/scrollbar/media/scrollbar.css */
782
+
783
+ /* xterm.js customization: Override xterm's cursor style */
784
+ .xterm .xterm-scrollable-element > .scrollbar {
785
+ cursor: default;
786
+ }
787
+
788
+ /* Arrows */
789
+ .xterm .xterm-scrollable-element > .scrollbar > .scra {
790
+ cursor: pointer;
791
+ font-size: 11px !important;
792
+ }
793
+
794
+ .xterm .xterm-scrollable-element > .visible {
795
+ opacity: 1;
796
+
797
+ /* Background rule added for IE9 - to allow clicks on dom node */
798
+ background:rgba(0,0,0,0);
799
+
800
+ transition: opacity 100ms linear;
801
+ /* In front of peek view */
802
+ z-index: 11;
803
+ }
804
+ .xterm .xterm-scrollable-element > .invisible {
805
+ opacity: 0;
806
+ pointer-events: none;
807
+ }
808
+ .xterm .xterm-scrollable-element > .invisible.fade {
809
+ transition: opacity 800ms linear;
810
+ }
811
+
812
+ /* Scrollable Content Inset Shadow */
813
+ .xterm .xterm-scrollable-element > .shadow {
814
+ position: absolute;
815
+ display: none;
816
+ }
817
+ .xterm .xterm-scrollable-element > .shadow.top {
818
+ display: block;
819
+ top: 0;
820
+ left: 3px;
821
+ height: 3px;
822
+ width: 100%;
823
+ box-shadow: var(--vscode-scrollbar-shadow, #000) 0 6px 6px -6px inset;
824
+ }
825
+ .xterm .xterm-scrollable-element > .shadow.left {
826
+ display: block;
827
+ top: 3px;
828
+ left: 0;
829
+ height: 100%;
830
+ width: 3px;
831
+ box-shadow: var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset;
832
+ }
833
+ .xterm .xterm-scrollable-element > .shadow.top-left-corner {
834
+ display: block;
835
+ top: 0;
836
+ left: 0;
837
+ height: 3px;
838
+ width: 3px;
839
+ }
840
+ .xterm .xterm-scrollable-element > .shadow.top.left {
841
+ box-shadow: var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset;
842
+ }
843
+ html,
844
+ body {
845
+ height: 100%;
846
+ margin: 0;
847
+ overflow: hidden;
848
+ /* 面板底色与 Finch 左侧栏一致,终端也用它,整块不留色差 */
849
+ background: var(--yicode-bg-panel);
850
+ }
851
+
852
+ /* 只有一行:终端区吃掉整个面板高度,底下不再有状态栏 */
853
+ body {
854
+ display: grid;
855
+ grid-template-rows: minmax(0, 1fr);
856
+ height: 100vh;
857
+ }
858
+
859
+ /* tab 栏:30px 定高、四周零间隙,tab 贴满整行。
860
+ 盒模型统一 border-box,避免描边把高度撑出一两个像素。 */
861
+ .tab-bar {
862
+ flex: 0 0 auto;
863
+ display: flex;
864
+ align-items: center;
865
+ gap: 0;
866
+ box-sizing: border-box;
867
+ position: relative;
868
+ height: var(--yicode-size-30);
869
+ min-height: var(--yicode-size-30);
870
+ max-height: var(--yicode-size-30);
871
+ margin: 0;
872
+ padding: 0;
873
+ /* 与终端区靠底色区分,不再画分隔线:画线会让 tab 的下划线离底边差 1px */
874
+ background: var(--yicode-bg-elevated);
875
+ }
876
+
877
+ .tabs {
878
+ display: flex;
879
+ align-items: center;
880
+ gap: 0;
881
+ flex: 1 1 auto;
882
+ min-width: 0;
883
+ /* 不出滚动条:挤不下的标签直接裁掉,终端列表走左边的数量按钮 */
884
+ overflow: hidden;
885
+ }
886
+
887
+ /* 一个 tab:整块可点,文字单行省略,右侧三点菜单。
888
+ 宽度有下限:再挤也留得住两三个字,认不出是哪个目录的标签等于没有标签。 */
889
+ .tab {
890
+ display: inline-flex;
891
+ align-items: center;
892
+ gap: var(--yicode-space-6);
893
+ box-sizing: border-box;
894
+ /* 三点按钮绝对定位在右端,需要 tab 做定位基准 */
895
+ position: relative;
896
+ /* 不参与压缩:挤不下就溢出,由数量按钮的下拉列表接管,别把标签缩成一两个字符 */
897
+ flex: 0 0 auto;
898
+ min-width: var(--yicode-size-96);
899
+ max-width: var(--yicode-size-180);
900
+ margin: 0;
901
+ /* 左右内缩 10px:再宽标签就显得松散 */
902
+ padding: 0 var(--yicode-space-10);
903
+ /* 高度写死成栏高:不靠 100% 去继承,父级怎么变它都不漂 */
904
+ height: var(--yicode-size-30);
905
+ border: 0;
906
+ border-radius: 0;
907
+ /* 选中线画在 tab 内部(inset),不吃盒模型,底边严丝合缝 */
908
+ box-shadow: inset 0 calc(-1 * var(--yicode-border-width-thick)) 0 transparent;
909
+ color: var(--yicode-muted);
910
+ font-family: var(--yicode-mono);
911
+ font-size: var(--yicode-font-size-14);
912
+ line-height: 1;
913
+ cursor: pointer;
914
+ user-select: none;
915
+ }
916
+
917
+ .tab:hover {
918
+ background: var(--yicode-bg-hover);
919
+ }
920
+
921
+ .tab.active {
922
+ background: var(--yicode-bg-panel);
923
+ box-shadow: inset 0 calc(-1 * var(--yicode-border-width-thick)) 0 var(--yicode-accent);
924
+ color: var(--yicode-text);
925
+ }
926
+
927
+ /* 文字单行省略:宽度不够就截断,绝不换行 */
928
+ .tab-label {
929
+ flex: 1 1 auto;
930
+ min-width: 0;
931
+ overflow: hidden;
932
+ white-space: nowrap;
933
+ text-overflow: ellipsis;
934
+ }
935
+
936
+ /* 会话终端左侧的运行指示:有输出时转圈,静下来就停 */
937
+ .tab-spinner {
938
+ flex: 0 0 auto;
939
+ display: inline-flex;
940
+ width: var(--yicode-size-14);
941
+ height: var(--yicode-size-14);
942
+ color: var(--yicode-faint);
943
+ }
944
+
945
+ .tab-spinner svg {
946
+ width: 100%;
947
+ height: 100%;
948
+ }
949
+
950
+ .tab-spinner.is-spinning {
951
+ color: var(--yicode-accent);
952
+ animation: tab-spin 0.8s linear infinite;
953
+ }
954
+
955
+ @keyframes tab-spin {
956
+ to {
957
+ transform: rotate(360deg);
958
+ }
959
+ }
960
+
961
+ /* 三点按钮:绝对定位压在 tab 右端,不占标签宽度;悬停 tab 时才露出来。
962
+ 尺寸写死 18×18、距上右各 6px(30 − 6 − 18 = 下边也是 6px)。基础按钮样式有 height,
963
+ 必须显式覆盖,否则 top 与 height 同时成立时 bottom 被忽略,按钮会从底边溢出去。 */
964
+ .tab-more {
965
+ position: absolute;
966
+ top: var(--yicode-space-6);
967
+ right: var(--yicode-space-6);
968
+ display: inline-flex;
969
+ align-items: center;
970
+ justify-content: center;
971
+ width: var(--yicode-size-18);
972
+ height: var(--yicode-size-18);
973
+ padding: 0;
974
+ border: 0;
975
+ border-radius: var(--yicode-radius-2xs);
976
+ /* 比所在 tab 亮一档,压在文字上也能看出是个按钮 */
977
+ background: var(--yicode-bg-elevated-solid);
978
+ color: var(--yicode-text);
979
+ cursor: pointer;
980
+ opacity: 0;
981
+ /* 描边画在内部:外扩 1px 会把可见方块撑大,四处 6px 就不成立了 */
982
+ box-shadow: inset 0 0 0 var(--yicode-border-width) var(--yicode-border);
983
+ }
984
+
985
+ /* 只在悬停 tab 时露出来:常显会一直挡住标签文字 */
986
+ .tab:hover .tab-more,
987
+ .tab-more:focus-visible {
988
+ opacity: 1;
989
+ }
990
+
991
+ /* 悬停按钮本身:底色与描边一起转成主题色,鼠标在哪儿一眼能看出来 */
992
+ .tab-more:hover {
993
+ background: var(--yicode-bg-elevated-solid);
994
+ color: var(--yicode-accent);
995
+ box-shadow: inset 0 0 0 var(--yicode-border-width) var(--yicode-accent);
996
+ }
997
+
998
+ .tab-more svg {
999
+ width: var(--yicode-size-14);
1000
+ height: var(--yicode-size-14);
1001
+ }
1002
+
1003
+ /* 唯一的终端区:tab 栏 30px 定高,终端吃掉剩余高度 */
1004
+ #pane {
1005
+ display: flex;
1006
+ flex-direction: column;
1007
+ min-height: 0;
1008
+ /* 终端内容超出去也不许把 tab 栏挤变形 */
1009
+ overflow: hidden;
1010
+ }
1011
+
1012
+ /* 终端容器:两个视图叠在同一块区域里,同一时刻只有一个显示 */
1013
+ #terminal {
1014
+ flex: 1 1 auto;
1015
+ position: relative;
1016
+ min-width: 0;
1017
+ min-height: 0;
1018
+ /* 关键:裁剪,字号变大时只影响行列数,不影响区域高度 */
1019
+ overflow: hidden;
1020
+ }
1021
+
1022
+ /* tab 栏四个方向:布局只在这里切,HTML 结构不动(tab 栏永远在 #pane 里、排在最前) */
1023
+ body[data-tabs="bottom"] #pane {
1024
+ flex-direction: column-reverse;
1025
+ }
1026
+
1027
+ body[data-tabs="left"] #pane {
1028
+ flex-direction: row;
1029
+ }
1030
+
1031
+ body[data-tabs="right"] #pane {
1032
+ flex-direction: row-reverse;
1033
+ }
1034
+
1035
+ /* 竖排时 tab 栏变成一列:定高换成定宽的克制版本 */
1036
+ body[data-tabs="left"] .tab-bar,
1037
+ body[data-tabs="right"] .tab-bar {
1038
+ flex-direction: column;
1039
+ align-items: stretch;
1040
+ width: var(--yicode-size-125);
1041
+ height: auto;
1042
+ min-height: 0;
1043
+ max-height: none;
1044
+ }
1045
+
1046
+ body[data-tabs="left"] .tabs,
1047
+ body[data-tabs="right"] .tabs {
1048
+ flex-direction: column;
1049
+ align-items: stretch;
1050
+ overflow: hidden;
1051
+ }
1052
+
1053
+ body[data-tabs="left"] .tab,
1054
+ body[data-tabs="right"] .tab {
1055
+ width: 100%;
1056
+ max-width: none;
1057
+ }
1058
+
1059
+ /* 选中线跟着换边:竖排时画在靠终端那一侧 */
1060
+ body[data-tabs="left"] .tab.active {
1061
+ box-shadow: inset calc(-1 * var(--yicode-border-width-thick)) 0 0 var(--yicode-accent);
1062
+ }
1063
+
1064
+ body[data-tabs="right"] .tab.active {
1065
+ box-shadow: inset var(--yicode-border-width-thick) 0 0 var(--yicode-accent);
1066
+ }
1067
+
1068
+ /* 竖排时按钮组在侧栏最上方一行:加号与位置按钮靠右挨着,数量单独推到最左 */
1069
+ body[data-tabs="left"] .tab-actions,
1070
+ body[data-tabs="right"] .tab-actions {
1071
+ order: -1;
1072
+ flex-direction: row;
1073
+ justify-content: flex-end;
1074
+ margin: 0;
1075
+ }
1076
+
1077
+ body[data-tabs="left"] .tab-count,
1078
+ body[data-tabs="right"] .tab-count {
1079
+ margin-right: auto;
1080
+ }
1081
+
1082
+ /* 竖排时数量格只放数字,箭头是横排才有的提示 */
1083
+ body[data-tabs="left"] .tab-count-arrow,
1084
+ body[data-tabs="right"] .tab-count-arrow {
1085
+ display: none;
1086
+ }
1087
+
1088
+ /* 每个标签一份视图:用 inset 直接留出四边间距,而不是 padding。
1089
+ inset 是物理边界,xterm 再怎么样也画不进那圈空白,最后一行永远离底边 30px。 */
1090
+ .term-view {
1091
+ position: absolute;
1092
+ inset: var(--yicode-space-8) var(--yicode-space-8) var(--yicode-size-30);
1093
+ overflow: hidden;
1094
+ }
1095
+
1096
+ .term-view[hidden] {
1097
+ display: none;
1098
+ }
1099
+
1100
+ /* 目录选择框:路径框 + 可滚动的子目录列表,撑满对话框剩余高度 */
1101
+ .dir-dialog {
1102
+ width: min(var(--yicode-size-420), 100%);
1103
+ margin-top: var(--yicode-space-24);
1104
+ }
1105
+
1106
+ .dir-path {
1107
+ flex: 0 0 auto;
1108
+ width: 100%;
1109
+ height: var(--yicode-control-h-sm);
1110
+ box-sizing: border-box;
1111
+ padding: 0 var(--yicode-space-8);
1112
+ border: var(--yicode-border-width) solid var(--yicode-border);
1113
+ border-radius: var(--yicode-radius-xs);
1114
+ background: var(--yicode-bg-panel);
1115
+ color: var(--yicode-text);
1116
+ font-family: var(--yicode-mono);
1117
+ font-size: var(--yicode-font-size-12);
1118
+ }
1119
+
1120
+ .dir-error {
1121
+ flex: 0 0 auto;
1122
+ margin: var(--yicode-space-4) 0 0;
1123
+ color: var(--yicode-danger);
1124
+ font-size: var(--yicode-font-size-12);
1125
+ line-height: 1.5;
1126
+ }
1127
+
1128
+ .dir-error:empty {
1129
+ display: none;
1130
+ }
1131
+
1132
+ .dir-list {
1133
+ flex: 1 1 auto;
1134
+ min-height: var(--yicode-size-200);
1135
+ max-height: var(--yicode-size-300);
1136
+ margin-top: var(--yicode-space-8);
1137
+ overflow-y: auto;
1138
+ border: var(--yicode-border-width) solid var(--yicode-border-subtle);
1139
+ border-radius: var(--yicode-radius-xs);
1140
+ }
1141
+
1142
+ /* 一行目录:整行可点,文字垂直居中,单行省略 */
1143
+ .dir-row {
1144
+ display: flex;
1145
+ align-items: center;
1146
+ width: 100%;
1147
+ padding: 0 var(--yicode-space-8);
1148
+ border: 0;
1149
+ border-radius: 0;
1150
+ background: transparent;
1151
+ color: var(--yicode-text);
1152
+ font-family: var(--yicode-mono);
1153
+ font-size: var(--yicode-font-size-13);
1154
+ line-height: 1;
1155
+ text-align: left;
1156
+ white-space: nowrap;
1157
+ overflow: hidden;
1158
+ text-overflow: ellipsis;
1159
+ cursor: pointer;
1160
+ }
1161
+
1162
+ .dir-row:hover {
1163
+ background: var(--yicode-bg-hover);
1164
+ }
1165
+
1166
+ .dir-empty {
1167
+ margin: 0;
1168
+ padding: var(--yicode-space-12) var(--yicode-space-8);
1169
+ color: var(--yicode-faint);
1170
+ font-size: var(--yicode-font-size-12);
1171
+ text-align: center;
1172
+ }
1173
+
1174
+ /* 通用图标按钮:tab 栏、对话框共用 */
1175
+ .icon-btn {
1176
+ flex: 0 0 auto;
1177
+ display: inline-flex;
1178
+ align-items: center;
1179
+ justify-content: center;
1180
+ box-sizing: border-box;
1181
+ /* 栏高 30px,按钮就是 30px 方块,紧挨着排 */
1182
+ width: var(--yicode-size-30);
1183
+ height: var(--yicode-size-30);
1184
+ margin: 0;
1185
+ padding: 0;
1186
+ border: 0;
1187
+ border-radius: 0;
1188
+ background: transparent;
1189
+ color: var(--yicode-muted);
1190
+ cursor: pointer;
1191
+ }
1192
+
1193
+ /* 终端数量兼终端列表入口:与按钮同高,宽度随位数增长,最小就是正方形;
1194
+ 右侧带一个小箭头,点开列出全部终端。 */
1195
+ .tab-count {
1196
+ flex: 0 0 auto;
1197
+ display: inline-flex;
1198
+ align-items: center;
1199
+ justify-content: center;
1200
+ gap: var(--yicode-space-2);
1201
+ box-sizing: border-box;
1202
+ min-width: var(--yicode-size-30);
1203
+ height: var(--yicode-size-30);
1204
+ padding: 0 var(--yicode-space-4);
1205
+ border: 0;
1206
+ border-radius: 0;
1207
+ background: transparent;
1208
+ color: var(--yicode-muted);
1209
+ font-family: var(--yicode-mono);
1210
+ font-size: var(--yicode-font-size-12);
1211
+ line-height: 1;
1212
+ cursor: pointer;
1213
+ user-select: none;
1214
+ }
1215
+
1216
+ .tab-count:hover {
1217
+ background: var(--yicode-bg-hover-solid);
1218
+ color: var(--yicode-text);
1219
+ }
1220
+
1221
+ .tab-count-arrow {
1222
+ width: var(--yicode-size-10);
1223
+ height: var(--yicode-size-10);
1224
+ }
1225
+
1226
+ /* 栏右侧的按钮组:贴边排,按钮一个挨一个;与左边标签之间留 12px,别贴在一起 */
1227
+ .tab-actions {
1228
+ position: relative;
1229
+ display: flex;
1230
+ align-items: center;
1231
+ flex: 0 0 auto;
1232
+ gap: 0;
1233
+ margin-left: var(--yicode-space-12);
1234
+ }
1235
+
1236
+ .icon-btn:hover {
1237
+ background: var(--yicode-bg-hover);
1238
+ color: var(--yicode-text);
1239
+ }
1240
+
1241
+ .icon-btn svg {
1242
+ width: var(--yicode-size-14);
1243
+ height: var(--yicode-size-14);
1244
+ }
1245
+
1246
+ /* 浮层菜单:三点弹出,贴按钮下方 */
1247
+ .pop-menu {
1248
+ position: fixed;
1249
+ z-index: var(--yicode-z-popover);
1250
+ min-width: var(--yicode-size-84);
1251
+ padding: var(--yicode-space-4);
1252
+ border: var(--yicode-border-width) solid var(--yicode-border);
1253
+ border-radius: var(--yicode-radius-control);
1254
+ background: var(--yicode-bg-soft);
1255
+ box-shadow: var(--yicode-shadow-md);
1256
+ }
1257
+
1258
+ /* 一行:高度由基础按钮样式定,用 flex 垂直居中——写成 block 会让文字顶在框的上沿 */
1259
+ .pop-menu-item {
1260
+ display: flex;
1261
+ align-items: center;
1262
+ width: 100%;
1263
+ padding: 0 var(--yicode-space-8);
1264
+ border: 0;
1265
+ border-radius: var(--yicode-radius-xs);
1266
+ background: transparent;
1267
+ color: var(--yicode-text);
1268
+ font-size: var(--yicode-font-size-12);
1269
+ line-height: 1;
1270
+ text-align: left;
1271
+ white-space: nowrap;
1272
+ cursor: pointer;
1273
+ }
1274
+
1275
+ .pop-menu-item:hover {
1276
+ background: var(--yicode-bg-hover);
1277
+ }
1278
+
1279
+ /* 带删除的行:整行一个按钮,删除按钮压在右侧,悬停整行才露出来 */
1280
+ .pop-menu-row {
1281
+ position: relative;
1282
+ display: flex;
1283
+ }
1284
+
1285
+ .pop-menu-row .pop-menu-item {
1286
+ flex: 1 1 auto;
1287
+ padding-right: var(--yicode-size-28);
1288
+ }
1289
+
1290
+ .pop-menu-remove {
1291
+ position: absolute;
1292
+ right: var(--yicode-space-2);
1293
+ top: 50%;
1294
+ transform: translateY(-50%);
1295
+ display: inline-flex;
1296
+ align-items: center;
1297
+ justify-content: center;
1298
+ width: var(--yicode-size-20);
1299
+ height: var(--yicode-size-20);
1300
+ padding: 0;
1301
+ border: 0;
1302
+ background: transparent;
1303
+ color: var(--yicode-faint);
1304
+ opacity: 0;
1305
+ cursor: pointer;
1306
+ }
1307
+
1308
+ .pop-menu-row:hover .pop-menu-remove,
1309
+ .pop-menu-remove:focus-visible {
1310
+ opacity: 1;
1311
+ }
1312
+
1313
+ .pop-menu-remove:hover {
1314
+ background: var(--yicode-bg-hover);
1315
+ color: var(--yicode-danger);
1316
+ }
1317
+
1318
+ .pop-menu-remove svg {
1319
+ width: var(--yicode-size-12);
1320
+ height: var(--yicode-size-12);
1321
+ }
1322
+
1323
+ /* 灰掉的一行:看得见但点不动,用来占位说明「还没有快捷目录」 */
1324
+ .pop-menu-item.is-disabled {
1325
+ color: var(--yicode-faint);
1326
+ cursor: default;
1327
+ }
1328
+
1329
+ /* 当前生效的那一项:用主题色标出来(tab 栏位置下拉用) */
1330
+ .pop-menu-item.is-active {
1331
+ color: var(--yicode-accent);
1332
+ }
1333
+
1334
+ .pop-menu-item.is-disabled:hover {
1335
+ background: transparent;
1336
+ }
1337
+
1338
+ /* + 菜单里的分割线:两个固定入口与快捷目录之间 */
1339
+ .pop-menu-sep {
1340
+ height: var(--yicode-border-width);
1341
+ margin: var(--yicode-space-4) 0;
1342
+ background: var(--yicode-border);
1343
+ }
1344
+
1345
+ /* tab 就地改名用的输入框 */
1346
+ .tab-rename {
1347
+ flex: 1 1 auto;
1348
+ min-width: 0;
1349
+ height: var(--yicode-control-h-sm);
1350
+ padding: 0 var(--yicode-space-4);
1351
+ border: var(--yicode-border-width) solid var(--yicode-border);
1352
+ border-radius: var(--yicode-radius-xs);
1353
+ background: var(--yicode-bg-panel);
1354
+ color: var(--yicode-text);
1355
+ font-family: var(--yicode-mono);
1356
+ font-size: var(--yicode-font-size-12);
1357
+ }