/* 全局样式 */
* {
    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%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
.header {
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.header h1 {
    font-size: 2.5rem;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
    font-weight: 700;
}

.header p {
    color: #666;
    font-size: 1.1rem;
}

/* 控制面板样式 */
.controls {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-group label {
    font-weight: 600;
    color: #555;
    white-space: nowrap;
}

.control-group select,
.control-group input[type="range"],
.control-group input[type="number"] {
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.control-group select:focus,
.control-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.control-group button {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.control-group button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

#dataRangeValue {
    font-weight: bold;
    color: #667eea;
    min-width: 40px;
    text-align: center;
}

/* 图表网格布局 */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 30px;
    margin-top: 30px;
    justify-content: center;
    align-items: start;
}

/* 图表容器样式 */
.chart-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: visible;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 450px;
}

.chart-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.chart-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

.chart-container h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.2rem;
    font-weight: 600;
}

.chart-wrapper {
    width: 100%;
    height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.chart-wrapper canvas,
.chart-wrapper div {
    max-width: 100%;
    max-height: 100%;
    width: 100% !important;
    height: 100% !important;
}

/* 确保Plotly图表完美居中 */
.chart-wrapper .js-plotly-plot {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* 确保Chart.js图表完美居中 */
.chart-wrapper canvas {
    margin: 0 auto;
    display: block;
}

/* 图表控制样式 */
.chart-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    align-items: center;
}

.chart-controls label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #555;
    font-weight: 500;
}

.chart-controls input[type="range"],
.chart-controls input[type="number"],
.chart-controls select {
    max-width: 120px;
}

.chart-controls button {
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.chart-controls button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 80%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #333;
}

.modal-content h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

#modalBody {
    margin-bottom: 20px;
}

#modalBody textarea {
    width: 100%;
    min-height: 200px;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    resize: vertical;
}

#modalBody textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#saveData {
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

#saveData:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

/* 隐藏元素样式 */
.hidden {
    display: none !important;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .charts-grid {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .control-group {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .chart-wrapper {
        height: 250px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5rem;
    }
    
    .header p {
        font-size: 1rem;
    }
    
    .chart-wrapper {
        height: 200px;
    }
    
    .chart-controls {
        flex-direction: column;
        align-items: stretch;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 提示信息样式 */
.tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    pointer-events: none;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tooltip.show {
    opacity: 1;
}

/* 图表特定样式调整 */
#contourChart,
#streamChart,
#dumbbellChart,
#ganttChart,
#pyramidChart,
#funnelChart,
#sankeyChart,
#treeChart,
#waffleChart {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* 等高线图特定优化 */
#contourChart .plotly,
#contourChart .js-plotly-plot {
    border-radius: 8px;
    overflow: hidden;
}

/* 哑铃图特定优化 */
#dumbbellChart .plotly .plotly .modebar {
    top: 10px !important;
    right: 10px !important;
}

/* 甘特图特定优化 */
#ganttChart .plotly .plotly .modebar {
    top: 10px !important;
    right: 10px !important;
}

/* 人口金字塔特定优化 */
#pyramidChart .plotly .plotly .modebar {
    top: 10px !important;
    right: 10px !important;
}

/* 漏斗图特定优化 */
#funnelChart .plotly .plotly .modebar {
    top: 10px !important;
    right: 10px !important;
}

/* 桑基图特定优化 */
#sankeyChart .plotly .plotly .modebar {
    top: 10px !important;
    right: 10px !important;
}

/* 树状图特定优化 */
#treeChart .plotly .plotly .modebar {
    top: 10px !important;
    right: 10px !important;
}

/* 华夫饼图特定优化 */
#waffleChart .plotly .plotly .modebar {
    top: 10px !important;
    right: 10px !important;
}

/* 棉棒图特定优化（Chart.js） */
#stemChart {
    max-height: 100%;
    max-width: 100%;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #5a6fd8, #6a4190);
}

/* 拖放区域样式 */
.drag-drop-area {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    margin: 20px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.drag-drop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.drag-drop-header h3 {
    color: #333;
    margin: 0;
}

.drag-drop-header p {
    color: #666;
    margin: 0;
    font-size: 0.9rem;
}

#closeDragArea {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

#closeDragArea:hover {
    background: #c82333;
    transform: scale(1.05);
}

.drag-drop-zone {
    margin: 20px;
    border: 3px dashed #667eea;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    background: #f8f9fa;
}

.drag-drop-zone.drag-over {
    background: rgba(102, 126, 234, 0.1);
    border-color: #764ba2;
    transform: scale(1.02);
}

.drag-drop-content {
    pointer-events: none;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    display: block;
}

.drag-drop-content p {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

#fileInput {
    display: none;
}

