/* ============================================================
   紫金县凤安中学2026届九（1）班 - 班级相册 现代UI样式
   ============================================================ */

/* ---------- CSS 变量覆盖 ---------- */
:root {
    --gallery-accent: #6366F1;
    --gallery-accent-light: #818CF8;
    --gallery-accent-dark: #4F46E5;
    --gallery-accent-glow: rgba(99, 102, 241, 0.25);
    --gallery-surface: #FFFFFF;
    --gallery-bg: #FAFAF9;
    --gallery-radius: 16px;
    --gallery-radius-sm: 10px;
    --gallery-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
    --gallery-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06), 0 2px 6px rgba(0, 0, 0, 0.04);
    --gallery-shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
    --gallery-transition: 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* ============================================================
   悬浮透明毛玻璃导航栏（仅相册页）
   ============================================================ */
.gallery-navbar {
    background: transparent !important;
    border-bottom: 1px solid transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    transition: background 0.4s ease,
                border-color 0.4s ease,
                backdrop-filter 0.4s ease,
                -webkit-backdrop-filter 0.4s ease !important;
}

/* 滚动后：毛玻璃效果 */
.gallery-navbar.scrolled {
    background: rgba(255, 255, 255, 0.72) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
}

/* 移动端简化毛玻璃 */
@media (max-width: 768px) {
    .gallery-navbar.scrolled {
        background: rgba(255, 255, 255, 0.88) !important;
        backdrop-filter: blur(16px) !important;
        -webkit-backdrop-filter: blur(16px) !important;
    }
}

/* Logo 副标题：显示班级全称 */
.nav-logo-sub {
    display: none;
    font-size: 0.72rem;
    font-weight: 400;
    color: rgba(107, 114, 128, 0.7);
    letter-spacing: 0.02em;
    white-space: nowrap;
}

@media (min-width: 769px) {
    .nav-logo-sub {
        display: inline;
    }
}

/* ============================================================
   Gallery Hero 区域
   ============================================================ */
.gallery-hero {
    position: relative;
    padding: calc(var(--nav-height) + 80px) 0 72px;
    overflow: hidden;
    background: linear-gradient(180deg,
        #EEF2FF 0%,
        #F5F3FF 30%,
        #FAFAF9 100%
    );
}

/* 装饰性几何图形 */
.gallery-hero-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.hero-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.12;
    animation: hero-float 8s ease-in-out infinite;
}

.shape-1 {
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, var(--gallery-accent) 0%, transparent 70%);
    top: -100px;
    right: -80px;
    animation-delay: 0s;
}

.shape-2 {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, #A78BFA 0%, transparent 70%);
    bottom: -40px;
    left: -40px;
    animation-delay: 2s;
}

.shape-3 {
    width: 160px;
    height: 160px;
    background: radial-gradient(circle, #34D399 0%, transparent 70%);
    top: 50%;
    left: 60%;
    animation-delay: 4s;
}

/* 背景点阵装饰 */
.hero-dots {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(99, 102, 241, 0.08) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0) 80%);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0) 80%);
}

@keyframes hero-float {
    0%, 100% { transform: translateY(0) scale(1); }
    25% { transform: translateY(-15px) scale(1.03); }
    50% { transform: translateY(-8px) scale(0.98); }
    75% { transform: translateY(-20px) scale(1.02); }
}

/* Hero 内容区 */
.gallery-hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 680px;
    margin: 0 auto;
}

.gallery-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gallery-accent);
    margin-bottom: 24px;
}

.gallery-hero-title {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.1;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 40%, #6366F1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gallery-hero-desc {
    font-size: 1.1rem;
    color: #6B7280;
    line-height: 1.7;
    max-width: 460px;
    margin: 0 auto 36px;
}

/* 统计数据 */
.gallery-hero-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.hero-stat {
    text-align: center;
    padding: 0 32px;
}

.hero-stat-num {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: var(--gallery-accent);
    line-height: 1.2;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hero-stat-num.counted {
    animation: count-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes count-pop {
    0% { transform: scale(0.5); opacity: 0; }
    60% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

.hero-stat-label {
    display: block;
    font-size: 0.85rem;
    color: #9CA3AF;
    margin-top: 4px;
    font-weight: 500;
}

.hero-stat-divider {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, transparent, rgba(99, 102, 241, 0.2), transparent);
}

/* ============================================================
   筛选栏 - 透明毛玻璃悬浮定位
   ============================================================ */
.gallery-filter-wrapper {
    position: sticky;
    top: var(--nav-height);
    z-index: 100;
    padding: 16px 0;
    background: transparent;
    border-bottom: none;
    transition: padding var(--gallery-transition);
}

.gallery-filter-wrapper.scrolled {
    padding: 10px 0;
}

.gallery-filter-bar {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 6px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06), 0 1px 4px rgba(0, 0, 0, 0.04);
    position: relative;
}

/* 让 flex 容器内的 bar 居中 */
.gallery-filter-wrapper .container {
    display: flex;
    justify-content: center;
}

.gallery-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 20px;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 500;
    color: #4B5563;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
    white-space: nowrap;
    position: relative;
    z-index: 1;
}

