/**
 * 案例中心专题 /gallery/
 * 深空蓝 + 金色点缀，与 front.css 变量一致
 */

.gal-page { background: var(--bg); }

.gal-hero {
    padding: 56px 0 64px;
    background:
        radial-gradient(ellipse 80% 60% at 85% 20%, rgba(201, 162, 39, .18) 0%, transparent 55%),
        radial-gradient(ellipse 50% 40% at 10% 80%, rgba(59, 130, 246, .2) 0%, transparent 50%),
        linear-gradient(145deg, var(--dark) 0%, var(--primary-dark) 48%, #163a8a 100%);
}
.gal-hero--cat,
.gal-hero--detail { padding: 48px 0 52px; }
.gal-hero .breadcrumb { margin-bottom: 28px; }
.gal-hero-main { max-width: 720px; position: relative; }
.gal-hero-kicker {
    margin: 0 0 12px;
    font-size: 13px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--accent-light);
    font-weight: 600;
}
.gal-hero-title {
    margin: 0;
    font-size: clamp(28px, 4.5vw, 42px);
    font-weight: 800;
    line-height: 1.25;
    color: #fff;
}
.gal-hero--detail .gal-hero-title {
    font-size: clamp(24px, 3.5vw, 34px);
}
.gal-hero-lead {
    margin: 16px 0 0;
    font-size: 16px;
    line-height: 1.75;
    color: rgba(255, 255, 255, .82);
    max-width: 40em;
}
.gal-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}
.gal-hero-actions .btn-lg {
    padding: .7rem 1.4rem;
    font-weight: 600;
    border-radius: 10px;
}
.gal-hero-actions .btn-outline-light:hover {
    background: rgba(255, 255, 255, .12);
    color: #fff;
}
.gal-hero-cat {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 22px;
    align-items: start;
    max-width: 800px;
}
.gal-hero-cat-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #fff;
    background: var(--pillar-accent, var(--primary));
    box-shadow: 0 10px 28px rgba(0, 0, 0, .22);
}

.gal-stats {
    margin-top: -28px;
    position: relative;
    z-index: 2;
    padding-bottom: 8px;
}
.gal-stats-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.gal-stats-list li {
    padding: 22px 16px;
    text-align: center;
    border-right: 1px solid var(--border);
}
.gal-stats-list li:last-child { border-right: 0; }
.gal-stats-list strong {
    display: block;
    font-size: clamp(20px, 2.4vw, 26px);
    font-weight: 800;
    color: var(--primary-dark);
    line-height: 1.2;
}
.gal-stats-list span {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: var(--text-muted);
}

.gal-section { padding: 64px 0; }
.gal-section-head {
    text-align: center;
    max-width: 560px;
    margin: 0 auto 36px;
}
.gal-section-head h2 {
    margin: 0;
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 800;
    color: var(--dark);
}
.gal-section-head p {
    margin: 10px 0 0;
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.7;
}

.gal-pillars { background: var(--white); padding-top: 56px; }
.gal-pillars-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 22px;
}
.gal-pillar-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 26px 24px;
    border-top: 3px solid var(--pillar-accent, var(--primary));
    transition: box-shadow .2s, transform .2s, background .2s;
}
.gal-pillar-card:hover {
    background: var(--white);
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}
.gal-pillar-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}
.gal-pillar-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
    background: var(--pillar-accent, var(--primary));
    flex-shrink: 0;
}
.gal-pillar-head h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
}
.gal-pillar-count {
    display: inline-block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-muted);
}
.gal-pillar-card > p {
    margin: 0;
    font-size: 14px;
    line-height: 1.75;
    color: var(--text-muted);
}
.gal-pillar-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
}
.gal-pillar-link:hover { color: var(--primary-dark); }
.gal-pillar-link i { transition: transform .2s; }
.gal-pillar-link:hover i { transform: translateX(3px); }

