/*
 * @file        gallery.css
 * @description 图片列表与内容页样式 - 响应式瀑布流卡片、悬浮蒙层、详情页大图+缩略图导航、灯箱
 * @author      zhuowebuqun
 * @date        2026-05-01
 * @notes       依赖 common.css；用于 gallery-list / gallery-detail / teachers 页面
 */

/* ================ 顶部筛选标签 ================ */
.gallery-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 40px 0 32px;
}
.gallery-tabs a {
    padding: 8px 22px;
    border: 1px solid var(--c-border);
    border-radius: 999px;
    font-size: 13px;
    color: var(--c-text);
    transition: all var(--t-fast);
}
.gallery-tabs a:hover,
.gallery-tabs a.is-active {
    background: var(--c-ink);
    border-color: var(--c-ink);
    color: #fff;
}

/* ================ 网格瀑布流 ================ */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding-bottom: 48px;
}

.g-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-md);
    aspect-ratio: 4 / 5;
    background: linear-gradient(135deg, var(--c-ivory), var(--c-cream));
    cursor: pointer;
}
.g-card .g-cover {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: transform .8s cubic-bezier(.4, 0, .2, 1);
}
.g-card:hover .g-cover {
    transform: scale(1.08);
}

/* 默认色块（无图片时） */
.g-card.bg-1 .g-cover { background: linear-gradient(135deg, #1A1B3A, #E63946); }
.g-card.bg-2 .g-cover { background: linear-gradient(135deg, #7B5EA7, #FF8C42); }
.g-card.bg-3 .g-cover { background: linear-gradient(135deg, #2D9596, #1A1B3A); }
.g-card.bg-4 .g-cover { background: linear-gradient(135deg, #F4B942, #C12A37); }
.g-card.bg-5 .g-cover { background: linear-gradient(135deg, #E63946, #7B5EA7); }
.g-card.bg-6 .g-cover { background: linear-gradient(135deg, #FF8C42, #E63946); }
.g-card.bg-7 .g-cover { background: linear-gradient(135deg, #2D9596, #7B5EA7); }
.g-card.bg-8 .g-cover { background: linear-gradient(135deg, #1F6F70, #1A1B3A); }

/* 蒙层 */
.g-card .g-mask {
    position: absolute;
    inset: 0;
    z-index: 2;
    padding: 20px;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,.75) 100%);
    transition: background var(--t-base);
}
.g-card:hover .g-mask {
    background: linear-gradient(180deg, rgba(26,35,50,.4) 0%, rgba(0,0,0,.85) 100%);
}
.g-card .g-cat {
    font-size: 12px;
    letter-spacing: 3px;
    color: var(--c-gold);
    margin-bottom: 8px;
    transform: translateY(20px);
    opacity: 0;
    transition: all var(--t-base);
}
.g-card .g-title {
    font-family: var(--font-serif);
    font-size: 18px;
    margin-bottom: 4px;
    line-height: 1.4;
}
.g-card .g-meta {
    font-size: 12px;
    opacity: .75;
    transform: translateY(20px);
    opacity: 0;
    transition: all var(--t-base);
    transition-delay: .05s;
}
.g-card:hover .g-cat,
.g-card:hover .g-meta {
    transform: none;
    opacity: 1;
}
.g-card:hover .g-meta {
    opacity: .8;
}

/* 师资风格变体（圆形人像、纵向） */
.g-card.is-teacher {
    aspect-ratio: 3/4;
    background: #fff;
    border: 1px solid var(--c-border);
}
.g-card.is-teacher .g-cover {
    inset: 24px 24px 80px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: var(--font-serif);
    font-size: 56px;
}
.g-card.is-teacher:hover .g-cover {
    transform: none;
}
.g-card.is-teacher .g-mask {
    background: none;
    color: var(--c-ink);
    text-align: center;
    justify-content: flex-end;
}
.g-card.is-teacher:hover .g-mask {
    background: none;
}
.g-card.is-teacher .g-title {
    color: var(--c-ink);
    font-size: 18px;
}
.g-card.is-teacher .g-meta {
    color: var(--c-text-muted);
    transform: none;
    opacity: 1;
}
.g-card.is-teacher .g-cat {
    color: var(--c-gold-deep);
    transform: none;
    opacity: 1;
    align-self: center;
}

/* ================ 详情页：左大图 + 右介绍 ================ */
.gallery-detail {
    padding: 56px 0 80px;
}
.gd-layout {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 48px;
}
.gd-stage {
    background: #fff;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--c-border);
}
.gd-main {
    aspect-ratio: 4/3;
    background: linear-gradient(135deg, #1A1B3A, #E63946 50%, #F4B942);
    background-size: cover;
    background-position: center;
    cursor: zoom-in;
    position: relative;
}
.gd-main::after {
    content: "⛶";
    position: absolute;
    right: 16px;
    bottom: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background var(--t-fast);
}
.gd-main:hover::after {
    background: var(--c-gold);
}

/* 缩略图导航 */
.gd-thumbs {
    display: flex;
    gap: 8px;
    padding: 16px;
    overflow-x: auto;
    border-top: 1px solid var(--c-border);
    background: var(--c-cream);
}
.gd-thumbs span {
    flex: 0 0 80px;
    height: 60px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 2px solid transparent;
    background-size: cover;
    background-position: center;
    transition: all var(--t-fast);
}
.gd-thumbs span.bg-1 { background: linear-gradient(135deg, #1A1B3A, #E63946); }
.gd-thumbs span.bg-2 { background: linear-gradient(135deg, #7B5EA7, #FF8C42); }
.gd-thumbs span.bg-3 { background: linear-gradient(135deg, #2D9596, #F4B942); }
.gd-thumbs span.bg-4 { background: linear-gradient(135deg, #FF8C42, #7B5EA7); }
.gd-thumbs span.is-active {
    border-color: var(--c-gold);
}
.gd-thumbs span:hover {
    transform: translateY(-2px);
}

/* 介绍区 */
.gd-info .gd-cat {
    display: inline-block;
    background: var(--c-ivory);
    color: var(--c-gold-deep);
    padding: 4px 12px;
    border-radius: 2px;
    font-size: 12px;
    margin-bottom: 16px;
    letter-spacing: 2px;
}
.gd-info h1 {
    font-family: var(--font-serif);
    font-size: 30px;
    color: var(--c-ink);
    line-height: 1.4;
    margin-bottom: 24px;
}
.gd-meta {
    list-style: none;
    padding: 16px 0;
    border-top: 1px dashed var(--c-border);
    border-bottom: 1px dashed var(--c-border);
    margin-bottom: 24px;
}
.gd-meta li {
    display: flex;
    padding: 6px 0;
    font-size: 14px;
}
.gd-meta li label {
    flex: 0 0 80px;
    color: var(--c-text-muted);
}
.gd-meta li span {
    color: var(--c-ink);
}
.gd-desc {
    font-size: 15px;
    line-height: 1.85;
    color: var(--c-text);
}
.gd-desc p {
    margin-bottom: 1em;
}
.gd-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
}

/* ================ 灯箱 ================ */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .92);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 32px;
}
.lightbox.is-open {
    display: flex;
}
.lightbox-img {
    max-width: 90%;
    max-height: 80vh;
    border-radius: var(--radius-sm);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .8);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    width: 1200px;
    height: 70vh;
}
.lightbox-caption {
    color: #fff;
    margin-top: 16px;
    font-size: 14px;
    text-align: center;
    opacity: .85;
}
.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .15);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--t-fast);
    font-size: 20px;
}
.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: var(--c-gold);
}
.lightbox-close {
    top: 24px;
    right: 24px;
}
.lightbox-prev { left: 24px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 24px; top: 50%; transform: translateY(-50%); }

/* ================ 响应式 ================ */
@media (max-width: 1199px) {
    .gallery-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 991px) {
    .gd-layout { grid-template-columns: 1fr; gap: 32px; }
}

@media (max-width: 767px) {
    .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .g-card .g-title { font-size: 14px; }
    .g-card .g-cat,
    .g-card .g-meta { transform: none; opacity: 1; }
    .gallery-tabs { gap: 6px; margin: 24px 0; }
    .gallery-tabs a { padding: 6px 14px; font-size: 12px; }
    .gallery-detail { padding: 32px 0 48px; }
    .gd-info h1 { font-size: 22px; }
    .gd-thumbs span { flex-basis: 60px; height: 45px; }
    .lightbox { padding: 16px; }
    .lightbox-prev, .lightbox-next { width: 40px; height: 40px; }
    .lightbox-close { top: 12px; right: 12px; }
    .lightbox-img { height: 50vh; }
}
