feat: 统一 Admin 后台设计语言
用中性灰底 + 单一强调色重做后台视觉,并集中到一套令牌: - 新增 apps/admin/src/lib/theme.ts,通过 ConfigProvider 注入主题令牌 - 新增 apps/admin/src/styles/admin.css 与 AdminSection、MetricCard、StatusTag 组件 - 侧栏改白底浅色并补图标,顶栏改 56px 白底,内容区最大宽 1200px - 全部页面接入状态标签,antd 原生彩色 Tag 与内联色值清零 - 登录与改密页、加载态骨架屏、错误提示条统一 - brand 页两个 Tab 统一为白卡片容器,消除双标题与宽度不一致 设计规范见 apps/admin/design.md。
This commit is contained in:
1 parent
bb94d80e13
commit
2f26828f09
34 files changed
+2159
-922
No files matched your search
@@ -0,0 +1,675 @@
|
||||
/*
|
||||
* 后台全局样式。视觉规则见 apps/admin/design.md。
|
||||
* 颜色令牌与 apps/admin/src/lib/theme.ts 保持一致,改动需同步。
|
||||
*/
|
||||
:root {
|
||||
--admin-bg: #f7f8fa;
|
||||
--admin-surface: #ffffff;
|
||||
--admin-border: #e7e9ec;
|
||||
--admin-divider: #f0f1f3;
|
||||
--admin-text: #1c1f23;
|
||||
--admin-text-secondary: #6b7280;
|
||||
--admin-text-tertiary: #9aa1ac;
|
||||
--admin-primary: #2563eb;
|
||||
--admin-primary-bg: #eff4ff;
|
||||
--admin-fill: #f7f8fa;
|
||||
--admin-fill-quiet: #fafafb;
|
||||
|
||||
--admin-tone-success-bg: #ecfdf3;
|
||||
--admin-tone-success-fg: #067647;
|
||||
--admin-tone-warning-bg: #fffaeb;
|
||||
--admin-tone-warning-fg: #b54708;
|
||||
--admin-tone-error-bg: #fef3f2;
|
||||
--admin-tone-error-fg: #b42318;
|
||||
--admin-tone-neutral-bg: #f2f4f7;
|
||||
--admin-tone-neutral-fg: #475467;
|
||||
--admin-tone-info-bg: #eff4ff;
|
||||
--admin-tone-info-fg: #2563eb;
|
||||
}
|
||||
|
||||
html,
|
||||
body,
|
||||
#app {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
background: var(--admin-bg);
|
||||
color: var(--admin-text);
|
||||
font-variant-numeric: tabular-nums;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
|
||||
:where(a, button, [tabindex]):focus-visible {
|
||||
outline: 2px solid var(--admin-primary);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
/* 外壳 */
|
||||
.admin-shell {
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.admin-sider,
|
||||
.admin-sider .ant-layout-sider-children {
|
||||
border-right: 1px solid var(--admin-border);
|
||||
}
|
||||
|
||||
.admin-sider.ant-layout-sider-collapsed,
|
||||
.admin-sider.ant-layout-sider-zero-width,
|
||||
.admin-sider.ant-layout-sider-zero-width .ant-layout-sider-children {
|
||||
border-right: 0;
|
||||
}
|
||||
|
||||
.admin-sider .ant-layout-sider-zero-width-trigger {
|
||||
border: 1px solid var(--admin-border);
|
||||
border-left: 0;
|
||||
border-radius: 0 6px 6px 0;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.admin-sider-brand {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
height: 56px;
|
||||
padding: 0 20px;
|
||||
}
|
||||
|
||||
.admin-sider-brand-mark {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
border-radius: 6px;
|
||||
background: var(--admin-primary);
|
||||
color: #fff;
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex: none;
|
||||
}
|
||||
|
||||
.admin-sider-brand-name {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: var(--admin-text);
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.admin-sider .ant-menu {
|
||||
border-inline-end: 0;
|
||||
padding: 4px 0 12px;
|
||||
}
|
||||
|
||||
.admin-sider .ant-menu-item-group-title {
|
||||
padding: 16px 24px 6px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.admin-main {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: 100vh;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.admin-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 16px;
|
||||
border-bottom: 1px solid var(--admin-border);
|
||||
}
|
||||
|
||||
.admin-header-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.admin-header-brand {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: var(--admin-text);
|
||||
}
|
||||
|
||||
.admin-header-context {
|
||||
font-size: 13px;
|
||||
color: var(--admin-text-tertiary);
|
||||
}
|
||||
|
||||
.admin-brand-switcher {
|
||||
min-width: 140px;
|
||||
}
|
||||
|
||||
.admin-equal-height > .ant-col > .ant-card {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.admin-content {
|
||||
flex: 1;
|
||||
padding: 24px;
|
||||
}
|
||||
|
||||
.admin-content-inner {
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
/* 页面头部 */
|
||||
.admin-page-header {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
gap: 16px;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.admin-page-header-title {
|
||||
margin: 0;
|
||||
font-size: 24px;
|
||||
font-weight: 600;
|
||||
line-height: 1.35;
|
||||
color: var(--admin-text);
|
||||
}
|
||||
|
||||
.admin-page-header-description {
|
||||
margin: 8px 0 0;
|
||||
font-size: 14px;
|
||||
line-height: 1.5;
|
||||
color: var(--admin-text-secondary);
|
||||
}
|
||||
|
||||
/* 区块与列表 */
|
||||
.admin-section {
|
||||
padding: 20px;
|
||||
border: 1px solid var(--admin-border);
|
||||
border-radius: 10px;
|
||||
background: var(--admin-surface);
|
||||
}
|
||||
|
||||
.admin-section + .admin-section {
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
.admin-section-head {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
gap: 16px;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.admin-section-head:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.admin-section-title {
|
||||
margin: 0;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
line-height: 1.45;
|
||||
color: var(--admin-text);
|
||||
}
|
||||
|
||||
.admin-section-description {
|
||||
margin: 6px 0 0;
|
||||
font-size: 13px;
|
||||
line-height: 1.5;
|
||||
color: var(--admin-text-secondary);
|
||||
}
|
||||
|
||||
.admin-stack {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.admin-stack-lg {
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.admin-stack-tight {
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.admin-actions {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.admin-row-title {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: var(--admin-text);
|
||||
}
|
||||
|
||||
.admin-row-meta {
|
||||
font-size: 12px;
|
||||
color: var(--admin-text-tertiary);
|
||||
}
|
||||
|
||||
.admin-row-summary {
|
||||
font-size: 13px;
|
||||
line-height: 1.5;
|
||||
color: var(--admin-text-secondary);
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.admin-empty-inline {
|
||||
padding: 24px 0;
|
||||
text-align: center;
|
||||
font-size: 13px;
|
||||
color: var(--admin-text-tertiary);
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* 列表行 */
|
||||
.admin-list {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.admin-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 16px;
|
||||
padding: 14px 0;
|
||||
border-bottom: 1px solid var(--admin-divider);
|
||||
}
|
||||
|
||||
.admin-row:last-child {
|
||||
border-bottom: 0;
|
||||
}
|
||||
|
||||
.admin-row-main {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.admin-row-line {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.admin-row-help {
|
||||
margin: 6px 0 0;
|
||||
font-size: 13px;
|
||||
line-height: 1.5;
|
||||
color: var(--admin-text-secondary);
|
||||
}
|
||||
|
||||
.admin-field-stack {
|
||||
display: grid;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.admin-field-label {
|
||||
display: block;
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
color: var(--admin-text-secondary);
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
.admin-offset-top {
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
.admin-offset-top-xs {
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.admin-divider {
|
||||
margin: 16px 0;
|
||||
}
|
||||
|
||||
.admin-offset-top-sm {
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.admin-offset-top-md {
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
.admin-offset-bottom {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.admin-text-xs {
|
||||
font-size: 12px;
|
||||
line-height: 1.5;
|
||||
color: var(--admin-text-secondary);
|
||||
}
|
||||
|
||||
.admin-text-xs-quiet {
|
||||
font-size: 12px;
|
||||
color: var(--admin-text-tertiary);
|
||||
}
|
||||
|
||||
.admin-text-warning {
|
||||
color: var(--admin-tone-warning-fg);
|
||||
}
|
||||
|
||||
.admin-flush {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.admin-flush-top {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.admin-block {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.admin-offset-bottom-sm {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.admin-offset-bottom-lg {
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.admin-offset-top-lg {
|
||||
margin-top: 24px;
|
||||
}
|
||||
|
||||
.admin-link-flush {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.admin-form-row {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 16px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.admin-form-row-center {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.admin-flex-1 {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.admin-field-w-sm {
|
||||
width: 90px;
|
||||
}
|
||||
|
||||
.admin-field-w-md {
|
||||
width: 150px;
|
||||
}
|
||||
|
||||
.admin-field-w-lg {
|
||||
width: 160px;
|
||||
}
|
||||
|
||||
.admin-field-w-xl {
|
||||
width: 220px;
|
||||
}
|
||||
|
||||
.admin-field-w-2xl {
|
||||
width: 180px;
|
||||
}
|
||||
|
||||
.admin-field-stack-xs {
|
||||
display: grid;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.admin-form-column {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.admin-brand-title {
|
||||
margin: 0;
|
||||
font-size: 20px;
|
||||
font-weight: 600;
|
||||
line-height: 1.4;
|
||||
color: var(--admin-text);
|
||||
}
|
||||
|
||||
.admin-brand-tagline {
|
||||
margin: 6px 0 12px;
|
||||
font-size: 14px;
|
||||
line-height: 1.5;
|
||||
color: var(--admin-text-secondary);
|
||||
}
|
||||
|
||||
.admin-field-offset {
|
||||
margin-top: 30px;
|
||||
}
|
||||
|
||||
.admin-offset-bottom-xs {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.admin-visual-card {
|
||||
width: 260px;
|
||||
}
|
||||
|
||||
.admin-swatch {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
height: 24px;
|
||||
padding: 0 8px;
|
||||
border-radius: 6px;
|
||||
background: var(--admin-fill);
|
||||
color: var(--admin-text-secondary);
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.admin-swatch::before {
|
||||
content: "";
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
border-radius: 3px;
|
||||
border: 1px solid var(--admin-border);
|
||||
background: var(--swatch-color, transparent);
|
||||
}
|
||||
|
||||
/* 状态标签 */
|
||||
.admin-status-tag {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
height: 24px;
|
||||
padding: 0 8px;
|
||||
border-radius: 6px;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
line-height: 1;
|
||||
white-space: nowrap;
|
||||
background: var(--admin-tone-neutral-bg);
|
||||
color: var(--admin-tone-neutral-fg);
|
||||
}
|
||||
|
||||
.admin-status-tag[data-tone="success"] {
|
||||
background: var(--admin-tone-success-bg);
|
||||
color: var(--admin-tone-success-fg);
|
||||
}
|
||||
|
||||
.admin-status-tag[data-tone="warning"] {
|
||||
background: var(--admin-tone-warning-bg);
|
||||
color: var(--admin-tone-warning-fg);
|
||||
}
|
||||
|
||||
.admin-status-tag[data-tone="error"] {
|
||||
background: var(--admin-tone-error-bg);
|
||||
color: var(--admin-tone-error-fg);
|
||||
}
|
||||
|
||||
.admin-status-tag[data-tone="info"] {
|
||||
background: var(--admin-tone-info-bg);
|
||||
color: var(--admin-tone-info-fg);
|
||||
}
|
||||
|
||||
/* 指标卡 */
|
||||
.admin-metric-label {
|
||||
font-size: 12px;
|
||||
color: var(--admin-text-tertiary);
|
||||
}
|
||||
|
||||
.admin-metric-value {
|
||||
margin-top: 8px;
|
||||
font-size: 28px;
|
||||
font-weight: 600;
|
||||
line-height: 1.2;
|
||||
color: var(--admin-text);
|
||||
}
|
||||
|
||||
.admin-metric-suffix {
|
||||
margin-left: 6px;
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
color: var(--admin-text-tertiary);
|
||||
}
|
||||
|
||||
/* 反馈 */
|
||||
.admin-error-note {
|
||||
padding: 12px 16px;
|
||||
border: 1px solid #fbd5d1;
|
||||
border-radius: 8px;
|
||||
background: var(--admin-tone-error-bg);
|
||||
color: var(--admin-tone-error-fg);
|
||||
font-size: 14px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.admin-loading-stack {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.admin-log {
|
||||
margin: 0;
|
||||
padding: 16px;
|
||||
border-radius: 8px;
|
||||
background: #1c1f23;
|
||||
color: #e4e7ec;
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
||||
font-size: 12px;
|
||||
line-height: 1.7;
|
||||
max-height: 280px;
|
||||
overflow: auto;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.admin-log__line {
|
||||
color: #e4e7ec;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.admin-log__line[data-stream="stderr"] {
|
||||
color: #fda29b;
|
||||
}
|
||||
|
||||
.admin-log__time {
|
||||
color: #98a2b3;
|
||||
}
|
||||
|
||||
.admin-code-input {
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.admin-thumb {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
object-fit: cover;
|
||||
border-radius: 8px;
|
||||
border: 1px solid var(--admin-border);
|
||||
}
|
||||
|
||||
.admin-thumb-remove {
|
||||
position: absolute;
|
||||
top: 8px;
|
||||
right: 8px;
|
||||
}
|
||||
|
||||
.admin-thumb-wrap {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.admin-media-preview {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
min-height: 140px;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
border: 1px solid var(--admin-border);
|
||||
background: var(--admin-fill);
|
||||
}
|
||||
|
||||
@media (max-width: 1024px) {
|
||||
.admin-content {
|
||||
padding: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
/* 登录与改密 */
|
||||
.admin-auth {
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 24px;
|
||||
background: var(--admin-bg);
|
||||
}
|
||||
|
||||
.admin-auth-card {
|
||||
width: 100%;
|
||||
max-width: 400px;
|
||||
}
|
||||
|
||||
.admin-auth-card .ant-card-body {
|
||||
padding: 32px;
|
||||
}
|
||||
|
||||
.admin-auth-brand {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.admin-auth-hint {
|
||||
margin: 8px 0 20px;
|
||||
font-size: 13px;
|
||||
color: var(--admin-text-secondary);
|
||||
}
|
||||
|
||||
.admin-auth-footnote {
|
||||
margin: 16px 0 0;
|
||||
font-size: 12px;
|
||||
color: var(--admin-text-tertiary);
|
||||
text-align: center;
|
||||
}
|
||||
Reference in new issue
Block a user