/**
 * 用户图库样式
 */

/* 图库区域 */
.gallery-section {
    margin-top: 2rem;
}

.gallery-header {
    margin-bottom: 2rem;
}

.gallery-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.gallery-stats {
    margin-left: auto;
    color: var(--text-secondary);
    font-weight: 500;
}

/* 图库网格 */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.gallery-item {
    position: relative;
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    cursor: pointer;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.gallery-item.selected {
    border: 3px solid var(--primary-color);
    transform: translateY(-2px);
}

.gallery-item-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.gallery-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

.gallery-item-checkbox {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 20px;
    height: 20px;
    accent-color: var(--primary-color);
    z-index: 2;
}

.gallery-item-actions {
    display: flex;
    gap: 0.5rem;
}

.gallery-item-actions .btn {
    padding: 0.5rem;
    min-width: auto;
    border-radius: 50%;
}

.gallery-item-info {
    padding: 1rem;
}

.gallery-item-name {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gallery-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.gallery-item-size {
    font-weight: 500;
}

.gallery-item-date {
    opacity: 0.8;
}

/* 上传区域 */
.upload-area {
    margin-bottom: 2rem;
}

.upload-placeholder {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-placeholder:hover {
    border-color: var(--primary-color);
    background: var(--primary-color-light);
}

.upload-placeholder.dragover {
    border-color: var(--primary-color);
    background: var(--primary-color-light);
    transform: scale(1.02);
}

.upload-placeholder i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: block;
}

.upload-placeholder h4 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.upload-placeholder p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* 预览区域 */
.upload-preview {
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.preview-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: var(--card-bg);
    box-shadow: var(--shadow-sm);
}

.preview-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

.preview-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--danger-color);
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.preview-remove:hover {
    background: var(--danger-color);
    color: white;
}

.preview-info {
    padding: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: center;
}

.upload-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .gallery-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .gallery-stats {
        margin-left: 0;
        text-align: center;
    }
    
    .preview-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .upload-placeholder {
        padding: 2rem 1rem;
    }
    
    .upload-placeholder i {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .gallery-item-image {
        height: 120px;
    }
    
    .upload-actions {
        flex-direction: column;
    }
}

/* 加载动画 */
.gallery-item.uploading {
    opacity: 0.6;
    pointer-events: none;
}

.gallery-item.uploading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 3px solid var(--primary-color-light);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* 选择状态指示 */
.gallery-item.selected .gallery-item-checkbox {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.gallery-item.selected .gallery-item-overlay {
    opacity: 0.3;
    background: var(--primary-color);
}

/* 批量操作提示 */
.batch-hint {
    background: var(--info-color-light);
    border: 1px solid var(--info-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.batch-hint i {
    color: var(--info-color);
}

.batch-hint-text {
    color: var(--text-primary);
    font-size: 0.9rem;
}