.gal-filter {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 32px;
}
.gal-filter a {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--white);
    border: 1px solid var(--border);
    transition: background .2s, color .2s, border-color .2s;
}
.gal-filter a:hover {
    color: var(--primary);
    border-color: rgba(26, 86, 219, .35);
}
.gal-filter a.is-active {
    color: #fff;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-color: transparent;
}

.gal-list { background: var(--bg); }
.gal-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}
.gal-card {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    color: inherit;
    transition: transform .25s, box-shadow .25s, border-color .25s;
}
.gal-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(26, 86, 219, .25);
    color: inherit;
}
.gal-card-media {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f1f5f9;
}
.gal-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s;
}
.gal-card:hover .gal-card-media img { transform: scale(1.06); }
.gal-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: var(--primary);
    font-size: 40px;
    opacity: .65;
}
.gal-card-zoom {
    position: absolute;
    right: 12px;
    bottom: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .95);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .2s, transform .2s;
}
.gal-card:hover .gal-card-zoom {
    opacity: 1;
    transform: translateY(0);
}
.gal-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 18px 20px 20px;
}
.gal-card-body h3 {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 700;
    color: var(--dark);
}
.gal-card-body p {
    margin: 0 0 12px;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.65;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}
.gal-card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
}
.gal-card-link i { transition: transform .2s; }
.gal-card:hover .gal-card-link i { transform: translateX(3px); }

.gal-empty {
    text-align: center;
    padding: 56px 20px;
    color: var(--text-muted);
}
.gal-empty i {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
    opacity: .45;
}
.gal-empty p { margin: 0 0 18px; }
.gal-empty h2 {
    margin: 12px 0 16px;
    font-size: 20px;
    color: var(--dark);
}
.gal-pagination {
    margin-top: 40px;
    display: flex;
    justify-content: center;
}

.gal-cta {
    padding: 56px 0 72px;
    background:
        radial-gradient(ellipse 70% 80% at 100% 0%, rgba(201, 162, 39, .15) 0%, transparent 50%),
        linear-gradient(120deg, var(--dark) 0%, var(--primary-dark) 55%, var(--primary) 100%);
}
.gal-cta--inset {
    margin: 40px 0 64px;
    padding: 36px 32px;
    border-radius: var(--radius-lg);
}
.gal-cta-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    flex-wrap: wrap;
    color: #fff;
}
.gal-cta-inner h2 {
    margin: 0;
    font-size: clamp(20px, 2.8vw, 28px);
    font-weight: 800;
}
.gal-cta-inner p {
    margin: 10px 0 0;
    font-size: 15px;
    color: rgba(255, 255, 255, .78);
    max-width: 36em;
}
.gal-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 10px;
    background: var(--accent);
    color: var(--dark);
    font-weight: 700;
    font-size: 15px;
    box-shadow: 0 8px 24px rgba(201, 162, 39, .35);
    transition: background .2s, transform .2s;
}
.gal-cta-btn:hover {
    background: var(--accent-light);
    color: var(--dark);
    transform: translateY(-2px);
}
.gal-cta-btn i { transition: transform .2s; }
.gal-cta-btn:hover i { transform: translateX(3px); }
.gal-cta-btn--block { width: 100%; }

.gal-detail-wrap { padding: 40px 0 24px; }
.gal-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 28px;
    align-items: start;
}
.gal-detail-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.gal-detail-media {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: #0f172a;
    position: relative;
    cursor: zoom-in;
    text-align: left;
}
.gal-detail-media img {
    width: 100%;
    max-height: 520px;
    object-fit: contain;
    background: #0f172a;
}
.gal-detail-media--empty {
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: var(--primary);
    font-size: 48px;
    opacity: .55;
    cursor: default;
}
.gal-detail-zoom {
    position: absolute;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(15, 23, 42, .72);
    color: #fff;
    font-size: 13px;
}
.gal-detail-info { padding: 28px 32px 30px; }
.gal-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    margin-bottom: 18px;
    font-size: 13px;
    color: var(--text-muted);
}
.gal-detail-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.gal-detail-meta i { color: var(--primary); }
.gal-detail-desc {
    margin-bottom: 22px;
    font-size: 15px;
    line-height: 1.8;
    color: var(--text);
}
.gal-detail-body {
    font-size: 15px;
    line-height: 1.85;
    color: var(--text);
    margin-bottom: 8px;
}
.gal-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid var(--border);
}
.gal-detail-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.gal-detail-nav-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.gal-detail-nav a {
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
}
.gal-detail-nav a:hover { color: var(--primary); }
.gal-detail-nav-next { text-align: right; }
.gal-detail-nav-muted {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
}

