feat(ui): 运营后台支持暗色模式与系统自适应切换

This commit is contained in:
yml
2026-11-20 23:12:39 +08:00
parent e6a9c2d81e
commit 7c2e01fb7e
8 changed files with 636 additions and 46 deletions
+215 -10
View File
@@ -353,7 +353,7 @@
.admin-sider {
height: 100vh;
overflow: hidden;
border-right: 1px solid #edf0f5;
border-right: 1px solid var(--theme-border-color);
box-shadow: 4px 0 18px rgba(15, 23, 42, 0.04);
z-index: 2;
}
@@ -382,7 +382,7 @@
justify-content: space-between;
gap: 10px;
padding: 12px 14px 12px 18px;
border-bottom: 1px solid #edf0f5;
border-bottom: 1px solid var(--theme-border-color);
}
.admin-brand-copy {
@@ -392,26 +392,26 @@
}
.admin-brand strong {
color: #111827;
color: var(--theme-text-primary);
font-size: 18px;
}
.admin-brand span {
color: #6b7280;
color: var(--theme-text-secondary);
font-size: 12px;
}
.admin-collapse-button {
flex: 0 0 auto;
border-color: #e5e7eb;
border-color: var(--theme-border-color-strong);
}
.admin-sidebar-profile {
margin: 12px 14px 8px;
padding: 12px;
border: 1px solid #edf0f5;
border: 1px solid var(--theme-border-color);
border-radius: 6px;
background: #f8fafc;
background: var(--theme-bg-subtle);
display: grid;
gap: 3px;
line-height: 1.35;
@@ -444,14 +444,14 @@
.admin-menu .ant-menu-item-group-title {
padding: 12px 10px 6px;
color: #9ca3af;
color: var(--theme-text-tertiary);
font-size: 12px;
font-weight: 700;
}
.admin-sider-footer {
padding: 10px 14px 14px;
border-top: 1px solid #edf0f5;
border-top: 1px solid var(--theme-border-color);
}
.admin-sider.ant-layout-sider-collapsed .admin-brand {
@@ -484,7 +484,7 @@
align-items: center;
justify-content: flex-end;
padding: 0 20px;
border-bottom: 1px solid #edf0f5;
border-bottom: 1px solid var(--theme-border-color);
}
.admin-user {
@@ -2406,3 +2406,208 @@
grid-template-columns: 1fr;
}
}
/* ==========================================================================
运营后台暗色模式适配 (Admin Dark Mode Overrides)
========================================================================== */
[data-theme='dark'] .admin-sider {
box-shadow: 4px 0 18px rgba(0, 0, 0, 0.45);
}
[data-theme='dark'] .auth-page {
background:
linear-gradient(135deg, rgba(255, 106, 0, 0.08), transparent 30%),
linear-gradient(315deg, rgba(0, 0, 0, 0.5), transparent 38%), #141414;
}
[data-theme='dark'] .auth-shell {
background: #1f1f1f;
border-color: var(--theme-border-color);
box-shadow: 0 28px 72px rgba(0, 0, 0, 0.6);
}
[data-theme='dark'] .auth-form-side {
background: #1f1f1f;
}
[data-theme='dark'] .auth-form-header h1 {
color: var(--theme-text-primary);
}
[data-theme='dark'] .auth-form-header p {
color: var(--theme-text-secondary);
}
[data-theme='dark'] .auth-mobile-brand strong {
color: var(--theme-text-primary);
}
[data-theme='dark'] .manual-channel-config-item,
[data-theme='dark'] .manual-channel-cost-preview {
border-color: var(--theme-border-color);
background: var(--theme-bg-subtle);
}
[data-theme='dark'] .task-action-group,
[data-theme='dark'] .task-flow-item,
[data-theme='dark'] .task-screenshot-preview,
[data-theme='dark'] .finance-review-evidence,
[data-theme='dark'] .platform-route-rule,
[data-theme='dark'] .field-switch,
[data-theme='dark'] .empty-rule-hint {
border-color: var(--theme-border-color);
background: var(--theme-bg-subtle);
}
[data-theme='dark'] .field-switch span {
color: var(--theme-text-secondary);
}
[data-theme='dark'] .fulfillment-step-card,
[data-theme='dark'] .platform-select-card {
border-color: var(--theme-border-color);
background: var(--theme-bg-container);
}
[data-theme='dark'] .binding-editor-card {
background: #1c1c1c !important;
border-color: var(--theme-border-color) !important;
}
[data-theme='dark'] .binding-editor-card .ant-card-head {
background: #242424;
border-bottom: 1px solid var(--theme-border-color);
}
[data-theme='dark'] .binding-pill-tag {
background: var(--theme-bg-subtle) !important;
border-color: var(--theme-border-color-strong) !important;
color: var(--theme-text-secondary) !important;
}
[data-theme='dark'] .shop-selector-box-inline {
background: var(--theme-bg-subtle);
border-color: var(--theme-border-color-strong);
}
[data-theme='dark'] .shop-selector-box-inline .shop-all-toggle {
border-right-color: var(--theme-border-color);
}
[data-theme='dark'] .product-rules-form-card .ant-card-head,
[data-theme='dark'] .product-rules-list-card .ant-card-head,
[data-theme='dark'] .product-rules-category-tabs-bar {
border-bottom-color: var(--theme-border-color);
}
[data-theme='dark'] .product-rules-sub-category-bar {
background: var(--theme-bg-subtle);
border-color: var(--theme-border-color);
}
[data-theme='dark'] .sub-category-bar-label {
color: var(--theme-text-secondary);
}
[data-theme='dark'] .sub-category-pill {
color: var(--theme-text-secondary);
background: var(--theme-bg-container);
border-color: var(--theme-border-color-strong);
}
[data-theme='dark'] .sub-category-pill .pill-count {
background: rgba(255, 255, 255, 0.08);
color: var(--theme-text-secondary);
}
[data-theme='dark'] .product-rule-row-active > td,
[data-theme='dark'] .product-binding-row-active > td {
background: rgba(255, 106, 0, 0.12) !important;
}
[data-theme='dark'] .product-rule-row-mapped > td {
background: rgba(82, 196, 26, 0.1) !important;
}
[data-theme='dark'] .task-list-row-error > td,
[data-theme='dark'] .admin-share-row-problem > td {
background: rgba(255, 77, 79, 0.14) !important;
}
[data-theme='dark'] .task-list-row-error:hover > td,
[data-theme='dark'] .admin-share-row-problem:hover > td {
background: rgba(255, 77, 79, 0.22) !important;
}
[data-theme='dark'] .admin-share-row-cancelled > td {
color: var(--theme-text-tertiary) !important;
background: rgba(255, 255, 255, 0.03) !important;
}
[data-theme='dark'] .admin-share-row-cancelled:hover > td {
background: rgba(255, 255, 255, 0.06) !important;
}
[data-theme='dark'] .order-service-shell > .ant-card-head {
background: var(--theme-bg-container);
}
[data-theme='dark'] .order-service-sidebar {
background: #181818;
border-right-color: var(--theme-border-color);
border-bottom-color: var(--theme-border-color);
}
[data-theme='dark'] .order-service-sidebar-head {
border-bottom-color: var(--theme-border-color);
}
[data-theme='dark'] .order-service-category-item {
color: var(--theme-text-regular);
}
[data-theme='dark'] .order-service-category-item:hover,
[data-theme='dark'] .order-service-category-item.is-active {
background: var(--theme-bg-elevated);
border-color: var(--theme-primary);
}
[data-theme='dark'] .order-service-section,
[data-theme='dark'] .order-service-status-step-card,
[data-theme='dark'] .order-service-confirmation-editor,
[data-theme='dark'] .order-service-jobs-collapse {
border-color: var(--theme-border-color);
background: var(--theme-bg-container);
}
[data-theme='dark'] .order-service-guide,
[data-theme='dark'] .order-service-confirmation-switch,
[data-theme='dark'] .order-service-field-row {
border-color: var(--theme-border-color);
background: var(--theme-bg-subtle);
}
[data-theme='dark'] .order-service-confirmation-preview {
color: var(--theme-text-regular);
background: var(--theme-bg-container);
border-color: var(--theme-border-color);
}
[data-theme='dark'] .order-service-confirmation-preview-content {
color: var(--theme-text-secondary);
}
[data-theme='dark'] .order-service-confirmation-preview-summary {
color: var(--theme-text-regular);
background: var(--theme-bg-subtle);
border-color: var(--theme-border-color);
}
[data-theme='dark'] .order-service-confirmation-preview-actions {
border-top-color: var(--theme-border-color);
}
[data-theme='dark'] .order-service-save-bar {
background: linear-gradient(180deg, rgba(20, 20, 20, 0) 0%, #141414 28%, #141414 100%);
}
+37 -5
View File
@@ -5,14 +5,46 @@
--theme-primary-soft: #fff3e8;
--theme-primary-soft-hover: #ffe6d1;
--theme-primary-shadow: rgba(255, 106, 0, 0.14);
color: #1f2937;
background: #f5f7fb;
--theme-bg-body: #f5f7fb;
--theme-bg-container: #ffffff;
--theme-bg-elevated: #ffffff;
--theme-bg-subtle: #f8fafc;
--theme-text-primary: #111827;
--theme-text-regular: #1f2937;
--theme-text-secondary: #6b7280;
--theme-text-tertiary: #9ca3af;
--theme-border-color: #edf0f5;
--theme-border-color-split: #f0f0f0;
--theme-border-color-strong: #e5e7eb;
color: var(--theme-text-regular);
background: var(--theme-bg-body);
font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
[data-theme='dark'],
:root[data-theme='dark'] {
--theme-primary-soft: rgba(255, 106, 0, 0.16);
--theme-primary-soft-hover: rgba(255, 106, 0, 0.24);
--theme-primary-shadow: rgba(255, 106, 0, 0.28);
--theme-bg-body: #141414;
--theme-bg-container: #1f1f1f;
--theme-bg-elevated: #262626;
--theme-bg-subtle: #242424;
--theme-text-primary: rgba(255, 255, 255, 0.95);
--theme-text-regular: rgba(255, 255, 255, 0.85);
--theme-text-secondary: rgba(255, 255, 255, 0.55);
--theme-text-tertiary: rgba(255, 255, 255, 0.35);
--theme-border-color: #303030;
--theme-border-color-split: #303030;
--theme-border-color-strong: #424242;
color: var(--theme-text-regular);
background: var(--theme-bg-body);
color-scheme: dark;
}
* {
box-sizing: border-box;
}
@@ -50,7 +82,7 @@ select {
.page-description {
margin: 6px 0 0;
color: #6b7280;
color: var(--theme-text-secondary);
}
.filter-form {
@@ -64,7 +96,7 @@ select {
}
.muted {
color: #6b7280;
color: var(--theme-text-secondary);
}
.full-width {
@@ -76,7 +108,7 @@ select {
overflow: auto;
margin: 0;
padding: 14px;
border: 1px solid #edf0f5;
border: 1px solid var(--theme-border-color);
border-radius: 6px;
background: #0f172a;
color: #dbeafe;