/* 图片上传弹框样式 */

.image-upload-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.image-upload-modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.image-upload-modal .modal-content {
    position: relative;
    width: 100%;
    max-width: 500px;
    background: white;
    border-radius: 16px;
    z-index: 1;
    animation: modalSlideUp 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

@keyframes modalSlideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.image-upload-modal .modal-close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 40px;
    height: 40px;
    background: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #ec4899;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 10;
}

.image-upload-modal .modal-close:hover {
    background: #ec4899;
    color: white;
    transform: rotate(90deg) scale(1.1);
}

.upload-modal-container {
    padding: 40px 30px;
}

.upload-modal-title {
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.upload-modal-title i {
    color: #667eea;
    font-size: 28px;
}

.upload-modal-description {
    color: #6b7280;
    margin-bottom: 30px;
    line-height: 1.6;
    font-size: 14px;
}

.upload-content-wrapper {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.upload-area {
    flex: 1;
    border: 3px dashed #d1d5db;
    border-radius: 12px;
    padding: 50px 30px;
    text-align: center;
    background: #f9fafb;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover {
    border-color: #667eea;
    background: #f3f4f6;
    transform: translateY(-2px);
}

.upload-area.dragover {
    border-color: #667eea;
    background: #eef2ff;
    transform: scale(1.02);
}

.upload-icon {
    font-size: 64px;
    color: #667eea;
    margin-bottom: 20px;
}

.upload-text {
    font-size: 16px;
    color: #374151;
    margin-bottom: 8px;
    font-weight: 600;
}

.upload-hint {
    font-size: 13px;
    color: #9ca3af;
}

.preview-container {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.preview-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 3px solid #e5e7eb;
    display: block;
    margin: 0 auto;
}

.preview-actions {
    display: flex;
    gap: 12px;
    width: 100%;
    justify-content: center;
}

.btn-change {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-change:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-change:active {
    transform: translateY(0);
}

.btn-upload {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px 35px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-upload:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-upload:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 上传进度条样式 */
.upload-progress-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    align-items: center;
}

.upload-progress-text {
    font-size: 14px;
    font-weight: 600;
    color: white;
}

.upload-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.upload-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #667eea 100%);
    background-size: 200% 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
    animation: progressShine 1.5s linear infinite;
}

@keyframes progressShine {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.upload-progress-percent {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    min-width: 35px;
    text-align: center;
}

.error-message {
    background: #fef2f2;
    border: 2px solid #fca5a5;
    color: #991b1b;
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 20px;
    display: none;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.error-message i {
    font-size: 18px;
}

/* 参考图样式 */
.example-image-container {
    width: 120px;
    flex-shrink: 0;
    text-align: center;
}

.example-label {
    font-size: 12px;
    color: #667eea;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.example-label i {
    font-size: 14px;
}

.example-image {
    width: 100%;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 8px;
}

.example-hint {
    font-size: 11px;
    color: #9ca3af;
    line-height: 1.4;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .image-upload-modal {
        padding: 20px 10px;
    }
    
    .image-upload-modal .modal-content {
        max-width: 100%;
        border-radius: 12px;
    }
    
    .upload-modal-container {
        padding: 30px 15px;
    }
    
    .upload-modal-title {
        font-size: 18px;
    }
    
    .upload-modal-title i {
        font-size: 22px;
    }
    
    .upload-modal-description {
        font-size: 13px;
        margin-bottom: 20px;
    }
    
    /* 保持左右布局 */
    .upload-content-wrapper {
        flex-direction: row;
        gap: 10px;
    }
    
    /* 缩小参考图 */
    .example-image-container {
        width: 90px;
        flex-shrink: 0;
    }
    
    .example-label {
        font-size: 10px;
        margin-bottom: 6px;
    }
    
    .example-label i {
        font-size: 11px;
    }
    
    .example-hint {
        font-size: 9px;
    }
    
    .upload-area {
        padding: 30px 15px;
        flex: 1;
    }
    
    .upload-icon {
        font-size: 40px;
        margin-bottom: 15px;
    }
    
    .upload-text {
        font-size: 14px;
    }
    
    .upload-hint {
        font-size: 11px;
    }
    
    .example-label.md\:hidden {
        display: none;
    }
}
