Elffuss BraidHub

kikocis/utopia public

f9f23e10e2c2 · 17.1 KiBRawPermalink
1@import "tailwindcss";
2@plugin "@tailwindcss/typography";
3
4@theme {
5 --font-display: "Geist", "Inter", "Noto Sans SC", system-ui, sans-serif;
6 --font-sans: "Geist", "Inter", "Noto Sans SC", system-ui, sans-serif;
7}
8
9/* ============================================================
10 Utopia design tokens — Vercel-style neutral dark + glass.
11 Chromatic color is reserved for DATA (graph entities, status);
12 the chrome itself is monochrome.
13 ============================================================ */
14:root {
15 font-family: var(--font-sans);
16 color-scheme: dark;
17
18 /* 品牌字:碑铭式衬线(Marcellus 仅 400,一字不粗) */
19 --font-brand: "Marcellus", "Georgia", "Times New Roman", serif;
20
21 --u-ground: #0a0a0a;
22 --u-text: #ededed;
23 --u-text-2: #a1a1a1;
24 --u-text-3: #6e6e6e;
25
26 /* 单色 chrome:accent 也是中性亮灰,彩色只属于数据(实体色/状态语义色) */
27 --u-accent: #d4d4d4;
28 --u-accent-deep: 255, 255, 255;
29
30 --u-ok: #4cc38a;
31 --u-warn: #f2b66d;
32 /* 浅玫瑰:深底上的危险"文字/描边/点"专用(够亮才可读) */
33 --u-danger: #ff9daf;
34 /* 深红:危险"实底按钮"专用(浅玫瑰做底会发粉;亮红在单色 chrome 上嗓门过大),配白字 */
35 --u-danger-solid: #c9353a;
36 --u-violet: #c4a5ff;
37
38 --u-line: rgba(255, 255, 255, 0.08);
39 --u-line-strong: rgba(255, 255, 255, 0.14);
40 --u-surface: rgba(255, 255, 255, 0.04);
41 --u-surface-strong: rgba(10, 10, 10, 0.72);
42}
43
44body {
45 background-color: var(--u-ground);
46 color: var(--u-text);
47 min-height: 100vh;
48}
49
50/* 选中态:中性白纱替掉浏览器默认蓝(零色偏原则同样管到这里)。
51 只设底色不改字色——半透明白纱下内容自身的颜色(代码令牌、实体色)仍透出 */
52::selection {
53 background: rgba(255, 255, 255, 0.22);
54}
55
56/* 空间感:极克制的中性顶光 + 暗角,零色偏 */
57body::before {
58 content: "";
59 position: fixed;
60 inset: 0;
61 z-index: -1;
62 background:
63 radial-gradient(1000px 600px at 50% -20%, rgba(255, 255, 255, 0.045), transparent 60%),
64 var(--u-ground);
65}
66
67/* ---- surfaces ---- */
68.glass {
69 background: var(--u-surface);
70 backdrop-filter: blur(14px);
71 -webkit-backdrop-filter: blur(14px);
72 border: 1px solid var(--u-line);
73}
74
75.glass-strong {
76 background: var(--u-surface-strong);
77 backdrop-filter: blur(20px);
78 -webkit-backdrop-filter: blur(20px);
79 border: 1px solid var(--u-line);
80}
81
82/* 模态对话框的面:**近实底**。
83 毛玻璃本来留给"带遮罩的大弹窗",但确认框不是那种——它要人读一句话然后
84 做一个不可逆的决定,下层正文透上来是直接的干扰(实测删除对话的确认框,
85 身后的回答文字清晰可辨,标题几乎读不出)。
86 遮罩也一并加深:0.6 的黑压不住一屏白字。 */
87.u-modal-panel {
88 background: rgba(12, 12, 14, 0.97);
89 backdrop-filter: blur(24px);
90 -webkit-backdrop-filter: blur(24px);
91 border: 1px solid var(--u-line-strong);
92}
93
94/* 确认框入场:遮罩淡入 + 面板浮起。
95 时长与缓动跟 u-pop-in 同族——同一套动作语汇,不另发明一种。
96 模态比下拉重一点(0.18s / 位移 8px),因为它要求人停下来看。 */
97@keyframes u-modal-scrim-kf {
98 from {
99 opacity: 0;
100 }
101 to {
102 opacity: 1;
103 }
104}
105@keyframes u-modal-panel-kf {
106 from {
107 opacity: 0;
108 transform: scale(0.97) translateY(8px);
109 }
110 to {
111 opacity: 1;
112 transform: scale(1) translateY(0);
113 }
114}
115.u-modal-scrim {
116 animation: u-modal-scrim-kf 0.14s ease-out both;
117}
118.u-modal-in {
119 animation: u-modal-panel-kf 0.18s cubic-bezier(0.16, 1, 0.3, 1) both;
120}
121/* 系统设了减少动效就只留淡入:位移与缩放是装饰,可读性不是 */
122@media (prefers-reduced-motion: reduce) {
123 .u-modal-in {
124 animation: u-modal-scrim-kf 0.14s ease-out both;
125 }
126}
127
128/* 弹出层(下拉/取色器等 popover):近实底——下层内容透出只会干扰 */
129.u-pop {
130 background: rgba(16, 16, 16, 0.98);
131 backdrop-filter: blur(8px);
132 -webkit-backdrop-filter: blur(8px);
133 border: 1px solid var(--u-line-strong);
134}
135
136/* 弹层入场:锚点为原点的缩放浮现(用户菜单/下拉共用)。
137 160ms + 出挑缓动(与 u-rise 同族),克制但有生气 */
138@keyframes u-pop-in-kf {
139 from {
140 opacity: 0;
141 transform: scale(0.96) translateY(-4px);
142 }
143 to {
144 opacity: 1;
145 transform: scale(1) translateY(0);
146 }
147}
148.u-pop-in {
149 transform-origin: top right;
150 animation: u-pop-in-kf 0.16s cubic-bezier(0.16, 1, 0.3, 1) both;
151}
152.u-pop-in-tl {
153 transform-origin: top left;
154}
155/* 向上弹出的变体(composer 停靠底部时菜单开口朝上) */
156@keyframes u-pop-up-kf {
157 from {
158 opacity: 0;
159 transform: scale(0.96) translateY(4px);
160 }
161 to {
162 opacity: 1;
163 transform: scale(1) translateY(0);
164 }
165}
166.u-pop-up {
167 transform-origin: bottom left;
168 animation: u-pop-up-kf 0.16s cubic-bezier(0.16, 1, 0.3, 1) both;
169}
170
171/* 用户菜单:半透玻璃面(比 .u-pop 更透,加强模糊补偿可读性)。
172 原地变形动画在组件内用 FLIP 实现(首帧压到胶囊真实边界再展开),
173 CSS 只负责面板的皮 */
174.u-menu-glass {
175 background: rgba(14, 14, 16, 0.85);
176 backdrop-filter: blur(24px);
177 -webkit-backdrop-filter: blur(24px);
178 border: 1px solid rgba(255, 255, 255, 0.14);
179}
180
181@media (prefers-reduced-motion: reduce) {
182 .u-pop-in,
183 .u-pop-up {
184 animation: none;
185 }
186}
187
188.glass-hover {
189 transition: border-color 0.15s;
190}
191.glass-hover:hover {
192 border-color: var(--u-line-strong);
193}
194
195/* ---- form controls ---- */
196.input-dark {
197 background: rgba(255, 255, 255, 0.04);
198 border: 1px solid var(--u-line-strong);
199 color: var(--u-text);
200 border-radius: 0.5rem;
201}
202.input-dark::placeholder {
203 color: var(--u-text-3);
204}
205.input-dark:focus {
206 outline: none;
207 border-color: rgba(255, 255, 255, 0.4);
208 box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
209}
210select.input-dark option {
211 background: #111111;
212 color: var(--u-text);
213}
214
215/* mono 输入框的 placeholder 回默认字体(提示语不是代码) */
216.u-placeholder-sans::placeholder {
217 font-family: var(--font-sans);
218}
219
220/* 数字输入:去掉原生 spinner,保持纯净外观 */
221.u-input-plain::-webkit-outer-spin-button,
222.u-input-plain::-webkit-inner-spin-button {
223 -webkit-appearance: none;
224 margin: 0;
225}
226.u-input-plain {
227 -moz-appearance: textfield;
228 appearance: textfield;
229}
230
231/* ---- buttons (Vercel: primary = white on black) ---- */
232.u-btn,
233.btn-primary,
234.btn-ghost {
235 border-radius: 0.5rem;
236 font-weight: 500;
237 transition: background 0.15s, border-color 0.15s, color 0.15s;
238}
239.u-btn:disabled,
240.btn-primary:disabled,
241.btn-ghost:disabled {
242 opacity: 0.4;
243}
244.u-btn-primary,
245.btn-primary {
246 background: var(--u-text);
247 border: 1px solid var(--u-text);
248 color: #0a0a0a;
249 font-weight: 600;
250}
251.u-btn-primary:hover:not(:disabled),
252.btn-primary:hover:not(:disabled) {
253 background: #ffffff;
254 border-color: #ffffff;
255}
256.u-btn-ghost,
257.btn-ghost {
258 border: 1px solid var(--u-line-strong);
259 color: var(--u-text-2);
260 background: transparent;
261}
262.u-btn-ghost:hover:not(:disabled),
263.btn-ghost:hover:not(:disabled) {
264 background: rgba(255, 255, 255, 0.06);
265 color: var(--u-text);
266 border-color: rgba(255, 255, 255, 0.22);
267}
268
269/* ---- chips ---- */
270.u-chip {
271 display: inline-block;
272 border-radius: 9999px;
273 padding: 0.125rem 0.5rem;
274 font-size: 0.75rem;
275 line-height: 1.25;
276 white-space: nowrap;
277}
278.u-chip-neutral {
279 background: rgba(255, 255, 255, 0.08);
280 color: var(--u-text-2);
281}
282.u-chip-info {
283 background: rgba(255, 255, 255, 0.12);
284 color: #ededed;
285}
286.u-chip-success {
287 background: rgba(76, 195, 138, 0.12);
288 color: var(--u-ok);
289}
290.u-chip-warn {
291 background: rgba(242, 182, 109, 0.12);
292 color: var(--u-warn);
293}
294.u-chip-danger {
295 background: rgba(255, 157, 175, 0.12);
296 color: var(--u-danger);
297}
298.u-chip-violet {
299 background: rgba(196, 165, 255, 0.12);
300 color: var(--u-violet);
301}
302
303/* 浏览态里的程度标注:同一个警示色,但没有填充、没有药丸形状。
304 chip 是"停下来看这个",用在审核队列上是对的;而在图谱列表里,
305 主角是实体名,置信度和右侧的时间区间同属元信息——不该是整屏
306 唯一有填充色的东西。 */
307.u-meta-warn {
308 color: rgba(242, 182, 109, 0.55);
309}
310
311/* ---- graph canvas: 图纸式大小网格(细密小格 + 每 4 格一条更亮的主线) ---- */
312.u-grid-bg {
313 background-image:
314 linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
315 linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px),
316 linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
317 linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
318 background-size:
319 104px 104px,
320 104px 104px,
321 26px 26px,
322 26px 26px;
323}
324
325/* ---- interactive accents ---- */
326.u-bubble-user {
327 background: rgba(255, 255, 255, 0.08);
328 border: 1px solid rgba(255, 255, 255, 0.14);
329}
330.u-highlight {
331 border-color: rgba(255, 255, 255, 0.45) !important;
332 background: rgba(255, 255, 255, 0.06) !important;
333 box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12);
334}
335.u-nav-active {
336 background: rgba(255, 255, 255, 0.09);
337 color: #ffffff;
338}
339
340/* 引用定位闪现:进场强光收敛到持有亮度(运动比静态边框更抓眼)。
341 fill-mode both 让 100% 帧在类存续期间保持;移除类后由元素自身的
342 transition 淡回普通卡片 */
343@keyframes u-flash-kf {
344 0% {
345 border-color: rgba(255, 255, 255, 0.9);
346 background-color: rgba(255, 255, 255, 0.14);
347 box-shadow:
348 0 0 0 3px rgba(255, 255, 255, 0.3),
349 0 0 36px rgba(255, 255, 255, 0.16);
350 }
351 100% {
352 border-color: rgba(255, 255, 255, 0.55);
353 background-color: rgba(255, 255, 255, 0.07);
354 box-shadow:
355 0 0 0 2px rgba(255, 255, 255, 0.16),
356 0 0 18px rgba(255, 255, 255, 0.06);
357 }
358}
359.u-flash {
360 animation: u-flash-kf 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
361}
362@media (prefers-reduced-motion: reduce) {
363 .u-flash {
364 animation: none;
365 border-color: rgba(255, 255, 255, 0.55);
366 background-color: rgba(255, 255, 255, 0.07);
367 box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.16);
368 }
369}
370
371/* ---- text helpers ---- */
372.u-accent {
373 color: var(--u-accent);
374}
375.u-link {
376 color: var(--u-text);
377 text-decoration: underline;
378 text-underline-offset: 3px;
379 text-decoration-color: rgba(255, 255, 255, 0.3);
380}
381.u-link:hover {
382 text-decoration-color: rgba(255, 255, 255, 0.8);
383}
384.u-title {
385 font-family: var(--font-display);
386 font-weight: 600;
387 letter-spacing: -0.01em;
388 color: #ffffff;
389}
390.brand-gradient {
391 color: #ffffff;
392 letter-spacing: -0.02em;
393}
394
395/* 登录卡:近实底,不用 backdrop-filter(对动画背景每帧重算模糊,代价高) */
396.u-card-opaque {
397 background: rgba(12, 12, 12, 0.92);
398 border: 1px solid var(--u-line);
399}
400
401/* ---- 入场动效(登录页等):淡入上浮 ---- */
402@keyframes u-rise-kf {
403 from {
404 opacity: 0;
405 transform: translateY(14px);
406 }
407 to {
408 opacity: 1;
409 transform: translateY(0);
410 }
411}
412.u-rise {
413 animation: u-rise-kf 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
414}
415
416/* 登录成功谢幕:内容上浮淡出;巨构放大淡出(像穿过它进入系统) */
417@keyframes u-depart-kf {
418 to {
419 opacity: 0;
420 transform: translateY(-14px);
421 }
422}
423.u-depart {
424 animation: u-depart-kf 0.55s cubic-bezier(0.5, 0, 0.9, 0.4) forwards;
425}
426.u-scene-depart {
427 transition: transform 0.7s cubic-bezier(0.5, 0, 0.9, 0.5), opacity 0.7s ease-in;
428 transform: scale(1.16);
429 opacity: 0;
430}
431
432/* 登录后首屏入场:整体淡入,衔接登录页谢幕 */
433@keyframes u-arrive-kf {
434 from {
435 opacity: 0;
436 }
437 to {
438 opacity: 1;
439 }
440}
441.u-arrive {
442 animation: u-arrive-kf 0.45s ease both;
443}
444
445@media (prefers-reduced-motion: reduce) {
446 .u-rise,
447 .u-depart,
448 .u-arrive {
449 animation: none;
450 }
451 .u-scene-depart {
452 transition: none;
453 }
454}
455
456/* Chrome 自动填充的蓝底与"零色偏"冲突:压回中性深灰 */
457input:-webkit-autofill,
458input:-webkit-autofill:hover,
459input:-webkit-autofill:focus {
460 -webkit-box-shadow: 0 0 0 1000px #141414 inset;
461 -webkit-text-fill-color: var(--u-text);
462 caret-color: var(--u-text);
463}
464
465/* ---- 品牌字标:逐字母左→右淡入;hover 浮出外链箭头 ---- */
466@keyframes u-letter-kf {
467 from {
468 opacity: 0;
469 }
470 to {
471 opacity: 1;
472 }
473}
474.u-letter {
475 animation: u-letter-kf 0.5s ease both;
476}
477.u-mark-arrow {
478 position: absolute;
479 right: -0.6em;
480 top: -0.08em;
481 width: 0.5em;
482 height: 0.5em;
483 color: var(--u-text-2);
484 opacity: 0;
485 transform: translate(-3px, 3px);
486 transition: opacity 0.18s ease, transform 0.18s ease;
487}
488a:hover > .u-mark-arrow {
489 opacity: 1;
490 transform: none;
491}
492@media (prefers-reduced-motion: reduce) {
493 .u-letter {
494 animation: none;
495 }
496 .u-mark-arrow {
497 transition: none;
498 }
499}
500
501/* toast 入场:复用淡入上浮关键帧,节奏更快 */
502.u-toast-in {
503 animation: u-rise-kf 0.25s ease both;
504}
505@media (prefers-reduced-motion: reduce) {
506 .u-toast-in {
507 animation: none;
508 }
509}
510
511/* 多行居中的短句:两行长度均衡,避免孤词 */
512.u-balance {
513 text-wrap: balance;
514}
515
516/* ---- numbers in chrome: 默认字体(Geist)+ 等宽数字,不再用 mono ---- */
517.u-num {
518 font-variant-numeric: tabular-nums;
519}
520
521/* ---- 全局滚动条:统一细条风格(Chromium 走 webkit 自绘;Firefox 走标准属性) ---- */
522@supports not selector(::-webkit-scrollbar) {
523 * {
524 scrollbar-width: thin;
525 scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
526 }
527}
528*::-webkit-scrollbar {
529 width: 7px;
530 height: 7px;
531}
532*::-webkit-scrollbar-track {
533 background: transparent;
534}
535*::-webkit-scrollbar-thumb {
536 background: rgba(255, 255, 255, 0.14);
537 border-radius: 4px;
538}
539*::-webkit-scrollbar-thumb:hover {
540 background: rgba(255, 255, 255, 0.26);
541}
542*::-webkit-scrollbar-corner {
543 background: transparent;
544}
545
546/* 面板内滚动区(滚动条样式已全局统一,这里只保留滚动隔离) */
547.u-scroll {
548 overscroll-behavior: contain;
549}
550
551/* ---- timeline scrubber ---- */
552.scrubber-range {
553 -webkit-appearance: none;
554 appearance: none;
555 width: 100%;
556 height: 100%;
557 background: transparent;
558 position: absolute;
559 inset: 0;
560 margin: 0;
561 cursor: ew-resize;
562}
563.scrubber-range::-webkit-slider-thumb {
564 -webkit-appearance: none;
565 appearance: none;
566 width: 2px;
567 height: 28px;
568 border-radius: 1px;
569 background: #ffffff;
570 box-shadow: 0 0 6px rgba(255, 255, 255, 0.5);
571 cursor: ew-resize;
572}
573.scrubber-range::-moz-range-thumb {
574 width: 2px;
575 height: 28px;
576 border: none;
577 border-radius: 1px;
578 background: #ffffff;
579 box-shadow: 0 0 6px rgba(255, 255, 255, 0.5);
580 cursor: ew-resize;
581}
582.scrubber-range::-webkit-slider-runnable-track {
583 background: transparent;
584}
585.scrubber-range::-moz-range-track {
586 background: transparent;
587}
588
589/* ---- 代码高亮(rehype-highlight / hljs):克制的粉彩令牌色,
590 与实体色板同族——颜色属于内容,chrome 保持无色 ---- */
591.u-chat-prose .hljs-comment,
592.u-chat-prose .hljs-quote {
593 color: #7d8590;
594 font-style: italic;
595}
596.u-chat-prose .hljs-keyword,
597.u-chat-prose .hljs-selector-tag,
598.u-chat-prose .hljs-meta {
599 color: #9fa8ff;
600}
601.u-chat-prose .hljs-string,
602.u-chat-prose .hljs-regexp,
603.u-chat-prose .hljs-addition {
604 color: #63e2b7;
605}
606.u-chat-prose .hljs-number,
607.u-chat-prose .hljs-literal,
608.u-chat-prose .hljs-symbol {
609 color: #ffd479;
610}
611.u-chat-prose .hljs-title,
612.u-chat-prose .hljs-title.function_,
613.u-chat-prose .hljs-section {
614 color: #7fd0ff;
615}
616.u-chat-prose .hljs-type,
617.u-chat-prose .hljs-built_in,
618.u-chat-prose .hljs-class .hljs-title {
619 color: #5fd4d0;
620}
621.u-chat-prose .hljs-attr,
622.u-chat-prose .hljs-attribute,
623.u-chat-prose .hljs-variable,
624.u-chat-prose .hljs-template-variable {
625 color: #c4a5ff;
626}
627.u-chat-prose .hljs-deletion {
628 color: #ff8a9e;
629}
630
631/* 对话气泡内的 markdown:紧凑排版,色彩服从气泡 */
632.u-chat-prose > :first-child {
633 margin-top: 0;
634}
635.u-chat-prose > :last-child {
636 margin-bottom: 0;
637}
638.u-chat-prose p {
639 margin: 0.4em 0;
640}
641.u-chat-prose ul,
642.u-chat-prose ol {
643 margin: 0.4em 0;
644 padding-left: 1.25em;
645}
646.u-chat-prose ul {
647 list-style: disc;
648}
649.u-chat-prose ol {
650 list-style: decimal;
651}
652.u-chat-prose li {
653 margin: 0.15em 0;
654}
655.u-chat-prose strong {
656 color: #ffffff;
657 font-weight: 600;
658}
659.u-chat-prose h1,
660.u-chat-prose h2,
661.u-chat-prose h3 {
662 font-weight: 600;
663 color: #ffffff;
664 margin: 0.7em 0 0.3em;
665 font-size: 1em;
666}
667/* 分割线(模型爱写 ---):几乎隐形的发丝线,只当呼吸口,不当版面元素 */
668.u-chat-prose hr {
669 border: 0;
670 border-top: 1px solid var(--u-line);
671 margin: 1em 0;
672}
673.u-chat-prose code {
674 font-size: 0.85em;
675 background: rgba(255, 255, 255, 0.08);
676 border-radius: 4px;
677 padding: 0.1em 0.35em;
678}
679.u-chat-prose pre {
680 background: rgba(0, 0, 0, 0.45);
681 border: 1px solid var(--u-line);
682 border-radius: 8px;
683 padding: 0.6em 0.8em;
684 overflow-x: auto;
685 margin: 0.5em 0;
686}
687.u-chat-prose pre code {
688 background: transparent;
689 padding: 0;
690}
691.u-chat-prose table {
692 border-collapse: collapse;
693 margin: 0.5em 0;
694 font-size: 0.9em;
695}
696.u-chat-prose th,
697.u-chat-prose td {
698 border: 1px solid var(--u-line-strong);
699 padding: 0.25em 0.6em;
700}
701.u-chat-prose a {
702 text-decoration: underline;
703 text-underline-offset: 2px;
704}
705.u-chat-prose blockquote {
706 border-left: 2px solid var(--u-line-strong);
707 padding-left: 0.75em;
708 color: var(--u-text-2);
709 margin: 0.4em 0;
710}