:root {
    --primary-color: #3B82F6;
    --secondary-color: #EBF8FF;
    --text-color: #1F2937;
    --accent-color: #10B981;
}

/* 全局样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
}

/* 直方图工具样式 */
#chart-container {
    min-height: 400px;
}

#histogram-canvas {
    max-width: 100%;
    height: auto;
}

.color-option {
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

.color-option:hover {
    transform: scale(1.1);
}

/* 文件上传区域 */
.file-upload-area {
    transition: border-color 0.3s ease;
}

.file-upload-area:hover {
    border-color: #3B82F6;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (max-width: 768px) {
    /* 移动端导航 */
    header nav ul {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    header nav ul li {
        margin: 0;
    }
    
    /* 移动端标题 */
    h1 {
        font-size: 2.5rem !important;
        line-height: 1.2;
    }
    
    h2 {
        font-size: 2rem !important;
    }
    
    /* 移动端网格 */
    .grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }
    
    /* 移动端工具面板 */
    #histogram-tool .grid {
        grid-template-columns: 1fr;
    }
    
    /* 移动端按钮 */
    .py-3.px-8 {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    /* 移动端间距 */
    .py-20 {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
    
    .py-16 {
        padding-top: 2.5rem;
        padding-bottom: 2.5rem;
    }
    
    .mb-12 {
        margin-bottom: 2rem;
    }
    
    /* 移动端卡片 */
    .p-6 {
        padding: 1rem;
    }
    
    .p-8 {
        padding: 1.5rem;
    }
}

@media (max-width: 640px) {
    /* 超小屏幕优化 */
    .text-5xl {
        font-size: 2rem !important;
    }
    
    .text-4xl {
        font-size: 1.75rem !important;
    }
    
    .text-2xl {
        font-size: 1.25rem !important;
    }
    
    .text-xl {
        font-size: 1.125rem !important;
    }
    
    /* 移动端语言选择器 */
    #language-switcher {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
    
    /* 移动端导航隐藏部分项目 */
    header nav ul li:nth-child(n+5) {
        display: none;
    }
    
    /* 移动端工具输入区域 */
    #data-input {
        min-height: 120px;
    }
    
    /* 移动端颜色选择器 */
    .color-option {
        width: 2rem;
        height: 2rem;
    }
}

/* 平板设备优化 */
@media (min-width: 768px) and (max-width: 1024px) {
    .grid.md\\:grid-cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid.md\\:grid-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid.lg\\:grid-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 打印样式 */
@media print {
    header, footer, #language-switcher {
        display: none;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .bg-gradient-to-b {
        background: white !important;
    }
}