/* ========== 统一媒体选择器样式 ========== */
/* 支持图片、视频、文件三种类型，通过data属性动态切换主题 */

#zfve_unified_picker {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    animation: zfveUnifiedFadeIn 0.3s ease;
}

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

/* 遮罩层 - 根据类型动态改变颜色 */
.zfve-unified-picker-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    backdrop-filter: blur(8px);
    transition: background-color 0.3s ease;
}

/* 图片类型 - 紫色 */
#zfve_unified_picker[data-type="image"] .zfve-unified-picker-backdrop {
    background: rgba(102, 126, 234, 0.5);
}

/* 视频类型 - 绿色 */
#zfve_unified_picker[data-type="video"] .zfve-unified-picker-backdrop {
    background: rgba(76, 175, 80, 0.5);
}

/* 文件类型 - 橙色 */
#zfve_unified_picker[data-type="file"] .zfve-unified-picker-backdrop {
    background: rgba(255, 152, 0, 0.5);
}

.zfve-unified-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: zfveUnifiedModalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* 头部 - 动态渐变 */
.zfve-unified-picker-header {
    padding: 24px 30px;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: relative;
    transition: background 0.3s ease;
}

/* 图片类型头部 */
#zfve_unified_picker[data-type="image"] .zfve-unified-picker-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* 视频类型头部 */
#zfve_unified_picker[data-type="video"] .zfve-unified-picker-header {
    background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%);
}

/* 文件类型头部 */
#zfve_unified_picker[data-type="file"] .zfve-unified-picker-header {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
}

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

.zfve-unified-picker-header h2 i {
    font-size: 28px;
    color: #FFE082;
}

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

.zfve-unified-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;
}

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

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

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

.zfve-unified-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;
}

.zfve-unified-picker-search input:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

/* 图片类型搜索框 */
#zfve_unified_picker[data-type="image"] .zfve-unified-picker-search input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

/* 视频类型搜索框 */
#zfve_unified_picker[data-type="video"] .zfve-unified-picker-search input:focus {
    border-color: #4CAF50;
    box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.1);
}

/* 文件类型搜索框 */
#zfve_unified_picker[data-type="file"] .zfve-unified-picker-search input:focus {
    border-color: #FF9800;
    box-shadow: 0 0 0 4px rgba(255, 152, 0, 0.1);
}

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

.zfve-unified-picker-upload-btn {
    padding: 12px 24px;
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 图片类型上传按钮 */
#zfve_unified_picker[data-type="image"] .zfve-unified-picker-upload-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
}

#zfve_unified_picker[data-type="image"] .zfve-unified-picker-upload-btn:hover {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
    transform: translateY(-2px);
}

/* 视频类型上传按钮 */
#zfve_unified_picker[data-type="video"] .zfve-unified-picker-upload-btn {
    background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.35);
}

#zfve_unified_picker[data-type="video"] .zfve-unified-picker-upload-btn:hover {
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.5);
    transform: translateY(-2px);
}

/* 文件类型上传按钮 */
#zfve_unified_picker[data-type="file"] .zfve-unified-picker-upload-btn {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.35);
}

#zfve_unified_picker[data-type="file"] .zfve-unified-picker-upload-btn:hover {
    box-shadow: 0 6px 20px rgba(255, 152, 0, 0.5);
    transform: translateY(-2px);
}

/* 上传进度 */
.zfve-unified-picker-upload-progress {
    padding: 15px 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    display: none;
}

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

.zfve-unified-picker-progress-fill {
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

/* 图片类型进度条 */
#zfve_unified_picker[data-type="image"] .zfve-unified-picker-progress-fill {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

/* 视频类型进度条 */
#zfve_unified_picker[data-type="video"] .zfve-unified-picker-progress-fill {
    background: linear-gradient(90deg, #4CAF50 0%, #388E3C 100%);
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

/* 文件类型进度条 */
#zfve_unified_picker[data-type="file"] .zfve-unified-picker-progress-fill {
    background: linear-gradient(90deg, #FF9800 0%, #F57C00 100%);
    box-shadow: 0 0 10px rgba(255, 152, 0, 0.5);
}

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

/* 网格布局 */
.zfve-unified-picker-grid {
    display: grid;
    gap: 20px;
    min-height: 300px;
}

/* 图片类型 - 正方形网格 */
#zfve_unified_picker[data-type="image"] .zfve-unified-picker-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}

/* 视频类型 - 16:9卡片 */
#zfve_unified_picker[data-type="video"] .zfve-unified-picker-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* 文件类型 - 横向卡片 */
#zfve_unified_picker[data-type="file"] .zfve-unified-picker-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* 通用项目样式 */
.zfve-unified-picker-item {
    position: relative;
    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);
    border: 2px solid transparent;
}

.zfve-unified-picker-item:hover {
    transform: translateY(-5px);
    z-index: 10;
}

/* 图片类型悬停 */
#zfve_unified_picker[data-type="image"] .zfve-unified-picker-item:hover {
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

/* 视频类型悬停 */
#zfve_unified_picker[data-type="video"] .zfve-unified-picker-item:hover {
    box-shadow: 0 8px 20px rgba(76, 175, 80, 0.3);
}