.data-preview {
    margin: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.data-preview h4 {
    color: #333;
    margin-bottom: 15px;
}

#previewContent {
    max-height: 300px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

/* 样式自定义模态框增强 */
.style-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.style-group {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
}

.style-group h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.1rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 8px;
}

.color-options,
.font-options,
.layout-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.color-options label,
.font-options label,
.layout-options label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #555;
}

.color-options input[type="color"],
.font-options select,
.layout-options input[type="range"],
.font-options input[type="range"] {
    max-width: 120px;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.modal-buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

#applyStyles {
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
}

#resetStyles {
    background: linear-gradient(45deg, #dc3545, #c82333);
    color: white;
}

#saveStyles {
    background: linear-gradient(45deg, #007bff, #0056b3);
    color: white;
}

.modal-buttons button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* 颜色主题预设 */
.theme-pastel {
    --primary-color: #a8dadc;
    --secondary-color: #457b9d;
    --accent-color: #f1faee;
}

.theme-vibrant {
    --primary-color: #ff006e;
    --secondary-color: #8338ec;
    --accent-color: #06ffa5;
}

.theme-monochrome {
    --primary-color: #2d3436;
    --secondary-color: #636e72;
    --accent-color: #dfe6e9;
}

.theme-rainbow {
    --primary-color: linear-gradient(90deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3);
}

/* 图表类型选择器增强 */
#chartTypeSelector {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    transition: all 0.3s ease;
    cursor: pointer;
}

#chartTypeSelector:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 动画效果类 */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

.slide-in {
    animation: slideIn 0.5s ease-out;
}

