/* image-upload.css */
.image-upload-wrapper {
    width: 100%;
}

.upload-container {
    display: flex;
    align-items: center;
    border: 2px dashed #c0c4cc;
    border-radius: 6px;
    background-color: #f5f7fa;
    min-height: 150px;
    padding: 20px;
    transition: border-color 0.3s, background-color 0.3s;
}

.upload-container:hover {
    border-color: #409eff;
    background-color: #ecf5ff;
}

.upload-container.dragover {
    border-color: #409eff;
    background-color: #ecf5ff;
}

.preview-area {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 110px;
    padding-right: 20px;
    border-right: 1px solid #e0e0e0;
    margin-right: 20px;
    order: 1;
}

.upload-dropzone {
    position: relative;
    flex: 1;
    text-align: center;
    cursor: pointer;
    padding: 20px;
    min-height: 110px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    order: 2;
}

.upload-content {
    pointer-events: none;
}

.upload-icon {
    font-size: 36px;
    color: #909399;
    margin-bottom: 12px;
}

.upload-title {
    font-size: 14px;
    color: #606266;
    margin-bottom: 6px;
}

.upload-subtitle {
    font-size: 12px;
    color: #909399;
    line-height: 1.4;
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.preview-item {
    position: relative;
    width: 120px;
    height: 120px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    /*overflow: hidden;*/
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    background: #f56c6c;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    z-index: 10;
    border: 2px solid white;
}

.preview-remove:hover {
    background: #f78989;
}

.preview-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 2px 4px;
    font-size: 10px;
    text-align: center;
}

.upload-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #ebeef5;
}

.upload-progress-bar {
    height: 100%;
    background: #409eff;
    width: 0%;
    transition: width 0.3s;
}

.error-message {
    color: #f56c6c;
    font-size: 13px;
    margin-top: 8px;
    padding: 8px 12px;
    background: #fef0f0;
    border-radius: 4px;
    border-left: 4px solid #f56c6c;
}

.uploading .upload-title {
    color: #409eff;
}

/* 当有图片时调整上传区域样式 */
.has-preview .upload-dropzone {
    padding: 10px;
}

.has-preview .upload-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.has-preview .upload-title {
    font-size: 12px;
}

.has-preview .upload-subtitle {
    font-size: 10px;
}