All checks were successful
continuous-integration/drone/push Build is passing
- .dashboard .stats-group .stat-item i.ph 覆盖全局 i{display:inline}
- display: inline-flex 确保 width/height 生效
- .row-3 > .card-sidebar 添加 min-height:100% 强制等高
328 lines
15 KiB
CSS
328 lines
15 KiB
CSS
/* ============================================
|
|
Dashboard — Design System
|
|
============================================ */
|
|
|
|
/* Tokens */
|
|
:root {
|
|
--text-primary: #1F2937;
|
|
--text-secondary: #6B7280;
|
|
--text-tertiary: #9CA3AF;
|
|
--surface: #FFFFFF;
|
|
--surface-hover: #F9FAFB;
|
|
--surface-muted: #F3F4F6;
|
|
--border: #E5E7EB;
|
|
--border-light: #F3F4F6;
|
|
--accent: var(--color-primary, #4F46E5);
|
|
--success: #059669;
|
|
--danger: #DC2626;
|
|
--shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
|
|
--shadow-md: 0 4px 8px rgba(0,0,0,0.06);
|
|
--radius: 12px;
|
|
--radius-sm: 8px;
|
|
--ease: 200ms ease-out;
|
|
}
|
|
|
|
/* Base Reset */
|
|
.home-main { padding: 0 !important; background: #F5F6FA !important; }
|
|
|
|
/* Dashboard */
|
|
.dashboard {
|
|
padding: 20px !important;
|
|
display: flex !important;
|
|
flex-direction: column !important;
|
|
gap: 16px !important;
|
|
box-sizing: border-box !important;
|
|
}
|
|
|
|
/* Card */
|
|
.card {
|
|
background: var(--surface) !important;
|
|
border-radius: var(--radius) !important;
|
|
border: 1px solid var(--border-light) !important;
|
|
box-shadow: var(--shadow-sm) !important;
|
|
box-sizing: border-box !important;
|
|
}
|
|
|
|
/* ====== ROW 1 — 用户信息 + 统计卡片(并排) ====== */
|
|
.row-1 {
|
|
display: flex !important;
|
|
flex-direction: row !important;
|
|
flex-wrap: nowrap !important;
|
|
gap: 16px !important;
|
|
align-items: stretch !important;
|
|
}
|
|
/* 用户卡片:占 60% */
|
|
.card-user {
|
|
flex: 3 !important;
|
|
min-width: 0 !important;
|
|
padding: 20px 24px !important;
|
|
cursor: pointer;
|
|
display: flex !important;
|
|
flex-direction: column !important;
|
|
justify-content: center !important;
|
|
gap: 14px !important;
|
|
}
|
|
.user-header { display: flex !important; align-items: center !important; gap: 12px !important; }
|
|
.user-avatar {
|
|
width: 42px !important; height: 42px !important; border-radius: 50% !important;
|
|
background: var(--accent) !important; color: #fff !important;
|
|
font-size: 16px !important; font-weight: 600 !important;
|
|
display: flex !important; align-items: center !important; justify-content: center !important;
|
|
flex-shrink: 0 !important;
|
|
}
|
|
.user-greeting { font-size: 15px; color: var(--text-primary); line-height: 1.4; }
|
|
.user-greeting strong { font-weight: 600; }
|
|
.user-level { margin-left: 4px; font-size: 12px; font-weight: 500; }
|
|
.user-id { font-size: 13px; color: var(--text-tertiary); margin-top: 2px; }
|
|
.user-contacts { display: flex !important; gap: 20px !important; flex-wrap: wrap; }
|
|
.contact-item { display: flex !important; align-items: center !important; gap: 6px !important; font-size: 13px; color: var(--text-secondary); }
|
|
.contact-item i { font-size: 15px; color: var(--text-tertiary); }
|
|
|
|
/* 统计卡片组:单卡片容器,占 40% */
|
|
.stats-group {
|
|
flex: 2 !important;
|
|
min-width: 0 !important;
|
|
display: flex !important;
|
|
flex-direction: row !important;
|
|
flex-wrap: nowrap !important;
|
|
padding: 0 !important;
|
|
overflow: hidden !important;
|
|
}
|
|
/* 每个统计子项 */
|
|
.stat-item {
|
|
flex: 1 !important;
|
|
min-width: 0 !important;
|
|
padding: 16px !important;
|
|
display: flex !important;
|
|
flex-direction: column !important;
|
|
align-items: center !important;
|
|
justify-content: center !important;
|
|
gap: 8px !important;
|
|
cursor: pointer;
|
|
text-align: center;
|
|
transition: background var(--ease);
|
|
box-sizing: border-box !important;
|
|
}
|
|
.stat-item + .stat-item { border-left: 1px solid var(--border-light); }
|
|
.stat-item:hover { background: var(--surface-hover); }
|
|
.stat-item:active { transform: scale(0.97); }
|
|
|
|
/* 圆形图标背景 — 高特异性覆盖全局 i{display:inline} */
|
|
.dashboard .stats-group .stat-item i.ph {
|
|
width: 36px !important; height: 36px !important;
|
|
min-width: 36px !important; min-height: 36px !important;
|
|
border-radius: 50% !important; flex-shrink: 0 !important;
|
|
display: inline-flex !important; align-items: center !important; justify-content: center !important;
|
|
font-size: 18px !important; line-height: 1 !important;
|
|
}
|
|
/* 兜底:任何 .stat-item 下的 i 标签 */
|
|
.stat-item > i {
|
|
width: 36px !important; height: 36px !important;
|
|
min-width: 36px !important; min-height: 36px !important;
|
|
border-radius: 50% !important; flex-shrink: 0 !important;
|
|
display: inline-flex !important; align-items: center !important; justify-content: center !important;
|
|
font-size: 18px !important; line-height: 1 !important;
|
|
}
|
|
.stat-value {
|
|
font-size: 24px; font-weight: 700; line-height: 1;
|
|
color: var(--text-primary); font-variant-numeric: tabular-nums;
|
|
}
|
|
.stat-label { font-size: 11px; color: var(--text-tertiary); font-weight: 500; }
|
|
|
|
/* 统计颜色 */
|
|
.stat-purple i { background: #F3F0FF; color: #7C3AED; }
|
|
.stat-blue i { background: #EFF6FF; color: #2563EB; }
|
|
.stat-amber i { background: #FFF7ED; color: #D97706; }
|
|
|
|
/* ====== ROW 2 — 余额 + 侧边 ====== */
|
|
.row-2 {
|
|
display: flex !important;
|
|
flex-direction: row !important;
|
|
flex-wrap: nowrap !important;
|
|
gap: 16px !important;
|
|
align-items: stretch !important;
|
|
}
|
|
|
|
/* 余额卡 60% */
|
|
.card-balance {
|
|
flex: 3 !important;
|
|
min-width: 0 !important;
|
|
padding: 20px 24px !important;
|
|
}
|
|
.balance-header { display: flex !important; align-items: center !important; justify-content: space-between !important; }
|
|
.balance-title { font-size: 14px; color: var(--text-secondary); font-weight: 500; }
|
|
.balance-btn {
|
|
font-size: 13px; color: #fff; background: var(--accent);
|
|
padding: 5px 14px; border-radius: 999px; cursor: pointer; font-weight: 500;
|
|
}
|
|
.balance-btn:hover { opacity: 0.85; }
|
|
.balance-amount { font-size: 32px; font-weight: 700; color: var(--text-primary); margin: 10px 0 4px; line-height: 1.1; font-variant-numeric: tabular-nums; }
|
|
.balance-amount .currency { font-size: 18px; margin-right: 2px; font-weight: 500; color: var(--text-secondary); }
|
|
.balance-extra { margin-bottom: 4px; }
|
|
.recharge-link { font-size: 13px; color: var(--accent); cursor: pointer; }
|
|
.balance-footer {
|
|
display: flex !important; align-items: center !important;
|
|
padding-top: 14px; margin-top: 14px; border-top: 1px solid var(--border-light);
|
|
}
|
|
.consume-item { flex: 1; display: flex !important; align-items: center !important; gap: 8px !important; }
|
|
.consume-label { font-size: 13px; color: var(--text-tertiary); white-space: nowrap; }
|
|
.consume-value { font-size: 14px; font-weight: 600; color: var(--text-primary); font-variant-numeric: tabular-nums; }
|
|
.consume-divider { width: 1px; height: 14px; background: var(--border); margin: 0 16px; flex-shrink: 0; }
|
|
.trend-up { font-size: 12px; color: var(--success); font-weight: 500; }
|
|
.trend-down { font-size: 12px; color: var(--danger); font-weight: 500; }
|
|
|
|
/* Credit */
|
|
.credit-section { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border-light); display: flex; flex-direction: column; gap: 8px; }
|
|
.credit-row { display: flex; align-items: center; justify-content: space-between; }
|
|
.credit-label { font-size: 13px; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; }
|
|
.credit-val { font-size: 14px; font-weight: 600; color: var(--text-primary); font-variant-numeric: tabular-nums; }
|
|
.credit-tag { font-size: 11px; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--border); color: var(--text-secondary); background: var(--surface-muted); }
|
|
|
|
/* Coin */
|
|
.coin-section { margin-top: 14px; padding: 14px; background: var(--surface-muted); border-radius: var(--radius-sm); }
|
|
.coin-header { display: flex; align-items: center; justify-content: space-between; font-size: 14px; color: var(--text-secondary); }
|
|
.coin-link { font-size: 13px; color: var(--accent); }
|
|
.coin-amount { margin-top: 6px; font-size: 20px; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; }
|
|
|
|
/* Voucher */
|
|
.voucher-row { margin-top: 10px; font-size: 12px; color: var(--text-tertiary); }
|
|
.voucher-link { color: var(--accent); margin-left: 4px; }
|
|
|
|
/* 侧边卡 40% */
|
|
.card-side {
|
|
flex: 2 !important;
|
|
min-width: 0 !important;
|
|
padding: 20px 24px !important;
|
|
display: flex !important;
|
|
flex-direction: column !important;
|
|
gap: 16px !important;
|
|
}
|
|
|
|
/* Certification */
|
|
.cert-section { display: flex; flex-direction: column; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--border-light); }
|
|
.cert-item { display: flex; align-items: center; gap: 10px; }
|
|
.cert-icon {
|
|
width: 34px; height: 34px; border-radius: var(--radius-sm);
|
|
background: var(--surface-muted); display: flex; align-items: center; justify-content: center; flex-shrink: 0;
|
|
}
|
|
.cert-icon i { font-size: 16px; color: var(--text-secondary); }
|
|
.cert-label { font-size: 12px; color: var(--text-tertiary); }
|
|
.cert-value { font-size: 14px; color: var(--text-primary); font-weight: 500; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
.cert-action { font-size: 14px; color: var(--accent); cursor: pointer; font-weight: 500; }
|
|
|
|
/* Referral Open */
|
|
.referral-open { display: flex; flex-direction: column; gap: 12px; }
|
|
.referral-title { display: flex; align-items: center; justify-content: space-between; }
|
|
.referral-title > span:first-child { font-size: 15px; font-weight: 600; color: var(--text-primary); }
|
|
.referral-reward { font-size: 12px; color: #fff; background: var(--danger); padding: 3px 10px; border-radius: 999px; cursor: pointer; display: flex; align-items: center; gap: 4px; }
|
|
.referral-reward:hover { opacity: 0.85; }
|
|
.referral-reward i { font-size: 13px; }
|
|
.referral-url { display: flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
|
|
.url-text { flex: 1; padding: 8px 12px; font-size: 13px; color: var(--text-secondary); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; background: var(--surface-muted); line-height: 1.6; }
|
|
.url-copy { padding: 8px 16px; font-size: 13px; color: var(--accent); font-weight: 500; cursor: pointer; border-left: 1px solid var(--border); }
|
|
.url-copy:hover { background: var(--surface-hover); }
|
|
.referral-stats { display: flex; gap: 10px; }
|
|
.ref-stat { flex: 1; padding: 10px 12px; background: var(--surface-muted); border-radius: var(--radius-sm); }
|
|
.ref-amount { font-size: 16px; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; }
|
|
.ref-label { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }
|
|
|
|
/* Referral Closed */
|
|
.referral-closed { text-align: center; padding: 16px 0; }
|
|
.referral-closed > i { font-size: 32px; color: var(--border); }
|
|
.referral-closed h3 { font-size: 14px; color: var(--text-primary); margin: 8px 0 4px; font-weight: 500; }
|
|
.referral-closed p { font-size: 13px; color: var(--text-tertiary); margin-bottom: 12px; }
|
|
.referral-open-btn { display: inline-block; padding: 6px 18px; background: var(--accent); color: #fff; font-size: 13px; border-radius: 999px; cursor: pointer; font-weight: 500; }
|
|
.referral-open-btn:hover { opacity: 0.85; }
|
|
.referral-disabled { font-size: 13px; color: var(--text-tertiary); margin-top: 6px; }
|
|
|
|
/* ====== ROW 3 — 产品列表 + 侧栏 ====== */
|
|
.row-3 {
|
|
display: flex !important;
|
|
flex-direction: row !important;
|
|
flex-wrap: nowrap !important;
|
|
gap: 16px !important;
|
|
align-items: stretch !important;
|
|
}
|
|
|
|
/* 产品卡 65% */
|
|
.card-products {
|
|
flex: 3 !important;
|
|
min-width: 0 !important;
|
|
padding: 20px 24px !important;
|
|
}
|
|
.section-title { font-size: 15px; font-weight: 600; color: var(--text-primary); margin: 0 0 14px; }
|
|
.product-link { color: var(--accent); font-weight: 500; text-decoration: none; }
|
|
.product-link:hover { text-decoration: underline; }
|
|
.text-danger { color: var(--danger); }
|
|
|
|
/* Empty */
|
|
.empty-state { text-align: center; padding: 40px 0; }
|
|
.empty-state > i { font-size: 40px; color: var(--border); }
|
|
.empty-state h3 { font-size: 15px; color: var(--text-primary); margin: 12px 0 4px; font-weight: 500; }
|
|
.empty-state p { font-size: 13px; color: var(--text-tertiary); margin-bottom: 14px; }
|
|
.empty-state .el-button { padding: 8px 22px; font-size: 14px; border: none; background: var(--accent); color: #fff; border-radius: 999px; }
|
|
|
|
/* 侧栏 35% — 与产品卡等高 */
|
|
.row-3 > .card-sidebar,
|
|
.card-sidebar {
|
|
flex: 2 !important;
|
|
min-width: 0 !important;
|
|
padding: 20px 24px !important;
|
|
display: flex !important;
|
|
flex-direction: column !important;
|
|
gap: 20px !important;
|
|
align-self: stretch !important;
|
|
height: auto !important;
|
|
min-height: 100% !important;
|
|
}
|
|
.sidebar-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
|
|
.sidebar-header > span:first-child { font-size: 14px; font-weight: 600; color: var(--text-primary); }
|
|
.sidebar-more { cursor: pointer; font-size: 16px; color: var(--text-tertiary); padding: 2px 6px; border-radius: 4px; }
|
|
.sidebar-more:hover { background: var(--surface-muted); }
|
|
|
|
/* Tickets */
|
|
.ticket-list { display: flex; flex-direction: column; gap: 4px; }
|
|
.ticket-item { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: var(--radius-sm); cursor: pointer; transition: background var(--ease); }
|
|
.ticket-item:hover { background: var(--surface-hover); }
|
|
.ticket-status { flex-shrink: 0; font-size: 11px; padding: 2px 8px; border-radius: 4px; color: #fff; font-weight: 500; }
|
|
.ticket-title { font-size: 13px; color: var(--text-primary); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
|
|
.ticket-dept { font-size: 12px; color: var(--text-tertiary); }
|
|
|
|
/* Notices */
|
|
.notice-list { display: flex; flex-direction: column; }
|
|
.notice-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 8px; border-radius: var(--radius-sm); cursor: pointer; transition: background var(--ease); }
|
|
.notice-item:hover { background: var(--surface-hover); }
|
|
.notice-title { font-size: 13px; color: var(--text-primary); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
|
|
.notice-meta { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }
|
|
.notice-item > i { font-size: 13px; color: var(--border); flex-shrink: 0; }
|
|
|
|
/* ====== Element UI Override ====== */
|
|
.card-products .el-table { background: transparent !important; color: var(--text-primary); font-size: 13px; }
|
|
.card-products .el-table th { background: var(--surface-muted) !important; color: var(--text-secondary) !important; font-weight: 500 !important; font-size: 12px !important; border-bottom: none !important; }
|
|
.card-products .el-table td { border-bottom: 1px solid var(--border-light) !important; }
|
|
.card-products .el-table tr:hover > td { background: var(--surface-hover) !important; }
|
|
.card-products .el-table::before { display: none; }
|
|
.card-products .el-table__empty-block { display: none; }
|
|
|
|
/* Dialog */
|
|
.open-dialog { border-radius: var(--radius); }
|
|
.open-dialog .dialog-footer .btn-ok { padding: 8px 20px; background: var(--accent); border-radius: 999px; color: #fff; border: none; }
|
|
.open-dialog .dialog-footer .btn-no { padding: 8px 20px; border-radius: 999px; }
|
|
|
|
/* WeChat */
|
|
.wx-code { position: fixed; right: 24px; bottom: 24px; z-index: 100; }
|
|
.wx-box .tit { text-align: center; font-size: 14px; color: var(--text-primary); margin-bottom: 8px; }
|
|
.wx-box .img { display: flex; justify-content: center; }
|
|
.wx-box .img img { width: 160px; height: 160px; }
|
|
.wx-img { width: 44px; height: 44px; border-radius: 50%; background: #07C160; cursor: pointer; box-shadow: 0 2px 8px rgba(7,193,96,0.25); }
|
|
|
|
/* Responsive */
|
|
@media (max-width: 1100px) {
|
|
.row-1, .row-2, .row-3 { flex-wrap: wrap !important; }
|
|
.card-user, .card-balance, .card-products { flex: 1 1 100% !important; }
|
|
.stats-group, .card-side, .card-sidebar { flex: 1 1 100% !important; }
|
|
}
|
|
@media (prefers-reduced-motion: reduce) {
|
|
* { transition-duration: 0.01ms !important; }
|
|
}
|