Skip to content

Commit 59d2289

Browse files
committed
feat: 统一蓝白配色风格 - 移除暗色模式,优化组件样式
1 parent 3d28374 commit 59d2289

3 files changed

Lines changed: 45 additions & 121 deletions

File tree

web/App.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ export default {
289289
},
290290
githubBtnStyle() {
291291
return {
292-
background: 'linear-gradient(135deg, #1D9BF0 0%, #2B6BFF 50%, #37B4FF 100%)'
292+
background: 'linear-gradient(135deg, var(--tf-brand-primary) 0%, #2B6BFF 50%, #37B4FF 100%)'
293293
}
294294
},
295295
isLoginPage() {
@@ -337,8 +337,8 @@ export default {
337337
methods: {
338338
inputStyle(active) {
339339
return {
340-
borderColor: active ? '#2563EB' : '#E5E7EB',
341-
boxShadow: active ? '0 0 0 4px rgba(37,99,235,0.14)' : 'none',
340+
borderColor: active ? 'var(--tf-brand-primary)' : 'var(--tf-border)',
341+
boxShadow: active ? '0 0 0 4px rgba(51, 112, 255, 0.14)' : 'none',
342342
}
343343
},
344344
async refreshClickStats() {

web/src/pages/StatsDetail.vue

Lines changed: 17 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -139,105 +139,26 @@ onMounted(()=>{ refresh() })
139139
</script>
140140

141141
<style scoped>
142-
/* 强制使用白色背景,避免暗色模式影响 */
143-
.stats-detail {
144-
background: #F8FAFC !important;
145-
color: #1E293B !important;
146-
}
147-
148-
.card {
149-
background: #FFFFFF !important;
150-
border-radius: 8px;
151-
border: 1px solid #e2e8f0;
152-
overflow: hidden;
153-
}
154-
155-
.card-header {
156-
padding: 12px 16px;
157-
font-weight: 600;
158-
border-bottom: 1px solid #f1f5f9;
159-
background: #FFFFFF !important;
160-
color: #1E293B !important;
161-
}
162-
163-
.card-body {
164-
padding: 16px;
165-
background: #FFFFFF !important;
166-
color: #1E293B !important;
167-
}
168-
169-
.form-input {
170-
padding: 8px 10px;
171-
border: 1px solid #e2e8f0;
172-
border-radius: 6px;
173-
background: #FFFFFF !important;
174-
color: #1E293B !important;
175-
}
176-
177-
.btn {
178-
padding: 8px 12px;
179-
border-radius: 6px;
180-
background: #FFFFFF !important;
181-
color: #1E293B !important;
182-
border: 1px solid #e2e8f0;
183-
}
184-
185-
.btn:hover {
186-
background: #F1F5F9 !important;
187-
}
142+
/* 统一蓝白企业冷静风 */
143+
.stats-detail { background: var(--tf-bg-page) !important; color: var(--tf-text-body) !important; }
188144
189-
.btn-primary {
190-
background: #3370FF !important;
191-
color: #FFFFFF !important;
192-
border: none;
193-
}
145+
.card { background: var(--tf-bg-card) !important; border-radius: 12px; border: 1px solid var(--tf-border); overflow: hidden; box-shadow: var(--tf-shadow-card); }
146+
.card-header { padding: 12px 16px; font-weight: 600; border-bottom: 1px solid var(--tf-divider); background: var(--tf-bg-card) !important; color: var(--tf-text-title) !important; }
147+
.card-body { padding: 16px; background: var(--tf-bg-card) !important; color: var(--tf-text-body) !important; }
194148
195-
.btn-primary:hover {
196-
background: #2B5FE6 !important;
197-
}
149+
.form-input { padding: 8px 10px; border: 1px solid var(--tf-border); border-radius: 8px; background: #FFFFFF !important; color: var(--tf-text-body) !important; }
198150
199-
/* 表格样式 */
200-
.events-table-container {
201-
background: #FFFFFF !important;
202-
}
151+
.btn { padding: 8px 12px; border-radius: 8px; background: #FFFFFF !important; color: var(--tf-text-body) !important; border: 1px solid var(--tf-border); }
152+
.btn:hover { background: var(--tf-bg-hover) !important; }
153+
.btn-primary { background: var(--tf-brand-primary) !important; color: #FFFFFF !important; border: none; }
154+
.btn-primary:hover { background: var(--tf-brand-primary-hover) !important; }
203155
204-
.events-table {
205-
width: 100%;
206-
background: #FFFFFF !important;
207-
color: #1E293B !important;
208-
}
156+
.events-table-container { background: var(--tf-bg-card) !important; }
157+
.events-table { width: 100%; background: var(--tf-bg-card) !important; color: var(--tf-text-body) !important; }
158+
.events-table th { background: var(--tf-bg-page) !important; color: var(--tf-text-muted) !important; padding: 12px; text-align: left; font-weight: 500; font-size: 13px; border-bottom: 1px solid var(--tf-border); }
159+
.events-table td { padding: 12px; border-bottom: 1px solid var(--tf-divider); font-size: 13px; color: var(--tf-text-body) !important; background: var(--tf-bg-card) !important; }
160+
.events-table tbody tr:hover { background: var(--tf-bg-hover) !important; }
209161
210-
.events-table th {
211-
background: #F8FAFC !important;
212-
color: #64748B !important;
213-
padding: 12px;
214-
text-align: left;
215-
font-weight: 500;
216-
font-size: 13px;
217-
border-bottom: 1px solid #e2e8f0;
218-
}
219-
220-
.events-table td {
221-
padding: 12px;
222-
border-bottom: 1px solid #f1f5f9;
223-
font-size: 13px;
224-
color: #1E293B !important;
225-
background: #FFFFFF !important;
226-
}
227-
228-
.events-table tbody tr:hover {
229-
background: #F8FAFC !important;
230-
}
231-
232-
.empty-state {
233-
text-align: center;
234-
padding: 24px;
235-
color: #94A3B8 !important;
236-
}
237-
238-
.chart-placeholder {
239-
text-align: center;
240-
padding: 40px;
241-
color: #94A3B8;
242-
}
162+
.empty-state { text-align: center; padding: 24px; color: var(--tf-text-muted) !important; }
163+
.chart-placeholder { text-align: center; padding: 40px; color: var(--tf-text-muted); }
243164
</style>

web/src/pages/StatsPage.vue

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div class="min-h-screen stats-page" :class="{ 'tf-card-root': useDarkTheme }">
2+
<div class="min-h-screen stats-page">
33
<!-- 粘性顶部栏 -->
44
<div class="topbar">
55
<div class="container">
@@ -66,7 +66,7 @@
6666
<!-- two-column layout -->
6767
<div class="grid-main">
6868
<div class="left-col">
69-
<div class="card elevated" :class="useDarkTheme ? 'dark-card' : ''">
69+
<div class="card elevated">
7070
<div class="card-header">
7171
<div class="title">访问趋势</div>
7272
<div class="actions">
@@ -271,7 +271,8 @@ const SkeletonLoader = defineAsyncComponent(() => import('../components/Skeleton
271271
const CityBarLoader = () => import('../components/charts/EChartsBar.vue')
272272
const CountryPieLoader = () => import('../components/charts/EChartsPie.vue')
273273
import '../style/charts-theme.css'
274-
const useDarkTheme = true
274+
// 统一为浅色企业冷静风
275+
const useDarkTheme = false
275276
276277
const route = useRoute()
277278
const router = useRouter()
@@ -658,14 +659,15 @@ function retryFetch(){ apiErrors.value = []; debouncedRefreshAll() }
658659

659660
<style scoped>
660661
:root {
661-
--bg: #f6f8fb;
662-
--card: #ffffff;
663-
--muted: #94a3b8;
664-
--accent: #2563eb;
665-
--glass: rgba(255,255,255,0.6);
662+
/* 统一蓝白企业冷静风配色,使用设计系统变量 */
663+
--bg: var(--tf-bg-page);
664+
--card: var(--tf-bg-card);
665+
--muted: var(--tf-text-muted);
666+
--accent: var(--tf-brand-primary);
667+
--glass: rgba(255,255,255,0.7);
666668
}
667669
668-
.stats-page { background: var(--bg); font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial; color: #0f172a; min-height: 100vh; padding-top: 84px; }
670+
.stats-page { background: var(--bg); font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial; color: var(--tf-text-body); min-height: 100vh; padding-top: 84px; }
669671
670672
/* container */
671673
.container { max-width: 1200px; margin: 0 auto; padding: 0 18px; }
@@ -675,37 +677,38 @@ function retryFetch(){ apiErrors.value = []; debouncedRefreshAll() }
675677
.topbar {
676678
position: fixed; top: 0; left: 0; right: 0; height: 68px;
677679
backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
678-
background: linear-gradient(180deg, rgba(255,255,255,0.6), rgba(255,255,255,0.45));
679-
border-bottom: 1px solid rgba(14, 18, 32, 0.04);
680+
background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(255,255,255,0.75));
681+
border-bottom: 1px solid var(--tf-border);
680682
display: flex; align-items: center; z-index: 80;
681683
}
682684
.topbar .container { display:flex; align-items:center; justify-content:space-between; }
683685
.topbar .left, .topbar .center, .topbar .right { display:flex; align-items:center; gap:12px; }
684686
.search-wrap { width: 420px; }
685-
.search-input { width:100%; padding:10px 12px; border-radius:8px; border:1px solid #e6eef9; background:linear-gradient(180deg,#fff,#fbfdff); font-size:14px; box-shadow:0 1px 2px rgba(16,24,40,0.03); }
686-
.btn { padding:8px 12px; border-radius:8px; background:transparent; border:none; cursor:pointer; color:var(--accent); font-weight:600; }
687+
.search-input { width:100%; padding:10px 12px; border-radius:8px; border:1px solid var(--tf-border); background:linear-gradient(180deg,#fff,#fbfdff); font-size:14px; box-shadow:0 1px 2px rgba(16,24,40,0.03); }
688+
.btn { padding:8px 12px; border-radius:8px; background:transparent; border:none; cursor:pointer; color:var(--tf-brand-primary); font-weight:600; }
687689
.btn-ghost { background:transparent; color:#334155; padding:6px 10px; border-radius:8px; }
688690
.btn-ghost.tiny { padding:6px 8px; font-size:12px; }
689691
.btn-sm { padding:6px 8px; border-radius:6px; background:#f1f5f9; color:#334155; margin-right:6px; }
690692
.btn-sm.active { background: var(--accent); color:#fff; }
691693
692694
/* metrics */
693695
.metrics { display:grid; grid-template-columns: repeat(6,1fr); gap:16px; margin-bottom:18px; }
694-
.metric-card { padding:16px; border-radius:12px; background:var(--card); border:1px solid rgba(14,18,32,0.04); text-align:center; transition:transform .18s ease, box-shadow .18s ease; }
696+
.metric-card { padding:16px; border-radius:12px; background:var(--card); border:1px solid var(--tf-border); text-align:center; transition:transform .18s ease, box-shadow .18s ease; }
695697
.metric-card .metric-label { font-size:12px; color:var(--muted); margin-bottom:8px; text-transform:uppercase; letter-spacing:0.6px; }
696698
.metric-value { font-size:26px; font-weight:700; color:#0f172a; }
697-
.metric-card.elevated { box-shadow: 0 6px 18px rgba(16,24,40,0.06); }
699+
.metric-card.elevated { box-shadow: var(--tf-shadow-card); }
698700
699701
/* layout */
700702
.grid-main { display:grid; grid-template-columns: 1fr 360px; gap:20px; align-items:start; }
701703
.left-col { display:flex; flex-direction:column; gap:16px; }
702704
.right-col { display:flex; flex-direction:column; gap:16px; }
703705
704706
/* cards */
705-
.card { border-radius:12px; background:var(--card); border:1px solid rgba(14,18,32,0.04); overflow:hidden; }
706-
.card.elevated { box-shadow:0 10px 30px rgba(16,24,40,0.06); }
707-
.dark-card { background: linear-gradient(180deg,#0b1221, #071224); color:#dbeafe; border-color: rgba(255,255,255,0.04); }
708-
.card-header { display:flex; justify-content:space-between; align-items:center; padding:16px 18px; border-bottom:1px solid rgba(14,18,32,0.04); font-weight:700; }
707+
.card { border-radius:12px; background:var(--card); border:1px solid var(--tf-border); overflow:hidden; }
708+
.card.elevated { box-shadow: var(--tf-shadow-card); }
709+
/* 移除暗色变体,保持统一蓝白风格 */
710+
711+
.card-header { display:flex; justify-content:space-between; align-items:center; padding:16px 18px; border-bottom:1px solid var(--tf-divider); font-weight:700; }
709712
.card-body { padding:18px; }
710713
711714
/* charts */
@@ -740,10 +743,10 @@ function retryFetch(){ apiErrors.value = []; debouncedRefreshAll() }
740743
.device-tag { background:#f1f5f9; padding:4px 8px; border-radius:6px; font-size:12px; color:#64748b; }
741744
742745
/* modal */
743-
.modal { width:560px; background:var(--card); border-radius:12px; overflow:hidden; box-shadow:0 10px 30px rgba(16,24,40,0.08); }
744-
.modal-header { padding:16px; font-weight:700; border-bottom:1px solid rgba(14,18,32,0.04); }
746+
.modal { width:560px; background:var(--card); border-radius:12px; overflow:hidden; box-shadow: var(--tf-shadow-modal); }
747+
.modal-header { padding:16px; font-weight:700; border-bottom:1px solid var(--tf-divider); }
745748
.modal-body { padding:16px; }
746-
.modal-footer { padding:12px 16px; display:flex; justify-content:flex-end; gap:8px; border-top:1px solid rgba(14,18,32,0.04); }
749+
.modal-footer { padding:12px 16px; display:flex; justify-content:flex-end; gap:8px; border-top:1px solid var(--tf-divider); }
747750
748751
/* error banner */
749752
.error-banner { padding:12px 16px; border-radius:10px; background:#fff5f5; border:1px solid #fee2e2; color:#991b1b; display:flex; justify-content:space-between; align-items:center; gap:12px; }

0 commit comments

Comments
 (0)