From 944673cac1f94c3fcf4e44b08d94c5d88604dd70 Mon Sep 17 00:00:00 2001 From: dekun Date: Fri, 10 Jul 2026 12:33:54 +0800 Subject: [PATCH] Improve hub and instance navigation contrast for light and dark themes. Co-authored-by: Cursor --- lib/common/static/instance_theme.css | 67 +++++++++++++++++++--- lib/common/static/instance_theme_early.css | 13 ++++- lib/instance/templates/embed_shell.html | 2 +- lib/instance/templates/index.html | 2 +- manual_trading_hub/static/app.css | 52 +++++++++++++++-- manual_trading_hub/static/index.html | 2 +- 6 files changed, 121 insertions(+), 17 deletions(-) diff --git a/lib/common/static/instance_theme.css b/lib/common/static/instance_theme.css index d0ce557..aa74a1e 100644 --- a/lib/common/static/instance_theme.css +++ b/lib/common/static/instance_theme.css @@ -1,4 +1,21 @@ /* 实例页手机端:与中控一致,桌面专属区块隐藏;下载仅电脑端 */ +:root, +html[data-theme="dark"] { + --inst-label: #8892b0; + --inst-muted: #9aa3bf; + --inst-text: #e8ecff; + --inst-nav-idle: #8fc8ff; + --inst-nav-active-fg: #dbe4ff; +} + +html[data-theme="light"] { + --inst-label: #4a6078; + --inst-muted: #5a6f85; + --inst-text: #142232; + --inst-nav-idle: #006e9a; + --inst-nav-active-fg: #004d6e; +} + @media (max-width: 720px) { .instance-desktop-only { display: none !important; @@ -362,13 +379,23 @@ html[data-theme="light"] .exchange-tag { html[data-theme="light"] .top-nav a { background: #fff !important; - color: #006e9a !important; + color: var(--inst-nav-idle) !important; border-color: rgba(0, 95, 140, 0.22) !important; } -html[data-theme="light"] .top-nav a.active { +html[data-theme="light"] .top-nav a:hover, +html[data-theme="light"] .embed-top-nav a:hover, +html[data-theme="light"] .strategy-subnav a:hover { + background: rgba(0, 110, 154, 0.1) !important; + color: var(--inst-nav-active-fg) !important; +} + +html[data-theme="light"] .top-nav a.active, +html[data-theme="light"] .embed-top-nav a.active { background: rgba(0, 110, 154, 0.12) !important; - color: #142232 !important; + color: var(--inst-nav-active-fg) !important; + border: 1px solid rgba(0, 95, 140, 0.28) !important; + font-weight: 600; } html[data-theme="light"] .stat-item, @@ -581,7 +608,7 @@ html[data-theme="light"] .theme-toggle-btn.is-active { display: inline-flex; align-items: center; gap: 6px; - color: #9aa; + color: var(--inst-label); margin: 0; } @@ -590,13 +617,13 @@ html[data-theme="light"] .theme-toggle-btn.is-active { } .list-window-label { - color: #cfd3ef; + color: var(--inst-text); font-size: 0.82rem; white-space: nowrap; } .list-window-hint { - color: #8892b0; + color: var(--inst-muted); font-size: 0.72rem; white-space: nowrap; } @@ -650,7 +677,7 @@ html[data-theme="light"] .theme-toggle-btn.is-active { .stat-strip-item .label { font-size: 0.72rem; - color: #8892b0; + color: var(--inst-label); margin-bottom: 6px; white-space: nowrap; } @@ -658,7 +685,7 @@ html[data-theme="light"] .theme-toggle-btn.is-active { .stat-strip-item .value { font-size: 0.88rem; font-weight: 600; - color: #e8ecff; + color: var(--inst-text); line-height: 1.3; white-space: nowrap; } @@ -726,7 +753,16 @@ html[data-theme="light"] .theme-toggle-btn.is-active { } html[data-theme="light"] .stat-strip-item .value { - color: #142232; + color: var(--inst-text); +} + +html[data-theme="light"] .stat-strip-item .label, +html[data-theme="light"] .instance-header-toolbar-filter label { + color: var(--inst-label) !important; +} + +html[data-theme="light"] .list-window-hint { + color: var(--inst-muted) !important; } html[data-theme="light"] .instance-header-stats { @@ -1067,6 +1103,19 @@ html[data-theme="light"] .strategy-subnav { border-bottom-color: #d0dae4 !important; } +html[data-theme="light"] .strategy-subnav a { + background: #fff !important; + color: var(--inst-nav-idle) !important; + border-color: rgba(0, 95, 140, 0.22) !important; +} + +html[data-theme="light"] .strategy-subnav a.active { + background: rgba(0, 110, 154, 0.12) !important; + color: var(--inst-nav-active-fg) !important; + border: 1px solid rgba(0, 95, 140, 0.28) !important; + font-weight: 600; +} + /* ── 策略交易 / 策略记录(strategy_templates 内联)── */ html[data-theme="dark"] .strategy-records-page .sr-summary, html[data-theme="dark"] .strategy-records-page .sr-detail { diff --git a/lib/common/static/instance_theme_early.css b/lib/common/static/instance_theme_early.css index 22d320f..872f586 100644 --- a/lib/common/static/instance_theme_early.css +++ b/lib/common/static/instance_theme_early.css @@ -24,16 +24,27 @@ html[data-theme="light"] .header h1 { } html[data-theme="light"] .top-nav a, +html[data-theme="light"] .embed-top-nav a, html[data-theme="light"] .strategy-subnav a { background: #fff !important; color: #006e9a !important; border-color: rgba(0, 95, 140, 0.22) !important; } +html[data-theme="light"] .top-nav a:hover, +html[data-theme="light"] .embed-top-nav a:hover, +html[data-theme="light"] .strategy-subnav a:hover { + background: rgba(0, 110, 154, 0.1) !important; + color: #004d6e !important; +} + html[data-theme="light"] .top-nav a.active, +html[data-theme="light"] .embed-top-nav a.active, html[data-theme="light"] .strategy-subnav a.active { background: rgba(0, 110, 154, 0.12) !important; - color: #142232 !important; + color: #004d6e !important; + border: 1px solid rgba(0, 95, 140, 0.28) !important; + font-weight: 600; } html[data-theme="light"] .card, diff --git a/lib/instance/templates/embed_shell.html b/lib/instance/templates/embed_shell.html index c9910cc..0331806 100644 --- a/lib/instance/templates/embed_shell.html +++ b/lib/instance/templates/embed_shell.html @@ -7,7 +7,7 @@ - + {{ exchange_display }} · 加密货币 | 交易监控复盘系统 diff --git a/lib/instance/templates/index.html b/lib/instance/templates/index.html index 6e9124b..e56ffc1 100644 --- a/lib/instance/templates/index.html +++ b/lib/instance/templates/index.html @@ -17,7 +17,7 @@ {{ exchange_display }} · 加密货币 | 交易监控复盘系统 - + - +