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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: #ffffff;
    color: #333;
    padding: 30px 20px;
    text-align: center;
    border-bottom: 2px solid #e0e0e0;
}

header h1 {
    font-size: 2.5em;
    color: #333;
}

.data-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 30px;
}

@media (max-width: 1024px) {
    .data-sections {
        grid-template-columns: 1fr;
    }
}

.data-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.data-section h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.chart-title-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    margin-bottom: 15px;
    transition: all 0.3s;
}

.chart-title-input:focus {
    outline: none;
    border-color: #5a9fd4;
    box-shadow: 0 0 0 3px rgba(90, 159, 212, 0.1);
}

.table-container {
    overflow-x: auto;
    margin-bottom: 15px;
    border-radius: 8px;
    background: white;
}

table {
    width: 100%;
    border-collapse: collapse;
    /*min-width: 400px;*/
}

thead {
    background: #5a9fd4;
    color: white;
}

th {
    padding: 12px 10px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9em;
}

td {
    padding: 8px 10px;
    border-bottom: 1px solid #e0e0e0;
}

tr:hover {
    background: #f0f0f0;
}

input[type="text"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9em;
    transition: all 0.3s;
}

input[type="text"]:focus {
    outline: none;
    border-color: #5a9fd4;
    box-shadow: 0 0 0 2px rgba(90, 159, 212, 0.1);
}

.btn-add, .btn-generate, .btn-download {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
    margin-right: 10px;
    margin-top: 10px;
    font-weight: 600;
}

.btn-add {
    background: #28a745;
    color: white;
}

.btn-add:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.btn-generate {
    background: #5a9fd4;
    color: white;
}

.btn-generate:hover {
    background: #4a8fc4;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(90, 159, 212, 0.3);
}

.btn-download {
    background: #ff6b6b;
    color: white;
}

.btn-download:hover {
    background: #ee5a52;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.charts-section {
    padding: 30px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    background: #f8f9fa;
}

@media (max-width: 1024px) {
    .charts-section {
        grid-template-columns: 1fr;
    }
}

.chart-wrapper {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.chart-wrapper canvas {
    min-height: 400px;
    width: 100% !important;
}

.chart-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: center;
}

.btn-fullscreen {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    background: #6c757d;
    color: white;
}

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

.chart-wrapper h3 {
    color: #333;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.3em;
}

canvas {
    max-width: 100%;
    height: auto !important;
}

footer {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    color: #666;
    border-top: 1px solid #e0e0e0;
}

footer p {
    font-size: 0.95em;
}

/* 全屏样式 */
.chart-wrapper.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    padding: 20px;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: auto;
}

.chart-wrapper.fullscreen canvas {
    max-width: 95vw;
    max-height: 75vh;
    min-height: auto;
    width: auto !important;
    height: auto !important;
}

.chart-wrapper.fullscreen .chart-actions {
    margin-top: 20px;
    position: sticky;
    bottom: 0;
    background: white;
    padding: 10px;
    z-index: 10000;
}

/* 横屏提示 */
.rotate-hint {
    display: none;
    text-align: center;
    padding: 8px 15px;
    background: #fff3cd;
    color: #856404;
    border-radius: 8px;
    margin-top: 15px;
    font-size: 0.9em;
    font-weight: 500;
}

.chart-wrapper.fullscreen .rotate-hint {
    display: block;
}

@media (orientation: landscape) and (max-height: 500px) {
    .chart-wrapper.fullscreen .rotate-hint {
        display: none;
    }
}

@media (max-width: 768px) {

    header {
        padding: 10px 10px;
    }
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 1.8em;
    }

    .data-sections, .charts-section {
        padding: 5px;
        gap: 15px;
    }

    .data-section {
        padding: 0;
    }

    th, td {
        padding: 8px 6px;
        font-size: 0.8em;
        white-space: nowrap;
    }

    input[type="text"] {
        padding: 6px;
        font-size: 0.8em;
        min-width: 60px;
    }

    .btn-add, .btn-generate, .btn-download, .btn-fullscreen {
        padding: 10px 15px;
        font-size: 0.9em;
        width: 100%;
        margin-right: 0;
        margin-top: 8px;
    }

    .chart-wrapper {
        padding: 15px;
    }
    
    .chart-wrapper canvas {
        min-height: 300px;
    }
    
    .chart-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5em;
    }

    .data-section h2 {
        font-size: 1.2em;
    }

    th {
        font-size: 0.8em;
    }
}