.gallery-filter-btn:hover {
    color: #1F2937;
    background: rgba(99, 102, 241, 0.1);
}

.gallery-filter-btn.active {
    color: #FFFFFF;
    background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
    font-weight: 600;
}

.gallery-filter-btn i {
    transition: transform 0.3s ease;
}

.gallery-filter-btn.active i {
    transform: scale(1.1);
}

/* 切换加载中禁用点击 */
.gallery-filter-btn.loading {
    pointer-events: none;
    opacity: 0.6;
}

/* 分类计数的微标 */
.filter-badge {
    font-size: 0.7rem;
    background: rgba(255, 255, 255, 0.25);
    padding: 1px 7px;
    border-radius: 100px;
    font-weight: 600;
    margin-left: 2px;
}

.gallery-filter-btn.active .filter-badge {
    background: rgba(255, 255, 255, 0.3);
}

/* ============================================================
   骨架屏
   ============================================================ */
.gallery-skeleton {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding-top: 24px;
    min-height: 300px;
    opacity: 1;
    transition: opacity 0.25s ease;
}

.skeleton-card {
    border-radius: var(--gallery-radius);
    background: linear-gradient(110deg, #ECECEC 8%, #F5F5F5 18%, #ECECEC 33%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    aspect-ratio: 3/4;
}

@keyframes skeleton-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ============================================================
   瀑布流照片网格 —— JS 绝对定位布局
   ============================================================ */
.gallery-masonry {
    position: relative;
    width: 100%;
    padding-top: 24px;
    min-height: 300px;
    opacity: 1;
    transition: opacity 0.25s ease;
}

/* 图片加载完成前的占位，防止高度跳变 */
.gallery-card-media {
    min-height: 160px;
    background: #F3F4F6;
}

/* 照片卡片 */
.gallery-card {
    position: absolute;
    border-radius: var(--gallery-radius);
    overflow: hidden;
    cursor: pointer;
    background: var(--gallery-surface);
    box-shadow: var(--gallery-shadow-sm);
    transition: transform 0.35s cubic-bezier(0.25, 0.1, 0.25, 1),
                box-shadow 0.35s cubic-bezier(0.25, 0.1, 0.25, 1),
                left 0.35s ease,
                top 0.35s ease,
                width 0.35s ease;
    animation: card-fade-in 0.5s cubic-bezier(0.25, 0.1, 0.25, 1) both;
}

@keyframes card-fade-in {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.gallery-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--gallery-shadow-lg);
    z-index: 10;
}

.gallery-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--gallery-radius);
    border: 2px solid transparent;
    transition: border-color 0.4s ease;
    pointer-events: none;
    z-index: 2;
}

.gallery-card:hover::after {
    border-color: rgba(99, 102, 241, 0.25);
}

/* 卡片内图片/视频 */
.gallery-card-media {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
    will-change: transform;
}

.gallery-card:hover .gallery-card-media {
    transform: scale(1.06);
}

/* 视频占位 */
.gallery-card video.gallery-card-media {
    background: #1a1a2e;
}

/* 悬停覆盖层 */
.gallery-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        transparent 40%,
        rgba(0, 0, 0, 0) 55%,
        rgba(0, 0, 0, 0.65) 100%
    );
    z-index: 1;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.4s ease;
}

.gallery-card:hover .gallery-card-overlay {
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.15) 0%,
        rgba(0, 0, 0, 0) 30%,
        rgba(0, 0, 0, 0.75) 100%
    );
}

/* 底部标题信息 */
.gallery-card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 20px 18px;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, transparent 100%);
}

.gallery-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #FFFFFF;
    margin-bottom: 4px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gallery-card-category {
    display: inline-block;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 3px 10px;
    border-radius: 100px;
    font-weight: 500;
}

/* 视频播放徽标 */
.gallery-video-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
    border: 2px solid rgba(255, 255, 255, 0.25);
}

.gallery-card:hover .gallery-video-badge {
    transform: translate(-50%, -50%) scale(1.1);
    background: rgba(99, 102, 241, 0.85);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.5);
}

/* 多图标记 */
.gallery-card-badge-multi {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 4px 10px;
    border-radius: 100px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ============================================================
   空状态
   ============================================================ */
.gallery-empty {
    text-align: center;
    padding: 80px 20px;
}

.gallery-empty-icon {
    margin-bottom: 20px;
}

.gallery-empty h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #9CA3AF;
    margin-bottom: 8px;
}

