/* 建筑展示轮播样式 */
.gallery-section {
    padding: 40px 0;
    background: transparent; /* 移除固定背景，使用统一背景系统 */
    margin: 30px 0;
    position: relative;
    z-index: 1;
}

/* 轮播容器背景 */
.gallery-container::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: -1;
}

.gallery-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 50px;
    position: relative;
}

.gallery-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(45deg, #3498db, #2980b9);
    border-radius: 2px;
}

.gallery-container {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    aspect-ratio: 16/9; /* 固定宽高比，确保一致性 */
}

.gallery-wrapper {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
    height: 100%;
}

.gallery-slide {
    min-width: 100%;
    flex-shrink: 0; /* 防止压缩 */
    position: relative;
    overflow: hidden;
    height: 100%;
}

.gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.3s ease;
}

.gallery-slide:hover img {
    transform: scale(1.05);
}

.slide-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
    padding: 30px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-slide:hover .slide-overlay {
    transform: translateY(0);
}

.slide-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.slide-description {
    font-size: 1rem;
    opacity: 0.9;
    line-height: 1.4;
}

/* 导航按钮 */
.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #2c3e50;
    transition: all 0.3s ease;
    z-index: 10;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.gallery-nav:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.gallery-nav.prev {
    left: 20px;
}

.gallery-nav.next {
    right: 20px;
}

/* 指示器 - 自适应布局 */
.gallery-indicators {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 30px;
    flex-wrap: wrap; /* 支持多行显示，适应大量图片 */
    max-width: 100%;
    padding: 0 20px;
}

.indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(52, 152, 219, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    flex-shrink: 0; /* 防止压缩 */
    position: relative;
}

.indicator.active {
    background: var(--primary-color);
    transform: scale(1.3);
    border-color: rgba(52, 152, 219, 0.3);
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.5);
}

.indicator:hover {
    background: var(--secondary-color);
    transform: scale(1.2);
}

/* 当指示器数量较多时的样式调整 */
.gallery-indicators:has(.indicator:nth-child(n+6)) .indicator {
    width: 8px;
    height: 8px;
    gap: 6px;
}

.gallery-indicators:has(.indicator:nth-child(n+10)) .indicator {
    width: 6px;
    height: 6px;
    gap: 4px;
}

/* 自动播放控制 */
.gallery-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
}

.play-pause-btn {
    background: linear-gradient(45deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.play-pause-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.gallery-info {
    color: #7f8c8d;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 加载状态 */
.gallery-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 500px;
    background: #f8f9fa;
    border-radius: 15px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e3e3e3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式设计 - 自适应优化 */
@media (max-width: 768px) {
    .gallery-section {
        padding: 30px 15px;
        margin: 20px 10px;
    }
    
    .gallery-title {
        font-size: 2rem;
        margin-bottom: 30px;
    }
    
    .gallery-container {
        aspect-ratio: 4/3; /* 移动端使用更方形的比例 */
    }
    
    .gallery-nav {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    .gallery-nav.prev {
        left: 8px;
    }
    
    .gallery-nav.next {
        right: 8px;
    }
    
    .gallery-indicators {
        gap: 6px;
        margin-top: 20px;
        padding: 0 15px;
    }
    
    .indicator {
        width: 8px;
        height: 8px;
    }
    
    .slide-overlay {
        padding: 15px;
    }
    
    .slide-title {
        font-size: 1.1rem;
    }
    
    .slide-description {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .gallery-section {
        padding: 25px 10px;
        margin: 15px 5px;
    }
    
    .gallery-title {
        font-size: 1.8rem;
    }
    
    .gallery-container {
        aspect-ratio: 1/1; /* 小屏幕使用正方形 */
    }
    
    .gallery-nav {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }
    
    .gallery-nav.prev {
        left: 5px;
    }
    
    .gallery-nav.next {
        right: 5px;
    }
    
    .gallery-indicators {
        gap: 4px;
        margin-top: 15px;
    }
    
    .indicator {
        width: 6px;
        height: 6px;
    }
    
    .gallery-controls {
        flex-direction: column;
        gap: 10px;
        margin-top: 15px;
    }
    
    .slide-counter {
        font-size: 0.8rem;
    }
}

/* 超大屏幕优化 */
@media (min-width: 1200px) {
    .gallery-container {
        max-width: 1200px;
    }
    
    .gallery-nav {
        width: 55px;
        height: 55px;
        font-size: 1.3rem;
    }
    
    .gallery-nav.prev {
        left: 25px;
    }
    
    .gallery-nav.next {
        right: 25px;
    }
}
