:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --success-color: #27ae60;
    --info-color: #17a2b8;
    --light-bg: #f8f9fa;
    --border-radius: 12px;
    --box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    padding: 2rem 1rem;
}

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

.header-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, #34495e 100%);
    color: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--box-shadow);
    border: none;
}

.header-card h1 {
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-size: 2rem;
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-card .subtitle {
    opacity: 0.9;
    font-size: 1rem;
    line-height: 1.6;
}

.warning-alert {
    background: #fff3cd;
    border: 2px solid var(--warning-color);
    border-radius: var(--border-radius);
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--box-shadow);
    display: flex;
    align-items: center;
}

.warning-alert .alert-icon {
    color: var(--danger-color);
    font-size: 1.5rem;
    margin-right: 15px;
    flex-shrink: 0;
}

/* 主内容区域 - 分栏布局 */
.main-content {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

/* 左侧图片预览区域 */
.preview-section {
    flex: 1;
    min-width: 0;
    /* 防止内容溢出 */
}

.preview-container {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.preview-header {
    margin-bottom: 1rem;
}

.preview-title {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.preview-title i {
    color: var(--secondary-color);
}

.canvas-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    border-radius: 8px;
    overflow: hidden;
    background: linear-gradient(45deg, #f8f9fa 25%, #e9ecef 25%, #e9ecef 50%, #f8f9fa 50%, #f8f9fa 75%, #e9ecef 75%, #e9ecef);
    background-size: 40px 40px;
    border: 2px dashed #dee2e6;
    transition: var(--transition);
    position: relative;
}

.canvas-wrapper.has-image {
    border: 2px solid white;
    background: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

canvas {
    display: block;
    max-width: 100%;
    max-height: 100%;
    cursor: pointer;
    transition: var(--transition);
}

canvas:hover {
    transform: scale(1.02);
}

.canvas-placeholder {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

.canvas-placeholder i {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: #adb5bd;
}

/* 右侧控制区域 */
.control-section {
    flex: 1;
    max-width: 500px;
    min-width: 400px;
}

.control-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--box-shadow);
    height: 100%;
    border: none;
}

/* 步骤指示器 */
.step-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1.5rem;
}

.step-number {
    background: var(--secondary-color);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: bold;
}

.step-title {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.1rem;
}

/* 表单控件 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-label i {
    color: var(--secondary-color);
    font-size: 1.1rem;
}

.form-control {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.25rem rgba(52, 152, 219, 0.25);
}

/* 文件上传样式 */
.file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
    width: 100%;
}

.file-input-btn {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #2980b9 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition);
    width: 100%;
}

.file-input-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-info {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: var(--light-bg);
    border-radius: 8px;
    border-left: 4px solid var(--info-color);
    display: none;
}

/* 滑块控件 */
.slider-group {
    margin-bottom: 1.5rem;
}

.slider-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.slider-value {
    font-weight: 600;
    color: var(--secondary-color);
    background: rgba(52, 152, 219, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    min-width: 60px;
    text-align: center;
}

.custom-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 10px;
    border-radius: 5px;
    background: linear-gradient(to right, #e9ecef, var(--secondary-color));
    outline: none;
}

.custom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--secondary-color);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
}

.custom-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: #2980b9;
}

.custom-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--secondary-color);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* 颜色选择器 */
.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
}

.color-preview {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    cursor: pointer;
}

.color-picker-wrapper input[type="color"] {
    flex: 1;
    height: 45px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
}

/* 复选框 */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1.5rem;
}

.custom-checkbox {
    position: relative;
    width: 20px;
    height: 20px;
    border: 2px solid var(--secondary-color);
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.custom-checkbox.checked {
    background: var(--secondary-color);
}

.custom-checkbox.checked::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 14px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* 按钮样式 */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    border: none;
    transition: var(--transition);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #2980b9 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #2ecc71 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* 按钮容器 */
.btn-container {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* 状态提示 */
.status-message {
    padding: 0.75rem;
    border-radius: 8px;
    margin-top: 1rem;
    display: none;
}

.status-message.success {
    background: rgba(39, 174, 96, 0.1);
    border-left: 4px solid var(--success-color);
    color: var(--success-color);
}

.status-message.error {
    background: rgba(231, 76, 60, 0.1);
    border-left: 4px solid var(--danger-color);
    color: var(--danger-color);
}

.status-message.info {
    background: rgba(23, 162, 184, 0.1);
    border-left: 4px solid var(--info-color);
    color: var(--info-color);
}

/* 信息框 */
.info-box {
    background: #e8f4fc;
    border-left: 4px solid var(--secondary-color);
    padding: 1.5rem;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.info-box h5 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .main-content {
        flex-direction: column;
    }

    .control-section {
        max-width: 100%;
        min-width: 0;
    }

    .canvas-wrapper {
        min-height: 300px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0.5rem;
    }

    .header-card,
    .preview-container,
    .control-card {
        padding: 1.5rem;
    }

    .header-card h1 {
        font-size: 1.6rem;
    }

    .btn-container {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 576px) {
    body {
        padding: 1rem 0.5rem;
    }

    .header-card {
        padding: 1.25rem;
    }

    .preview-container,
    .control-card {
        padding: 1rem;
    }

    .preview-title,
    .step-title {
        font-size: 1.2rem;
    }

    .color-picker-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .color-preview {
        width: 100%;
        height: 40px;
    }

    .canvas-wrapper {
        min-height: 250px;
    }
}