fix(web): align playground chat layout

This commit is contained in:
2026-05-10 21:53:45 +08:00
parent fdcdcd477b
commit 205a4b625e
4 changed files with 1851 additions and 50 deletions
+164 -47
View File
@@ -1,24 +1,103 @@
@import "tailwindcss";
@source "../node_modules/streamdown/dist/*.js";
@source "../node_modules/@streamdown/code/dist/*.js";
@source "../node_modules/@streamdown/math/dist/*.js";
@source "../node_modules/@streamdown/mermaid/dist/*.js";
@source "../node_modules/@streamdown/cjk/dist/*.js";
@import './styles/ui.css';
@import './styles/pages.css';
@import './styles/admin-capabilities.css';
@import './styles/pricing.css';
@import './styles/api-docs.css';
@import './styles/landing.css';
@import './styles/playground.css';
@theme inline {
--font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
--font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
--color-background: var(--background);
--color-foreground: var(--foreground);
--color-card: var(--card);
--color-card-foreground: var(--card-foreground);
--color-muted: var(--muted);
--color-muted-foreground: var(--muted-foreground);
--color-border: var(--border);
--color-input: var(--input);
--color-primary: var(--primary);
--color-primary-foreground: var(--primary-foreground);
--color-secondary: var(--secondary);
--color-secondary-foreground: var(--secondary-foreground);
--color-destructive: var(--destructive);
--color-ring: var(--ring);
--color-surface: var(--surface);
--color-surface-subtle: var(--surface-subtle);
--color-text-strong: var(--text-strong);
--color-text-normal: var(--text-normal);
--color-text-soft: var(--text-soft);
--text-xs: 12px;
--text-sm: 13px;
--text-base: 14px;
--text-md: 15px;
--text-lg: 16px;
--text-xl: 18px;
--text-2xl: 22px;
--text-3xl: 30px;
--radius-sm: 7px;
--radius-md: 8px;
--radius-lg: 10px;
--radius-xl: 12px;
--shadow-card: 0 1px 2px rgba(16, 24, 40, 0.06);
--shadow-dialog: 0 22px 60px rgba(16, 24, 40, 0.16);
}
:root {
--background: #f7f8fa;
--foreground: #101318;
--background: #ffffff;
--foreground: #09090b;
--card: #ffffff;
--card-foreground: #101318;
--muted: #f2f4f7;
--muted-foreground: #6b7280;
--border: #e4e7ec;
--input: #d8dee6;
--primary: #111827;
--card-foreground: #09090b;
--surface: #ffffff;
--surface-subtle: #fafafa;
--surface-muted: #f4f4f5;
--muted: #f4f4f5;
--muted-foreground: #71717a;
--border: #e4e4e7;
--border-subtle: #e4e4e7;
--input: #e4e4e7;
--primary: #18181b;
--primary-foreground: #ffffff;
--secondary: #f4f6f8;
--secondary-foreground: #202734;
--destructive: #b42318;
--ring: #64748b;
--secondary: #f4f4f5;
--secondary-foreground: #18181b;
--destructive: #dc2626;
--destructive-foreground: #ffffff;
--accent: #f4f4f5;
--accent-foreground: #18181b;
--popover: #ffffff;
--popover-foreground: #09090b;
--ring: #a1a1aa;
--text-strong: #09090b;
--text-normal: #27272a;
--text-soft: #71717a;
--text-faint: #a1a1aa;
--font-size-xs: 12px;
--font-size-sm: 13px;
--font-size-base: 14px;
--font-size-md: 15px;
--font-size-lg: 16px;
--font-size-xl: 18px;
--font-size-2xl: 22px;
--line-height-tight: 1.2;
--line-height-normal: 1.55;
--font-weight-regular: 400;
--font-weight-medium: 500;
--font-weight-semibold: 600;
--font-weight-strong: 650;
--control-height-sm: 32px;
--control-height: 40px;
--control-radius: 6px;
--card-radius: 12px;
--focus-ring: 0 0 0 3px rgba(24, 24, 27, 0.12);
--shadow-soft: none;
--shadow-panel: none;
color: var(--foreground);
background: var(--background);
font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
@@ -32,6 +111,11 @@ body {
margin: 0;
min-width: 320px;
min-height: 100vh;
color: var(--text-normal);
font-size: var(--font-size-base);
font-weight: var(--font-weight-regular);
line-height: var(--line-height-normal);
background: var(--background);
}
button,
@@ -39,6 +123,7 @@ input,
select,
textarea {
font: inherit;
color: inherit;
}
button {
@@ -58,15 +143,28 @@ p {
}
h1 {
font-size: 30px;
color: var(--text-strong);
font-size: 28px;
font-weight: var(--font-weight-semibold);
line-height: 1.15;
}
h2,
h3 {
color: var(--text-strong);
font-weight: var(--font-weight-semibold);
}
b,
strong {
font-weight: var(--font-weight-semibold);
}
.eyebrow {
margin-bottom: 5px;
color: var(--muted-foreground);
font-size: 12px;
font-weight: 800;
font-weight: var(--font-weight-semibold);
text-transform: uppercase;
}
@@ -92,11 +190,11 @@ h1 {
width: 38px;
height: 38px;
place-items: center;
border-radius: 10px;
background: #111827;
border-radius: var(--card-radius);
background: var(--primary);
color: #fff;
font-size: 13px;
font-weight: 900;
font-size: var(--font-size-sm);
font-weight: var(--font-weight-semibold);
}
.authShell {
@@ -130,13 +228,23 @@ h1 {
min-height: 100vh;
}
.appShell[data-page="playground"] {
display: grid;
height: 100dvh;
min-height: 0;
grid-template-rows: auto minmax(0, 1fr);
overflow: hidden;
}
.brandBlock {
min-width: 210px;
}
.brandBlock strong {
display: block;
font-size: 15px;
color: var(--text-strong);
font-size: var(--font-size-md);
font-weight: var(--font-weight-semibold);
}
.brandBlock span,
@@ -147,7 +255,7 @@ h1 {
.docNote span,
.capabilityCard small {
color: var(--muted-foreground);
font-size: 13px;
font-size: var(--font-size-sm);
}
.topNav {
@@ -155,47 +263,52 @@ h1 {
align-items: center;
gap: 2px;
padding: 3px;
border: 1px solid #e7ebf0;
border: 1px solid var(--border);
border-radius: 999px;
background: rgba(255, 255, 255, 0.72);
}
.topNavItem {
display: flex;
min-height: 38px;
min-height: 34px;
align-items: center;
gap: 7px;
padding: 0 14px;
border: 0;
border-radius: 999px;
background: transparent;
color: #5d6675;
font-size: 14px;
font-weight: 800;
color: var(--text-soft);
font-size: var(--font-size-sm);
font-weight: var(--font-weight-medium);
white-space: nowrap;
}
.topNavItem:hover,
.topNavItem[data-active="true"] {
background: #ffffff;
color: #111827;
box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
color: var(--text-strong);
box-shadow: var(--shadow-soft);
}
.workspaceShell {
min-width: 0;
}
.appShell[data-page="playground"] .workspaceShell {
min-height: 0;
overflow: hidden;
}
.appTopbar {
position: sticky;
top: 0;
z-index: 2;
display: flex;
min-height: 68px;
min-height: 64px;
align-items: center;
justify-content: space-between;
gap: 16px;
padding: 0 28px;
padding: 0 26px;
border-bottom: 1px solid var(--border);
background: rgba(255, 255, 255, 0.88);
box-shadow: 0 1px 0 rgba(16, 24, 40, 0.03);
@@ -216,8 +329,8 @@ h1 {
align-items: center;
gap: 8px;
color: var(--muted-foreground);
font-size: 13px;
font-weight: 700;
font-size: var(--font-size-sm);
font-weight: var(--font-weight-medium);
}
.health span {
@@ -236,9 +349,9 @@ h1 {
min-height: 34px;
padding: 0 10px;
border: 1px solid var(--input);
border-radius: 8px;
background: #fff;
color: var(--foreground);
border-radius: var(--control-radius);
background: var(--surface);
color: var(--text-normal);
}
.contentShell {
@@ -256,8 +369,8 @@ h1 {
.pageHeader p:not(.eyebrow) {
margin-top: 8px;
color: var(--muted-foreground);
font-size: 14px;
color: var(--text-soft);
font-size: var(--font-size-base);
}
.notice,
@@ -267,7 +380,7 @@ h1 {
border-radius: 8px;
background: #fff7f7;
color: #9f2f2f;
font-size: 14px;
font-size: var(--font-size-sm);
}
.statGrid {
@@ -302,8 +415,9 @@ h1 {
min-height: 92px;
padding: 15px;
border: 1px solid var(--border);
border-radius: 10px;
background: var(--card);
border-radius: var(--card-radius);
background: var(--surface);
box-shadow: var(--shadow-soft);
}
.statCard[data-tone="blue"] { border-color: #d8e0ea; }
@@ -314,8 +428,8 @@ h1 {
.statCard[data-tone="rose"] { border-color: #ead8df; }
.statCard span {
color: var(--muted-foreground);
font-size: 13px;
color: var(--text-soft);
font-size: var(--font-size-sm);
}
.statCard strong,
@@ -323,7 +437,10 @@ h1 {
.balanceCard strong {
display: block;
margin-top: 10px;
font-size: 28px;
color: var(--text-strong);
font-size: 24px;
font-weight: var(--font-weight-semibold);
line-height: var(--line-height-tight);
}
.capabilityCard {
@@ -337,9 +454,9 @@ h1 {
height: 38px;
place-items: center;
border: 1px solid var(--border);
border-radius: 10px;
background: #fff;
color: #111827;
border-radius: var(--card-radius);
background: var(--surface);
color: var(--text-strong);
}
.infoItem,
@@ -348,8 +465,8 @@ h1 {
gap: 5px;
padding: 12px;
border: 1px solid var(--border);
border-radius: 8px;
background: #fafbfc;
border-radius: var(--control-radius);
background: var(--surface-subtle);
}
@media (max-width: 980px) {