feat: 增加暗黑模式

develop
Lxy 4 months ago
parent fd99430c6f
commit 1b4ffdfc7e

@ -12,10 +12,52 @@
box-sizing: border-box; box-sizing: border-box;
} }
:root {
--bg-primary: #f0f2f5;
--bg-secondary: #ffffff;
--bg-tertiary: #f9fafb;
--text-primary: #333333;
--text-secondary: #666666;
--text-tertiary: #999999;
--border-color: #d9d9d9;
--header-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
--card-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
--card-hover-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}
body.dark-theme {
--bg-primary: #1a1a1a;
--bg-secondary: #2d2d2d;
--bg-tertiary: #3d3d3d;
--text-primary: #e0e0e0;
--text-secondary: #b0b0b0;
--text-tertiary: #808080;
--border-color: #444444;
--header-bg: linear-gradient(135deg, #334155 0%, #1e293b 100%);
--card-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
--card-hover-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}
body { body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
background-color: #f0f2f5; background-color: var(--bg-primary);
color: #333; color: var(--text-primary);
transition: all 0.3s ease;
}
.theme-toggle {
background: var(--bg-tertiary);
border: 1px solid var(--border-color);
border-radius: 6px;
padding: 6px 12px;
font-size: 14px;
cursor: pointer;
color: var(--text-primary);
transition: all 0.3s ease;
}
.theme-toggle:hover {
background: var(--bg-secondary);
} }
.container { .container {
@ -25,12 +67,12 @@
} }
.header { .header {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); background: var(--header-bg);
color: white; color: white;
padding: 24px; padding: 24px;
border-radius: 12px; border-radius: 12px;
margin-bottom: 24px; margin-bottom: 24px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); box-shadow: var(--card-shadow);
} }
.header-content { .header-content {
@ -59,11 +101,12 @@
} }
.card { .card {
background: white; background: var(--bg-secondary);
border-radius: 12px; border-radius: 12px;
padding: 24px; padding: 24px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); box-shadow: var(--card-shadow);
margin-bottom: 24px; margin-bottom: 24px;
border: 1px solid var(--border-color);
} }
.card-header { .card-header {
@ -72,7 +115,7 @@
align-items: flex-start; align-items: flex-start;
margin-bottom: 20px; margin-bottom: 20px;
padding-bottom: 16px; padding-bottom: 16px;
border-bottom: 1px solid #f0f0f0; border-bottom: 1px solid var(--border-color);
} }
.symbol-info { .symbol-info {
@ -82,13 +125,13 @@
.symbol-name { .symbol-name {
font-size: 24px; font-size: 24px;
font-weight: 600; font-weight: 600;
color: #333; color: var(--text-primary);
margin-bottom: 4px; margin-bottom: 4px;
} }
.symbol-code { .symbol-code {
font-size: 14px; font-size: 14px;
color: #999; color: var(--text-tertiary);
} }
.price-info { .price-info {
@ -98,7 +141,7 @@
.current-price { .current-price {
font-size: 32px; font-size: 32px;
font-weight: 700; font-weight: 700;
color: #333; color: var(--text-primary);
margin-bottom: 8px; margin-bottom: 8px;
} }
@ -111,21 +154,21 @@
} }
.direction-up { .direction-up {
background-color: #f6ffed; background-color: rgba(82, 196, 26, 0.1);
color: #52c41a; color: #52c41a;
border: 1px solid #b7eb8f; border: 1px solid rgba(82, 196, 26, 0.3);
} }
.direction-down { .direction-down {
background-color: #fff2f0; background-color: rgba(255, 77, 79, 0.1);
color: #ff4d4f; color: #ff4d4f;
border: 1px solid #ffccc7; border: 1px solid rgba(255, 77, 79, 0.3);
} }
.direction-sideways { .direction-sideways {
background-color: #f0f5ff; background-color: rgba(24, 144, 255, 0.1);
color: #1890ff; color: #1890ff;
border: 1px solid #adc6ff; border: 1px solid rgba(24, 144, 255, 0.3);
} }
.card-body { .card-body {
@ -139,7 +182,7 @@
.section-title { .section-title {
font-size: 16px; font-size: 16px;
font-weight: 600; font-weight: 600;
color: #333; color: var(--text-primary);
margin-bottom: 12px; margin-bottom: 12px;
display: flex; display: flex;
align-items: center; align-items: center;
@ -161,22 +204,23 @@
} }
.stat-item { .stat-item {
background-color: #f9fafb; background-color: var(--bg-tertiary);
padding: 16px; padding: 16px;
border-radius: 8px; border-radius: 8px;
text-align: center; text-align: center;
border: 1px solid var(--border-color);
} }
.stat-label { .stat-label {
font-size: 12px; font-size: 12px;
color: #666; color: var(--text-secondary);
margin-bottom: 8px; margin-bottom: 8px;
} }
.stat-value { .stat-value {
font-size: 18px; font-size: 18px;
font-weight: 600; font-weight: 600;
color: #333; color: var(--text-primary);
} }
.win-rate { .win-rate {
@ -202,23 +246,24 @@
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
padding: 10px 12px; padding: 10px 12px;
background-color: #f9fafb; background-color: var(--bg-tertiary);
border-radius: 6px; border-radius: 6px;
border: 1px solid var(--border-color);
} }
.indicator-name { .indicator-name {
font-size: 14px; font-size: 14px;
color: #666; color: var(--text-secondary);
} }
.indicator-value { .indicator-value {
font-size: 14px; font-size: 14px;
font-weight: 500; font-weight: 500;
color: #333; color: var(--text-primary);
} }
.recommendation { .recommendation {
background-color: #f0f5ff; background-color: rgba(24, 144, 255, 0.1);
border-radius: 8px; border-radius: 8px;
padding: 16px; padding: 16px;
border-left: 4px solid #1890ff; border-left: 4px solid #1890ff;
@ -234,14 +279,14 @@
.recommendation-content { .recommendation-content {
font-size: 14px; font-size: 14px;
color: #333; color: var(--text-primary);
line-height: 1.5; line-height: 1.5;
} }
.card-footer { .card-footer {
text-align: center; text-align: center;
padding-top: 16px; padding-top: 16px;
border-top: 1px solid #f0f0f0; border-top: 1px solid var(--border-color);
} }
.detail-link { .detail-link {
@ -261,7 +306,7 @@
.footer { .footer {
text-align: center; text-align: center;
padding: 20px; padding: 20px;
color: #999; color: var(--text-tertiary);
font-size: 14px; font-size: 14px;
} }
@ -292,8 +337,13 @@
} }
</style> </style>
</head> </head>
<body> <body class="dark-theme">
<div class="container"> <div class="container">
<!-- 主题切换 -->
<div style="text-align: right; margin-bottom: 20px;">
<button class="theme-toggle" onclick="toggleTheme()">切换主题</button>
</div>
<!-- 头部 --> <!-- 头部 -->
<div class="header"> <div class="header">
<div class="header-content"> <div class="header-content">
@ -400,6 +450,28 @@
const date = new Date(); const date = new Date();
return date.toLocaleString('zh-CN'); return date.toLocaleString('zh-CN');
} }
// 主题切换功能
function toggleTheme() {
const body = document.body;
if (body.classList.contains('dark-theme')) {
body.classList.remove('dark-theme');
localStorage.setItem('theme', 'light');
} else {
body.classList.add('dark-theme');
localStorage.setItem('theme', 'dark');
}
}
// 初始化主题
document.addEventListener('DOMContentLoaded', function() {
const savedTheme = localStorage.getItem('theme');
if (savedTheme === 'light') {
document.body.classList.remove('dark-theme');
} else {
document.body.classList.add('dark-theme');
}
});
</script> </script>
</body> </body>
</html> </html>

@ -12,10 +12,37 @@
box-sizing: border-box; box-sizing: border-box;
} }
:root {
--bg-primary: #f0f2f5;
--bg-secondary: #ffffff;
--bg-tertiary: #f9fafb;
--text-primary: #333333;
--text-secondary: #666666;
--text-tertiary: #999999;
--border-color: #d9d9d9;
--header-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
--card-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
--card-hover-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}
body.dark-theme {
--bg-primary: #1a1a1a;
--bg-secondary: #2d2d2d;
--bg-tertiary: #3d3d3d;
--text-primary: #e0e0e0;
--text-secondary: #b0b0b0;
--text-tertiary: #808080;
--border-color: #444444;
--header-bg: linear-gradient(135deg, #334155 0%, #1e293b 100%);
--card-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
--card-hover-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}
body { body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
background-color: #f0f2f5; background-color: var(--bg-primary);
color: #333; color: var(--text-primary);
transition: all 0.3s ease;
} }
.container { .container {
@ -29,17 +56,18 @@
} }
.error-card { .error-card {
background: white; background: var(--bg-secondary);
border-radius: 12px; border-radius: 12px;
padding: 40px; padding: 40px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); box-shadow: var(--card-shadow);
text-align: center; text-align: center;
border: 1px solid var(--border-color);
} }
.error-icon { .error-icon {
width: 80px; width: 80px;
height: 80px; height: 80px;
background-color: #fff2f0; background-color: rgba(255, 77, 79, 0.1);
color: #ff4d4f; color: #ff4d4f;
border-radius: 50%; border-radius: 50%;
display: flex; display: flex;
@ -47,18 +75,19 @@
justify-content: center; justify-content: center;
font-size: 40px; font-size: 40px;
margin: 0 auto 24px; margin: 0 auto 24px;
border: 1px solid rgba(255, 77, 79, 0.3);
} }
.error-title { .error-title {
font-size: 24px; font-size: 24px;
font-weight: 600; font-weight: 600;
color: #333; color: var(--text-primary);
margin-bottom: 16px; margin-bottom: 16px;
} }
.error-message { .error-message {
font-size: 16px; font-size: 16px;
color: #666; color: var(--text-secondary);
margin-bottom: 32px; margin-bottom: 32px;
line-height: 1.5; line-height: 1.5;
} }
@ -104,7 +133,7 @@
} }
</style> </style>
</head> </head>
<body> <body class="dark-theme">
<div class="container"> <div class="container">
<div class="error-card"> <div class="error-card">
<div class="error-icon">⚠️</div> <div class="error-icon">⚠️</div>