.gallery-empty p {
    color: #C4C4C4;
    font-size: 0.9rem;
}

/* ============================================================
   灯箱 - 全新设计
   ============================================================ */
.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.gallery-lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

/* 关闭按钮 */
.lightbox-close-btn {
    position: absolute;
    top: 24px;
    right: 28px;
    z-index: 10;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.lightbox-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* 导航按钮 */
.lightbox-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.lightbox-nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.08);
}

.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }

/* 媒体容器 */
.lightbox-media-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 90vw;
    max-height: 80vh;
}

.lightbox-media {
    max-width: 90vw;
    max-height: 80vh;
    border-radius: 8px;
    object-fit: contain;
    box-shadow: 0 8px 60px rgba(0, 0, 0, 0.5);
    transition: opacity 0.3s ease;
}

.lightbox-media[src=""] {
    opacity: 0;
}

.gallery-lightbox video.lightbox-media {
    background: #000;
}

/* 底部信息面板 */
.lightbox-info-panel {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    text-align: center;
    color: #fff;
}

.lightbox-info-panel h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.lightbox-info-panel p {
    font-size: 0.8rem;
    opacity: 0.55;
    margin-top: 2px;
}

.lightbox-counter {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.45);
    padding: 4px 14px;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* 键盘提示 */
.lightbox-hint {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.25);
    letter-spacing: 0.03em;
}

/* ============================================================
   响应式设计
   ============================================================ */

/* 平板 */
@media (max-width: 1024px) {

    .gallery-hero {
        padding: calc(var(--nav-height) + 48px) 0 48px;
    }

    .gallery-hero-title {
        font-size: 2.2rem;
    }

    .lightbox-prev { left: 8px; }
    .lightbox-next { right: 8px; }
    .lightbox-nav-btn {
        width: 42px;
        height: 42px;
    }
}

/* 手机横屏 / 小平板 */
@media (max-width: 768px) {

    .gallery-card {
        border-radius: 12px;
    }

    .gallery-skeleton {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .gallery-hero {
        padding: calc(var(--nav-height) + 32px) 0 36px;
    }

    .gallery-hero-badge {
        font-size: 0.78rem;
        padding: 5px 14px;
    }

    .gallery-hero-title {
        font-size: 1.8rem;
    }

    .gallery-hero-desc {
        font-size: 0.95rem;
        margin-bottom: 24px;
    }

    .hero-stat {
        padding: 0 20px;
    }

    .hero-stat-num {
        font-size: 1.5rem;
    }

    .gallery-filter-wrapper {
        top: calc(var(--nav-height) - 1px);
        padding: 10px 0;
    }

    .gallery-filter-bar {
        gap: 4px;
        border-radius: 12px;
    }

    .gallery-filter-btn {
        padding: 7px 14px;
        font-size: 0.8rem;
        border-radius: 10px;
    }

    .gallery-filter-btn i {
        display: none;
    }

    .lightbox-close-btn {
        top: 12px;
        right: 12px;
        width: 38px;
        height: 38px;
    }

    .lightbox-nav-btn {
        width: 38px;
        height: 38px;
    }

    .lightbox-hint {
        display: none;
    }

    .gallery-card-info {
        padding: 30px 14px 14px;
    }

    .gallery-card-title {
        font-size: 0.85rem;
    }
}

/* 覆盖旧 reveal 类的冲突：gallery-card 使用自身的 CSS 动画 */
.gallery-card.reveal {
    opacity: 1;
    transform: none;
    transition: none;
}

/* 小屏手机 */
@media (max-width: 480px) {

    .gallery-card {
        border-radius: 10px;
    }

    .gallery-skeleton {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .skeleton-card {
        border-radius: 10px;
    }

    .gallery-hero {
        padding: calc(var(--nav-height) + 24px) 0 28px;
    }

    .gallery-hero-title {
        font-size: 1.6rem;
    }

    .gallery-hero-desc {
        font-size: 0.85rem;
        margin-bottom: 20px;
    }

    .hero-stat {
        padding: 0 16px;
    }

    .hero-stat-num {
        font-size: 1.3rem;
    }

    .hero-stat-label {
        font-size: 0.75rem;
    }

    .gallery-filter-bar {
        gap: 3px;
        padding: 3px;
        border-radius: 10px;
    }

    .gallery-filter-btn {
        padding: 5px 10px;
        font-size: 0.72rem;
        border-radius: 8px;
        gap: 3px;
    }

    .gallery-video-badge {
        width: 40px;
        height: 40px;
    }
}
