/* ========================================
   图片画廊样式
   ======================================== */

.gallery-section {
    padding: 80px 0;
    background: #fafafa;
}

/* 画廊网格布局 */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 60px;
}

/* 画廊项目 */
.gallery-item {
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.gallery-item:nth-child(1) { animation-delay: 0.1s; }
.gallery-item:nth-child(2) { animation-delay: 0.2s; }
.gallery-item:nth-child(3) { animation-delay: 0.3s; }
.gallery-item:nth-child(4) { animation-delay: 0.4s; }
.gallery-item:nth-child(5) { animation-delay: 0.5s; }
.gallery-item:nth-child(6) { animation-delay: 0.6s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 画廊卡片 */
.gallery-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.gallery-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(234, 85, 22, 0.2);
}

/* 图片容器 */
.gallery-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 80%; /* 5:4 宽高比 */
    overflow: hidden;
    background: #f5f5f5;
}

.gallery-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
}

.gallery-card:hover .gallery-image {
    transform: scale(1.1);
}

/* 遮罩层 */
.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(234, 85, 22, 0.7) 0%, rgba(255, 107, 53, 0.7) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-card:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay-content {
    display: flex;
    gap: 15px;
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-card:hover .gallery-overlay-content {
    transform: translateY(0);
}

/* 按钮样式 */
.gallery-zoom-btn,
.gallery-link-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    color: #EA5516;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.gallery-zoom-btn:hover,
.gallery-link-btn:hover {
    background: #ffffff;
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
}

.gallery-zoom-btn:active,
.gallery-link-btn:active {
    transform: scale(1.05);
}

/* 图片信息 */
.gallery-info {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.gallery-title {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
    line-height: 1.4;
    transition: color 0.3s ease;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.gallery-card:hover .gallery-title {
    color: #EA5516;
}

.gallery-desc {
    font-size: 14px;
    color: #7f8c8d;
    line-height: 1.6;
    margin: 0;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

/* ========================================
   Lightbox 弹窗样式
   ======================================== */

.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 20px;
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-container {
    position: relative;
    max-width: 1400px;
    width: 100%;
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.lightbox-overlay.active .lightbox-container {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10001;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(90deg) scale(1.1);
}

.lightbox-content {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-image {
    width: 100%;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
    display: block;
    background: #000;
}

.lightbox-caption {
    padding: 25px 30px;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    text-align: center;
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
    border-top: 3px solid #EA5516;
}

/* ========================================
   响应式设计
   ======================================== */

@media (max-width: 1200px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

@media (max-width: 992px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .gallery-section {
        padding: 60px 0;
    }
}

@media (max-width: 768px) {
    .gallery-section {
        padding: 40px 0;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-bottom: 40px;
    }
    
    .gallery-info {
        padding: 15px;
    }
    
    .gallery-title {
        font-size: 15px;
    }
    
    .gallery-zoom-btn,
    .gallery-link-btn {
        width: 45px;
        height: 45px;
        font-size: 16px;
    }
    
    .lightbox-close {
        width: 40px;
        height: 40px;
        top: 10px;
        right: 10px;
        font-size: 20px;
    }
    
    .lightbox-image {
        max-height: 70vh;
    }
    
    .lightbox-caption {
        padding: 20px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .gallery-section {
        padding: 30px 0;
    }
    
    .gallery-card {
        border-radius: 8px;
    }
    
    .gallery-info {
        padding: 12px;
    }
    
    .gallery-title {
        font-size: 14px;
    }
    
    .gallery-overlay-content {
        gap: 12px;
    }
    
    .gallery-zoom-btn,
    .gallery-link-btn {
        width: 42px;
        height: 42px;
        font-size: 15px;
    }
    
    .lightbox-caption {
        padding: 15px;
        font-size: 14px;
    }
}

/* 防止页面滚动 */
body.lightbox-active {
    overflow: hidden;
}

