refactor: 统一页面样式
This commit is contained in:
1 parent
42908b42f1
commit
0c6f1c0ffc
25 files changed
+3509
-2044
No files matched your search
+103
-106
@@ -1,24 +1,12 @@
|
||||
@import './styles/tokens.css';
|
||||
@import './styles/utilities.css';
|
||||
@import './styles/components-ds.css';
|
||||
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
|
||||
@layer base {
|
||||
:root {
|
||||
--bg-page: #f8fafc;
|
||||
--bg-surface: #ffffff;
|
||||
--bg-surface-soft: #f8fafc;
|
||||
--bg-surface-strong: #f1f5f9;
|
||||
--text-primary: #0f172a;
|
||||
--text-secondary: #334155;
|
||||
--text-muted: #64748b;
|
||||
--border-default: #e2e8f0;
|
||||
--border-subtle: #f1f5f9;
|
||||
--overlay-soft: rgba(15, 23, 42, 0.4);
|
||||
--shadow-elevated: 0 8px 30px -12px rgba(15, 23, 42, 0.2);
|
||||
--glow-accent: 0 0 0 1px rgba(14, 165, 233, 0.18), 0 16px 40px -22px rgba(14, 165, 233, 0.45);
|
||||
}
|
||||
|
||||
html {
|
||||
font-family: 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', 'Helvetica Neue', Arial, system-ui, sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
@@ -28,35 +16,14 @@
|
||||
}
|
||||
|
||||
html.dark {
|
||||
color-scheme: dark;
|
||||
--bg-page: #020617;
|
||||
--bg-surface: #0b1220;
|
||||
--bg-surface-soft: #0f172a;
|
||||
--bg-surface-strong: #1e293b;
|
||||
--text-primary: #f8fafc;
|
||||
--text-secondary: #cbd5e1;
|
||||
--text-muted: #94a3b8;
|
||||
--border-default: #334155;
|
||||
--border-subtle: #1e293b;
|
||||
--overlay-soft: rgba(2, 6, 23, 0.72);
|
||||
--shadow-elevated: 0 12px 30px -16px rgba(2, 6, 23, 0.85);
|
||||
--glow-accent: 0 0 0 1px rgba(56, 189, 248, 0.28), 0 20px 44px -24px rgba(56, 189, 248, 0.5);
|
||||
background-color: var(--bg-page);
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
font-family: 'PingFang SC', 'Microsoft YaHei', 'Segoe UI Semibold', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
|
||||
@apply tracking-tight font-semibold text-slate-900;
|
||||
}
|
||||
|
||||
html.dark h1,
|
||||
html.dark h2,
|
||||
html.dark h3,
|
||||
html.dark h4,
|
||||
html.dark h5,
|
||||
html.dark h6 {
|
||||
@apply text-slate-100;
|
||||
@apply tracking-tight font-semibold;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
body {
|
||||
@@ -82,23 +49,105 @@
|
||||
}
|
||||
|
||||
.btn-secondary {
|
||||
@apply btn bg-white text-slate-700 border border-slate-200 hover:bg-slate-50 hover:border-slate-300 shadow-sm;
|
||||
@apply btn shadow-sm;
|
||||
background-color: var(--bg-surface);
|
||||
border: 1px solid var(--border-default);
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.btn-secondary:hover {
|
||||
background-color: var(--bg-surface-soft);
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.btn-ghost {
|
||||
@apply btn bg-transparent text-slate-600 hover:bg-slate-100 hover:text-slate-900 shadow-none;
|
||||
@apply btn shadow-none;
|
||||
background-color: transparent;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.btn-ghost:hover {
|
||||
background-color: var(--bg-surface-strong);
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.btn-danger {
|
||||
@apply btn bg-red-50 text-red-600 hover:bg-red-100 border border-transparent;
|
||||
@apply btn border border-transparent;
|
||||
background-color: var(--status-error-bg);
|
||||
color: var(--status-error-fg);
|
||||
}
|
||||
|
||||
.btn-danger:hover {
|
||||
filter: brightness(0.95);
|
||||
}
|
||||
|
||||
.btn-sm {
|
||||
@apply px-3 py-1.5 text-sm rounded-lg gap-1.5;
|
||||
}
|
||||
|
||||
.btn-lg {
|
||||
@apply px-6 py-3 text-base rounded-xl gap-2;
|
||||
}
|
||||
|
||||
.btn-primary.btn-sm,
|
||||
.btn-secondary.btn-sm,
|
||||
.btn-ghost.btn-sm,
|
||||
.btn-danger.btn-sm {
|
||||
@apply px-3 py-1.5 text-sm rounded-lg;
|
||||
}
|
||||
|
||||
.btn-primary.btn-lg,
|
||||
.btn-secondary.btn-lg {
|
||||
@apply px-6 py-3 text-base rounded-xl;
|
||||
}
|
||||
|
||||
.select-field {
|
||||
@apply input-field cursor-pointer;
|
||||
appearance: auto;
|
||||
}
|
||||
|
||||
.label-field {
|
||||
@apply text-xs font-semibold uppercase tracking-wider;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.section-gap {
|
||||
@apply space-y-6;
|
||||
}
|
||||
|
||||
.form-stack {
|
||||
@apply space-y-4;
|
||||
}
|
||||
|
||||
/* @deprecated — use .segment-control + .segment-item (components-ds.css) */
|
||||
.btn-segment {
|
||||
@apply segment-item;
|
||||
}
|
||||
|
||||
.btn-segment--active {
|
||||
@apply segment-item--active;
|
||||
}
|
||||
|
||||
.input-field {
|
||||
@apply w-full px-4 py-3 rounded-xl border border-slate-200 bg-white text-slate-900 placeholder-slate-400 focus:border-brand-500 focus:ring-2 focus:ring-brand-500/20 outline-none transition-all duration-200;
|
||||
@apply w-full px-4 py-3 rounded-xl outline-none transition-all duration-200;
|
||||
border: 1px solid var(--border-default);
|
||||
background-color: var(--bg-surface);
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.input-field::placeholder {
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.input-field:focus {
|
||||
border-color: #0ea5e9;
|
||||
box-shadow: 0 0 0 3px var(--focus-ring);
|
||||
}
|
||||
|
||||
.card {
|
||||
@apply bg-white rounded-2xl border border-slate-100 shadow-soft hover:shadow-lg transition-all duration-300 dark:bg-slate-800 dark:border-slate-700;
|
||||
@apply rounded-2xl shadow-soft hover:shadow-lg transition-all duration-300;
|
||||
background-color: var(--bg-surface);
|
||||
border: 1px solid var(--border-default);
|
||||
}
|
||||
|
||||
/* Mobile-first layout tokens for consistent spacing and density. */
|
||||
@@ -128,21 +177,20 @@
|
||||
|
||||
.glass-panel {
|
||||
@apply backdrop-blur-xl border;
|
||||
background: rgba(255, 255, 255, 0.68);
|
||||
border-color: rgba(148, 163, 184, 0.26);
|
||||
background: var(--glass-panel-bg);
|
||||
border-color: var(--glass-panel-border);
|
||||
box-shadow: var(--glow-accent);
|
||||
}
|
||||
|
||||
/* Keep chat composer border and fill visually consistent in light/dark themes. */
|
||||
.chat-composer-shell {
|
||||
background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(248, 250, 252, 0.97) 100%);
|
||||
box-shadow: 0 14px 28px -20px rgba(15, 23, 42, 0.38);
|
||||
background-image: var(--chat-composer-gradient);
|
||||
box-shadow: var(--chat-composer-shadow);
|
||||
background-clip: padding-box;
|
||||
}
|
||||
|
||||
.chat-composer-shell:focus-within {
|
||||
transform: translateY(-1px);
|
||||
box-shadow: 0 16px 34px -22px rgba(14, 165, 233, 0.45);
|
||||
box-shadow: var(--chat-composer-shadow-focus);
|
||||
}
|
||||
|
||||
.chat-composer-textarea {
|
||||
@@ -164,57 +212,14 @@
|
||||
.chat-composer-textarea::selection {
|
||||
background-color: rgba(14, 165, 233, 0.2);
|
||||
}
|
||||
}
|
||||
|
||||
@layer components {
|
||||
html.dark .btn-secondary {
|
||||
background-color: var(--bg-surface-strong);
|
||||
border-color: var(--border-default);
|
||||
color: var(--text-secondary);
|
||||
html.dark .chat-composer-textarea {
|
||||
caret-color: #67e8f9;
|
||||
}
|
||||
|
||||
html.dark .btn-secondary:hover {
|
||||
background-color: var(--bg-surface-soft);
|
||||
border-color: #475569;
|
||||
color: var(--text-primary);
|
||||
html.dark .chat-composer-textarea::selection {
|
||||
background-color: rgba(56, 189, 248, 0.25);
|
||||
}
|
||||
|
||||
html.dark .btn-ghost {
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
html.dark .btn-ghost:hover {
|
||||
background-color: var(--bg-surface-strong);
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
html.dark .btn-danger {
|
||||
background-color: rgba(239, 68, 68, 0.12);
|
||||
color: #fca5a5;
|
||||
}
|
||||
|
||||
html.dark .btn-danger:hover {
|
||||
background-color: rgba(239, 68, 68, 0.2);
|
||||
}
|
||||
|
||||
html.dark .glass-panel {
|
||||
background: rgba(2, 6, 23, 0.66);
|
||||
border-color: rgba(71, 85, 105, 0.5);
|
||||
}
|
||||
|
||||
html.dark .chat-composer-shell {
|
||||
background-image: linear-gradient(180deg, rgba(15, 23, 42, 0.92) 0%, rgba(10, 16, 30, 0.92) 100%);
|
||||
box-shadow: 0 18px 36px -28px rgba(2, 6, 23, 0.96);
|
||||
}
|
||||
|
||||
html.dark .chat-composer-textarea {
|
||||
background-color: transparent !important;
|
||||
caret-color: #67e8f9;
|
||||
}
|
||||
|
||||
html.dark .chat-composer-textarea::selection {
|
||||
background-color: rgba(56, 189, 248, 0.25);
|
||||
}
|
||||
}
|
||||
|
||||
/* Custom Scrollbar */
|
||||
@@ -241,6 +246,8 @@ html.dark #app {
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
/* Legacy shim — maps unmigrated Tailwind color utilities to L1 tokens. Remove as views finish migration. */
|
||||
|
||||
html.dark .bg-white {
|
||||
background-color: var(--bg-surface) !important;
|
||||
}
|
||||
@@ -325,16 +332,6 @@ html.dark .ring-1 {
|
||||
--tw-ring-color: rgba(148, 163, 184, 0.3);
|
||||
}
|
||||
|
||||
html.dark .input-field {
|
||||
background-color: var(--bg-surface-soft) !important;
|
||||
border-color: var(--border-default) !important;
|
||||
color: var(--text-primary) !important;
|
||||
}
|
||||
|
||||
html.dark .input-field::placeholder {
|
||||
color: var(--text-muted) !important;
|
||||
}
|
||||
|
||||
html.dark input:not([type="checkbox"]):not([type="radio"]),
|
||||
html.dark textarea,
|
||||
html.dark select {
|
||||
|
||||
Reference in new issue
Block a user