diff --git a/src/App.vue b/src/App.vue index 7bb9b19..64c3b6c 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,5 +1,5 @@ @@ -74,37 +73,135 @@ onMounted(() => { --border-color: #4a5568 !important; } -/* 强制深色主题样式 - 更具体的选择器 */ +/* 深色主题样式优化 - 针对Naive UI组件 */ html.dark, -html.dark body, -html.dark #app, -html.dark * { +html[data-theme="dark"] { + color-scheme: dark; +} + +/* 全局深色主题文字颜色 */ +html.dark *, +html[data-theme="dark"] * { + color: #ffffff; +} + +/* Naive UI 表单组件 */ +html.dark .n-form-item-label, +html.dark .n-form-item-label__text, +html[data-theme="dark"] .n-form-item-label, +html[data-theme="dark"] .n-form-item-label__text { color: #ffffff !important; } -html.dark .n-form-item-label, -html.dark .n-form-item-label__text, +/* Naive UI 输入组件 */ html.dark .n-input, html.dark .n-input__input, html.dark .n-input__textarea, +html[data-theme="dark"] .n-input, +html[data-theme="dark"] .n-input__input, +html[data-theme="dark"] .n-input__textarea { + color: #ffffff !important; + background-color: rgba(255, 255, 255, 0.1) !important; +} + +/* Naive UI 弹框组件 */ +html.dark .n-modal, +html.dark .n-drawer, +html.dark .n-popover, +html.dark .n-dropdown, +html.dark .n-tooltip, +html.dark .n-dialog, +html[data-theme="dark"] .n-modal, +html[data-theme="dark"] .n-drawer, +html[data-theme="dark"] .n-popover, +html[data-theme="dark"] .n-dropdown, +html[data-theme="dark"] .n-tooltip, +html[data-theme="dark"] .n-dialog { + color: #ffffff !important; +} + +/* Naive UI 弹框内容 */ +html.dark .n-modal .n-card, +html.dark .n-drawer-content, +html.dark .n-popover-content, +html.dark .n-dropdown-option, +html.dark .n-dialog__content, +html[data-theme="dark"] .n-modal .n-card, +html[data-theme="dark"] .n-drawer-content, +html[data-theme="dark"] .n-popover-content, +html[data-theme="dark"] .n-dropdown-option, +html[data-theme="dark"] .n-dialog__content { + color: #ffffff !important; +} + +/* Naive UI 下拉选项 */ +html.dark .n-dropdown-option__label, +html.dark .n-select-option, +html.dark .n-menu-item-content, +html[data-theme="dark"] .n-dropdown-option__label, +html[data-theme="dark"] .n-select-option, +html[data-theme="dark"] .n-menu-item-content { + color: #ffffff !important; +} + +/* 其他组件 */ html.dark .n-collapse-item__header, html.dark .n-radio-button, html.dark .n-card, html.dark .n-card__content, -html.dark h1, -html.dark h2, -html.dark h3, -html.dark p, -html.dark span, -html.dark div { +html.dark .n-button, +html.dark .n-tag, +html[data-theme="dark"] .n-collapse-item__header, +html[data-theme="dark"] .n-radio-button, +html[data-theme="dark"] .n-card, +html[data-theme="dark"] .n-card__content, +html[data-theme="dark"] .n-button, +html[data-theme="dark"] .n-tag { color: #ffffff !important; } +/* 标题和文本 */ +html.dark h1, +html.dark h2, +html.dark h3, +html.dark h4, +html.dark h5, +html.dark h6, +html.dark p, +html.dark span, +html.dark div, +html.dark label, +html[data-theme="dark"] h1, +html[data-theme="dark"] h2, +html[data-theme="dark"] h3, +html[data-theme="dark"] h4, +html[data-theme="dark"] h5, +html[data-theme="dark"] h6, +html[data-theme="dark"] p, +html[data-theme="dark"] span, +html[data-theme="dark"] div, +html[data-theme="dark"] label { + color: #ffffff !important; +} + +/* 占位符文本 */ html.dark .n-input__placeholder, -html.dark ::placeholder { +html.dark ::placeholder, +html[data-theme="dark"] .n-input__placeholder, +html[data-theme="dark"] ::placeholder { color: rgba(255, 255, 255, 0.6) !important; } +/* 确保Portal渲染的组件也应用深色主题 */ +body.dark .n-modal-container, +body.dark .n-drawer-container, +body.dark .n-popover-container, +body[data-theme="dark"] .n-modal-container, +body[data-theme="dark"] .n-drawer-container, +body[data-theme="dark"] .n-popover-container { + color: #ffffff !important; +} + #app { min-height: 100vh; background: var(--app-background); diff --git a/src/components/TokenManager.vue b/src/components/TokenManager.vue index bcda8d7..eea33a9 100644 --- a/src/components/TokenManager.vue +++ b/src/components/TokenManager.vue @@ -92,10 +92,13 @@ - + diff --git a/src/views/Dashboard.vue b/src/views/Dashboard.vue index 8f9a138..a622a49 100644 --- a/src/views/Dashboard.vue +++ b/src/views/Dashboard.vue @@ -64,6 +64,9 @@

游戏Token管理

@@ -451,10 +437,11 @@