/* gallery.css */
.media-gallery {
    max-width: 1440px;
    padding: 0 1rem;
    margin: 150px auto 2rem;
}

.gallery-viewport {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.main-carousel {
    position: relative;
    height: 70vh;
    max-height: 800px;
    min-height: 500px;
}

.slide {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.3s ease;
}

.slide.active {
    opacity: 1;
    z-index: 1;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.slide-caption {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 1.5rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: white;
    text-align: center;
    font-size: 1.25rem;
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.9);
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 2;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.prev-btn { left: 2rem; }
.next-btn { right: 2rem; }

.thumbnail-scroller {
    margin-top: 1.5rem;
    padding: 0 2rem;
}

.thumb-track {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding-bottom: 0.5rem;
}

.thumb-item {
    flex: 0 0 160px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transition: transform 0.3s ease;
}

.thumb-item::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 3px solid transparent;
    border-radius: 8px;
    transition: border-color 0.3s ease;
}

.thumb-item.active::after {
    border-color: #2196F3;
}

.thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
/* 添加播放状态指示 */
.gallery-viewport::after {
    content: "";
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: rgba(255,255,255,0.3);
    z-index: 2;
}
.nav-btn svg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* 精确居中 */
    width: 24px;
    height: 24px;
}
.gallery-viewport.playing::after {
    animation: progressBar 500ms linear;
}

@keyframes progressBar {
    from { width: 0 }
    to { width: 60px }
}