/* ========== 自定义图片选择器样式 ========== */
#ardata_custom_image_picker {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    animation: fadeIn 0.3s ease;
}

/* 单选模式样式优化 */
#ardata_custom_image_picker[data-mode="single"] .ardata-picker-item {
    cursor: pointer;
}

#ardata_custom_image_picker[data-mode="single"] .ardata-picker-item.selected {
    transform: scale(0.98);
}

#ardata_custom_image_picker[data-mode="single"] .ardata-picker-item.selected::after {
    content: '已选择';
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(16, 185, 129, 0.95);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    z-index: 3;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

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

.ardata-picker-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(102, 126, 234, 0.5);
    backdrop-filter: blur(8px);
}

.ardata-picker-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    background: white;
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideIn {
    from {
        transform: translate(-50%, -48%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%);
        opacity: 1;
    }
}

/* 头部 */
.ardata-picker-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 24px 30px;
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
    position: relative;
}

.ardata-picker-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.ardata-picker-header h2 i {
    font-size: 28px;
    color: #ffd54f;
}

.ardata-picker-header p {
    margin: 8px 0 0 0;
    font-size: 14px;
    opacity: 0.95;
}

.ardata-picker-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ardata-picker-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1) rotate(90deg);
}

/* 工具栏 */
.ardata-picker-toolbar {
    padding: 20px 30px;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.ardata-picker-search {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.ardata-picker-search input {
    width: 100%;
    padding: 12px 20px 12px 45px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
}

.ardata-picker-search input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    outline: none;
}

.ardata-picker-search i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
    font-size: 16px;
}

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

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

.ardata-picker-upload-btn i {
    font-size: 16px;
}

/* 上传进度 */
#ardata_picker_upload_progress {
    display: none;
    padding: 15px 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.ardata-picker-progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

#ardata_picker_progress_bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

/* 内容区域 */
.ardata-picker-content {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

/* 图片网格 */
#ardata_custom_picker_grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    min-height: 300px;
}

.ardata-picker-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ardata-picker-item:hover {
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
    z-index: 10;
}

.ardata-picker-item-inner {
    position: relative;
    width: 100%;
    height: 100%;
    background: #f8f9fa;
}

.ardata-picker-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.ardata-picker-item:hover img {
    transform: scale(1.05);
}

/* 选中标记 */
.ardata-picker-item-check {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.9);
    border: 3px solid #e9ecef;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0;
}

.ardata-picker-item:hover .ardata-picker-item-check {
    opacity: 1;
}

.ardata-picker-item.selected .ardata-picker-item-check {
    opacity: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: white;
    transform: scale(1.1);
}

.ardata-picker-item-check i {
    color: #adb5bd;
    font-size: 16px;
    font-weight: bold;
}

.ardata-picker-item.selected .ardata-picker-item-check i {
    color: white;
}

.ardata-picker-item.selected {
    box-shadow: 0 0 0 4px #667eea, 0 8px 20px rgba(102, 126, 234, 0.4);
}

/* 加载状态 */
.ardata-picker-loading,
.ardata-picker-empty,
.ardata-picker-error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: #6c757d;
}

.ardata-picker-loading i {
    font-size: 48px;
    color: #667eea;
    margin-bottom: 15px;
    display: block;
}

.ardata-picker-empty i {
    font-size: 64px;
    color: #dee2e6;
    margin-bottom: 20px;
    display: block;
}

.ardata-picker-empty p,
.ardata-picker-error p {
    font-size: 16px;
    margin: 0;
}

.ardata-picker-error i {
    font-size: 64px;
    color: #f44336;
    margin-bottom: 20px;
    display: block;
}

/* 底部按钮区 */
.ardata-picker-footer {
    padding: 20px 30px;
    background: #f8f9fa;
    border-top: 2px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

#ardata_picker_pagination {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ardata-picker-page-btn {
    padding: 10px 18px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #667eea;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.ardata-picker-page-info {
    font-size: 14px;
    color: #6c757d;
    font-weight: 500;
    padding: 0 8px;
}

.ardata-picker-actions {
    display: flex;
    gap: 12px;
}

#ardata_picker_confirm_btn {
    padding: 12px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
}

#ardata_picker_confirm_btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

#ardata_picker_confirm_btn:disabled {
    background: #e9ecef;
    color: #adb5bd;
    cursor: not-allowed;
    box-shadow: none;
}

#ardata_picker_cancel_btn {
    padding: 12px 32px;
    background: white;
    color: #6c757d;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#ardata_picker_cancel_btn:hover {
    background: #f8f9fa;
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-2px);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .ardata-picker-modal {
        width: 95%;
        max-height: 95vh;
    }
    
    .ardata-picker-header {
        padding: 20px;
    }
    
    .ardata-picker-header h2 {
        font-size: 20px;
    }
    
    .ardata-picker-toolbar,
    .ardata-picker-content,
    .ardata-picker-footer {
        padding: 15px;
    }
    
    #ardata_custom_picker_grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }
    
    .ardata-picker-footer {
        flex-direction: column;
    }
    
    #ardata_picker_pagination {
        width: 100%;
        justify-content: center;
    }
    
    .ardata-picker-actions {
        width: 100%;
    }
    
    #ardata_picker_confirm_btn,
    #ardata_picker_cancel_btn {
        flex: 1;
        padding: 12px 20px;
    }
}

