Files
xiaoxia-saas/apps/web/src/pages/dashboard/dashboard.css
T
CI Test f0eed0ca3f
Deploy / Build Production Runtime Images (push) Has been skipped
Deploy / Deploy Production (push) Has been skipped
Deploy / Production Browser E2E (push) Has been skipped
Deploy / Deploy Staging (push) Failing after 192h26m58s
CI/CD Pipeline / Frontend Lint (push) Failing after 192h27m37s
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 192h27m46s
style: fix prettier formatting issues
2026-07-01 12:26:48 +08:00

525 lines
11 KiB
CSS

/**
* 控制台页面 - V21 设计系统样式
* KPI 卡片网格 + 快速入口 + 最近任务卡片列表 + 使用统计图表 + 公告
* 统一使用 CSS 变量,支持深色/浅色主题
*/
@import "../../styles/global.css";
/* ============================================================
页面容器
============================================================ */
.xx-dashboard-page {
min-height: 100%;
padding: var(--space-xl);
}
/* ============================================================
欢迎头部
============================================================ */
.xx-dashboard-welcome {
margin-bottom: var(--space-lg);
}
.xx-dashboard-welcome h2 {
margin: 0 0 4px;
font-size: var(--font-size-xl);
font-weight: var(--font-weight-bold);
color: var(--text-primary);
}
.xx-dashboard-welcome p {
margin: 0;
font-size: var(--font-size-sm);
color: var(--text-secondary);
}
/* ============================================================
KPI 卡片网格
============================================================ */
.xx-kpi-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: var(--space-md);
margin-bottom: var(--space-lg);
}
.xx-kpi-card {
background: linear-gradient(
180deg,
var(--bg-primary),
var(--bg-secondary, #f8fafc)
);
border: 1px solid var(--border-color);
border-radius: var(--radius-lg);
padding: 20px;
transition: var(--transition-all);
position: relative;
overflow: hidden;
}
.xx-kpi-card::before {
content: "";
position: absolute;
top: 0;
left: 0;
right: 0;
height: 3px;
background: var(--kpi-accent, var(--primary-color));
border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.xx-kpi-card:hover {
border-color: var(--primary-color);
box-shadow: var(--shadow-md);
transform: translateY(-2px);
}
.xx-kpi-icon {
width: 40px;
height: 40px;
border-radius: var(--radius-md);
display: flex;
align-items: center;
justify-content: center;
font-size: 20px;
margin-bottom: 12px;
}
.xx-kpi-value {
font-size: 30px;
font-weight: 800;
color: var(--text-primary);
line-height: 1.2;
margin-bottom: 4px;
}
.xx-kpi-label {
font-size: 13px;
color: var(--text-secondary);
margin-bottom: 8px;
}
.xx-kpi-trend {
font-size: 12px;
display: inline-flex;
align-items: center;
gap: 4px;
padding: 2px 8px;
border-radius: var(--radius-sm);
}
.xx-kpi-trend--up {
color: var(--success-color);
background: var(--success-soft);
}
.xx-kpi-trend--down {
color: var(--error-color);
background: var(--error-soft);
}
.xx-kpi-trend--neutral {
color: var(--text-secondary);
background: var(--bg-secondary, #f1f5f9);
}
/* ============================================================
主内容区两栏布局
============================================================ */
.xx-dashboard-main {
display: grid;
grid-template-columns: 1fr 320px;
gap: var(--space-md);
margin-bottom: var(--space-lg);
}
/* ============================================================
区块卡片
============================================================ */
.xx-dashboard-section {
background: var(--bg-primary);
border: 1px solid var(--border-color);
border-radius: var(--radius-lg);
padding: var(--space-md);
}
.xx-dashboard-section-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: var(--space-md);
}
.xx-dashboard-section-header h3 {
margin: 0;
font-size: var(--font-size-base);
font-weight: var(--font-weight-semibold);
color: var(--text-primary);
}
.xx-dashboard-section-header a,
.xx-dashboard-section-header button {
font-size: var(--font-size-sm);
color: var(--primary-color);
cursor: pointer;
background: none;
border: none;
padding: 0;
text-decoration: none;
transition: var(--transition-color);
}
.xx-dashboard-section-header a:hover,
.xx-dashboard-section-header button:hover {
color: var(--primary-hover);
text-decoration: underline;
}
/* ============================================================
最近任务卡片列表
============================================================ */
.xx-task-list {
display: flex;
flex-direction: column;
gap: 10px;
}
.xx-task-item {
background: var(--bg-primary);
border: 1px solid var(--border-color);
border-radius: var(--radius-md);
padding: 14px 16px;
display: grid;
grid-template-columns: 1fr auto auto auto;
gap: 16px;
align-items: center;
transition: var(--transition-all);
}
.xx-task-item:hover {
border-color: var(--primary-color);
box-shadow: var(--shadow-sm);
}
.xx-task-info h4 {
margin: 0 0 4px;
font-size: 14px;
font-weight: 600;
color: var(--text-primary);
}
.xx-task-info span {
font-size: 12px;
color: var(--text-secondary);
}
.xx-task-status {
display: inline-flex;
align-items: center;
gap: 4px;
padding: 3px 10px;
border-radius: var(--radius-sm);
font-size: 12px;
font-weight: 500;
white-space: nowrap;
}
.xx-task-status--completed {
color: var(--success-color);
background: var(--success-soft);
border: 1px solid var(--success-border);
}
.xx-task-status--processing {
color: var(--info-color);
background: var(--primary-soft);
border: 1px solid var(--color-primary-200);
}
.xx-task-status--pending {
color: var(--text-secondary);
background: var(--bg-secondary, #f1f5f9);
border: 1px solid var(--border-color);
}
.xx-task-status--failed {
color: var(--error-color);
background: var(--error-soft);
border: 1px solid var(--error-border);
}
.xx-task-time {
text-align: right;
font-size: 12px;
color: var(--text-secondary);
min-width: 100px;
}
.xx-task-time span {
display: block;
margin-bottom: 2px;
}
.xx-task-action {
font-size: 12px;
}
/* ============================================================
使用统计图表(纯 CSS 柱状图)
============================================================ */
.xx-chart-container {
padding: var(--space-sm) 0;
}
.xx-chart-bars {
display: flex;
align-items: flex-end;
gap: 8px;
height: 160px;
padding-top: var(--space-sm);
}
.xx-chart-bar-wrapper {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
height: 100%;
justify-content: flex-end;
}
.xx-chart-bar {
width: 100%;
max-width: 36px;
border-radius: var(--radius-sm) var(--radius-sm) 0 0;
background: var(--gradient-primary);
transition: height 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
position: relative;
min-height: 4px;
cursor: pointer;
}
.xx-chart-bar:hover {
opacity: 0.85;
}
.xx-chart-bar-value {
position: absolute;
top: -20px;
left: 50%;
transform: translateX(-50%);
font-size: 11px;
font-weight: 600;
color: var(--text-primary);
white-space: nowrap;
opacity: 0;
transition: var(--transition-opacity);
}
.xx-chart-bar:hover .xx-chart-bar-value {
opacity: 1;
}
.xx-chart-labels {
display: flex;
gap: 8px;
margin-top: 8px;
}
.xx-chart-label {
flex: 1;
text-align: center;
font-size: 11px;
color: var(--text-secondary);
}
/* ============================================================
快速入口卡片网格
============================================================ */
.xx-quick-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: var(--space-md);
margin-bottom: var(--space-lg);
}
.xx-quick-card {
background: var(--bg-primary);
border: 1px solid var(--border-color);
border-radius: var(--radius-lg);
padding: 20px;
cursor: pointer;
transition: var(--transition-all);
text-align: center;
}
.xx-quick-card:hover {
border-color: var(--primary-color);
box-shadow: var(--shadow-md);
transform: translateY(-2px);
}
.xx-quick-card-icon {
width: 52px;
height: 52px;
border-radius: var(--radius-md);
display: flex;
align-items: center;
justify-content: center;
font-size: 24px;
margin: 0 auto 14px;
color: #fff;
}
.xx-quick-card h3 {
margin: 0 0 8px;
font-size: 16px;
font-weight: var(--font-weight-semibold);
color: var(--text-primary);
}
.xx-quick-card p {
margin: 0;
color: var(--text-secondary);
font-size: 13px;
}
/* ============================================================
公告区域
============================================================ */
.xx-announcement-list {
display: flex;
flex-direction: column;
gap: 12px;
}
.xx-announcement-item {
display: flex;
gap: 12px;
padding: 12px;
border-radius: var(--radius-md);
background: var(--bg-secondary, #f8fafc);
border: 1px solid var(--border-color);
transition: var(--transition-all);
}
.xx-announcement-item:hover {
border-color: var(--primary-color);
background: var(--primary-soft);
}
.xx-announcement-tag {
flex-shrink: 0;
padding: 2px 8px;
border-radius: var(--radius-sm);
font-size: 11px;
font-weight: 500;
height: fit-content;
}
.xx-announcement-tag--update {
color: var(--primary-color);
background: var(--primary-soft);
}
.xx-announcement-tag--notice {
color: var(--warning-color);
background: var(--warning-soft);
}
.xx-announcement-tag--activity {
color: var(--success-color);
background: var(--success-soft);
}
.xx-announcement-content {
flex: 1;
min-width: 0;
}
.xx-announcement-content h4 {
margin: 0 0 4px;
font-size: 13px;
font-weight: 500;
color: var(--text-primary);
line-height: 1.4;
}
.xx-announcement-content time {
font-size: 11px;
color: var(--text-secondary);
}
/* ============================================================
存储用量条
============================================================ */
.xx-storage-bar {
margin-top: 12px;
}
.xx-storage-bar-track {
height: 8px;
background: var(--bg-secondary, #e2e8f0);
border-radius: 4px;
overflow: hidden;
}
.xx-storage-bar-fill {
height: 100%;
border-radius: 4px;
background: var(--gradient-primary);
transition: width 0.6s ease;
}
.xx-storage-bar-label {
display: flex;
justify-content: space-between;
font-size: 11px;
color: var(--text-secondary);
margin-top: 4px;
}
/* ============================================================
响应式
============================================================ */
@media (max-width: 1200px) {
.xx-dashboard-main {
grid-template-columns: 1fr;
}
.xx-kpi-grid {
grid-template-columns: repeat(2, 1fr);
}
.xx-quick-grid {
grid-template-columns: repeat(2, 1fr);
}
}
@media (max-width: 768px) {
.xx-dashboard-page {
padding: var(--space-md);
}
.xx-kpi-grid {
grid-template-columns: 1fr;
}
.xx-quick-grid {
grid-template-columns: 1fr;
}
.xx-task-item {
grid-template-columns: 1fr;
gap: 8px;
}
.xx-task-time {
text-align: left;
}
.xx-chart-bars {
height: 120px;
}
}