.scale-up {
    animation: scaleUp 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes scaleUp {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* 通知样式 */
.notification {
    animation: slideIn 0.3s ease-out;
}

.notification-success {
    background: linear-gradient(45deg, #28a745, #20c997);
}

.notification-error {
    background: linear-gradient(45deg, #dc3545, #c82333);
}

.notification-warning {
    background: linear-gradient(45deg, #ffc107, #ff9800);
}

.notification-info {
    background: linear-gradient(45deg, #17a2b8, #007bff);
}

/* 按钮激活状态 */
button.active {
    background: linear-gradient(45deg, #28a745, #20c997) !important;
    color: white !important;
    transform: scale(1.05);
}

/* 图表容器悬停效果增强 */
.chart-container:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

/* 图表加载状态 */
.chart-container.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    backdrop-filter: blur(2px);
}

.chart-container.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 11;
}

/* 图表淡入动画 */
@keyframes chartFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chart-wrapper {
    animation: chartFadeIn 0.6s ease-out;
}

/* 图表标题优化 */
.chart-container h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.4;
}

/* 加载状态 */
.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
}

/* 增强的控制面板 */
.controls:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

/* 图表控制区域增强 */
.chart-controls:hover {
    background: #e9ecef;
    transform: scale(1.02);
}

/* 模态框增强 */
.modal-content:hover {
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.4);
}

/* 工具提示样式 */
.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;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tooltip.show {
    opacity: 1;
}

/* 滑块样式增强 */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-track {
    background: #e0e0e0;
    height: 6px;
    border-radius: 3px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(45deg, #667eea, #764ba2);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
}

input[type="range"]::-moz-range-track {
    background: #e0e0e0;
    height: 6px;
    border-radius: 3px;
}

input[type="range"]::-moz-range-thumb {
    background: linear-gradient(45deg, #667eea, #764ba2);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

/* 颜色选择器样式 */
input[type="color"] {
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    width: 50px;
    height: 35px;
    transition: all 0.3s ease;
}

input[type="color"]:hover {
    border-color: #667eea;
    transform: scale(1.05);
}

/* 数字输入框样式 */
input[type="number"] {
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    transition: all 0.3s ease;
}

input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 选择框样式增强 */
select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* 图表特定优化 */
#contourChart,
#streamChart,
#sankeyChart,
#treeChart {
    width: 100% !important;
    height: 100% !important;
}

/* 响应式断点优化 */
@media (max-width: 1400px) {
    .charts-grid {
        grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
        gap: 25px;
    }
}

@media (max-width: 1200px) {
    .charts-grid {
        grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
        gap: 20px;
    }
    
    .chart-container {
        min-height: 420px;
    }
    
    .chart-wrapper {
        height: 300px;
    }
    
    .header h1 {
        font-size: 2.2rem;
    }
    
    .controls {
        padding: 15px;
        gap: 15px;
    }
}

@media (max-width: 992px) {
    .charts-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
        gap: 18px;
    }
    
    .chart-container {
        min-height: 400px;
        padding: 20px;
    }
    
    .chart-wrapper {
        height: 290px;
    }
    
    .chart-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px;
    }
    
    .drag-drop-zone {
        padding: 30px;
    }
    
    .style-controls {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

/* 超宽屏优化 */
@media (min-width: 1600px) {
    .charts-grid {
        grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
        gap: 40px;
    }
    
    .chart-container {
        min-height: 500px;
        padding: 30px;
    }
    
    .chart-wrapper {
        height: 380px;
    }
}

/* 平板横屏优化 */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .charts-grid {
        grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
        gap: 20px;
    }
    
    .chart-container {
        min-height: 360px;
        padding: 20px;
    }
    
    .chart-wrapper {
        height: 280px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 15px;
    }
    
    .control-group {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        justify-content: center;
    }
    
    .chart-container {
        min-height: 380px;
        padding: 20px;
    }
    
    .chart-wrapper {
        height: 280px;
        padding: 10px;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
        padding: 20px;
        max-height: 90vh;
    }
    
    .drag-drop-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .drag-drop-zone {
        padding: 20px;
        margin: 15px;
    }
    
    .upload-icon {
        font-size: 2rem;
    }
    
    .style-controls {
        grid-template-columns: 1fr;
    }
    
    .color-options,
    .font-options,
    .layout-options {
        gap: 8px;
    }
    
    .color-options label,
    .font-options label,
    .layout-options label {
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
    }
    
    .modal-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .modal-buttons button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .header {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .header p {
        font-size: 1rem;
    }
    
    .controls {
        padding: 12px;
        gap: 10px;
    }
    
    .control-group {
        gap: 6px;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 0 5px;
    }
    
    .chart-container {
        min-height: 350px;
        padding: 15px;
    }
    
    .chart-wrapper {
        height: 250px;
        padding: 8px;
    }
    
    .chart-controls {
        padding: 8px;
        font-size: 0.85rem;
        gap: 8px;
    }
    
    .chart-controls label {
        font-size: 0.8rem;
        gap: 5px;
    }
    
    .chart-controls input[type="range"],
    .chart-controls input[type="number"],
    .chart-controls select {
        max-width: 100px;
        font-size: 0.8rem;
    }
    
    .chart-controls button {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .drag-drop-zone {
        padding: 15px;
        margin: 10px;
    }
    
    .upload-icon {
        font-size: 1.5rem;
    }
    
    .data-preview {
        margin: 10px;
        padding: 10px;
    }
    
    .style-group {
        padding: 15px;
    }
    
    .style-group h3 {
        font-size: 1rem;
    }
    
    #previewContent {
        max-height: 200px;
        font-size: 0.8rem;
        padding: 10px;
    }
    
    /* 图表特定响应式调整 */
    .chart-wrapper canvas,
    .chart-wrapper div {
        width: 100% !important;
        height: 100% !important;
    }
    
    /* 移动端图表字体调整 */
    #contourChart .plotly .xticks text,
    #contourChart .plotly .yticks text {
        font-size: 8px !important;
    }
    
    #dumbbellChart .plotly .xticks text,
    #dumbbellChart .plotly .yticks text {
        font-size: 8px !important;
    }
    
    #ganttChart .plotly .xticks text,
    #ganttChart .plotly .yticks text {
        font-size: 8px !important;
    }
    
    #pyramidChart .plotly .xticks text,
    #pyramidChart .plotly .yticks text {
        font-size: 8px !important;
    }
    
    #funnelChart .plotly .xticks text,
    #funnelChart .plotly .yticks text {
        font-size: 8px !important;
    }
    
    #sankeyChart .plotly text {
        font-size: 8px !important;
    }
    
    #treeChart .plotly .xticks text,
    #treeChart .plotly .yticks text {
        font-size: 8px !important;
    }
    
    #waffleChart .plotly .xticks text,
    #waffleChart .plotly .yticks text {
        font-size: 8px !important;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    }
    
    .header,
    .controls,
    .chart-container,
    .modal-content,
    .drag-drop-area {
        background: rgba(255, 255, 255, 0.95);
        color: #333;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .chart-container,
    .controls,
    .modal-content {
        border: 2px solid #000;
    }
    
    button {
        border: 2px solid #000;
    }
}

/* 减少动画模式支持 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .chart-container:hover,
    .controls:hover,
    button:hover {
        transform: none;
    }
}

/* 响应式增强 */
@media (max-width: 768px) {
    .drag-drop-zone {
        padding: 20px;
    }
    
    .upload-icon {
        font-size: 2rem;
    }
    
    .style-controls {
        grid-template-columns: 1fr;
    }
    
    .color-options,
    .font-options,
    .layout-options {
        gap: 8px;
    }
    
    .color-options label,
    .font-options label,
    .layout-options label {
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
    }
    
    .color-options input[type="color"],
    .font-options select,
    .layout-options input[type="range"],
    .font-options input[type="range"] {
        max-width: 100%;
    }
    
    .modal-buttons {
        flex-direction: column;
    }
}