.gal-detail-aside {
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: sticky;
    top: calc(var(--nav-h, 72px) + 16px);
}
.gal-side-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.gal-side-title {
    margin: 0;
    padding: 14px 18px;
    font-size: 15px;
    font-weight: 700;
    color: var(--dark);
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
}
.gal-side-list {
    list-style: none;
    margin: 0;
    padding: 8px 0;
}
.gal-side-list a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    font-size: 14px;
    color: var(--text);
    border-bottom: 1px solid #f1f5f9;
}
.gal-side-list li:last-child a { border-bottom: 0; }
.gal-side-list a:hover {
    background: #f8fafc;
    color: var(--primary);
}
.gal-side-list img,
.gal-side-thumb {
    width: 48px;
    height: 36px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: #e2e8f0;
}
.gal-side-thumb {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 14px;
}
.gal-side-cta {
    padding: 22px 20px;
    border-radius: var(--radius-lg);
    background:
        radial-gradient(ellipse 80% 60% at 100% 0%, rgba(201, 162, 39, .2) 0%, transparent 55%),
        linear-gradient(145deg, var(--dark) 0%, var(--primary-dark) 100%);
    color: #fff;
}
.gal-side-cta h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
}
.gal-side-cta p {
    margin: 8px 0 16px;
    font-size: 13px;
    color: rgba(255, 255, 255, .75);
    line-height: 1.6;
}

.gal-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10050;
    background: rgba(2, 8, 23, .88);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.gal-lightbox[hidden] { display: none !important; }
.gal-lightbox img {
    max-width: min(96vw, 1100px);
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
}
.gal-lightbox-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: 20px;
}

@media (max-width: 991.98px) {
    .gal-stats-list { grid-template-columns: repeat(2, 1fr); }
    .gal-stats-list li:nth-child(2) { border-right: 0; }
    .gal-stats-list li:nth-child(1),
    .gal-stats-list li:nth-child(2) { border-bottom: 1px solid var(--border); }
    .gal-pillars-grid { grid-template-columns: 1fr; }
    .gal-cards-grid { grid-template-columns: repeat(2, 1fr); }
    .gal-detail-layout { grid-template-columns: 1fr; }
    .gal-detail-aside { position: static; }
    .gal-hero-cat { grid-template-columns: 1fr; }
}

@media (max-width: 575.98px) {
    .gal-hero { padding: 40px 0 52px; }
    .gal-stats { margin-top: -20px; }
    .gal-section { padding: 48px 0; }
    .gal-cards-grid { grid-template-columns: 1fr; }
    .gal-detail-info { padding: 22px 18px; }
    .gal-detail-nav { grid-template-columns: 1fr; }
    .gal-detail-nav-next { text-align: left; }
    .gal-cta-inner { flex-direction: column; align-items: flex-start; }
    .gal-cta-btn { width: 100%; }
    .gal-cta--inset { padding: 28px 20px; margin-bottom: 48px; }
    .gal-filter { justify-content: flex-start; }
}

@media (max-width: 991.98px) {
    body.h5-has-tabbar .gal-cta:not(.gal-cta--inset) {
        padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    }
}

@media (hover: none) and (pointer: coarse) {
    .gal-card:hover,
    .gal-pillar-card:hover { transform: none; }
    .gal-card-zoom { opacity: 1; transform: none; }
}
