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

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    display: flex;
    min-height: 100vh;
    padding: 20px;
    gap: 20px;
}

.sidebar {
    flex: 0 0 300px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    max-height: calc(100vh - 40px);
}

.control-panel {
    padding: 20px;
}

.control-panel h3 {
    margin: 15px 0;
    color: #2c3e50;
    font-size: 1.2em;
}

.control-group {
    margin-bottom: 15px;
}

.control-group label {
    display: block;
    margin-bottom: 5px;
    color: #666;
}

.control-group input[type="range"],
.control-group select {
    width: 100%;
    margin-bottom: 5px;
}

.value-display {
    width: 60px;
    text-align: center;
    padding: 2px;
}

.style-buttons,
.align-buttons {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
}

button {
    padding: 8px 12px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

button:hover {
    background: #2980b9;
}

button.active {
    background: #2c3e50;
}

.editor-container {
    flex: 1;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.editor {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
    min-height: 500px;
    outline: none;
    background-size: cover;
    background-position: center;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        padding: 10px;
    }

    .sidebar {
        flex: none;
        width: 100%;
        max-height: none;
    }

    .editor-container {
        min-height: 400px;
    }

    .editor {
        padding: 20px;
    }
}

/* Spectrum颜色选择器自定义样式 */
.sp-container {
    border: none;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.sp-picker-container {
    border: none;
}

.color-picker {
    width: 100%;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* 长图切分样式 */
.ratio-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ratio-inputs input {
    width: 60px;
    text-align: center;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.ratio-inputs span {
    font-weight: bold;
    color: #666;
}

.split-preview-container {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.split-preview-container h4 {
    margin-bottom: 10px;
    color: #2c3e50;
    font-size: 0.95em;
}

.split-preview-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.split-preview-item {
    position: relative;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
}

.split-preview-item img {
    width: 100%;
    display: block;
}

.split-preview-label {
    position: absolute;
    top: 4px;
    left: 4px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: bold;
}

#splitPreviewBtn,
#splitExportBtn {
    width: 100%;
    margin-bottom: 5px;
}

#splitPreviewBtn {
    background: #27ae60;
}

#splitPreviewBtn:hover {
    background: #219a52;
}

#splitExportBtn {
    background: #e67e22;
}

#splitExportBtn:hover {
    background: #d35400;
}