Luxx/dashboard/src/style.css

513 lines
10 KiB
CSS

/* ============ Global Reset & Base ============ */
:root {
/* 背景色 */
--bg-primary: #ffffff;
--bg-secondary: #f8fafc;
--bg-tertiary: #f0f4f8;
--bg-hover: rgba(37, 99, 235, 0.06);
--bg-active: rgba(37, 99, 235, 0.12);
--bg-input: #f8fafc;
--bg-code: #f1f5f9;
--bg-thinking: #f1f5f9;
/* 文字颜色 */
--text-primary: #1e293b;
--text-secondary: #64748b;
--text-tertiary: #94a3b8;
/* 边框颜色 */
--border-light: rgba(0, 0, 0, 0.06);
--border-medium: rgba(0, 0, 0, 0.08);
--border-input: rgba(0, 0, 0, 0.08);
/* 主题色 */
--accent-primary: #2563eb;
--accent-primary-hover: #3b82f6;
--accent-primary-light: rgba(37, 99, 235, 0.08);
--accent-primary-medium: rgba(37, 99, 235, 0.15);
/* 工具调用颜色 */
--tool-color: #5478FF;
--tool-color-hover: #3d5ce0;
--tool-bg: rgba(84, 120, 255, 0.18);
--tool-bg-hover: rgba(84, 120, 255, 0.28);
--tool-border: rgba(84, 120, 255, 0.22);
/* 附件颜色 */
--attachment-color: #ca8a04;
--attachment-color-hover: #a16207;
--attachment-bg: rgba(202, 138, 4, 0.15);
/* 状态颜色 */
--success-color: #059669;
--success-bg: rgba(16, 185, 129, 0.1);
--warning-color: #d97706;
--warning-bg: rgba(217, 119, 6, 0.1);
--danger-color: #ef4444;
--danger-bg: rgba(239, 68, 68, 0.08);
/* 滚动条颜色 */
--scrollbar-thumb: rgba(0, 0, 0, 0.08);
--scrollbar-thumb-sidebar: rgba(0, 0, 0, 0.1);
/* 遮罩背景 */
--overlay-bg: rgba(0, 0, 0, 0.3);
--avatar-gradient: linear-gradient(135deg, #3b82f6, #60a5fa);
/* 兼容旧变量 */
--text: var(--text-primary);
--text-h: var(--text-primary);
--bg: var(--bg-primary);
--border: var(--border-light);
--accent: var(--accent-primary);
--accent-bg: var(--accent-primary-light);
--accent-border: var(--accent-primary-medium);
--social-bg: rgba(244, 243, 236, 0.5);
--sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
--heading: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
--mono: ui-monospace, Consolas, 'JetBrains Mono', monospace;
font: 18px/145% var(--sans);
letter-spacing: 0.18px;
color-scheme: light dark;
color: var(--text-primary);
background: var(--bg-primary);
font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
[data-theme="dark"] {
--bg-primary: #1a1a1a;
--bg-secondary: #141414;
--bg-tertiary: #0a0a0a;
--bg-hover: rgba(255, 255, 255, 0.08);
--bg-active: rgba(255, 255, 255, 0.12);
--bg-input: #141414;
--bg-code: #141414;
--bg-thinking: #141414;
--text-primary: #f0f0f0;
--text-secondary: #a0a0a0;
--text-tertiary: #606060;
--border-light: rgba(255, 255, 255, 0.08);
--border-medium: rgba(255, 255, 255, 0.12);
--border-input: rgba(255, 255, 255, 0.1);
--accent-primary: #3b82f6;
--accent-primary-hover: #60a5fa;
--accent-primary-light: rgba(59, 130, 246, 0.15);
--accent-primary-medium: rgba(59, 130, 246, 0.25);
--tool-color: #5478FF;
--tool-color-hover: #7a96ff;
--tool-bg: rgba(84, 120, 255, 0.28);
--tool-bg-hover: rgba(84, 120, 255, 0.40);
--tool-border: rgba(84, 120, 255, 0.32);
--attachment-color: #facc15;
--attachment-color-hover: #fde047;
--attachment-bg: rgba(250, 204, 21, 0.22);
--success-color: #34d399;
--success-bg: rgba(52, 211, 153, 0.15);
--warning-color: #fbbf24;
--warning-bg: rgba(251, 191, 36, 0.15);
--danger-color: #f87171;
--danger-bg: rgba(248, 113, 113, 0.15);
--scrollbar-thumb: rgba(255, 255, 255, 0.1);
--scrollbar-thumb-sidebar: rgba(255, 255, 255, 0.15);
--overlay-bg: rgba(0, 0, 0, 0.6);
--avatar-gradient: linear-gradient(135deg, #3b82f6, #60a5fa);
/* 兼容旧变量 */
--text: var(--text-primary);
--text-h: var(--text-primary);
--bg: var(--bg-primary);
--border: var(--border-light);
--accent: var(--accent-primary);
--accent-bg: var(--accent-primary-light);
--accent-border: var(--accent-primary-medium);
--social-bg: rgba(47, 48, 58, 0.5);
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html, body {
height: 100%;
overflow: hidden;
}
body {
margin: 0;
}
#app {
height: 100%;
}
/* ============ Scrollbar ============ */
::-webkit-scrollbar {
width: 10px;
height: 10px;
}
::-webkit-scrollbar-track {
background: transparent;
}
::-webkit-scrollbar-thumb {
background: var(--border-medium);
border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
background: var(--text-tertiary);
}
/* ============ Ghost Button ============ */
.ghost-btn {
background: none;
border: none;
color: var(--text-tertiary);
cursor: pointer;
padding: 4px 6px;
border-radius: 4px;
font-size: 14px;
display: inline-flex;
align-items: center;
justify-content: center;
transition: all 0.15s;
}
.ghost-btn:hover {
background: var(--bg-hover);
color: var(--text-secondary);
}
.ghost-btn.danger:hover {
background: var(--danger-bg);
color: var(--danger-color);
}
.ghost-btn.success:hover {
background: var(--success-bg);
color: var(--success-color);
}
.ghost-btn.accent:hover {
background: var(--accent-primary-light);
color: var(--accent-primary);
}
/* ============ Markdown Content ============ */
.md-content {
font-size: 15px;
line-height: 1.7;
color: var(--text-primary);
word-break: break-word;
}
.md-content h1,
.md-content h2,
.md-content h3 {
margin: 0.8em 0 0.4em;
font-weight: 600;
}
.md-content h1 { font-size: 1.4em; }
.md-content h2 { font-size: 1.2em; }
.md-content h3 { font-size: 1.1em; }
.md-content p {
margin: 0.4em 0;
}
.md-content code {
background: var(--bg-code);
padding: 2px 6px;
border-radius: 4px;
font-family: var(--mono);
font-size: 0.9em;
}
.md-content pre {
background: var(--bg-code);
padding: 12px;
border-radius: 8px;
overflow-x: auto;
margin: 0.5em 0;
}
.md-content pre code {
background: transparent;
padding: 0;
}
.md-content blockquote {
border-left: 3px solid var(--border-medium);
padding-left: 12px;
margin: 0.5em 0;
color: var(--text-secondary);
}
.md-content ul,
.md-content ol {
padding-left: 20px;
margin: 0.5em 0;
}
.md-content a {
color: var(--accent-primary);
text-decoration: none;
}
.md-content a:hover {
text-decoration: underline;
}
.md-content img {
max-width: 100%;
border-radius: 8px;
}
.md-content table {
border-collapse: collapse;
width: 100%;
margin: 0.5em 0;
}
.md-content th,
.md-content td {
border: 1px solid var(--border-light);
padding: 8px 12px;
text-align: left;
}
.md-content th {
background: var(--bg-secondary);
}
/* ============ Message Bubble Shared ============ */
.message-bubble {
display: flex;
gap: 12px;
margin-bottom: 16px;
width: 100%;
}
.message-bubble.user {
flex-direction: row-reverse;
}
.message-container {
display: flex;
flex-direction: column;
min-width: 200px;
width: 100%;
}
.message-bubble.user .message-container {
align-items: flex-end;
width: fit-content;
max-width: 85%;
}
.message-bubble.assistant .message-container {
align-items: flex-start;
flex: 1 1 auto;
width: 100%;
min-width: 0;
}
.message-bubble.assistant .message-body {
width: 100%;
}
.avatar {
width: 32px;
height: 32px;
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
font-size: 11px;
font-weight: 700;
letter-spacing: -0.3px;
flex-shrink: 0;
}
.user .avatar {
background: linear-gradient(135deg, #2563eb, #3b82f6);
color: white;
font-size: 12px;
}
.assistant .avatar {
background: var(--avatar-gradient);
color: white;
font-size: 12px;
}
.message-body {
flex: 1;
min-width: 0;
padding: 16px;
border: 1px solid var(--border-light);
border-radius: 12px;
background: var(--bg-primary);
transition: background 0.2s, border-color 0.2s;
}
/* ============ App Layout ============ */
.app {
height: 100vh;
display: flex;
overflow: hidden;
}
.main-panel {
flex: 1 1 0;
min-width: 0;
overflow: hidden;
transition: all 0.2s;
}
/* ============ Transitions ============ */
.fade-enter-active,
.fade-leave-active {
transition: opacity 0.2s ease;
}
.fade-enter-from,
.fade-leave-to {
opacity: 0;
}
/* ============ Modal Overlay ============ */
.modal-overlay {
position: fixed;
inset: 0;
background: var(--overlay-bg);
display: flex;
align-items: center;
justify-content: center;
z-index: 100;
}
.modal-content {
background: var(--bg-primary);
border-radius: 12px;
max-width: 600px;
width: 90%;
max-height: 80vh;
overflow: auto;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
/* ============ Form ============ */
.form-group {
margin-bottom: 16px;
}
.form-group label {
display: block;
font-size: 13px;
font-weight: 500;
color: var(--text-secondary);
margin-bottom: 8px;
}
.form-group input,
.form-group textarea,
.form-group select {
width: 100%;
padding: 10px 12px;
background: var(--bg-input);
border: 1px solid var(--border-input);
border-radius: 8px;
color: var(--text-primary);
font-size: 14px;
outline: none;
transition: border-color 0.2s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
border-color: var(--accent-primary);
}
.form-group textarea {
resize: vertical;
min-height: 80px;
}
.form-group .hint {
font-size: 12px;
color: var(--text-tertiary);
margin-top: 4px;
}
/* ============ Common Page Layout ============ */
.page-container {
padding: 2rem;
overflow-y: auto;
max-height: 100vh;
}
.page-header {
margin-bottom: 2rem;
}
.page-header h1 {
font-size: 1.75rem;
margin: 0 0 0.5rem;
color: var(--text-primary);
}
.page-header .subtitle {
font-size: 0.9rem;
color: var(--text-secondary);
}
.page-section {
margin-bottom: 2rem;
}
.page-section .section-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1rem;
}
.page-section .section-header h2 {
font-size: 1rem;
margin: 0;
color: var(--text-primary);
font-weight: 600;
}
.page-card {
background: var(--bg-primary);
border: 1px solid var(--border-light);
border-radius: 12px;
padding: 1.25rem;
}
.page-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
gap: 1rem;
}