DCTS/dashboard/src/style.css

566 lines
11 KiB
CSS

/* DCTS Cluster Dashboard — AstroResearch 暖纸张学术风 (Light Academic Paper Style) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap');
:root {
color-scheme: light;
/* ── AstroResearch 暖纸张学术风 (Light Academic Paper) ── */
--bg-app: #faf9f6; /* 暖白纸底 */
--bg-surface: #ffffff; /* 卡片/面板纯白 */
--bg-elevated: #ffffff; /* 弹层面板 */
--bg-sunken: #f4f2ed; /* 表头/凹陷底面 */
--text-primary: #292524; /* 暖墨黑 (stone-800) */
--text-secondary: #57534e; /* 暖深灰 (stone-600) */
--text-muted: #78716c; /* 暖中灰 (stone-500) */
--border-default: #e7e5e4; /* 基础描述线 (stone-200) */
--border-subtle: #f5f2ec; /* 更轻分割线 */
--border-strong: #ddd7cc; /* 强调分割线 */
/* 品牌与功能强调色 */
--accent-blueprint: #0369a1;/* 学术蓝 (Blueprint Blue) */
--accent-cyan: #0284c7; /* 天空蓝 (Sky Cyan) */
--accent-purple: #6d28d9; /* 皇家紫 */
--accent-emerald: #047857; /* 翡翠绿 (Success) */
--accent-amber: #b45309; /* 琥珀金 (Warning/Star) */
--accent-rose: #dc2626; /* 珊瑚红 (Danger) */
--font-sans: 'Inter', system-ui, -apple-system, sans-serif;
--font-mono: 'JetBrains Mono', monospace;
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
background-color: var(--bg-app);
background-image:
radial-gradient(at 10% 10%, rgba(3, 105, 161, 0.04) 0px, transparent 50%),
radial-gradient(at 90% 90%, rgba(180, 83, 9, 0.04) 0px, transparent 50%);
background-attachment: fixed;
color: var(--text-primary);
font-family: var(--font-sans);
min-height: 100vh;
line-height: 1.5;
-webkit-font-smoothing: antialiased;
}
#app {
display: flex;
flex-direction: column;
min-height: 100vh;
}
/* 暖纸张卡片面板 */
.glass {
background: var(--bg-surface);
border: 1px solid var(--border-default);
border-radius: 12px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}
/* 导航顶栏 Header */
.header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1.1rem 2.2rem;
background: rgba(255, 255, 255, 0.9);
backdrop-filter: blur(12px);
border-bottom: 1px solid var(--border-default);
position: sticky;
top: 0;
z-index: 100;
}
.logo-container {
display: flex;
align-items: center;
gap: 1rem;
}
.logo-icon {
width: 42px;
height: 42px;
border-radius: 10px;
background: linear-gradient(135deg, var(--accent-blueprint), var(--accent-cyan));
display: flex;
align-items: center;
justify-content: center;
color: white;
box-shadow: 0 4px 12px rgba(3, 105, 161, 0.25);
}
.logo-title {
font-size: 1.25rem;
font-weight: 700;
letter-spacing: -0.02em;
color: var(--text-primary);
}
.logo-subtitle {
font-size: 0.8rem;
color: var(--text-secondary);
}
.header-status {
display: flex;
align-items: center;
gap: 1rem;
}
.status-indicator {
display: flex;
align-items: center;
gap: 0.5rem;
font-size: 0.85rem;
padding: 0.4rem 0.9rem;
border-radius: 20px;
font-family: var(--font-mono);
font-weight: 500;
}
.status-indicator.online {
background: rgba(4, 120, 87, 0.08);
border: 1px solid rgba(4, 120, 87, 0.25);
color: var(--accent-emerald);
}
.status-indicator.offline {
background: rgba(220, 38, 38, 0.08);
border: 1px solid rgba(220, 38, 38, 0.25);
color: var(--accent-rose);
}
.status-dot {
width: 8px;
height: 8px;
border-radius: 50%;
background-color: var(--accent-emerald);
box-shadow: 0 0 8px var(--accent-emerald);
animation: pulse 2s infinite;
}
@keyframes pulse {
0% { transform: scale(0.95); opacity: 0.8; }
50% { transform: scale(1.15); opacity: 1; }
100% { transform: scale(0.95); opacity: 0.8; }
}
.btn {
display: inline-flex;
align-items: center;
gap: 0.5rem;
padding: 0.55rem 1.1rem;
border-radius: 8px;
font-size: 0.85rem;
font-weight: 500;
cursor: pointer;
transition: all 0.2s ease;
border: none;
}
.btn-secondary {
background: var(--bg-sunken);
color: var(--text-primary);
border: 1px solid var(--border-default);
}
.btn-secondary:hover {
background: #eae6df;
border-color: var(--border-strong);
}
.btn-primary {
background: linear-gradient(135deg, var(--accent-blueprint), var(--accent-cyan));
color: white;
box-shadow: 0 3px 10px rgba(3, 105, 161, 0.25);
}
.btn-primary:hover {
opacity: 0.92;
transform: translateY(-1px);
}
.btn-danger {
background: rgba(220, 38, 38, 0.1);
color: var(--accent-rose);
border: 1px solid rgba(220, 38, 38, 0.2);
}
.btn-danger:hover {
background: rgba(220, 38, 38, 0.2);
}
.btn-sm {
padding: 0.35rem 0.7rem;
font-size: 0.78rem;
}
/* 主内容容器 */
.main-container {
max-width: 1400px;
width: 100%;
margin: 0 auto;
padding: 2rem;
flex: 1;
display: flex;
flex-direction: column;
gap: 2rem;
}
/* 指标卡片矩阵 */
.metrics-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
gap: 1.25rem;
}
.metric-card {
padding: 1.35rem 1.5rem;
transition: transform 0.2s ease, border-color 0.2s ease;
}
.metric-card:hover {
transform: translateY(-2px);
border-color: var(--border-strong);
}
.metric-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 0.85rem;
}
.metric-title {
font-size: 0.875rem;
color: var(--text-secondary);
font-weight: 500;
}
.metric-icon {
width: 38px;
height: 38px;
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
}
.nodes-icon { background: rgba(3, 105, 161, 0.08); color: var(--accent-blueprint); }
.pending-icon { background: rgba(180, 83, 9, 0.08); color: var(--accent-amber); }
.success-icon { background: rgba(4, 120, 87, 0.08); color: var(--accent-emerald); }
.workflow-icon { background: rgba(109, 40, 217, 0.08); color: var(--accent-purple); }
.metric-body {
display: flex;
flex-direction: column;
}
.metric-value {
font-size: 2.1rem;
font-weight: 700;
letter-spacing: -0.03em;
font-family: var(--font-mono);
color: var(--text-primary);
}
.metric-sub {
font-size: 0.8rem;
color: var(--text-secondary);
margin-top: 0.25rem;
}
/* 内容双栏布局 */
.content-grid {
display: grid;
grid-template-columns: 3fr 2fr;
gap: 1.5rem;
}
@media (max-width: 1024px) {
.content-grid {
grid-template-columns: 1fr;
}
}
/* 面板 */
.panel {
display: flex;
flex-direction: column;
overflow: hidden;
}
.panel-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1.1rem 1.5rem;
border-bottom: 1px solid var(--border-default);
background: var(--bg-sunken);
}
.panel-header h2 {
font-size: 1.05rem;
font-weight: 600;
color: var(--text-primary);
}
.badge {
background: rgba(3, 105, 161, 0.08);
color: var(--accent-blueprint);
font-size: 0.75rem;
font-weight: 600;
padding: 0.25rem 0.65rem;
border-radius: 12px;
font-family: var(--font-mono);
border: 1px solid rgba(3, 105, 161, 0.2);
}
.panel-body {
padding: 1.35rem 1.5rem;
flex: 1;
}
/* 表格组件 */
.table-responsive {
overflow-x: auto;
}
.data-table {
width: 100%;
border-collapse: collapse;
text-align: left;
font-size: 0.875rem;
}
.data-table th {
padding: 0.8rem 1rem;
color: var(--text-secondary);
font-weight: 600;
border-bottom: 1px solid var(--border-default);
background: var(--bg-sunken);
}
.data-table td {
padding: 0.85rem 1rem;
border-bottom: 1px solid var(--border-default);
color: var(--text-primary);
}
.data-table tr:hover {
background: rgba(0, 0, 0, 0.015);
}
.node-id {
font-family: var(--font-mono);
font-weight: 600;
color: var(--accent-blueprint);
}
.empty-cell {
text-align: center;
color: var(--text-muted);
padding: 2.5rem !important;
}
.status-badge {
display: inline-block;
padding: 0.2rem 0.55rem;
border-radius: 4px;
font-size: 0.75rem;
font-weight: 600;
font-family: var(--font-mono);
}
.status-badge.online {
background: rgba(4, 120, 87, 0.1);
color: var(--accent-emerald);
}
.status-badge.offline {
background: rgba(220, 38, 38, 0.1);
color: var(--accent-rose);
}
/* 工作流卡片 */
.workflows-container {
display: flex;
flex-direction: column;
gap: 1rem;
}
.workflow-card {
background: var(--bg-surface);
border: 1px solid var(--border-default);
border-radius: 10px;
padding: 1.2rem;
transition: all 0.2s ease;
}
.workflow-card:hover {
border-color: var(--border-strong);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}
.wf-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 0.5rem;
}
.wf-name {
font-size: 1rem;
font-weight: 600;
color: var(--text-primary);
}
.wf-desc {
font-size: 0.85rem;
color: var(--text-secondary);
margin-bottom: 0.85rem;
line-height: 1.4;
}
.wf-actions {
display: flex;
gap: 0.5rem;
margin-top: 1rem;
}
.wf-progress-bar {
width: 100%;
height: 7px;
background: #e7e5e4;
border-radius: 4px;
overflow: hidden;
margin-bottom: 0.5rem;
}
.wf-progress-fill {
height: 100%;
background: linear-gradient(90deg, var(--accent-blueprint), var(--accent-cyan));
border-radius: 4px;
transition: width 0.4s ease;
}
.wf-meta {
display: flex;
justify-content: space-between;
font-size: 0.78rem;
color: var(--text-muted);
font-family: var(--font-mono);
}
/* 模态弹窗 (Modal Dialog) */
.modal-backdrop {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background: rgba(41, 37, 36, 0.4);
backdrop-filter: blur(4px);
display: flex;
align-items: center;
justify-content: center;
z-index: 1000;
}
.modal-backdrop.hidden {
display: none;
}
.modal-card {
background: var(--bg-surface);
border: 1px solid var(--border-default);
border-radius: 12px;
width: 90%;
max-width: 650px;
padding: 1.75rem;
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
display: flex;
flex-direction: column;
gap: 1.25rem;
}
.modal-header {
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 1px solid var(--border-default);
padding-bottom: 0.85rem;
}
.modal-header h3 {
font-size: 1.15rem;
font-weight: 600;
color: var(--text-primary);
}
.modal-close {
background: none;
border: none;
font-size: 1.5rem;
color: var(--text-muted);
cursor: pointer;
}
.form-group {
display: flex;
flex-direction: column;
gap: 0.4rem;
}
.form-group label {
font-size: 0.85rem;
font-weight: 500;
color: var(--text-secondary);
}
.form-input, .form-textarea {
background: var(--bg-sunken);
border: 1px solid var(--border-default);
border-radius: 6px;
padding: 0.6rem 0.8rem;
font-size: 0.9rem;
color: var(--text-primary);
font-family: var(--font-sans);
}
.form-textarea {
font-family: var(--font-mono);
min-height: 180px;
resize: vertical;
}
.form-input:focus, .form-textarea:focus {
outline: none;
border-color: var(--accent-blueprint);
box-shadow: 0 0 0 3px rgba(3, 105, 161, 0.1);
}
.modal-footer {
display: flex;
justify-content: flex-end;
gap: 0.75rem;
border-top: 1px solid var(--border-default);
padding-top: 1rem;
}
/* 页脚 Footer */
.footer {
text-align: center;
padding: 1.5rem;
border-top: 1px solid var(--border-default);
color: var(--text-muted);
font-size: 0.82rem;
background: var(--bg-surface);
}