功能特性: - 支持柱状图、折线图、混合图 - 支持多系列数据对比 - 支持拖拽调整系列顺序和自定义颜色 - 支持区域分割(左右对比) - 5种主题风格可选 - 支持导出PNG/SVG - 响应式布局,适配移动端
381 lines
6.9 KiB
CSS
381 lines
6.9 KiB
CSS
/* ===== 全局样式 ===== */
|
|
* {
|
|
margin: 0;
|
|
padding: 0;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
:root {
|
|
--primary: #4f46e5;
|
|
--primary-hover: #4338ca;
|
|
--success: #10b981;
|
|
--success-hover: #059669;
|
|
--bg: #f8fafc;
|
|
--panel-bg: #ffffff;
|
|
--border: #e2e8f0;
|
|
--text: #1e293b;
|
|
--text-light: #64748b;
|
|
--shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
|
|
--shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
|
|
--radius: 12px;
|
|
}
|
|
|
|
body {
|
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
|
|
background: var(--bg);
|
|
color: var(--text);
|
|
min-height: 100vh;
|
|
}
|
|
|
|
/* ===== 布局 ===== */
|
|
.app-container {
|
|
max-width: 1600px;
|
|
margin: 0 auto;
|
|
padding: 20px;
|
|
}
|
|
|
|
.app-header {
|
|
text-align: center;
|
|
padding: 20px 0 30px;
|
|
}
|
|
|
|
.app-header h1 {
|
|
font-size: 2rem;
|
|
background: linear-gradient(135deg, var(--primary), #7c3aed);
|
|
-webkit-background-clip: text;
|
|
-webkit-text-fill-color: transparent;
|
|
background-clip: text;
|
|
}
|
|
|
|
.subtitle {
|
|
color: var(--text-light);
|
|
margin-top: 5px;
|
|
font-size: 0.95rem;
|
|
}
|
|
|
|
.main-content {
|
|
display: grid;
|
|
grid-template-columns: 420px 1fr;
|
|
gap: 20px;
|
|
align-items: start;
|
|
}
|
|
|
|
/* ===== 左侧面板 ===== */
|
|
.left-panel {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 16px;
|
|
max-height: calc(100vh - 140px);
|
|
overflow-y: auto;
|
|
padding-right: 8px;
|
|
}
|
|
|
|
.left-panel::-webkit-scrollbar {
|
|
width: 6px;
|
|
}
|
|
|
|
.left-panel::-webkit-scrollbar-track {
|
|
background: transparent;
|
|
}
|
|
|
|
.left-panel::-webkit-scrollbar-thumb {
|
|
background: #cbd5e1;
|
|
border-radius: 3px;
|
|
}
|
|
|
|
.panel-section {
|
|
background: var(--panel-bg);
|
|
border-radius: var(--radius);
|
|
padding: 20px;
|
|
box-shadow: var(--shadow);
|
|
border: 1px solid var(--border);
|
|
}
|
|
|
|
.panel-section h2 {
|
|
font-size: 1.05rem;
|
|
margin-bottom: 12px;
|
|
color: var(--text);
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
}
|
|
|
|
/* ===== 数据输入 ===== */
|
|
.input-format-hint {
|
|
background: #f1f5f9;
|
|
border-radius: 8px;
|
|
padding: 10px 14px;
|
|
margin-bottom: 12px;
|
|
font-size: 0.82rem;
|
|
color: var(--text-light);
|
|
}
|
|
|
|
.input-format-hint pre {
|
|
margin-top: 6px;
|
|
font-family: 'Fira Code', monospace;
|
|
font-size: 0.78rem;
|
|
color: var(--primary);
|
|
white-space: pre-wrap;
|
|
}
|
|
|
|
#dataInput {
|
|
width: 100%;
|
|
height: 180px;
|
|
border: 2px solid var(--border);
|
|
border-radius: 8px;
|
|
padding: 12px;
|
|
font-family: 'Fira Code', 'Courier New', monospace;
|
|
font-size: 0.85rem;
|
|
resize: vertical;
|
|
transition: border-color 0.2s;
|
|
line-height: 1.5;
|
|
}
|
|
|
|
#dataInput:focus {
|
|
outline: none;
|
|
border-color: var(--primary);
|
|
box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
|
|
}
|
|
|
|
/* ===== 按钮 ===== */
|
|
.btn-group {
|
|
display: flex;
|
|
gap: 8px;
|
|
margin-top: 12px;
|
|
flex-wrap: wrap;
|
|
}
|
|
|
|
.btn {
|
|
padding: 8px 16px;
|
|
border: none;
|
|
border-radius: 8px;
|
|
font-size: 0.88rem;
|
|
font-weight: 500;
|
|
cursor: pointer;
|
|
transition: all 0.2s;
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 4px;
|
|
}
|
|
|
|
.btn-primary {
|
|
background: var(--primary);
|
|
color: white;
|
|
}
|
|
|
|
.btn-primary:hover {
|
|
background: var(--primary-hover);
|
|
transform: translateY(-1px);
|
|
box-shadow: var(--shadow);
|
|
}
|
|
|
|
.btn-secondary {
|
|
background: #f1f5f9;
|
|
color: var(--text);
|
|
border: 1px solid var(--border);
|
|
}
|
|
|
|
.btn-secondary:hover {
|
|
background: #e2e8f0;
|
|
}
|
|
|
|
.btn-success {
|
|
background: var(--success);
|
|
color: white;
|
|
flex: 1;
|
|
}
|
|
|
|
.btn-success:hover {
|
|
background: var(--success-hover);
|
|
transform: translateY(-1px);
|
|
}
|
|
|
|
/* ===== 配置区 ===== */
|
|
.config-group {
|
|
margin-bottom: 12px;
|
|
}
|
|
|
|
.config-group > label {
|
|
display: block;
|
|
font-size: 0.85rem;
|
|
font-weight: 500;
|
|
color: var(--text-light);
|
|
margin-bottom: 5px;
|
|
}
|
|
|
|
.config-group select,
|
|
.config-group input[type="text"],
|
|
.config-group input[type="number"] {
|
|
width: 100%;
|
|
padding: 8px 12px;
|
|
border: 1px solid var(--border);
|
|
border-radius: 8px;
|
|
font-size: 0.88rem;
|
|
background: white;
|
|
transition: border-color 0.2s;
|
|
}
|
|
|
|
.config-group select:focus,
|
|
.config-group input:focus {
|
|
outline: none;
|
|
border-color: var(--primary);
|
|
box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
|
|
}
|
|
|
|
.checkbox-group {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: 8px;
|
|
}
|
|
|
|
.checkbox-group label {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 4px;
|
|
font-size: 0.83rem;
|
|
color: var(--text);
|
|
cursor: pointer;
|
|
background: #f8fafc;
|
|
padding: 4px 10px;
|
|
border-radius: 6px;
|
|
border: 1px solid var(--border);
|
|
transition: all 0.2s;
|
|
}
|
|
|
|
.checkbox-group label:hover {
|
|
background: #f1f5f9;
|
|
border-color: var(--primary);
|
|
}
|
|
|
|
.checkbox-group input[type="checkbox"] {
|
|
accent-color: var(--primary);
|
|
}
|
|
|
|
/* ===== 系列配置 ===== */
|
|
.series-config {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 8px;
|
|
}
|
|
|
|
.series-item {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
padding: 8px 12px;
|
|
background: #f8fafc;
|
|
border-radius: 8px;
|
|
border: 1px solid var(--border);
|
|
cursor: grab;
|
|
transition: all 0.2s;
|
|
}
|
|
|
|
.series-item:hover {
|
|
border-color: var(--primary);
|
|
box-shadow: var(--shadow);
|
|
}
|
|
|
|
.series-item.dragging {
|
|
opacity: 0.5;
|
|
cursor: grabbing;
|
|
}
|
|
|
|
.series-item .drag-handle {
|
|
color: #94a3b8;
|
|
cursor: grab;
|
|
font-size: 1.1rem;
|
|
}
|
|
|
|
.series-item .series-name {
|
|
flex: 1;
|
|
font-size: 0.85rem;
|
|
font-weight: 500;
|
|
}
|
|
|
|
.series-item input[type="color"] {
|
|
width: 32px;
|
|
height: 32px;
|
|
border: none;
|
|
border-radius: 6px;
|
|
cursor: pointer;
|
|
padding: 0;
|
|
}
|
|
|
|
.series-item select {
|
|
padding: 4px 8px;
|
|
border: 1px solid var(--border);
|
|
border-radius: 6px;
|
|
font-size: 0.8rem;
|
|
background: white;
|
|
}
|
|
|
|
.hint-text {
|
|
font-size: 0.83rem;
|
|
color: var(--text-light);
|
|
text-align: center;
|
|
padding: 10px;
|
|
}
|
|
|
|
/* ===== 右侧图表区 ===== */
|
|
.right-panel {
|
|
position: sticky;
|
|
top: 20px;
|
|
}
|
|
|
|
.chart-container {
|
|
background: var(--panel-bg);
|
|
border-radius: var(--radius);
|
|
padding: 20px;
|
|
box-shadow: var(--shadow-lg);
|
|
border: 1px solid var(--border);
|
|
}
|
|
|
|
.chart-area {
|
|
width: 100%;
|
|
height: 600px;
|
|
}
|
|
|
|
.placeholder {
|
|
width: 100%;
|
|
height: 100%;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
justify-content: center;
|
|
color: var(--text-light);
|
|
}
|
|
|
|
.placeholder p:first-child {
|
|
font-size: 4rem;
|
|
margin-bottom: 16px;
|
|
}
|
|
|
|
.placeholder p:last-child {
|
|
font-size: 1.1rem;
|
|
}
|
|
|
|
/* ===== 响应式 ===== */
|
|
@media (max-width: 1024px) {
|
|
.main-content {
|
|
grid-template-columns: 1fr;
|
|
}
|
|
|
|
.left-panel {
|
|
max-height: none;
|
|
}
|
|
|
|
.chart-area {
|
|
height: 450px;
|
|
}
|
|
}
|
|
|
|
/* ===== 动画 ===== */
|
|
@keyframes fadeIn {
|
|
from { opacity: 0; transform: translateY(10px); }
|
|
to { opacity: 1; transform: translateY(0); }
|
|
}
|
|
|
|
.panel-section {
|
|
animation: fadeIn 0.3s ease-out;
|
|
}
|