Files

971 lines
24 KiB
CSS

/* ═══════════════════════════════════════════════════════════════
Palladium Monitor — Dark Theme Dashboard
═══════════════════════════════════════════════════════════════ */
:root {
--bg-primary: #0d1117;
--bg-secondary: #161b22;
--bg-card: #1c2330;
--bg-card-hover: #232b3a;
--border: #30363d;
--border-light: #3a4250;
--text-primary: #e6edf3;
--text-secondary: #8b949e;
--text-muted: #6e7681;
--accent: #58a6ff;
--green: #3fb950;
--red: #f85149;
--orange: #d29922;
--blue: #58a6ff;
--purple: #bc8cff;
--gray: #6e7681;
--radius: 8px;
--shadow: 0 2px 8px rgba(0,0,0,0.3);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
Arial, "Noto Sans SC", "Microsoft YaHei", sans-serif;
background: var(--bg-primary);
color: var(--text-primary);
font-size: 14px;
line-height: 1.5;
}
/* ─── Top Nav ─── */
.topnav {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 24px;
height: 56px;
background: var(--bg-secondary);
border-bottom: 1px solid var(--border);
position: sticky;
top: 0;
z-index: 100;
}
.nav-brand {
display: flex;
align-items: center;
gap: 8px;
}
.nav-logo { font-size: 22px; }
.nav-title {
font-size: 17px;
font-weight: 700;
color: var(--text-primary);
}
.nav-links {
display: flex;
align-items: center;
gap: 4px;
}
.nav-links a {
padding: 8px 16px;
color: var(--text-secondary);
text-decoration: none;
border-radius: var(--radius);
transition: all 0.15s;
font-weight: 500;
}
.nav-links a:hover { color: var(--text-primary); background: var(--bg-card); }
.nav-links a.active { color: var(--accent); background: rgba(88,166,255,0.1); }
.nav-btn {
padding: 8px 16px;
background: var(--accent);
color: #fff;
border: none;
border-radius: var(--radius);
cursor: pointer;
font-weight: 600;
font-size: 13px;
transition: opacity 0.15s;
}
.nav-btn:hover { opacity: 0.85; }
/* ─── Container ─── */
.container {
max-width: 1600px;
margin: 0 auto;
padding: 20px 24px 60px;
}
/* ─── System Info Bar ─── */
.system-bar {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 24px;
padding: 12px 20px;
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: var(--radius);
margin-bottom: 16px;
}
.sys-item {
display: flex;
flex-direction: column;
gap: 2px;
}
.sys-label {
font-size: 11px;
color: var(--text-muted);
text-transform: uppercase;
letter-spacing: 0.5px;
}
.sys-value {
font-size: 14px;
font-weight: 600;
color: var(--text-primary);
font-family: "SF Mono", "Fira Code", Consolas, monospace;
}
.refresh-controls {
margin-left: auto;
display: flex;
align-items: center;
gap: 8px;
flex-direction: row;
}
.refresh-controls label {
display: flex;
align-items: center;
gap: 4px;
font-size: 13px;
color: var(--text-secondary);
cursor: pointer;
}
.refresh-controls select {
background: var(--bg-primary);
color: var(--text-primary);
border: 1px solid var(--border);
border-radius: 4px;
padding: 3px 8px;
font-size: 12px;
}
.btn-sm {
padding: 4px 8px;
font-size: 12px;
background: var(--bg-card-hover);
color: var(--text-primary);
border: 1px solid var(--border);
border-radius: 4px;
cursor: pointer;
text-decoration: none;
transition: all 0.15s;
}
.btn-sm:hover { background: var(--border-light); }
.btn-sm.btn-danger { color: var(--red); border-color: var(--red); }
.btn-sm.btn-danger:hover { background: rgba(248,81,73,0.15); }
/* ─── Status Badges ─── */
.status-badge {
display: inline-block;
padding: 2px 10px;
border-radius: 12px;
font-size: 12px;
font-weight: 700;
letter-spacing: 0.3px;
}
.status-ok { background: rgba(63,185,80,0.15); color: var(--green); }
.status-warning { background: rgba(210,153,34,0.15); color: var(--orange); }
.status-error { background: rgba(248,81,73,0.15); color: var(--red); }
.status-unknown { background: rgba(110,118,129,0.15); color: var(--gray); }
.status-online { background: rgba(63,185,80,0.15); color: var(--green); }
.status-offline { background: rgba(248,81,73,0.15); color: var(--red); }
/* ─── Metrics Grid ─── */
.metrics-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
gap: 12px;
margin-bottom: 20px;
}
.metric-card {
display: flex;
align-items: center;
gap: 14px;
padding: 16px;
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: var(--radius);
transition: border-color 0.15s;
}
.metric-card:hover { border-color: var(--border-light); }
.metric-icon { font-size: 28px; }
.metric-label {
font-size: 12px;
color: var(--text-muted);
text-transform: uppercase;
letter-spacing: 0.5px;
}
.metric-value {
font-size: 28px;
font-weight: 700;
line-height: 1.2;
color: var(--text-primary);
}
.metric-value.metric-warn { color: var(--orange); }
.metric-sub {
font-size: 12px;
color: var(--text-secondary);
margin-top: 2px;
}
/* ─── Section Headers ─── */
.section-header {
display: flex;
align-items: center;
justify-content: space-between;
margin: 24px 0 12px;
}
.section-header h2 {
font-size: 18px;
font-weight: 700;
color: var(--text-primary);
}
/* ─── Legend ─── */
.legend {
display: flex;
gap: 16px;
font-size: 12px;
color: var(--text-secondary);
}
.legend-item {
display: flex;
align-items: center;
gap: 4px;
}
/* ─── Rack Card ─── */
.rack-card {
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: var(--radius);
margin-bottom: 12px;
overflow: hidden;
}
.rack-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px 16px;
background: var(--bg-secondary);
border-bottom: 1px solid var(--border);
}
.rack-title {
font-size: 15px;
font-weight: 700;
color: var(--text-primary);
}
.rack-count {
font-size: 12px;
color: var(--text-muted);
}
/* ─── Cluster Section ─── */
.cluster-section {
padding: 12px 16px;
border-bottom: 1px solid var(--border);
}
.cluster-section:last-child { border-bottom: none; }
.cluster-header {
display: flex;
align-items: center;
gap: 12px;
margin-bottom: 10px;
font-size: 14px;
font-weight: 600;
color: var(--text-secondary);
}
.ccd-badge {
padding: 1px 8px;
border-radius: 10px;
font-size: 11px;
font-weight: 600;
}
.ccd-online { background: rgba(63,185,80,0.15); color: var(--green); }
.ccd-offline { background: rgba(248,81,73,0.15); color: var(--red); }
/* ─── Boards Grid ─── */
.boards-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
gap: 8px;
}
/* ─── Board Card ─── */
.board-card {
background: var(--bg-primary);
border: 1px solid var(--border);
border-radius: 6px;
padding: 8px 10px;
transition: all 0.15s;
}
.board-card:hover { border-color: var(--border-light); transform: translateY(-1px); }
.board-card.board-offline {
border-color: rgba(248,81,73,0.4);
background: rgba(248,81,73,0.05);
}
.board-top {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 6px;
}
.board-ld {
font-size: 13px;
font-weight: 700;
color: var(--text-primary);
}
.board-status-badge {
padding: 1px 6px;
border-radius: 8px;
font-size: 10px;
font-weight: 600;
}
/* ─── Domain Cells ─── */
.domains-row {
display: grid;
grid-template-columns: repeat(8, 1fr);
gap: 2px;
}
.domain-cell {
text-align: center;
font-size: 10px;
font-weight: 700;
padding: 4px 0;
border-radius: 3px;
min-width: 18px;
transition: transform 0.1s;
cursor: default;
font-family: "SF Mono", "Fira Code", Consolas, monospace;
}
.domain-cell:hover { transform: scale(1.15); z-index: 5; position: relative; }
.domain-available {
background: rgba(63,185,80,0.15);
color: var(--green);
border: 1px solid rgba(63,185,80,0.3);
}
.domain-downloaded {
background: rgba(88,166,255,0.2);
color: var(--blue);
border: 1px solid rgba(88,166,255,0.4);
}
.domain-disabled {
background: rgba(248,81,73,0.15);
color: var(--red);
border: 1px solid rgba(248,81,73,0.3);
}
.domain-not_exist {
background: rgba(110,118,129,0.1);
color: var(--gray);
border: 1px solid rgba(110,118,129,0.2);
}
/* ─── Card (generic) ─── */
.card {
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: var(--radius);
overflow: hidden;
margin-bottom: 12px;
}
.card.empty-state {
padding: 24px;
text-align: center;
color: var(--text-muted);
}
/* ─── Data Table ─── */
.data-table {
width: 100%;
border-collapse: collapse;
font-size: 13px;
}
.data-table thead {
background: var(--bg-secondary);
}
.data-table th {
padding: 10px 14px;
text-align: left;
font-weight: 600;
color: var(--text-muted);
text-transform: uppercase;
font-size: 11px;
letter-spacing: 0.5px;
border-bottom: 1px solid var(--border);
white-space: nowrap;
}
.data-table td {
padding: 8px 14px;
border-bottom: 1px solid rgba(48,54,61,0.5);
color: var(--text-primary);
}
.data-table tbody tr:hover { background: var(--bg-card-hover); }
.data-table tbody tr:last-child td { border-bottom: none; }
.text-mono {
font-family: "SF Mono", "Fira Code", Consolas, monospace;
font-size: 12px;
}
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-blue { color: var(--blue); }
.text-gray { color: var(--gray); }
/* ─── Pods Grid ─── */
.pods-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
gap: 12px;
margin-bottom: 12px;
}
.pod-card {
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: var(--radius);
overflow: hidden;
}
.pod-header {
padding: 8px 14px;
background: var(--bg-secondary);
border-bottom: 1px solid var(--border);
font-weight: 700;
font-size: 14px;
}
.pod-table {
width: 100%;
border-collapse: collapse;
font-size: 12px;
}
.pod-table td {
padding: 5px 14px;
border-bottom: 1px solid rgba(48,54,61,0.4);
}
.pod-table tr:last-child td { border-bottom: none; }
.pod-label {
color: var(--text-secondary);
white-space: nowrap;
width: 40%;
}
.pod-sublabel {
color: var(--text-muted);
font-size: 11px;
padding-left: 24px !important;
}
.pod-value {
font-family: "SF Mono", "Fira Code", Consolas, monospace;
color: var(--text-primary);
}
.pod-row-available td { color: var(--green); }
.pod-row-locked td { color: var(--orange); }
.pod-row-reserved td { color: var(--blue); }
.pod-row-unavailable td { color: var(--red); }
/* ─── Utilization Bar (history table) ─── */
.util-bar {
position: relative;
width: 120px;
height: 20px;
background: var(--bg-primary);
border-radius: 10px;
overflow: hidden;
border: 1px solid var(--border);
}
.util-fill {
height: 100%;
background: linear-gradient(90deg, var(--green), var(--blue));
border-radius: 10px;
transition: width 0.3s;
}
.util-text {
position: absolute;
top: 0; left: 0; right: 0; bottom: 0;
display: flex;
align-items: center;
justify-content: center;
font-size: 11px;
font-weight: 700;
color: var(--text-primary);
text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
/* ─── Pagination ─── */
.pagination {
display: flex;
align-items: center;
justify-content: center;
gap: 16px;
margin-top: 16px;
}
.page-btn {
padding: 6px 14px;
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: var(--radius);
color: var(--text-primary);
text-decoration: none;
font-size: 13px;
transition: all 0.15s;
}
.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-info {
font-size: 13px;
color: var(--text-secondary);
}
/* ─── Tags ─── */
.tag {
display: inline-block;
padding: 1px 8px;
background: rgba(88,166,255,0.1);
color: var(--accent);
border-radius: 4px;
font-size: 11px;
font-weight: 600;
}
/* ─── Modal ─── */
.modal-overlay {
position: fixed;
top: 0; left: 0; right: 0; bottom: 0;
background: rgba(0,0,0,0.7);
display: flex;
align-items: center;
justify-content: center;
z-index: 200;
}
.modal {
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: 12px;
width: 90%;
max-width: 800px;
max-height: 85vh;
display: flex;
flex-direction: column;
box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.modal-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 16px 20px;
border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 16px; font-weight: 700; }
.modal-close {
background: none;
border: none;
color: var(--text-secondary);
font-size: 18px;
cursor: pointer;
padding: 4px 8px;
border-radius: 4px;
}
.modal-close:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.modal-body {
padding: 16px 20px;
overflow-y: auto;
flex: 1;
}
.modal-hint {
margin-bottom: 10px;
color: var(--text-secondary);
font-size: 13px;
}
.modal-hint code {
background: var(--bg-primary);
padding: 1px 6px;
border-radius: 3px;
font-size: 12px;
color: var(--accent);
}
.paste-textarea {
width: 100%;
background: var(--bg-primary);
color: var(--text-primary);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 12px;
font-family: "SF Mono", "Fira Code", Consolas, monospace;
font-size: 12px;
resize: vertical;
line-height: 1.6;
}
.paste-textarea:focus {
outline: none;
border-color: var(--accent);
}
.modal-footer {
display: flex;
justify-content: flex-end;
gap: 8px;
padding: 12px 20px;
border-top: 1px solid var(--border);
}
.btn {
padding: 8px 16px;
border: none;
border-radius: var(--radius);
cursor: pointer;
font-weight: 600;
font-size: 13px;
text-decoration: none;
transition: all 0.15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #4493f8; }
.btn-secondary { background: var(--bg-card-hover); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--border-light); }
.btn-lg { padding: 12px 24px; font-size: 15px; }
/* ─── Empty State (no data) ─── */
.empty-state-full {
text-align: center;
padding: 80px 20px;
}
.empty-icon { font-size: 64px; margin-bottom: 16px; }
.empty-state-full h2 { font-size: 22px; margin-bottom: 8px; }
.empty-state-full p { color: var(--text-secondary); margin-bottom: 20px; }
.empty-actions { margin-bottom: 16px; }
.empty-hint {
color: var(--text-muted) !important;
font-size: 13px;
}
.empty-hint code {
background: var(--bg-card);
padding: 2px 8px;
border-radius: 4px;
color: var(--accent);
}
/* ─── Snapshot Header ─── */
.snapshot-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 16px;
}
.snapshot-meta {
font-size: 13px;
color: var(--text-secondary);
margin-top: 4px;
}
/* ─── Raw Output ─── */
.raw-output-section {
margin-top: 24px;
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 12px 16px;
}
.raw-output-section summary {
cursor: pointer;
font-weight: 600;
color: var(--text-secondary);
padding: 4px 0;
}
.raw-output {
margin-top: 12px;
background: var(--bg-primary);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 12px;
font-family: "SF Mono", "Fira Code", Consolas, monospace;
font-size: 11px;
color: var(--text-secondary);
overflow-x: auto;
white-space: pre-wrap;
max-height: 500px;
overflow-y: auto;
}
/* ─── Chart container ─── */
.card canvas {
padding: 16px;
}
/* ─── 邮件配置页面 ─── */
.page-header {
margin-bottom: 20px;
}
.page-header h1 {
font-size: 22px;
font-weight: 700;
color: var(--text-primary);
}
.page-subtitle {
color: var(--text-secondary);
font-size: 13px;
margin-top: 4px;
}
/* 状态卡片 */
.config-status-card {
display: flex;
align-items: center;
gap: 14px;
padding: 14px 18px;
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: var(--radius);
margin-bottom: 16px;
transition: border-color 0.2s;
}
.config-status-card.status-ok { border-color: var(--green); background: rgba(63,185,80,0.06); }
.config-status-card.status-error { border-color: var(--red); background: rgba(248,81,73,0.06); }
.config-status-card.status-warning { border-color: var(--orange); background: rgba(210,153,34,0.06); }
.status-icon { font-size: 24px; flex-shrink: 0; }
.status-title { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.status-detail { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
/* 配置卡片 */
.config-card {
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 20px 24px;
margin-bottom: 16px;
}
.config-card-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 18px;
padding-bottom: 12px;
border-bottom: 1px solid var(--border);
}
.config-card-header h2 { font-size: 16px; font-weight: 700; }
.config-source-badge {
font-size: 11px;
color: var(--accent);
background: rgba(88,166,255,0.1);
padding: 2px 8px;
border-radius: 4px;
}
/* 表单通用 */
.form-group { margin-bottom: 14px; }
.form-group label {
display: block;
font-size: 12px;
color: var(--text-secondary);
margin-bottom: 5px;
font-weight: 500;
}
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="url"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group textarea {
width: 100%;
background: var(--bg-primary);
color: var(--text-primary);
border: 1px solid var(--border);
border-radius: 6px;
padding: 8px 12px;
font-size: 13px;
font-family: inherit;
transition: border-color 0.15s;
}
.form-group input:focus,
.form-group textarea:focus {
outline: none;
border-color: var(--accent);
}
.form-group textarea { resize: vertical; line-height: 1.5; }
.label-hint { color: var(--text-muted); font-weight: 400; font-size: 11px; }
/* 小字段 (行内并排) */
.form-group-small { margin-bottom: 14px; }
/* 表单分区 */
.form-section {
padding: 16px 0;
border-top: 1px solid var(--border);
display: grid;
grid-template-columns: 1fr 1fr;
gap: 16px;
}
.form-section:first-of-type { border-top: none; padding-top: 0; }
.form-section-title {
grid-column: 1 / -1;
font-size: 14px;
font-weight: 600;
color: var(--text-primary);
margin-bottom: 4px;
padding-top: 4px;
}
/* 输入框提示文字 */
.input-hint {
display: block;
font-size: 11px;
color: var(--text-muted);
margin-top: 2px;
}
/* 全宽字段 */
.form-group.full-width { grid-column: 1 / -1; }
/* ─── 用户视角页面 ─── */
.users-table { table-layout: fixed; }
.users-table th:nth-child(1) { width: 14%; }
.users-table th:nth-child(2) { width: 10%; text-align: center; }
.users-table th:nth-child(3) { width: 30%; }
.users-table th:nth-child(4) { width: 12%; }
.users-table th:nth-child(5) { width: 15%; }
.users-table th:nth-child(6) { width: 19%; }
.user-cell {
font-weight: 600;
color: var(--accent);
}
.boards-cell {
max-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 12px;
color: var(--text-secondary);
}
.design-cell {
font-size: 12px;
color: var(--text-secondary);
}
.text-center { text-align: center; }
/* 启用开关 */
.toggle-row {
display: flex;
align-items: center;
justify-content: space-between;
padding: 14px 18px;
background: var(--bg-primary);
border: 1px solid var(--border);
border-radius: var(--radius);
margin-bottom: 16px;
}
.toggle-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.toggle-desc { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.toggle-switch {
position: relative;
display: inline-block;
width: 44px;
height: 24px;
cursor: pointer;
}
.toggle-switch input { display: none; }
.toggle-slider {
position: absolute;
inset: 0;
background: var(--border-light);
border-radius: 12px;
transition: 0.2s;
}
.toggle-slider:before {
content: "";
position: absolute;
height: 18px;
width: 18px;
left: 3px;
bottom: 3px;
background: #fff;
border-radius: 50%;
transition: 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(20px); }
/* 密码输入 */
.password-input-wrap { position: relative; }
.password-input-wrap input { padding-right: 36px; }
.password-toggle {
position: absolute;
right: 6px;
top: 50%;
transform: translateY(-50%);
background: none;
border: none;
cursor: pointer;
font-size: 14px;
padding: 4px;
color: var(--text-secondary);
}
/* 复选框组 */
.checkbox-group { display: flex; gap: 16px; padding-top: 4px; }
.checkbox-label {
display: flex;
align-items: center;
gap: 6px;
font-size: 13px;
color: var(--text-secondary);
cursor: pointer;
}
.checkbox-label input[type="checkbox"] {
accent-color: var(--accent);
width: 15px;
height: 15px;
}
/* 操作按钮 */
.form-actions {
display: flex;
flex-wrap: wrap;
gap: 10px;
padding-top: 18px;
border-top: 1px solid var(--border);
margin-top: 6px;
}
.form-actions .btn { white-space: nowrap; }
.btn-outline {
background: transparent;
color: var(--text-secondary);
border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--text-secondary); color: var(--text-primary); }
.form-actions .btn:disabled { opacity: 0.5; cursor: not-allowed; }
/* 信息卡片 */
.info-card {
background: var(--bg-card);
border: 1px solid var(--border);
border-left: 3px solid var(--accent);
border-radius: var(--radius);
padding: 14px 18px;
}
.info-card h3 {
font-size: 14px;
font-weight: 600;
margin-bottom: 8px;
color: var(--text-primary);
}
.info-card ul { margin: 0; padding-left: 18px; }
.info-card li {
font-size: 13px;
color: var(--text-secondary);
margin-bottom: 4px;
line-height: 1.5;
}
/* ─── Responsive ─── */
@media (max-width: 768px) {
.topnav { padding: 0 12px; }
.container { padding: 12px; }
.system-bar { gap: 12px; }
.refresh-controls { margin-left: 0; }
.boards-grid { grid-template-columns: 1fr; }
.metrics-grid { grid-template-columns: 1fr; }
.form-section { grid-template-columns: 1fr; }
.toggle-row { flex-direction: column; align-items: flex-start; gap: 8px; }
.form-actions { flex-direction: column; }
.form-actions .btn { width: 100%; text-align: center; }
}