* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    min-height: 100vh;
}

header {
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem;
    text-align: center;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

header h1 {
    color: #2c3e50;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

header p {
    color: #7f8c8d;
    font-size: 1.1rem;
}

main {
    display: flex;
    max-width: 1400px;
    margin: 2rem auto;
    gap: 2rem;
    padding: 0 2rem;
    flex-wrap: wrap;
}

.control-panel {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 1.5rem;
    width: 350px;
    height: fit-content;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.control-panel h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
}

.control-group {
    margin-bottom: 2rem;
}

.control-group h3 {
    color: #34495e;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.chart-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.chart-btn {
    background: #ecf0f1;
    border: none;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    color: #2c3e50;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    min-width: 80px;
}

.btn-icon {
    font-size: 1.2rem;
}

.btn-text {
    font-size: 0.8rem;
    text-align: center;
}

.chart-btn:hover {
    background: #3498db;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.chart-btn.active {
    background: #2980b9;
    color: white;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
}

.parameters {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.parameter {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem;
    background: #f8f9fa;
    border-radius: 8px;
    transition: background 0.3s ease;
}

.parameter:hover {
    background: #e9ecef;
}

.parameter label {
    flex: 1;
    font-weight: 500;
    color: #495057;
    font-size: 0.9rem;
}

.parameter input[type="range"] {
    flex: 2;
    height: 6px;
    background: #ddd;
    outline: none;
    border-radius: 3px;
    cursor: pointer;
}

.parameter input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    background: #3498db;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s ease;
}

.parameter input[type="range"]::-webkit-slider-thumb:hover {
    background: #2980b9;
    transform: scale(1.2);
}

.parameter {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.parameter:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.parameter.enhanced {
    border-left: 3px solid #3498db;
}

.parameter label {
    flex: 1;
    font-weight: 500;
    color: #495057;
    font-size: 0.9rem;
}

.parameter span {
    min-width: 60px;
    text-align: right;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

.value-display {
    background: #3498db;
    color: white;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

.parameter-tooltip {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.parameter:hover .parameter-tooltip {
    opacity: 1;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.visual-effects {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.effect-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

.switch input:checked + .slider {
    background-color: #3498db;
}

.switch input:checked + .slider:before {
    transform: translateX(26px);
}

.label-text {
    margin-left: 1rem;
    font-weight: 500;
    color: #495057;
}

.presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.preset-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8rem;
    font-weight: 500;
}

.preset-btn:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.action-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
    flex: 1;
    min-width: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.actions button:hover {
    background: #229954;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

#reset-btn {
    background: #e74c3c;
}

#reset-btn:hover {
    background: #c0392b;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

#export-btn {
    background: #f39c12;
}

#export-btn:hover {
    background: #e67e22;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.3);
}

#fullscreen-btn {
    background: #9b59b6;
}

#fullscreen-btn:hover {
    background: #8e44ad;
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.3);
}

.visualization-area {
    flex: 1;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    min-width: 600px;
    max-width: 1200px;
}

.chart-container {
    position: relative;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.05);
}

#main-canvas {
    display: block;
    width: 100%;
    height: 800px;
    cursor: grab;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
}

#main-canvas:active {
    cursor: grabbing;
}

.chart-info {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(255, 255, 255, 0.9);
    padding: 1rem;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.chart-info h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.chart-info p {
    color: #7f8c8d;
    font-size: 0.9rem;
    line-height: 1.4;
}

.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding: 0.8rem;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #6c757d;
}

.status-bar span {
    font-weight: 500;
}

footer {
    background: rgba(255, 255, 255, 0.95);
    text-align: center;
    padding: 1.5rem;
    margin-top: 2rem;
    color: #6c757d;
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.1);
}

/* 响应式设计 */
@media (max-width: 1024px) {
    main {
        flex-direction: column;
        align-items: center;
    }

    .control-panel {
        width: 100%;
        max-width: 500px;
    }

    .visualization-area {
        width: 100%;
        max-width: 800px;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .chart-selector {
        flex-direction: column;
    }

    .chart-btn {
        width: 100%;
        text-align: center;
    }

    .actions {
        flex-direction: column;
    }
}

/* 新增动画和地图相关样式 */
.parameter-enhanced {
    position: relative;
    transition: all 0.3s ease;
}

.parameter-enhanced:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.chart-btn[data-chart="func-animation"]:hover,
.chart-btn[data-chart="wave-animation"]:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.chart-btn[data-chart="func-animation"] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.chart-btn[data-chart="wave-animation"] {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.chart-btn[data-chart="geographic"] {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* 动画特殊效果 */
@keyframes pulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

.chart-btn.active[data-chart="func-animation"],
.chart-btn.active[data-chart="wave-animation"] {
    animation: pulse 2s infinite;
}

/* 增强的地图交互样式 */
.canvas-container {
    position: relative;
}

.canvas-container::after {
    content: attr(data-tooltip);
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    pointer-events: none;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    white-space: nowrap;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 10px;
}

.canvas-container:hover::after {
    opacity: 1;
}

/* 高级控制面板样式 */
.control-group h3 {
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.value-display {
    background: rgba(102, 126, 234, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    min-width: 50px;
    text-align: center;
    display: inline-block;
}

/* 动画性能优化 */
#main-canvas {
    image-rendering: optimizeSpeed;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
}

    .actions button {
        width: 100%;
    }

    .status-bar {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    #main-canvas {
        height: 400px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.control-panel, .visualization-area {
    animation: fadeIn 0.6s ease-out;
}

/* 加载动画 */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    to {
        left: 100%;
    }
}

/* 工具提示 */
.tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    pointer-events: none;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tooltip.show {
    opacity: 1;
}