/* 文件类型悬停 */
#zfve_unified_picker[data-type="file"] .zfve-unified-picker-item:hover {
    box-shadow: 0 8px 20px rgba(255, 152, 0, 0.3);
}

/* 选中状态 */
.zfve-unified-picker-item.selected {
    transform: translateY(-3px);
}

/* 图片类型选中 */
#zfve_unified_picker[data-type="image"] .zfve-unified-picker-item.selected {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2), 0 8px 20px rgba(102, 126, 234, 0.4);
}

/* 视频类型选中 */
#zfve_unified_picker[data-type="video"] .zfve-unified-picker-item.selected {
    border-color: #4CAF50;
    box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.2), 0 8px 20px rgba(76, 175, 80, 0.4);
}

/* 文件类型选中 */
#zfve_unified_picker[data-type="file"] .zfve-unified-picker-item.selected {
    border-color: #FF9800;
    box-shadow: 0 0 0 4px rgba(255, 152, 0, 0.2), 0 8px 20px rgba(255, 152, 0, 0.4);
}

/* 选中标记 */
.zfve-unified-picker-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;
    z-index: 5;
}

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

.zfve-unified-picker-item.selected .zfve-unified-picker-check {
    opacity: 1;
    border-color: white;
    transform: scale(1.1);
}

/* 图片类型选中标记 */
#zfve_unified_picker[data-type="image"] .zfve-unified-picker-item.selected .zfve-unified-picker-check {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* 视频类型选中标记 */
#zfve_unified_picker[data-type="video"] .zfve-unified-picker-item.selected .zfve-unified-picker-check {
    background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%);
}

/* 文件类型选中标记 */
#zfve_unified_picker[data-type="file"] .zfve-unified-picker-item.selected .zfve-unified-picker-check {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
}

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

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

/* 图片特定样式 */
.zfve-unified-picker-image {
    aspect-ratio: 1;
    background: #f8f9fa;
}

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

.zfve-unified-picker-item:hover .zfve-unified-picker-image img {
    transform: scale(1.05);
}

/* 视频特定样式 */
.zfve-unified-picker-video {
    padding-bottom: 56.25%; /* 16:9 */
    position: relative;
    background: #1a1a1a;
}

.zfve-unified-picker-video video,
.zfve-unified-picker-video img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.zfve-unified-picker-video-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    pointer-events: none;
}

.zfve-unified-picker-item:hover .zfve-unified-picker-video-play {
    background: rgba(76, 175, 80, 0.9);
    transform: translate(-50%, -50%) scale(1.1);
}

.zfve-unified-picker-video-play i {
    color: white;
    font-size: 24px;
    margin-left: 4px;
}

/* 文件特定样式 */
.zfve-unified-picker-file {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    background: #f8f9fa;
}

.zfve-unified-picker-file-icon {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 28px;
    color: white;
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
}

.zfve-unified-picker-file-info {
    flex: 1;
    min-width: 0;
}

.zfve-unified-picker-file-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.zfve-unified-picker-file-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: #6c757d;
}

/* 底部 */
.zfve-unified-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;
}

.zfve-unified-picker-pagination {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

/* 图片类型分页按钮 */
#zfve_unified_picker[data-type="image"] .zfve-unified-picker-page-btn {
    color: #667eea;
}

#zfve_unified_picker[data-type="image"] .zfve-unified-picker-page-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* 视频类型分页按钮 */
#zfve_unified_picker[data-type="video"] .zfve-unified-picker-page-btn {
    color: #4CAF50;
}

#zfve_unified_picker[data-type="video"] .zfve-unified-picker-page-btn:hover {
    background: #4CAF50;
    color: white;
    border-color: #4CAF50;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