@ -13,10 +13,37 @@
box-sizing: border-box; box-sizing: border-box;
} }
:root {
--bg-primary: #f0f2f5;
--bg-secondary: #ffffff;
--bg-tertiary: #f9fafb;
--text-primary: #333333;
--text-secondary: #666666;
--text-tertiary: #999999;
--border-color: #d9d9d9;
--header-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
--card-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
--card-hover-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}
body.dark-theme {
--bg-primary: #1a1a1a;
--bg-secondary: #2d2d2d;
--bg-tertiary: #3d3d3d;
--text-primary: #e0e0e0;
--text-secondary: #b0b0b0;
--text-tertiary: #808080;
--border-color: #444444;
--header-bg: linear-gradient(135deg, #334155 0%, #1e293b 100%);
--card-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
--card-hover-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}
body { body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
background-color: #f0f2f5; background-color: var(--bg-primary);
color: #333; color: var(--text-primary);
transition: all 0.3s ease;
} }
.container { .container {
@ -26,12 +53,12 @@
} }
.header { .header {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); background: var(--header-bg);
color: white; color: white;
padding: 30px; padding: 30px;
border-radius: 12px; border-radius: 12px;
margin-bottom: 30px; margin-bottom: 30px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); box-shadow: var(--card-shadow);
} }
.header h1 { .header h1 {
@ -46,23 +73,38 @@
} }
.section { .section {
background: white; background: var(--bg-secondary);
border-radius: 12px; border-radius: 12px;
padding: 24px; padding: 24px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); box-shadow: var(--card-shadow);
margin-bottom: 30px; margin-bottom: 30px;
} }
.section-title { .section-title {
font-size: 20px; font-size: 20px;
font-weight: 600; font-weight: 600;
color: #333; color: var(--text-primary);
margin-bottom: 20px; margin-bottom: 20px;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
} }
.theme-toggle {
background: var(--bg-tertiary);
border: 1px solid var(--border-color);
border-radius: 6px;
padding: 6px 12px;
font-size: 14px;
cursor: pointer;
color: var(--text-primary);
transition: all 0.3s ease;
}
.theme-toggle:hover {
background: var(--bg-secondary);
}
.search-container { .search-container {
margin-bottom: 20px; margin-bottom: 20px;
} }
@ -70,11 +112,13 @@
.search-input { .search-input {
width: 100%; width: 100%;
padding: 12px 16px; padding: 12px 16px;
border: 1px solid #d9d9d9; border: 1px solid var(--border-color);
border-radius: 8px; border-radius: 8px;
font-size: 14px; font-size: 14px;
outline: none; outline: none;
transition: all 0.3s ease; transition: all 0.3s ease;
background: var(--bg-secondary);
color: var(--text-primary);
} }
.search-input:focus { .search-input:focus {
@ -90,18 +134,19 @@
} }
.symbol-card { .symbol-card {
background: white; background: var(--bg-secondary);
border-radius: 12px; border-radius: 12px;
padding: 20px; padding: 20px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); box-shadow: var(--card-shadow);
transition: transform 0.3s ease, box-shadow 0.3s ease; transition: transform 0.3s ease, box-shadow 0.3s ease;
cursor: pointer; cursor: pointer;
position: relative; position: relative;
border: 1px solid var(--border-color);
} }
.symbol-card:hover { .symbol-card:hover {
transform: translateY(-5px); transform: translateY(-5px);
box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12); box-shadow: var(--card-hover-shadow);
} }
.symbol-header { .symbol-header {
@ -114,12 +159,12 @@
.symbol-name { .symbol-name {
font-size: 18px; font-size: 18px;
font-weight: 600; font-weight: 600;
color: #333; color: var(--text-primary);
} }
.symbol-code { .symbol-code {
font-size: 14px; font-size: 14px;
color: #999; color: var(--text-tertiary);
margin-top: 4px; margin-top: 4px;
} }
@ -130,7 +175,7 @@
.current-price { .current-price {
font-size: 24px; font-size: 24px;
font-weight: 700; font-weight: 700;
color: #333; color: var(--text-primary);
} }
.direction-indicator { .direction-indicator {
@ -143,21 +188,21 @@
} }
.direction-up { .direction-up {
background-color: #f6ffed; background-color: rgba(82, 196, 26, 0.1);
color: #52c41a; color: #52c41a;
border: 1px solid #b7eb8f; border: 1px solid rgba(82, 196, 26, 0.3);
} }
.direction-down { .direction-down {
background-color: #fff2f0; background-color: rgba(255, 77, 79, 0.1);
color: #ff4d4f; color: #ff4d4f;
border: 1px solid #ffccc7; border: 1px solid rgba(255, 77, 79, 0.3);
} }
.direction-sideways { .direction-sideways {
background-color: #f0f5ff; background-color: rgba(24, 144, 255, 0.1);
color: #1890ff; color: #1890ff;
border: 1px solid #adc6ff; border: 1px solid rgba(24, 144, 255, 0.3);
} }
.analysis-grid { .analysis-grid {
@ -168,21 +213,22 @@
} }
.analysis-item { .analysis-item {
background-color: #f9fafb; background-color: var(--bg-tertiary);
padding: 12px; padding: 12px;
border-radius: 8px; border-radius: 8px;
border: 1px solid var(--border-color);
} }
.analysis-label { .analysis-label {
font-size: 12px; font-size: 12px;
color: #666; color: var(--text-secondary);
margin-bottom: 4px; margin-bottom: 4px;
} }
.analysis-value { .analysis-value {
font-size: 14px; font-size: 14px;
font-weight: 500; font-weight: 500;
color: #333; color: var(--text-primary);
} }
.win-rate { .win-rate {
@ -205,15 +251,16 @@
} }
.hot-subsection { .hot-subsection {
background: #f9fafb; background: var(--bg-tertiary);
border-radius: 8px; border-radius: 8px;
padding: 16px; padding: 16px;
border: 1px solid var(--border-color);
} }
.hot-subsection-title { .hot-subsection-title {
font-size: 16px; font-size: 16px;
font-weight: 600; font-weight: 600;
color: #333; color: var(--text-primary);
margin-bottom: 12px; margin-bottom: 12px;
} }
@ -231,7 +278,7 @@
cursor: pointer; cursor: pointer;
transition: all 0.3s ease; transition: all 0.3s ease;
font-size: 12px; font-size: 12px;
color: #999; color: var(--text-tertiary);
} }
.favorite-btn:hover { .favorite-btn:hover {
@ -247,7 +294,7 @@
.footer { .footer {
text-align: center; text-align: center;
padding: 20px; padding: 20px;
color: #999; color: var(--text-tertiary);
font-size: 14px; font-size: 14px;
margin-top: 40px; margin-top: 40px;
} }
@ -267,7 +314,7 @@
} }
</style> </style>
</head> </head>
<body> <body class="dark-theme">
<div class="container"> <div class="container">
<!-- 头部 --> <!-- 头部 -->
<div class="header"> <div class="header">
@ -275,14 +322,19 @@
<p>基于DeepSeek大模型和量化分析算法的智能决策平台</p> <p>基于DeepSeek大模型和量化分析算法的智能决策平台</p>
</div> </div>
<!-- 主题切换 -->
<div style="text-align: right; margin-bottom: 20px;">
<button class="theme-toggle" onclick="toggleTheme()">切换主题</button>
</div>
{% if data_unavailable %} {% if data_unavailable %}
<div style="text-align: center; padding: 60px; background: white; border-radius: 12px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);"> <div style="text-align: center; padding: 60px; background: var(--bg-secondary); border-radius: 12px; box-shadow: var(--card-shadow); border: 1px solid var(--border-color);">
<div style="font-size: 48px; margin-bottom: 20px;">⚠️</div> <div style="font-size: 48px; margin-bottom: 20px;">⚠️</div>
<h2 style="font-size: 24px; font-weight: 600; color: #333; margin-bottom: 16px;">数据不可用</h2> <h2 style="font-size: 24px; font-weight: 600; color: var(--text-primary); margin-bottom: 16px;">数据不可用</h2>
<p style="font-size: 16px; color: #666; margin-bottom: 32px;">{{ message }}</p> <p style="font-size: 16px; color: var(--text-secondary); margin-bottom: 32px;">{{ message }}</p>
<div style="display: flex; justify-content: center; gap: 16px;"> <div style="display: flex; justify-content: center; gap: 16px;">
<a href="/" style="padding: 10px 24px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; text-decoration: none; border-radius: 6px; font-size: 14px; font-weight: 500;">重试</a> <a href="/" style="padding: 10px 24px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; text-decoration: none; border-radius: 6px; font-size: 14px; font-weight: 500;">重试</a>
<a href="javascript:location.reload()" style="padding: 10px 24px; background: #f0f0f0; color: #333; text-decoration: none; border-radius: 6px; font-size: 14px; font-weight: 500;">刷新</a> <a href="javascript:location.reload()" style="padding: 10px 24px; background: var(--bg-tertiary); color: var(--text-primary); text-decoration: none; border-radius: 6px; font-size: 14px; font-weight: 500; border: 1px solid var(--border-color);">刷新</a>
</div> </div>
</div> </div>
{% else %} {% else %}
@ -654,6 +706,28 @@
} }
}); });
// 主题切换功能
function toggleTheme() {
const body = document.body;
if (body.classList.contains('dark-theme')) {
body.classList.remove('dark-theme');
localStorage.setItem('theme', 'light');
} else {
body.classList.add('dark-theme');
localStorage.setItem('theme', 'dark');
}
}
// 初始化主题
document.addEventListener('DOMContentLoaded', function() {
const savedTheme = localStorage.getItem('theme');
if (savedTheme === 'light') {
document.body.classList.remove('dark-theme');
} else {
document.body.classList.add('dark-theme');
}
});
// 定时刷新数据 // 定时刷新数据
setInterval(() => { setInterval(() => {
window.location.reload(); window.location.reload();

@ -13,10 +13,37 @@
box-sizing: border-box; box-sizing: border-box;
} }
:root {
--bg-primary: #f0f2f5;
--bg-secondary: #ffffff;
--bg-tertiary: #f9fafb;
--text-primary: #333333;
--text-secondary: #666666;
--text-tertiary: #999999;
--border-color: #d9d9d9;
--header-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
--card-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
--card-hover-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}
body.dark-theme {
--bg-primary: #1a1a1a;
--bg-secondary: #2d2d2d;
--bg-tertiary: #3d3d3d;
--text-primary: #e0e0e0;
--text-secondary: #b0b0b0;
--text-tertiary: #808080;
--border-color: #444444;
--header-bg: linear-gradient(135deg, #334155 0%, #1e293b 100%);
--card-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
--card-hover-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}
body { body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
background-color: #f0f2f5; background-color: var(--bg-primary);
color: #333; color: var(--text-primary);
transition: all 0.3s ease;
} }
.container { .container {
@ -25,13 +52,28 @@
padding: 20px; padding: 20px;
} }
.theme-toggle {
background: var(--bg-tertiary);
border: 1px solid var(--border-color);
border-radius: 6px;
padding: 6px 12px;
font-size: 14px;
cursor: pointer;
color: var(--text-primary);
transition: all 0.3s ease;
}
.theme-toggle:hover {
background: var(--bg-secondary);
}
.header { .header {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); background: var(--header-bg);
color: white; color: white;
padding: 30px; padding: 30px;
border-radius: 12px; border-radius: 12px;
margin-bottom: 30px; margin-bottom: 30px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); box-shadow: var(--card-shadow);
} }
.header-content { .header-content {
@ -66,11 +108,12 @@
} }
.price-section { .price-section {
background: white; background: var(--bg-secondary);
border-radius: 12px; border-radius: 12px;
padding: 24px; padding: 24px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); box-shadow: var(--card-shadow);
margin-bottom: 30px; margin-bottom: 30px;
border: 1px solid var(--border-color);
} }
.price-info { .price-info {
@ -87,7 +130,7 @@
.price-value { .price-value {
font-size: 48px; font-size: 48px;
font-weight: 700; font-weight: 700;
color: #333; color: var(--text-primary);
margin-bottom: 8px; margin-bottom: 8px;
} }
@ -117,28 +160,29 @@
.stat-label { .stat-label {
font-size: 14px; font-size: 14px;
color: #666; color: var(--text-secondary);
margin-bottom: 4px; margin-bottom: 4px;
} }
.stat-value { .stat-value {
font-size: 18px; font-size: 18px;
font-weight: 600; font-weight: 600;
color: #333; color: var(--text-primary);
} }
.chart-section { .chart-section {
background: white; background: var(--bg-secondary);
border-radius: 12px; border-radius: 12px;
padding: 24px; padding: 24px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); box-shadow: var(--card-shadow);
margin-bottom: 30px; margin-bottom: 30px;
border: 1px solid var(--border-color);
} }
.chart-title { .chart-title {
font-size: 16px; font-size: 16px;
font-weight: 600; font-weight: 600;
color: #333; color: var(--text-primary);
margin-bottom: 20px; margin-bottom: 20px;
} }
@ -155,19 +199,20 @@
} }
.analysis-card { .analysis-card {
background: white; background: var(--bg-secondary);
border-radius: 12px; border-radius: 12px;
padding: 20px; padding: 20px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); box-shadow: var(--card-shadow);
border: 1px solid var(--border-color);
} }
.card-title { .card-title {
font-size: 16px; font-size: 16px;
font-weight: 600; font-weight: 600;
color: #333; color: var(--text-primary);
margin-bottom: 16px; margin-bottom: 16px;
padding-bottom: 12px; padding-bottom: 12px;
border-bottom: 1px solid #f0f0f0; border-bottom: 1px solid var(--border-color);
} }
.analysis-item { .analysis-item {
@ -175,18 +220,18 @@
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
padding: 8px 0; padding: 8px 0;
border-bottom: 1px solid #f9f9f9; border-bottom: 1px solid var(--border-color);
} }
.analysis-label { .analysis-label {
font-size: 14px; font-size: 14px;
color: #666; color: var(--text-secondary);
} }
.analysis-value { .analysis-value {
font-size: 14px; font-size: 14px;
font-weight: 500; font-weight: 500;
color: #333; color: var(--text-primary);
} }
.direction-up { .direction-up {
@ -202,17 +247,18 @@
} }
.ai-analysis { .ai-analysis {
background: white; background: var(--bg-secondary);
border-radius: 12px; border-radius: 12px;
padding: 24px; padding: 24px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); box-shadow: var(--card-shadow);
margin-bottom: 30px; margin-bottom: 30px;
border: 1px solid var(--border-color);
} }
.ai-title { .ai-title {
font-size: 18px; font-size: 18px;
font-weight: 600; font-weight: 600;
color: #333; color: var(--text-primary);
margin-bottom: 16px; margin-bottom: 16px;
display: flex; display: flex;
align-items: center; align-items: center;
@ -233,10 +279,11 @@
} }
.ai-content { .ai-content {
background-color: #f9fafb; background-color: var(--bg-tertiary);
border-radius: 8px; border-radius: 8px;
padding: 16px; padding: 16px;
margin-bottom: 16px; margin-bottom: 16px;
border: 1px solid var(--border-color);
} }
.recommendation { .recommendation {
@ -255,13 +302,13 @@
.recommendation-content { .recommendation-content {
font-size: 14px; font-size: 14px;
color: #333; color: var(--text-primary);
} }
.footer { .footer {
text-align: center; text-align: center;
padding: 20px; padding: 20px;
color: #999; color: var(--text-tertiary);
font-size: 14px; font-size: 14px;
margin-top: 40px; margin-top: 40px;
} }
@ -289,8 +336,13 @@
} }
</style> </style>
</head> </head>
<body> <body class="dark-theme">
<div class="container"> <div class="container">
<!-- 主题切换 -->
<div style="text-align: right; margin-bottom: 20px;">
<button class="theme-toggle" onclick="toggleTheme()">切换主题</button>
</div>
<!-- 头部 --> <!-- 头部 -->
<div class="header"> <div class="header">
<div class="header-content"> <div class="header-content">
@ -816,6 +868,28 @@
chart.resize(); chart.resize();
}); });
}; };
// 主题切换功能
function toggleTheme() {
const body = document.body;
if (body.classList.contains('dark-theme')) {
body.classList.remove('dark-theme');
localStorage.setItem('theme', 'light');
} else {
body.classList.add('dark-theme');
localStorage.setItem('theme', 'dark');
}
}
// 初始化主题
document.addEventListener('DOMContentLoaded', function() {
const savedTheme = localStorage.getItem('theme');
if (savedTheme === 'light') {
document.body.classList.remove('dark-theme');
} else {
document.body.classList.add('dark-theme');
}
});
</script> </script>
</body> </body>
</html> </html>
Loading…
Cancel
Save