Repository navigation
Expand file tree
/
Copy pathinput.css
More file actions
263 lines (248 loc) · 7.78 KB
/
Copy pathinput.css
File metadata and controls
263 lines (248 loc) · 7.78 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
@tailwind base;
@tailwind components;
@tailwind utilities;
/* 主题:页面只使用语义颜色(bg、card、fg、muted…),浅色和深色只在这里定义 */
@layer base {
:root {
--bg: 255 255 255;
--surface: 250 250 250;
--card: 255 255 255;
--line: 228 228 231;
--line-soft: 244 244 245;
--fg: 24 24 27;
--muted: 113 113 122;
--subtle: 161 161 170;
--hover: 244 244 245;
--primary: 24 24 27;
--primary-fg: 250 250 250;
--accent: 22 163 74;
color-scheme: light;
}
.dark {
--bg: 9 9 11;
--surface: 12 12 14;
--card: 19 19 22;
--line: 39 39 42;
--line-soft: 30 30 34;
--fg: 244 244 245;
--muted: 161 161 170;
--subtle: 113 113 122;
--hover: 33 33 37;
--primary: 244 244 245;
--primary-fg: 24 24 27;
--accent: 74 222 128;
color-scheme: dark;
}
body {
@apply bg-bg text-fg antialiased;
}
}
@layer components {
/* 图标:svgIcon 输出的 SVG 由外层元素控制尺寸 */
.icon {
@apply inline-flex shrink-0 items-center justify-center;
}
.icon > svg {
@apply h-4 w-4;
}
.tile {
@apply flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-hover text-muted;
}
.tile > svg {
@apply h-5 w-5;
}
/* 按钮 */
.btn {
@apply inline-flex h-9 items-center justify-center gap-2 whitespace-nowrap rounded-lg px-3.5 text-sm font-medium transition-colors
focus:outline-none focus-visible:ring-2 focus-visible:ring-fg/20 focus-visible:ring-offset-1 focus-visible:ring-offset-bg
disabled:pointer-events-none disabled:opacity-40;
}
.btn svg {
@apply h-4 w-4 shrink-0;
}
.btn-primary {
@apply bg-primary text-primary-fg shadow-sm hover:bg-primary/85;
}
.btn-secondary {
@apply border border-line bg-card text-fg shadow-sm hover:bg-hover;
}
.btn-danger {
@apply border border-red-600/25 bg-card text-red-600 shadow-sm hover:bg-red-500/10 dark:border-red-400/25 dark:text-red-400;
}
.btn-ghost {
@apply text-muted hover:bg-hover hover:text-fg;
}
.btn-ghost-danger {
@apply text-red-600 hover:bg-red-500/10 dark:text-red-400;
}
.btn-sm {
@apply h-8 px-2.5 text-[13px];
}
.btn-icon {
@apply inline-flex h-9 w-9 items-center justify-center rounded-lg text-muted transition-colors hover:bg-hover hover:text-fg;
}
.btn-icon svg {
@apply h-5 w-5;
}
/* 卡片 */
.card {
@apply rounded-xl border border-line bg-card shadow-sm shadow-black/[0.03];
}
.card-header {
@apply flex items-center justify-between gap-4 border-b border-line-soft px-5 py-3.5;
}
.card-title {
@apply flex items-center gap-2 text-sm font-semibold text-fg;
}
.card-title svg {
@apply h-4 w-4 text-subtle;
}
.link {
@apply text-sm font-medium text-muted transition-colors hover:text-fg;
}
/* 页面标题 */
.page-header {
@apply mb-8 flex flex-wrap items-end justify-between gap-4;
}
.page-title {
@apply text-2xl font-semibold tracking-tight text-fg;
}
.page-desc {
@apply mt-1.5 text-sm text-muted;
}
.back-link {
@apply mb-3 inline-flex items-center gap-1.5 text-sm text-muted transition-colors hover:text-fg;
}
.back-link svg {
@apply h-4 w-4;
}
/* 侧边导航 */
.nav-link {
@apply flex items-center gap-3 rounded-lg px-3 py-2 text-sm font-medium text-muted transition-colors hover:bg-hover hover:text-fg;
}
.nav-link svg {
@apply h-[18px] w-[18px] shrink-0;
}
.nav-link.active {
@apply bg-card text-fg shadow-sm ring-1 ring-line;
}
.theme-btn {
@apply inline-flex h-7 flex-1 items-center justify-center rounded-md text-muted transition-colors hover:text-fg;
}
.theme-btn svg {
@apply h-4 w-4;
}
.theme-btn[aria-pressed="true"] {
@apply bg-card text-fg shadow-sm ring-1 ring-line;
}
/* 表单 */
.label {
@apply mb-1.5 block text-sm font-medium text-fg;
}
.input {
@apply block h-10 w-full rounded-lg border border-line bg-card px-3 text-sm text-fg shadow-sm placeholder:text-subtle
focus:border-fg/30 focus:outline-none focus:ring-2 focus:ring-fg/10
read-only:bg-surface read-only:text-muted;
}
/* 下拉框:外观同输入框,箭头用图标(.input 的只读灰底会套到 select 上,所以单独一个类) */
.select-wrap {
@apply relative;
}
.select {
@apply block h-10 w-full cursor-pointer appearance-none rounded-lg border border-line bg-card pl-3 pr-9 text-sm text-fg shadow-sm
focus:border-fg/30 focus:outline-none focus:ring-2 focus:ring-fg/10;
}
.select-wrap > svg {
@apply pointer-events-none absolute right-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted;
}
.hint {
@apply mt-1.5 text-xs text-muted;
}
/* 提示 */
.alert {
@apply flex items-start gap-3 rounded-lg border px-4 py-3 text-sm;
}
.alert svg {
@apply mt-0.5 h-4 w-4 shrink-0;
}
.alert-error {
@apply border-red-600/20 bg-red-500/10 text-red-700 dark:border-red-400/20 dark:text-red-300;
}
.alert-success {
@apply border-green-600/20 bg-green-500/10 text-green-800 dark:border-green-400/20 dark:text-green-300;
}
.alert-warning {
@apply border-amber-600/20 bg-amber-500/10 text-amber-800 dark:border-amber-400/20 dark:text-amber-300;
}
.alert-info {
@apply border-line bg-surface text-muted;
}
/* 状态标签 */
.badge {
@apply inline-flex items-center gap-1.5 whitespace-nowrap rounded-md px-2 py-0.5 text-xs font-medium ring-1 ring-inset;
}
.badge-green {
@apply bg-green-500/10 text-green-700 ring-green-600/20 dark:text-green-400 dark:ring-green-400/20;
}
.badge-amber {
@apply bg-amber-500/10 text-amber-700 ring-amber-600/20 dark:text-amber-400 dark:ring-amber-400/20;
}
.badge-red {
@apply bg-red-500/10 text-red-700 ring-red-600/20 dark:text-red-400 dark:ring-red-400/20;
}
.badge-gray {
@apply bg-hover text-muted ring-line;
}
.dot {
@apply inline-block h-1.5 w-1.5 rounded-full bg-current;
}
/* 键值列表 */
.kv {
@apply divide-y divide-line-soft px-5;
}
.kv > div {
@apply flex items-baseline justify-between gap-4 py-3 text-sm;
}
.kv dt {
@apply shrink-0 text-muted;
}
.kv dd {
@apply min-w-0 break-words text-right font-medium text-fg;
}
/* 指标 */
.stat-label {
@apply flex items-center justify-between text-sm text-muted;
}
.stat-label svg {
@apply h-4 w-4 text-subtle;
}
.stat-value {
@apply mt-3 text-2xl font-semibold tracking-tight text-fg;
}
.stat-unit {
@apply ml-1 text-sm font-normal text-muted;
}
.meter {
@apply mt-3 h-1.5 overflow-hidden rounded-full bg-hover;
}
/* 表格 */
.table {
@apply w-full text-left text-sm;
}
.table thead th {
@apply whitespace-nowrap border-b border-line bg-surface px-4 py-2.5 text-xs font-medium text-muted sm:px-5;
}
.table tbody td {
@apply border-b border-line-soft px-4 py-3.5 align-middle sm:px-5;
}
.table tbody tr:last-child td {
@apply border-b-0;
}
.table tbody tr {
@apply transition-colors hover:bg-surface;
}
/* 代码编辑器容器:两种主题下都用深色编辑器 */
.editor-frame {
@apply overflow-hidden rounded-xl border border-line bg-[#1e1e1e] shadow-sm;
}
}