feat: MetonaAI Desktop 初始项目
- Electron + React + TypeScript 架构 - 三栏布局: Sidebar | ChatPanel | DetailPanel - 9 个内置工具 (文件系统/网络/记忆/命令) - SQLite 持久化 (better-sqlite3) - MUI 暗色/亮色主题系统 - Agent Loop ReAct 状态机引擎 - DeepSeek / Agnes AI / Ollama Provider 适配器 - MCP 协议集成 - 系统托盘 + 全局快捷键 - Tailwind CSS v4 + Tailwind Merge - 修复: Sidebar 缺失 TextField 导入导致黑屏
This commit is contained in:
@@ -0,0 +1,263 @@
|
||||
@import "tailwindcss";
|
||||
|
||||
/* ===== MetonaAI Desktop — 全局样式 ===== */
|
||||
|
||||
/* CSS 变量 — 暗色主题(默认) */
|
||||
:root,
|
||||
:root[data-theme="dark"] {
|
||||
color-scheme: dark;
|
||||
--bg-primary: #0f1117;
|
||||
--bg-secondary: #1a1d27;
|
||||
--bg-tertiary: #252836;
|
||||
--bg-hover: rgba(99, 102, 241, 0.06);
|
||||
--bg-card: #1a1d27;
|
||||
--text-primary: #e1e4ed;
|
||||
--text-secondary: #64748b;
|
||||
--text-dim: #8b8fa7;
|
||||
--border-color: #2a2d3a;
|
||||
--accent: #818cf8;
|
||||
--accent-soft: rgba(99, 102, 241, 0.15);
|
||||
--green: #34d399;
|
||||
--orange: #fb923c;
|
||||
--red: #f87171;
|
||||
--amber: #fbbf24;
|
||||
--cyan: #22d3ee;
|
||||
--purple: #a855f7;
|
||||
--pink: #f472b6;
|
||||
--background: #0f1117;
|
||||
--foreground: #e1e4ed;
|
||||
--primary: #818cf8;
|
||||
--primary-foreground: #0f1117;
|
||||
--secondary: #252836;
|
||||
--secondary-foreground: #e1e4ed;
|
||||
--muted: #252836;
|
||||
--muted-foreground: #8b8fa7;
|
||||
--destructive: #f87171;
|
||||
--destructive-foreground: #e1e4ed;
|
||||
--border: #2a2d3a;
|
||||
--input: #2a2d3a;
|
||||
--ring: #818cf8;
|
||||
--radius: 0.625rem;
|
||||
}
|
||||
|
||||
/* 亮色主题 */
|
||||
:root[data-theme="light"] {
|
||||
color-scheme: light;
|
||||
--bg-primary: #ffffff;
|
||||
--bg-secondary: #f8fafc;
|
||||
--bg-tertiary: #f1f5f9;
|
||||
--bg-hover: rgba(99, 102, 241, 0.04);
|
||||
--bg-card: #f8fafc;
|
||||
--text-primary: #0f172a;
|
||||
--text-secondary: #334155;
|
||||
--text-dim: #64748b;
|
||||
--border-color: #e2e8f0;
|
||||
--accent: #6366f1;
|
||||
--accent-soft: rgba(99, 102, 241, 0.1);
|
||||
--green: #059669;
|
||||
--orange: #ea580c;
|
||||
--red: #dc2626;
|
||||
--amber: #d97706;
|
||||
--cyan: #0891b2;
|
||||
--purple: #9333ea;
|
||||
--pink: #db2777;
|
||||
--background: #ffffff;
|
||||
--foreground: #0f172a;
|
||||
--primary: #6366f1;
|
||||
--primary-foreground: #ffffff;
|
||||
--secondary: #f1f5f9;
|
||||
--secondary-foreground: #0f172a;
|
||||
--muted: #f1f5f9;
|
||||
--muted-foreground: #64748b;
|
||||
--destructive: #dc2626;
|
||||
--destructive-foreground: #ffffff;
|
||||
--border: #e2e8f0;
|
||||
--input: #e2e8f0;
|
||||
--ring: #6366f1;
|
||||
--radius: 0.625rem;
|
||||
}
|
||||
|
||||
/* Tailwind v4 主题注册 */
|
||||
@theme {
|
||||
--color-bg-primary: var(--bg-primary);
|
||||
--color-bg-secondary: var(--bg-secondary);
|
||||
--color-bg-tertiary: var(--bg-tertiary);
|
||||
--color-bg-hover: var(--bg-hover);
|
||||
--color-text-primary: var(--text-primary);
|
||||
--color-text-secondary: var(--text-secondary);
|
||||
--color-text-dim: var(--text-dim);
|
||||
--color-border-color: var(--border-color);
|
||||
--color-green: var(--green);
|
||||
--color-orange: var(--orange);
|
||||
--color-red: var(--red);
|
||||
--color-amber: var(--amber);
|
||||
--color-cyan: var(--cyan);
|
||||
--color-purple: var(--purple);
|
||||
--color-pink: var(--pink);
|
||||
--color-background: var(--background);
|
||||
--color-foreground: var(--foreground);
|
||||
--color-primary: var(--primary);
|
||||
--color-primary-foreground: var(--primary-foreground);
|
||||
--color-secondary: var(--secondary);
|
||||
--color-secondary-foreground: var(--secondary-foreground);
|
||||
--color-muted: var(--muted);
|
||||
--color-muted-foreground: var(--muted-foreground);
|
||||
--color-destructive: var(--destructive);
|
||||
--color-destructive-foreground: var(--destructive-foreground);
|
||||
--color-border: var(--border);
|
||||
--color-input: var(--input);
|
||||
--color-ring: var(--ring);
|
||||
--radius: var(--radius);
|
||||
}
|
||||
|
||||
:root[data-theme="light"] {
|
||||
color-scheme: light;
|
||||
}
|
||||
|
||||
/* ===== 全局基础样式 ===== */
|
||||
|
||||
* { margin: 0; padding: 0; box-sizing: border-box; }
|
||||
html, body, #root { width: 100%; height: 100%; overflow: hidden; }
|
||||
body {
|
||||
background: var(--bg-primary);
|
||||
color: var(--text-primary);
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
|
||||
/* ===== 滚动条样式 ===== */
|
||||
|
||||
::-webkit-scrollbar { width: 6px; height: 6px; }
|
||||
::-webkit-scrollbar-track { background: transparent; }
|
||||
::-webkit-scrollbar-thumb { background: #2a2d3a; border-radius: 3px; }
|
||||
::-webkit-scrollbar-thumb:hover { background: #8b8fa7; }
|
||||
|
||||
/* ===== 代码字体 ===== */
|
||||
|
||||
code, pre, .font-mono { font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace; }
|
||||
|
||||
/* ===== 选择文本颜色 ===== */
|
||||
::selection { background: rgba(99, 102, 241, 0.15); }
|
||||
|
||||
/* ===== 焦点样式 ===== */
|
||||
:focus-visible { outline: 2px solid #818cf8; outline-offset: 2px; }
|
||||
|
||||
/* ===== 动画 Keyframes ===== */
|
||||
|
||||
@keyframes fadeInUp {
|
||||
from { opacity: 0; transform: translateY(10px); }
|
||||
to { opacity: 1; transform: translateY(0); }
|
||||
}
|
||||
|
||||
@keyframes pulse {
|
||||
0%, 100% { opacity: 1; }
|
||||
50% { opacity: 0.5; }
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
from { transform: rotate(0deg); }
|
||||
to { transform: rotate(360deg); }
|
||||
}
|
||||
|
||||
@keyframes shimmer {
|
||||
0% { background-position: -200% 0; }
|
||||
100% { background-position: 200% 0; }
|
||||
}
|
||||
|
||||
@keyframes blink {
|
||||
0%, 100% { opacity: 1; }
|
||||
50% { opacity: 0; }
|
||||
}
|
||||
|
||||
@keyframes slideUp {
|
||||
from { opacity: 0; transform: translateY(20px); }
|
||||
to { opacity: 1; transform: translateY(0); }
|
||||
}
|
||||
|
||||
@keyframes fadeIn {
|
||||
from { opacity: 0; }
|
||||
to { opacity: 1; }
|
||||
}
|
||||
|
||||
@keyframes scaleIn {
|
||||
from { opacity: 0; transform: scale(0.95); }
|
||||
to { opacity: 1; transform: scale(1); }
|
||||
}
|
||||
|
||||
/* ===== Markdown Prose 样式 ===== */
|
||||
|
||||
.prose-metona {
|
||||
color: inherit;
|
||||
line-height: 1.7;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.prose-metona h1,
|
||||
.prose-metona h2,
|
||||
.prose-metona h3,
|
||||
.prose-metona h4 {
|
||||
font-weight: 600;
|
||||
margin-top: 1.5em;
|
||||
margin-bottom: 0.5em;
|
||||
}
|
||||
|
||||
.prose-metona h1 { font-size: 1.5em; }
|
||||
.prose-metona h2 { font-size: 1.25em; }
|
||||
.prose-metona h3 { font-size: 1.125em; }
|
||||
|
||||
.prose-metona p { margin-bottom: 0.75em; }
|
||||
|
||||
.prose-metona a { color: #818cf8; text-decoration: none; }
|
||||
.prose-metona a:hover { text-decoration: underline; }
|
||||
|
||||
.prose-metona code {
|
||||
color: #22d3ee;
|
||||
background: rgba(34, 211, 238, 0.1);
|
||||
padding: 1px 5px;
|
||||
border-radius: 3px;
|
||||
font-size: 0.875em;
|
||||
}
|
||||
|
||||
.prose-metona pre {
|
||||
background: #252836;
|
||||
border: 1px solid #2a2d3a;
|
||||
border-radius: 8px;
|
||||
padding: 16px;
|
||||
overflow-x: auto;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
.prose-metona pre code {
|
||||
color: inherit;
|
||||
background: transparent;
|
||||
padding: 0;
|
||||
font-size: 13px;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.prose-metona blockquote {
|
||||
border-left: 3px solid #818cf8;
|
||||
padding-left: 16px;
|
||||
color: #64748b;
|
||||
margin-bottom: 0.75em;
|
||||
}
|
||||
|
||||
.prose-metona ul, .prose-metona ol { padding-left: 1.5em; margin-bottom: 0.75em; }
|
||||
.prose-metona li { margin-bottom: 0.25em; }
|
||||
|
||||
.prose-metona table { width: 100%; border-collapse: collapse; margin-bottom: 1em; font-size: 13px; }
|
||||
.prose-metona th { text-align: left; padding: 8px 12px; background: #252836; border-bottom: 1px solid #2a2d3a; color: #64748b; font-weight: 600; }
|
||||
.prose-metona td { padding: 8px 12px; border-bottom: 1px solid #2a2d3a; }
|
||||
|
||||
.prose-metona hr { border: none; height: 1px; background: #2a2d3a; margin: 1.5em 0; }
|
||||
.prose-metona img { max-width: 100%; border-radius: 8px; }
|
||||
|
||||
/* ===== 动效降级 ===== */
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
*, *::before, *::after {
|
||||
animation-duration: 0.01ms !important;
|
||||
animation-iteration-count: 1 !important;
|
||||
transition-duration: 0.01ms !important;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user