Files

548 lines
9.5 KiB
CSS

/* Hunzi 前端样式 */
:root {
--bg-primary: #0f1117;
--bg-secondary: #1a1d27;
--bg-tertiary: #242836;
--bg-hover: #2d3245;
--text-primary: #e4e7f1;
--text-secondary: #9ca3b8;
--text-muted: #6b7280;
--accent: #6366f1;
--accent-hover: #818cf8;
--accent-light: rgba(99, 102, 241, 0.15);
--success: #22c55e;
--warning: #f59e0b;
--error: #ef4444;
--border: #2d3245;
--radius: 10px;
--radius-sm: 6px;
--shadow: 0 4px 24px rgba(0,0,0,0.3);
--transition: all 0.2s ease;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans SC', sans-serif;
background: var(--bg-primary);
color: var(--text-primary);
min-height: 100vh;
display: flex;
}
/* Sidebar */
.sidebar {
width: 240px;
min-height: 100vh;
background: var(--bg-secondary);
border-right: 1px solid var(--border);
display: flex;
flex-direction: column;
padding: 0;
flex-shrink: 0;
}
.sidebar-header {
padding: 20px;
border-bottom: 1px solid var(--border);
}
.logo {
font-size: 22px;
font-weight: 800;
color: var(--accent);
display: flex;
align-items: center;
gap: 10px;
text-decoration: none;
}
.logo-icon {
font-size: 28px;
}
.sidebar-nav {
flex: 1;
padding: 12px;
}
.nav-section {
margin-bottom: 16px;
}
.nav-section-title {
font-size: 11px;
font-weight: 600;
text-transform: uppercase;
color: var(--text-muted);
padding: 8px 12px;
letter-spacing: 0.5px;
}
.nav-item {
display: flex;
align-items: center;
gap: 10px;
padding: 10px 12px;
border-radius: var(--radius-sm);
cursor: pointer;
color: var(--text-secondary);
transition: var(--transition);
font-size: 14px;
border: none;
background: none;
width: 100%;
text-align: left;
}
.nav-item:hover {
background: var(--bg-hover);
color: var(--text-primary);
}
.nav-item.active {
background: var(--accent-light);
color: var(--accent);
}
.nav-icon { font-size: 18px; width: 22px; text-align: center; }
/* Main Content */
.main-content {
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
}
.topbar {
height: 56px;
background: var(--bg-secondary);
border-bottom: 1px solid var(--border);
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 24px;
flex-shrink: 0;
}
.topbar-title {
font-size: 16px;
font-weight: 600;
}
.topbar-actions {
display: flex;
gap: 8px;
}
.page-content {
flex: 1;
overflow-y: auto;
padding: 24px;
}
/* Buttons */
.btn {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 8px 16px;
border-radius: var(--radius-sm);
font-size: 13px;
font-weight: 500;
cursor: pointer;
border: 1px solid transparent;
transition: var(--transition);
white-space: nowrap;
}
.btn-primary {
background: var(--accent);
color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary {
background: var(--bg-tertiary);
color: var(--text-primary);
border-color: var(--border);
}
.btn-secondary:hover { background: var(--bg-hover); }
.btn-danger {
background: rgba(239, 68, 68, 0.15);
color: var(--error);
border-color: rgba(239, 68, 68, 0.3);
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.25); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
/* Cards */
.card {
background: var(--bg-secondary);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 20px;
margin-bottom: 16px;
}
.card-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 16px;
}
.card-title {
font-size: 15px;
font-weight: 600;
}
/* Stats Grid */
.stats-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 16px;
margin-bottom: 24px;
}
.stat-card {
background: var(--bg-secondary);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 20px;
}
.stat-value {
font-size: 28px;
font-weight: 700;
color: var(--accent);
margin-bottom: 4px;
}
.stat-label {
font-size: 13px;
color: var(--text-secondary);
}
/* Table */
.table-container {
overflow-x: auto;
}
table {
width: 100%;
border-collapse: collapse;
}
th, td {
padding: 10px 12px;
text-align: left;
border-bottom: 1px solid var(--border);
font-size: 13px;
}
th {
color: var(--text-muted);
font-weight: 600;
font-size: 12px;
text-transform: uppercase;
letter-spacing: 0.5px;
}
tr:hover td {
background: var(--bg-hover);
}
/* Badge */
.badge {
display: inline-block;
padding: 3px 8px;
border-radius: 99px;
font-size: 11px;
font-weight: 600;
}
.badge-active {
background: rgba(34, 197, 94, 0.15);
color: var(--success);
}
.badge-draft {
background: rgba(245, 158, 11, 0.15);
color: var(--warning);
}
.badge-running {
background: rgba(99, 102, 241, 0.15);
color: var(--accent);
}
.badge-failed {
background: rgba(239, 68, 68, 0.15);
color: var(--error);
}
.badge-completed {
background: rgba(34, 197, 94, 0.15);
color: var(--success);
}
/* Form */
.form-group {
margin-bottom: 16px;
}
.form-label {
display: block;
font-size: 13px;
font-weight: 500;
color: var(--text-secondary);
margin-bottom: 6px;
}
.form-input, .form-textarea, .form-select {
width: 100%;
padding: 9px 12px;
background: var(--bg-tertiary);
border: 1px solid var(--border);
border-radius: var(--radius-sm);
color: var(--text-primary);
font-size: 13px;
transition: var(--transition);
font-family: inherit;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
outline: none;
border-color: var(--accent);
box-shadow: 0 0 0 3px var(--accent-light);
}
.form-textarea {
resize: vertical;
min-height: 80px;
}
/* Modal */
.modal-overlay {
position: fixed;
inset: 0;
background: rgba(0,0,0,0.6);
display: flex;
align-items: center;
justify-content: center;
z-index: 1000;
}
.modal {
background: var(--bg-secondary);
border: 1px solid var(--border);
border-radius: var(--radius);
width: 520px;
max-width: 90vw;
max-height: 85vh;
overflow-y: auto;
box-shadow: var(--shadow);
}
.modal-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 16px 20px;
border-bottom: 1px solid var(--border);
}
.modal-title {
font-size: 16px;
font-weight: 600;
}
.modal-close {
background: none;
border: none;
color: var(--text-muted);
font-size: 20px;
cursor: pointer;
padding: 4px;
}
.modal-close:hover { color: var(--text-primary); }
.modal-body { padding: 20px; }
.modal-footer {
padding: 12px 20px;
border-top: 1px solid var(--border);
display: flex;
justify-content: flex-end;
gap: 8px;
}
/* Chat */
.chat-container {
display: flex;
flex-direction: column;
height: calc(100vh - 104px);
}
.chat-messages {
flex: 1;
overflow-y: auto;
padding: 16px 0;
}
.chat-message {
display: flex;
gap: 12px;
margin-bottom: 16px;
max-width: 80%;
}
.chat-message.user {
margin-left: auto;
flex-direction: row-reverse;
}
.chat-avatar {
width: 32px;
height: 32px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 14px;
font-weight: 700;
flex-shrink: 0;
}
.chat-message.user .chat-avatar {
background: var(--accent);
color: #fff;
}
.chat-message.assistant .chat-avatar {
background: var(--bg-tertiary);
color: var(--accent);
}
.chat-bubble {
padding: 10px 14px;
border-radius: var(--radius);
font-size: 14px;
line-height: 1.5;
white-space: pre-wrap;
}
.chat-message.user .chat-bubble {
background: var(--accent);
color: #fff;
}
.chat-message.assistant .chat-bubble {
background: var(--bg-tertiary);
color: var(--text-primary);
}
.chat-input-area {
padding: 16px 0 0;
border-top: 1px solid var(--border);
}
.chat-input-row {
display: flex;
gap: 8px;
}
.chat-input {
flex: 1;
padding: 10px 14px;
background: var(--bg-tertiary);
border: 1px solid var(--border);
border-radius: var(--radius-sm);
color: var(--text-primary);
font-size: 14px;
font-family: inherit;
}
.chat-input:focus {
outline: none;
border-color: var(--accent);
}
/* Empty state */
.empty-state {
text-align: center;
padding: 60px 20px;
color: var(--text-muted);
}
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-text { font-size: 15px; margin-bottom: 16px; }
/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
/* Page sections */
.page { display: none; }
.page.active { display: block; }
/* Agent selector in chat */
.agent-selector {
display: flex;
gap: 8px;
align-items: center;
margin-bottom: 16px;
}
/* Workflow visualizer */
.workflow-steps {
display: flex;
flex-direction: column;
gap: 8px;
}
.workflow-step-item {
display: flex;
align-items: center;
gap: 12px;
padding: 12px;
background: var(--bg-tertiary);
border-radius: var(--radius-sm);
border-left: 3px solid var(--accent);
}
.step-number {
width: 24px;
height: 24px;
border-radius: 50%;
background: var(--accent);
color: #fff;
display: flex;
align-items: center;
justify-content: center;
font-size: 12px;
font-weight: 700;
flex-shrink: 0;
}
/* Loading spinner */
.spinner {
width: 16px;
height: 16px;
border: 2px solid var(--border);
border-top-color: var(--accent);
border-radius: 50%;
animation: spin 0.6s linear infinite;
display: inline-block;
}
@keyframes spin {
to { transform: rotate(360deg); }
}