/* 文件类型分页按钮 */
#zfve_unified_picker[data-type="file"] .zfve-unified-picker-page-btn {
    color: #FF9800;
}

#zfve_unified_picker[data-type="file"] .zfve-unified-picker-page-btn:hover {
    background: #FF9800;
    color: white;
    border-color: #FF9800;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

.zfve-unified-picker-page-btn:hover {
    transform: translateY(-2px);
}

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

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

.zfve-unified-picker-confirm-btn {
    padding: 12px 32px;
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* 图片类型确认按钮 */
#zfve_unified_picker[data-type="image"] .zfve-unified-picker-confirm-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
}

#zfve_unified_picker[data-type="image"] .zfve-unified-picker-confirm-btn:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

/* 视频类型确认按钮 */
#zfve_unified_picker[data-type="video"] .zfve-unified-picker-confirm-btn {
    background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.35);
}

#zfve_unified_picker[data-type="video"] .zfve-unified-picker-confirm-btn:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.5);
}

/* 文件类型确认按钮 */
#zfve_unified_picker[data-type="file"] .zfve-unified-picker-confirm-btn {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.35);
}

#zfve_unified_picker[data-type="file"] .zfve-unified-picker-confirm-btn:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(255, 152, 0, 0.5);
}

.zfve-unified-picker-confirm-btn:hover:not(:disabled) {
    transform: translateY(-2px);
}

.zfve-unified-picker-confirm-btn:disabled {
    background: #e9ecef;
    color: #adb5bd;
    cursor: not-allowed;
    box-shadow: none;
}

.zfve-unified-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;
}

.zfve-unified-picker-cancel-btn:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
}

/* 图片类型取消按钮 */
#zfve_unified_picker[data-type="image"] .zfve-unified-picker-cancel-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

/* 视频类型取消按钮 */
#zfve_unified_picker[data-type="video"] .zfve-unified-picker-cancel-btn:hover {
    border-color: #4CAF50;
    color: #4CAF50;
}

/* 文件类型取消按钮 */
#zfve_unified_picker[data-type="file"] .zfve-unified-picker-cancel-btn:hover {
    border-color: #FF9800;
    color: #FF9800;
}

/* 加载/空/错误状态 */
.zfve-unified-picker-loading,
.zfve-unified-picker-empty,
.zfve-unified-picker-error {
    text-align: center;
    padding: 80px 20px;
    color: #6c757d;
}

.zfve-unified-picker-loading i,
.zfve-unified-picker-empty i,
.zfve-unified-picker-error i {
    font-size: 64px;
    margin-bottom: 20px;
    display: block;
}

/* 响应式 */
@media (max-width: 768px) {
    .zfve-unified-picker-modal {
        width: 95%;
        max-height: 95vh;
    }
    
    .zfve-unified-picker-header {
        padding: 20px;
    }
    
    .zfve-unified-picker-header h2 {
        font-size: 20px;
    }
    
    .zfve-unified-picker-toolbar,
    .zfve-unified-picker-content,
    .zfve-unified-picker-footer {
        padding: 15px;
    }
    
    .zfve-unified-picker-footer {
        flex-direction: column;
    }
    
    .zfve-unified-picker-pagination {
        width: 100%;
        justify-content: center;
    }
    
    .zfve-unified-picker-actions {
        width: 100%;
    }
    
    .zfve-unified-picker-confirm-btn,
    .zfve-unified-picker-cancel-btn {
        flex: 1;
    }
}

/* ========== 删除按钮样式 ========== */
.zfve-unified-picker-delete-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(244, 67, 54, 0.9);
    color: white;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s ease;
    z-index: 3;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.zfve-unified-picker-delete-btn:hover {
    background: #d32f2f;
    transform: scale(1);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.4);
}

.zfve-unified-picker-delete-btn:active {
    transform: scale(0.95);
}

/* 鼠标悬停时显示删除按钮 */
.zfve-unified-picker-item:hover .zfve-unified-picker-delete-btn {
    opacity: 1;
    transform: scale(1);
}

/* 删除按钮中的图标 */
.zfve-unified-picker-delete-btn i {
    pointer-events: none;
}

/* 删除中状态 */
.zfve-unified-picker-delete-btn:disabled {
    background: #999;
    cursor: not-allowed;
    opacity: 1;
}

/* 通知消息动画 */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.zfve-notice {
    animation: slideInRight 0.3s ease;
}

