+
+
{currentSessionId ? (
-
会话: {currentSessionId.slice(0, 8)}...
+
+
{currentSessionId.slice(0, 12)}...
+
) : (
-
暂无对话
+
暂无对话
)}
diff --git a/frontend/web/src/index.css b/frontend/web/src/index.css
index 3ea6a81..662db5b 100644
--- a/frontend/web/src/index.css
+++ b/frontend/web/src/index.css
@@ -1,9 +1,100 @@
@import "tailwindcss";
+@theme {
+ /* Miuix Dark Color Scheme — Xiaomi HyperOS */
+ --color-mx-primary: #277AF7;
+ --color-mx-primary-hover: #3482FF;
+ --color-mx-primary-container: #338FE4;
+ --color-mx-on-primary: #FFFFFF;
+
+ --color-mx-bg: #242424;
+ --color-mx-bg-elevated: #000000;
+ --color-mx-bg-high: #2D2D2D;
+
+ --color-mx-surface: #000000;
+ --color-mx-surface-variant: #242424;
+ --color-mx-surface-high: #2D2D2D;
+
+ --color-mx-text: #F2F2F2;
+ --color-mx-text-secondary: rgba(255,255,255,0.8);
+ --color-mx-text-dim: rgba(255,255,255,0.5);
+ --color-mx-text-disabled: #666666;
+
+ --color-mx-outline: #404040;
+ --color-mx-divider: #393939;
+
+ --color-mx-error: #F12522;
+ --color-mx-error-container: #2E0603;
+
+ --color-mx-tertiary: #2B3B54;
+ --color-mx-tertiary-text: #4788FF;
+
+ --radius-mx-card: 18px;
+ --radius-mx-button: 9999px;
+ --radius-mx-input: 14px;
+ --radius-mx-bubble: 18px;
+
+ --font-mx: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
+}
+
body {
margin: 0;
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
+ background: var(--color-mx-bg);
+ color: var(--color-mx-text);
+ font-family: var(--font-mx);
+ -webkit-font-smoothing: antialiased;
}
-::-webkit-scrollbar { width: 6px; }
-::-webkit-scrollbar-thumb { background: #4b5563; border-radius: 3px; }
+::-webkit-scrollbar { width: 4px; }
+::-webkit-scrollbar-track { background: transparent; }
+::-webkit-scrollbar-thumb { background: var(--color-mx-outline); border-radius: 2px; }
+
+/* Smooth focus ring */
+*:focus-visible {
+ outline: 2px solid var(--color-mx-primary);
+ outline-offset: 2px;
+ border-radius: var(--radius-mx-button);
+}
+
+/* Glass effect for header */
+.mx-glass {
+ background: rgba(36, 36, 36, 0.85);
+ backdrop-filter: blur(20px) saturate(1.5);
+ -webkit-backdrop-filter: blur(20px) saturate(1.5);
+}
+
+/* Smooth transitions */
+.mx-transition {
+ transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
+}
+
+/* Card surface */
+.mx-card {
+ background: var(--color-mx-surface);
+ border-radius: var(--radius-mx-card);
+ border: 0.5px solid var(--color-mx-outline);
+}
+
+/* Button base */
+.mx-btn {
+ background: var(--color-mx-primary);
+ color: var(--color-mx-on-primary);
+ border-radius: var(--radius-mx-button);
+ font-weight: 500;
+ transition: all 0.2s ease;
+}
+.mx-btn:hover { background: var(--color-mx-primary-hover); }
+.mx-btn:active { transform: scale(0.97); }
+.mx-btn:disabled { background: #253E64; color: #677993; }
+
+/* Input base */
+.mx-input {
+ background: var(--color-mx-surface);
+ border: 0.5px solid var(--color-mx-outline);
+ border-radius: var(--radius-mx-input);
+ color: var(--color-mx-text);
+ outline: none;
+ transition: border-color 0.2s;
+}
+.mx-input:focus { border-color: var(--color-mx-primary); }
+.mx-input::placeholder { color: var(--color-mx-text-dim); }
diff --git a/frontend/web/src/pages/LoginPage.tsx b/frontend/web/src/pages/LoginPage.tsx
index 5e5abf7..f8a4519 100644
--- a/frontend/web/src/pages/LoginPage.tsx
+++ b/frontend/web/src/pages/LoginPage.tsx
@@ -6,31 +6,64 @@ export default function LoginPage() {
const [username, setUsername] = useState('admin')
const [password, setPassword] = useState('admin')
const [error, setError] = useState('')
+ const [loading, setLoading] = useState(false)
const navigate = useNavigate()
const login = useAuthStore((s) => s.login)
const handleSubmit = async (e: React.FormEvent) => {
e.preventDefault()
setError('')
+ setLoading(true)
try {
await login(username, password)
navigate('/chat')
} catch (err) {
- setError(err instanceof Error ? err.message : 'Login failed')
+ setError(err instanceof Error ? err.message : '登录失败')
+ } finally {
+ setLoading(false)
}
}
return (
-