* {
    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;
    line-height: 1.6;
}

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

header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 10px;
}

.logo {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

header h1 {
    font-size: 2.8em;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

header p {
    font-size: 1.3em;
    opacity: 0.9;
}

.upload-section {
    margin-bottom: 30px;
}

.upload-area {
    background: white;
    border: 3px dashed #ddd;
    border-radius: 20px;
    padding: 50px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.upload-area:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateY(-2px);
}

.upload-area.dragover {
    border-color: #667eea;
    background: #f0f4ff;
    transform: scale(1.02);
}

.upload-icon {
    font-size: 4.5em;
    margin-bottom: 20px;
    color: #667eea;
}

.upload-content h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.6em;
}

.upload-content p {
    color: #666;
    margin-bottom: 25px;
    font-size: 1.1em;
}

.upload-btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 15px 35px;
    border-radius: 30px;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    font-weight: 600;
}

.upload-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.data-preview, .chart-config {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.data-preview h3, .chart-config h3 {
    color: #333;
    margin-bottom: 25px;
    font-size: 1.5em;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.table-container {
    max-height: 400px;
    overflow: auto;
    border: 1px solid #eee;
    border-radius: 12px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background: linear-gradient(45deg, #f8f9fa, #e9ecef);
    font-weight: 600;
    color: #555;
    position: sticky;
    top: 0;
    z-index: 10;
}

tr:hover {
    background: #f8f9ff;
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.config-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    border: 1px solid #e9ecef;
}

.config-section h4 {
    color: #495057;
    margin-bottom: 20px;
    font-size: 1.2em;
    border-bottom: 2px solid #667eea;
    padding-bottom: 8px;
}

.config-row {
    display: flex;
    align-items: center;
    margin-bottom: 18px;
    gap: 15px;
}

.config-row label {
    font-weight: 600;
    color: #555;
    min-width: 100px;
    font-size: 0.95em;
}

.config-row select,
.config-row input[type="text"],
.config-row input[type="range"] {
    flex: 1;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1em;
    transition: all 0.3s ease;
}

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

.config-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    cursor: pointer;
}

.config-row input[type="color"] {
    width: 50px;
    height: 40px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
}

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

.y-axis-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.y-axis-container select {
    min-height: 80px;
}

.add-y-axis-btn {
    background: linear-gradient(45deg, #17a2b8, #138496);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.3s ease;
    align-self: flex-start;
}

.add-y-axis-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(23, 162, 184, 0.4);
}

.y-axis-selections {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    max-height: 200px;
    overflow-y: auto;
}

.y-axis-selection {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.y-axis-selection:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.y-axis-selection:last-child {
    margin-bottom: 0;
}

.y-axis-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.y-axis-label {
    font-weight: 600;
    color: #495057;
    font-size: 0.95em;
}

.y-axis-color {
    width: 35px;
    height: 35px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s ease;
}

.y-axis-color:hover {
    border-color: #667eea;
    transform: scale(1.05);
}

.remove-y-axis-btn {
    background: #dc3545;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.remove-y-axis-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}

#opacityValue {
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 15px;
    font-size: 0.9em;
    font-weight: 600;
    min-width: 40px;
    text-align: center;
}

.generate-btn {
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 18px 50px;
    border-radius: 30px;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(40, 167, 69, 0.4);
    font-weight: 600;
    display: block;
    margin: 0 auto;
}

.generate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.6);
}

.chart-container {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.chart-header h3 {
    color: #333;
    font-size: 1.5em;
}

.export-toggle-btn {
    background: linear-gradient(45deg, #6c757d, #5a6268);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.export-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.4);
}

.export-panel {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 25px;
    animation: slideDown 0.3s ease;
}

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

.export-panel h4 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.export-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.export-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.export-row label {
    font-weight: 600;
    color: #555;
    min-width: 50px;
}

.export-row select {
    flex: 1;
    padding: 8px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.9em;
}

.export-btn {
    background: linear-gradient(45deg, #007bff, #0056b3);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.4);
}

.export-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.6);
}

.chart-wrapper {
    position: relative;
    height: 500px;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

#myChart {
    max-width: 100%;
    max-height: 100%;
}

.loading {
    text-align: center;
    padding: 60px;
    color: white;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 25px;
}

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

.loading p {
    font-size: 1.3em;
    font-weight: 600;
}

.footer {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 30px 0;
    margin-top: 60px;
    border-top: 3px solid #3498db;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.footer-content p {
    margin: 8px 0;
    font-size: 0.95em;
    line-height: 1.6;
}

.footer-content p:first-child {
    font-weight: 600;
    font-size: 1.05em;
    margin-bottom: 10px;
}

.footer-content p:last-child {
    opacity: 0.8;
    font-size: 0.9em;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .container {
        max-width: 95%;
        padding: 15px;
    }
    
    .config-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2.2em;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .logo {
        width: 50px;
        height: 50px;
    }
    
    header p {
        font-size: 1.1em;
    }
    
    .upload-area {
        padding: 30px 20px;
    }
    
    .upload-icon {
        font-size: 3.5em;
    }
    
    .config-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .config-row label {
        min-width: auto;
        margin-bottom: 5px;
    }
    
    .config-row select,
    .config-row input {
        width: 100%;
    }
    
    .chart-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .export-options {
        grid-template-columns: 1fr;
    }
    
    .chart-wrapper {
        height: 400px;
    }
    
    .footer {
        margin-top: 40px;
        padding: 20px 0;
    }
    
    .footer-content {
        padding: 0 15px;
    }
}

@media (max-width: 480px) {
    .data-preview, .chart-config, .chart-container {
        padding: 20px;
    }
    
    .generate-btn {
        padding: 15px 30px;
        font-size: 1.1em;
    }
    
    .upload-content h3 {
        font-size: 1.4em;
    }
    
    .chart-wrapper {
        height: 300px;
    }
    
    .footer {
        margin-top: 30px;
        padding: 15px 0;
    }
    
    .footer-content p {
        font-size: 0.85em;
    }
    
    .footer-content p:first-child {
        font-size: 0.95em;
    }
}

/* 深色主题支持 */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    }
    
    .data-preview, .chart-config, .chart-container {
        background: #1e293b;
        color: #f1f5f9;
        border: 1px solid #334155;
    }
    
    .config-section {
        background: #334155;
        border-color: #475569;
        color: #f1f5f9;
    }
    
    .export-panel {
        background: #334155;
        border-color: #475569;
        color: #f1f5f9;
    }
    
    th {
        background: linear-gradient(45deg, #475569, #334155);
        color: #f1f5f9;
        border-bottom: 1px solid #475569;
    }
    
    td {
        border-bottom: 1px solid #334155;
        color: #e2e8f0;
    }
    
    tr:hover {
        background: #334155;
    }
    
    .upload-area {
        background: #1e293b;
        border-color: #475569;
        color: #f1f5f9;
    }
    
    .upload-area:hover {
        background: #334155;
        border-color: #64748b;
    }
    
    .upload-area.dragover {
        background: #334155;
        border-color: #3b82f6;
    }
    
    .upload-content h3 {
        color: #f1f5f9;
    }
    
    .upload-content p {
        color: #94a3b8;
    }
    
    .config-section h4 {
        color: #f1f5f9;
        border-bottom: 2px solid #3b82f6;
    }
    
    .config-row label {
        color: #e2e8f0;
    }
    
    .config-row select,
    .config-row input[type="text"],
    .config-row input[type="range"] {
        background: #0f172a;
        border: 2px solid #475569;
        color: #f1f5f9;
    }
    
    .config-row select:focus,
    .config-row input[type="text"]:focus {
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    }
    
    .config-row select option {
        background: #0f172a;
        color: #f1f5f9;
    }
    
    .chart-header {
        border-bottom: 2px solid #334155;
    }
    
    .chart-header h3 {
        color: #f1f5f9;
    }
    
    .export-panel h4 {
        color: #f1f5f9;
    }
    
    .export-row label {
        color: #e2e8f0;
    }
    
    .export-row select {
        background: #0f172a;
        border: 2px solid #475569;
        color: #f1f5f9;
    }
    
    .export-row select option {
        background: #0f172a;
        color: #f1f5f9;
    }
    
    .table-container {
        border: 1px solid #475569;
    }
    
    .data-preview h3, .chart-config h3 {
        color: #f1f5f9;
        border-bottom: 2px solid #475569;
    }
    
    #opacityValue {
        background: #3b82f6;
        color: #f1f5f9;
    }
    
    .loading {
        color: #f1f5f9;
    }
    
    .loading p {
        color: #f1f5f9;
    }
    
    .chart-wrapper {
        background: #1e293b;
        border: 1px solid #334155;
    }
    
    .config-row input[type="color"] {
        background: #0f172a;
        border: 2px solid #475569;
    }
    
    .config-row input[type="color"]:focus {
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    }
    
    .y-axis-container select {
        background: #0f172a;
        border: 2px solid #475569;
        color: #f1f5f9;
    }
    
    .y-axis-selections {
        background: #334155;
        border: 1px solid #475569;
    }
    
    .y-axis-selection {
        background: #1e293b;
        border: 1px solid #475569;
    }
    
    .y-axis-selection:hover {
        box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
    }
    
    .y-axis-label {
        color: #f1f5f9;
    }
    
    .y-axis-color {
        background: #0f172a;
        border: 2px solid #475569;
    }
    
    .y-axis-color:hover {
        border-color: #3b82f6;
    }
    
    .footer {
        background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
        border-top: 3px solid #3b82f6;
    }
    
    .footer-content p {
        color: #f1f5f9;
    }
    
    .footer-content p:last-child {
        color: #94a3b8;
    }
}