/* 抠图工具专用样式 */

#uploadArea {
    border: 2px dashed #e5e6eb;
    border-radius: 12px;
    padding: 50px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 20px;
    background: #fff;
}

#uploadArea:hover {
    border-color: #00d4ff;
    background: rgba(0, 212, 255, 0.03);
}

#uploadArea .upload-icon {
    font-size: 56px;
    margin-bottom: 16px;
}

#uploadArea h3 {
    font-size: 16px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

#uploadArea p {
    font-size: 13px;
    color: #999;
    margin-bottom: 24px;
}

#uploadArea .upload-btn {
    background: linear-gradient(135deg, #00d4ff 0%, #0099ff 100%);
    border: none;
    color: white;
    padding: 12px 40px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

#uploadArea .upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.4);
}

#fileInput {
    display: none;
}

#previewSection {
    border: 2px dashed #00d4ff;
    border-radius: 12px;
    padding: 20px;
    background: #fff;
    position: relative;
}

#previewSection .close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #ff4d4d;
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}

#previewSection .close-btn:hover {
    background: #ff3333;
    transform: scale(1.1);
}

.preview-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.preview-item {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 10px;
    padding: 16px;
    border: 1px solid #e5e6eb;
}

.preview-label {
    font-size: 14px;
    color: #666;
    font-weight: 600;
    margin-bottom: 12px;
    text-align: center;
}

.zoom-hint {
    font-size: 12px;
    color: #999;
    font-weight: 400;
}

.preview-item img,
.preview-item canvas {
    max-width: 100%;
    max-height: 350px;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
    background: repeating-conic-gradient(#f0f0f0 0% 25%, #ffffff 0% 50%) 50% / 20px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    cursor: zoom-in;
    transition: transform 0.3s;
}

.preview-item img:hover,
.preview-item canvas:hover {
    transform: scale(1.02);
}

.zoom-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.zoom-modal.show {
    display: flex;
}

.zoom-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background: #fff;
    border-radius: 12px;
    padding: 20px;
}

.zoom-close-btn {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #ff4d4d;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 10;
}

.zoom-close-btn:hover {
    background: #ff3333;
    transform: scale(1.1);
}

.zoom-image-container {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    max-height: 85vh;
    overflow: auto;
}

