Skip to content

Open-source, local-first AI agent for real work.

5.9 KB
Raw Blame
/* 导入 theme 层 + utilities 层(不要 preflight,避免 reset 污染宿主全局)。
   只 @import utilities 会漏掉依赖 theme 变量的工具类,故 theme 层必须一并导入。 */
@layer theme, base, components, utilities;
@import "tailwindcss/theme.css" layer(theme);
@import "tailwindcss/utilities.css" layer(utilities);

/* 插件 CSS 被构建包进以插件根为界的 @scope,宿主 <html data-mode="dark"> 在作用域之外,
   任何祖先选择器(含 Tailwind 的 dark: 变体)都匹配不到。明暗只能靠继承下来的宿主 CSS
   变量,这里把它们映射成语义色工具类:bg-card / text-muted-foreground / border-border… */
@theme inline {
	--color-background: var(--background);
	--color-foreground: var(--foreground);
	--color-card: var(--card);
	--color-card-foreground: var(--card-foreground);
	--color-border: var(--border);
	--color-muted: var(--muted);
	--color-muted-foreground: var(--muted-foreground);
	--color-accent: var(--accent);
	--color-accent-foreground: var(--accent-foreground);
	--color-primary: var(--primary);
	--color-primary-foreground: var(--primary-foreground);
	--color-destructive: var(--destructive);
}

.browser-page {
	height: 100%;
	overflow-y: auto;
	background: var(--background);
	color: var(--foreground);
}

.browser-page-inner {
	max-width: 56rem;
	margin: 0 auto;
	padding: 2.5rem 1.75rem 4rem;
	display: flex;
	flex-direction: column;
	gap: 2.5rem;
}

/* 超椭圆(squircle)底板:|x|^4.5 + |y|^4.5 = 1 采样成 72 个点。
   用 clip-path: polygon 而不是 corner-shape: squircle —— 后者要 Chromium 139,
   而 Electron 34 只到 132;polygon 的百分比坐标又能跟着盒子缩放,不像 path() 钉死像素。
   采样点在圆角处自然变密、直边处稀疏,所以直线段只出现在本来就是直的地方。 */
.browser-icon-plate {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 3.5rem;
	height: 3.5rem;
	background: color-mix(in oklab, var(--foreground) 7%, transparent);
	clip-path: polygon(100.00% 50.00%, 99.92% 66.90%, 99.66% 72.96%, 99.24% 77.42%, 98.64% 81.04%, 97.86% 84.10%, 96.90% 86.74%, 95.76% 89.06%, 94.41% 91.08%, 92.86% 92.86%, 91.08% 94.41%, 89.06% 95.76%, 86.74% 96.90%, 84.10% 97.86%, 81.04% 98.64%, 77.42% 99.24%, 72.96% 99.66%, 66.90% 99.92%, 50.00% 100.00%, 33.10% 99.92%, 27.04% 99.66%, 22.58% 99.24%, 18.96% 98.64%, 15.90% 97.86%, 13.26% 96.90%, 10.94% 95.76%, 8.92% 94.41%, 7.14% 92.86%, 5.59% 91.08%, 4.24% 89.06%, 3.10% 86.74%, 2.14% 84.10%, 1.36% 81.04%, 0.76% 77.42%, 0.34% 72.96%, 0.08% 66.90%, 0.00% 50.00%, 0.08% 33.10%, 0.34% 27.04%, 0.76% 22.58%, 1.36% 18.96%, 2.14% 15.90%, 3.10% 13.26%, 4.24% 10.94%, 5.59% 8.92%, 7.14% 7.14%, 8.92% 5.59%, 10.94% 4.24%, 13.26% 3.10%, 15.90% 2.14%, 18.96% 1.36%, 22.58% 0.76%, 27.04% 0.34%, 33.10% 0.08%, 50.00% 0.00%, 66.90% 0.08%, 72.96% 0.34%, 77.42% 0.76%, 81.04% 1.36%, 84.10% 2.14%, 86.74% 3.10%, 89.06% 4.24%, 91.08% 5.59%, 92.86% 7.14%, 94.41% 8.92%, 95.76% 10.94%, 96.90% 13.26%, 97.86% 15.90%, 98.64% 18.96%, 99.24% 22.58%, 99.66% 27.04%, 99.92% 33.10%);
}

.browser-section-label {
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--muted-foreground);
}

.browser-card {
	border: 1px solid var(--border);
	border-radius: 0.875rem;
	background: var(--card);
	color: var(--card-foreground);
}

.browser-button {
	font-size: 0.8125rem;
	font-weight: 500;
	padding: 0.375rem 0.9375rem;
	border-radius: 0.5rem;
	border: 1px solid transparent;
	background: var(--primary);
	color: var(--primary-foreground);
	cursor: pointer;
	transition: opacity 0.15s ease;
}

.browser-button:hover:not(:disabled) {
	opacity: 0.88;
}

.browser-button-ghost {
	font-size: 0.8125rem;
	padding: 0.375rem 0.75rem;
	border-radius: 0.5rem;
	border: 1px solid var(--border);
	background: transparent;
	color: inherit;
	cursor: pointer;
	transition: background 0.15s ease;
}

.browser-button-ghost:hover:not(:disabled) {
	background: color-mix(in oklab, var(--foreground) 6%, transparent);
}

.browser-button:disabled,
.browser-button-ghost:disabled {
	opacity: 0.45;
	cursor: default;
}

/* 安装输出可能很长且带 \r 进度条,锁高度并允许滚动,避免撑破布局。 */
.browser-output {
	max-height: 9rem;
	overflow: auto;
	font-size: 0.6875rem;
	line-height: 1.5;
	white-space: pre-wrap;
	word-break: break-all;
	padding: 0.625rem 0.75rem;
	border-radius: 0.5rem;
	background: color-mix(in oklab, var(--foreground) 5%, transparent);
	color: var(--muted-foreground);
}

.browser-grid {
	display: grid;
	gap: 0.875rem;
	grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}

/* 示例 prompt:整块可点即复制,所以要有明确的可交互反馈。 */
.browser-prompt {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	width: 100%;
	text-align: start;
	padding: 0.75rem 0.875rem;
	border: 1px solid var(--border);
	border-radius: 0.75rem;
	background: color-mix(in oklab, var(--foreground) 3%, transparent);
	color: inherit;
	font: inherit;
	line-height: 1.6;
	cursor: pointer;
	transition:
		border-color 0.15s ease,
		background 0.15s ease;
}

.browser-prompt:hover {
	border-color: color-mix(in oklab, var(--primary) 45%, var(--border));
	background: color-mix(in oklab, var(--foreground) 6%, transparent);
}

.browser-prompt-action {
	flex-shrink: 0;
	font-size: 0.6875rem;
	color: var(--muted-foreground);
	white-space: nowrap;
	padding-top: 0.125rem;
}

.browser-dot {
	width: 0.5rem;
	height: 0.5rem;
	border-radius: 9999px;
	flex-shrink: 0;
}

.browser-link {
	color: inherit;
	text-decoration: none;
	border-bottom: 1px solid color-mix(in oklab, currentColor 35%, transparent);
	cursor: pointer;
	background: none;
	border-inline: 0;
	border-top: 0;
	padding: 0;
	font: inherit;
}

.browser-link:hover {
	border-bottom-color: currentColor;
}

@keyframes browser-pulse {
	0%,
	100% {
		opacity: 1;
	}
	50% {
		opacity: 0.35;
	}
}

.browser-pulse {
	animation: browser-pulse 1.6s ease-in-out infinite;
}