/* ==========================================
   爆发富论坛 - 图库页面样式
   ========================================== */

/* 图库头部 */
.gallery-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #fff;
    padding: 48px 0;
    text-align: center;
}

.gallery-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.gallery-header p {
    font-size: 1rem;
    opacity: 0.9;
}

/* 图库容器 */
.gallery-container {
    padding: 32px 20px;
}

/* 图库筛选 */
.gallery-filter {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.gallery-filter button {
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    color: var(--text-secondary);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.gallery-filter button:hover {
    background: var(--primary-light);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.gallery-filter button.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* 图库网格 */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.gallery-item {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.gallery-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 3/2;
}

.gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.gallery-item:hover .gallery-image img {
    transform: scale(1.05);
}

.gallery-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 var(--transition-normal);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.btn-view {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #fff;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: transform var(--transition-fast);
}

.btn-view:hover {
    transform: scale(1.1);
}

.gallery-info {
    padding: 16px 20px;
}

.gallery-info h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.gallery-info p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.gallery-date {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.pagination a,
.pagination span {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.pagination a:hover {
    background: var(--primary-light);
    color: var(--primary-color);
}

.pagination a.active {
    background: var(--primary-color);
    color: #fff;
}

.pagination a.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.page-ellipsis {
    color: var(--text-muted);
}

/* 灯箱 */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.lightbox-caption {
    text-align: center;
    color: #fff;
    padding: 16px;
    font-size: 1rem;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast);
    z-index: 10;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-close {
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    font-size: 1.5rem;
}

.lightbox-prev,
.lightbox-next {
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

/* 响应式 */
@media screen and (max-width: 1199px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 767px) {
    .gallery-header h1 {
        font-size: 1.5rem;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-filter {
        gap: 6px;
    }
    
    .gallery-filter button {
        padding: 6px 14px;
        font-size: 0.875rem;
    }
    
    .lightbox-close {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }
    
    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
    }
}

@media screen and (max-width: 479px) {
    .gallery-header {
        padding: 32px 0;
    }
    
    .gallery-header h1 {
        font-size: 1.25rem;
    }
    
    .gallery-container {
        padding: 20px 16px;
    }
    
    .gallery-info {
        padding: 12px 16px;
    }
    
    .gallery-info h3 {
        font-size: 0.9375rem;
    }
    
    .gallery-info p {
        font-size: 0.8125rem;
    }
}