.zoom-image-container img {
    max-width: 100%;
    max-height: 85vh;
    display: block;
    border-radius: 8px;
    background: repeating-conic-gradient(#f0f0f0 0% 25%, #ffffff 0% 50%) 50% / 20px 20px;
}

.zoom-compare-container {
    display: flex;
    gap: 0;
    max-width: 100%;
    max-height: 85vh;
    overflow: hidden;
}

.zoom-compare-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.zoom-compare-label {
    text-align: center;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    background: #f8f9fa;
    border-bottom: 1px solid #e5e6eb;
}

.zoom-compare-item img {
    flex: 1;
    max-width: 100%;
    max-height: calc(85vh - 60px);
    object-fit: contain;
    display: block;
    background: repeating-conic-gradient(#f0f0f0 0% 25%, #ffffff 0% 50%) 50% / 20px 20px;
}

.zoom-compare-divider {
    width: 2px;
    background: #e5e6eb;
}

.status-bar {
    background: #dcfce7;
    border-radius: 8px;
    padding: 12px 20px;
    margin-top: 16px;
    text-align: center;
    font-size: 14px;
    color: #166534;
    font-weight: 500;
}

.status-bar.error {
    background: #fee2e2;
    color: #dc2626;
}

.status-bar.info {
    background: #dbeafe;
    color: #1e40af;
}

.progress-container {
    margin-top: 16px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #f0f1f5;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-inner {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.3s;
}

.settings-area {
    margin-top: 24px;
    background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
    border: 1px solid #f0f1f5;
}

.settings-area h3 {
    font-size: 15px;
    color: #222;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 2px solid #f0f1f5;
    position: relative;
}

.settings-area h3::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 30px;
    height: 2px;
    background: linear-gradient(135deg, #00d4ff 0%, #0099ff 100%);
    border-radius: 2px;
}

.settings-row {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

.settings-row label {
    font-size: 14px;
    color: #555;
    min-width: 100px;
    font-weight: 500;
}

.settings-row input[type="range"] {
    flex: 1;
    min-width: 200px;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #e5e6eb;
    border-radius: 3px;
    cursor: pointer;
}

.settings-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    cursor: pointer;
}

.settings-row span.value {
    min-width: 45px;
    text-align: right;
    font-weight: 600;
    color: #667eea;
    font-size: 14px;
}

.bg-color-display {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(34, 197, 94, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.bg-color-display span.label {
    font-size: 13px;
    color: #666;
}

.bg-color-display span.value {
    font-size: 13px;
    color: #22c55e;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.bg-options {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

.bg-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.bg-option:hover {
    background: rgba(102, 126, 234, 0.08);
}

.bg-option.active {
    background: rgba(102, 126, 234, 0.12);
    border-color: #667eea;
}

.bg-swatch {
    width: 44px;
    height: 44px;
    border-radius: 10px;
}

.bg-swatch.checkered {
    background: repeating-conic-gradient(#f0f0f0 0% 25%, #ffffff 0% 50%) 50% / 16px 16px;
    border: 1px solid #e0e0e0;
}

.bg-option span {
    font-size: 13px;
    color: #555;
    font-weight: 500;
}

.settings-row input[type="color"] {
    width: 50px;
    height: 36px;
    padding: 2px;
    border: 2px solid #e5e6eb;
    border-radius: 8px;
    cursor: pointer;
}

.toggle-row {
    justify-content: space-between;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 28px;
}

.toggle-switch .slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

.toggle-switch input:checked + .slider {
    background-color: #667eea;
}

.toggle-switch input:checked + .slider:before {
    transform: translateX(24px);
}

#zoomModalContent.edit-mode {
    max-width: 1000px;
    height: 80vh;
    max-height: 700px;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.zoom-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e5e6eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.zoom-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1d2129;
}

.zoom-modal-actions {
    display: flex;
    gap: 10px;
}

.btn-small {
    padding: 6px 16px;
    font-size: 14px;
}

.btn-secondary {
    background: #f7f8fa;
    color: #4e5969;
    border: 1px solid #e5e6eb;
}

.btn-secondary:hover {
    background: #e5e6eb;
}

.zoom-modal-body {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.edit-image-container {
    flex: 1;
    background: repeating-conic-gradient(#f0f0f0 0% 25%, #ffffff 0% 50%) 50% / 20px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    padding: 20px;
}

.edit-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.edit-sidebar {
    width: 260px;
    background: #f7f8fa;
    padding: 20px;
    border-left: 1px solid #e5e6eb;
    overflow-y: auto;
}

.edit-section {
    margin-bottom: 24px;
}

.edit-section h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #1d2129;
    font-weight: 600;
}

.edit-sidebar .settings-row {
    margin-bottom: 12px;
}

.edit-sidebar .bg-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.edit-sidebar .bg-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
    width: calc(25% - 6px);
    min-width: 60px;
}

.edit-sidebar .bg-option:hover {
    background: rgba(102, 126, 234, 0.08);
}

.edit-sidebar .bg-option.active {
    background: rgba(102, 126, 234, 0.12);
    border-color: #667eea;
}

.edit-sidebar .bg-swatch {
    width: 32px;
    height: 32px;
    border-radius: 6px;
}

.edit-sidebar .bg-swatch.checkered {
    background: repeating-conic-gradient(#f0f0f0 0% 25%, #ffffff 0% 50%) 50% / 10px 10px;
    border: 1px solid #e0e0e0;
}

.edit-sidebar .bg-option span {
    font-size: 12px;
    color: #555;
}

@media (max-width: 768px) {
    .preview-container {
        grid-template-columns: 1fr;
    }
}
