.chart-builder {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

header h1 {
    font-size: 1.8rem;
    color: #4285f4;
}

.back-btn {
    background: #f5f5f5;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    text-decoration: none;
    color: #333;
    transition: background 0.3s;
}

.back-btn:hover {
    background: #e0e0e0;
}

.builder-container {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 2rem;
}

.config-panel {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    height: fit-content;
    position: sticky;
    top: 1rem;
}

.form-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

.form-section h2 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: #333;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.7rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.axis-tabs {
    display: flex;
    margin-bottom: 1rem;
    border-bottom: 1px solid #ddd;
}

.axis-tab {
    padding: 0.5rem 1rem;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
    color: #666;
    border-bottom: 2px solid transparent;
}

.axis-tab.active {
    color: #4285f4;
    border-bottom-color: #4285f4;
}

.axis-content {
    padding: 0.5rem;
}

.hidden {
    display: none;
}

.series-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.series-item {
    background: #f5f5f5;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.series-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.series-title {
    font-size: 1.1rem;
    color: #333;
}

.remove-series-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 1.1rem;
    transition: color 0.3s;
}

.remove-series-btn:hover {
    color: #ea4335;
}

.data-points {
    margin-top: 1rem;
}

.points-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.points-header h4 {
    font-size: 1rem;
    color: #555;
}

.add-point-btn {
    background: #4285f4;
    color: white;
    border: none;
    padding: 0.3rem 0.7rem;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.3s;
}

.add-point-btn:hover {
    background: #3367d6;
}

.points-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.points-table th {
    text-align: left;
    padding: 0.5rem;
    background: #f0f0f0;
    font-weight: 500;
}

.points-table td {
    padding: 0.5rem;
    border-bottom: 1px solid #eee;
}

.point-row input {
    width: 100%;
    padding: 0.3rem;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.remove-point-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    transition: color 0.3s;
}

.remove-point-btn:hover {
    color: #ea4335;
}

.add-series-btn {
    width: 100%;
    padding: 0.7rem;
    background: #34a853;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 0.5rem;
}

.add-series-btn:hover {
    background: #2d9249;
}

.generate-btn {
    width: 100%;
    padding: 0.8rem;
    background: #4285f4;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 1rem;
}

.generate-btn:hover {
    background: #3367d6;
}

.chart-container {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 1rem;
}

.chart-wrapper {
    width: 100%;
    height: 500px;
    position: relative;
}

.chart-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.chart-actions button {
    flex: 1;
    padding: 0.7rem;
    border: none;
    border-radius: 5px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.3s;
}

#download-btn {
    background: #34a853;
    color: white;
}

#download-btn:hover {
    background: #2d9249;
}

#reset-btn {
    background: #f5f5f5;
    color: #333;
}

#reset-btn:hover {
    background: #e0e0e0;
}

@media (max-width: 1024px) {
    .builder-container {
        grid-template-columns: 1fr;
    }

    .config-panel {
        position: static;
    }

    .chart-container {
        position: static;
    }
}

@media (max-width: 480px) {
    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .form-section h2 {
        font-size: 1.1rem;
    }

    .series-item {
        padding: 0.8rem;
    }
}

/* 颜色选择器专用样式 */
.series-color {
    -webkit-appearance: none; /* 清除默认样式 */
    -moz-appearance: none;
    appearance: none;
    width: 100%;
    height: 40px;
    padding: 3px;
    background: none;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
}

/* 颜色选择器按钮样式 */
.series-color::-webkit-color-swatch {
    border-radius: 3px;
    border: none;
}

.series-color::-moz-color-swatch {
    border-radius: 3px;
    border: none;
}