/**
 * 美图主题 - 内页样式
 * @package Saotheme
 */

/* ===== 页面基础 ===== */
.gallery-page { background: #f8f9fb; min-height: 100vh; }
[data-bs-theme="dark"] .gallery-page { background: #0f1117; }

.gallery-container { max-width: 1200px; margin: 0 auto; padding: 16px; }

/* 面包屑 */
.gallery-breadcrumb { font-size: 13px; color: #94a3b8; margin-bottom: 16px; display: flex; align-items: center; gap: 6px; }
.gallery-breadcrumb a { color: #94a3b8; text-decoration: none; transition: color .2s; }
.gallery-breadcrumb a:hover { color: #ec4899; }
.gallery-breadcrumb i { font-size: 10px; color: #cbd5e1; }
.gallery-breadcrumb .current { color: #ec4899; font-weight: 600; }

/* 主布局 */
.gallery-layout { display: grid; grid-template-columns: 1fr 340px; gap: 24px; padding-bottom: 40px; }
@media(max-width:991px) { .gallery-layout { grid-template-columns: 1fr; } }

/* ===== 左侧主图区 ===== */
.gallery-main { min-width: 0; }

/* 主图（拟物模糊背景） */
.gallery-hero { position: relative; background: #0a0a0a; border-radius: 16px; overflow: hidden; box-shadow: 0 2px 12px rgba(0,0,0,.06); }
[data-bs-theme="dark"] .gallery-hero { background: #050508; border: 1px solid rgba(255,255,255,.06); }

/* 主图区 */
.gallery-hero-img-wrap {
    position: relative; z-index: 1; width: 100%; aspect-ratio: 16/10;
    overflow: hidden; cursor: zoom-in;
    display: flex; align-items: center; justify-content: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
/* 伪元素做模糊背景，filter 不影响前景图 */
.gallery-hero-img-wrap::before {
    content: ''; position: absolute; inset: 0; z-index: 0;
    background: inherit;
    -webkit-filter: blur(5px) brightness(0.45) saturate(1.4);
    filter: blur(5px) brightness(0.45) saturate(1.4);
    transform: scale(1.2);
    margin: -30px;
}
/* 主图 */
.gallery-hero-img-wrap .gallery-hero-img {
    max-width: 100%; max-height: 100%; object-fit: contain;
    transition: opacity .3s ease; display: block;
    position: relative; z-index: 1;
    -webkit-filter: drop-shadow(0 4px 20px rgba(0,0,0,.3));
    filter: drop-shadow(0 4px 20px rgba(0,0,0,.3));
}

/* [清理] 旧方案 */
.gallery-hero-blur { display: none; }
.gallery-hero-blur-bg { display: none; }

/* 角标 */
.gallery-badge { position: absolute; top: 16px; left: 16px; z-index: 5; padding: 5px 14px; border-radius: 20px; font-size: 12px; font-weight: 700; color: #fff; letter-spacing: .5px; box-shadow: 0 4px 12px rgba(0,0,0,.2); }
.gallery-original-badge { position: absolute; top: 16px; right: 16px; z-index: 5; padding: 5px 14px; border-radius: 20px; font-size: 12px; font-weight: 700; color: #fff; background: linear-gradient(135deg, #ec4899, #f43f5e); box-shadow: 0 4px 12px rgba(236,72,153,.3); }

/* 计数器 */
.gallery-hero-counter { position: absolute; bottom: 16px; right: 16px; z-index: 5; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; padding: 4px 12px; border-radius: 16px; backdrop-filter: blur(8px); }

/* 导航箭头 */
.gallery-nav-btn { position: absolute; top: 50%; transform: translateY(-50%); z-index: 5; width: 44px; height: 44px; border-radius: 50%; border: none; background: rgba(255,255,255,.15); color: #fff; font-size: 16px; cursor: pointer; backdrop-filter: blur(8px); transition: all .2s; display: flex; align-items: center; justify-content: center; opacity: 0; }
.gallery-hero-img-wrap:hover .gallery-nav-btn { opacity: 1; }
.gallery-nav-btn:hover { background: rgba(236,72,153,.7); }
.gallery-nav-prev { left: 16px; }
.gallery-nav-next { right: 16px; }

/* 放大按钮 */
.gallery-zoom-btn { position: absolute; bottom: 16px; left: 16px; z-index: 5; width: 36px; height: 36px; border-radius: 8px; border: none; background: rgba(0,0,0,.5); color: #fff; font-size: 14px; cursor: pointer; backdrop-filter: blur(8px); transition: all .2s; display: flex; align-items: center; justify-content: center; opacity: 0; }
.gallery-hero-img-wrap:hover .gallery-zoom-btn { opacity: 1; }
.gallery-zoom-btn:hover { background: rgba(236,72,153,.7); }

/* 缩略图条 */
.gallery-thumbs { display: flex; gap: 8px; padding: 12px; overflow-x: auto; background: #fff; border-radius: 0 0 16px 16px; }
[data-bs-theme="dark"] .gallery-thumbs { background: #1a1b23; }
.gallery-thumb-item { width: 72px; height: 72px; border-radius: 10px; overflow: hidden; border: 2.5px solid #e2e8f0; cursor: pointer; flex-shrink: 0; transition: all .2s; }
.gallery-thumb-item.active { border-color: #ec4899; box-shadow: 0 0 0 2px rgba(236,72,153,.2); }
.gallery-thumb-item:hover { border-color: #ec4899; }
.gallery-thumb-item img { width: 100%; height: 100%; object-fit: cover; }

/* 内容卡片 */
.gallery-content-card { background: #fff; border-radius: 16px; overflow: hidden; margin-top: 20px; box-shadow: 0 1px 4px rgba(0,0,0,.04); }
[data-bs-theme="dark"] .gallery-content-card { background: #1a1b23; border: 1px solid rgba(255,255,255,.06); }
.gallery-content-title { font-size: 15px; font-weight: 700; color: #1e293b; padding: 16px 20px; border-bottom: 1px solid #f0f0f0; display: flex; align-items: center; gap: 8px; }
[data-bs-theme="dark"] .gallery-content-title { color: #e2e8f0; border-color: rgba(255,255,255,.06); }
.gallery-content-title i { color: #ec4899; }
.gallery-content-body { padding: 20px; font-size: 14px; line-height: 1.8; color: #475569; }
[data-bs-theme="dark"] .gallery-content-body { color: #94a3b8; }
/* 内容区图片：自动识别比例排列 */
.gallery-content-body img {
    max-width: 100%; height: auto; display: block;
    border-radius: 10px; object-fit: cover;
    cursor: zoom-in; transition: transform .2s, box-shadow .2s;
}
.gallery-content-body img:hover {
    transform: scale(1.01);
    box-shadow: 0 6px 24px rgba(0,0,0,.12);
}

/* 多图段落：自动网格，根据图片比例自适应 */
.gallery-content-body .cb-img-grid {
    display: grid; gap: 10px; margin: 0; padding: 0;
}
/* 横屏图（宽>高）：一行放多张 */
.gallery-content-body .cb-img-grid.cb-landscape {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.gallery-content-body .cb-img-grid.cb-landscape img {
    width: 100%; aspect-ratio: 16/10; object-fit: cover;
}
/* 竖屏图（高>宽）：一行放2-3张，高度更大 */
.gallery-content-body .cb-img-grid.cb-portrait {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.gallery-content-body .cb-img-grid.cb-portrait img {
    width: 100%; aspect-ratio: 3/4; object-fit: cover;
}
/* 混合比例：统一用正方形 */
.gallery-content-body .cb-img-grid.cb-mixed {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.gallery-content-body .cb-img-grid.cb-mixed img {
    width: 100%; aspect-ratio: 1; object-fit: cover;
}
/* WP自带画廊 */
.gallery-content-body .wp-block-gallery,
.gallery-content-body .gallery {
    display: grid !important; gap: 10px; padding: 0;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.gallery-content-body .wp-block-gallery li,
.gallery-content-body .wp-block-gallery figure,
.gallery-content-body .gallery .gallery-item {
    margin: 0 !important; padding: 0 !important;
    border-radius: 10px; overflow: hidden;
}
.gallery-content-body .wp-block-gallery img,
.gallery-content-body .gallery img {
    width: 100%; height: 180px; object-fit: cover;
    border-radius: 10px; cursor: zoom-in;
    transition: transform .3s;
}
.gallery-content-body .wp-block-gallery img:hover,
.gallery-content-body .gallery img:hover {
    transform: scale(1.05);
}
/* 散图：单独一张时按自然比例 */
.gallery-content-body > p > img:only-child,
.gallery-content-body > img {
    width: 100%; height: auto; max-height: 500px;
    object-fit: cover; border-radius: 10px; cursor: zoom-in;
}

/* 内容区图片灯箱 */
.gallery-cbody-lightbox {
    position: fixed; inset: 0; z-index: 99999;
    background: rgba(0,0,0,.92); display: none;
    align-items: center; justify-content: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.gallery-cbody-lightbox.show { display: flex; }
.gallery-cbody-lightbox img {
    max-width: 92vw; max-height: 90vh; object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.gallery-cbody-lb-close {
    position: absolute; top: 20px; right: 24px;
    width: 44px; height: 44px; border-radius: 50%;
    background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15);
    color: #fff; font-size: 18px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all .2s; z-index: 2;
}
.gallery-cbody-lb-close:hover {
    background: rgba(236,72,153,.8); border-color: transparent; transform: rotate(90deg);
}
.gallery-cbody-lb-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 48px; height: 48px; border-radius: 50%;
    background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12);
    color: #fff; font-size: 18px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all .2s; z-index: 2;
}
.gallery-cbody-lb-nav:hover { background: rgba(236,72,153,.6); border-color: transparent; }
.gallery-cbody-lb-prev { left: 20px; }
.gallery-cbody-lb-next { right: 20px; }
.gallery-cbody-lb-counter {
    position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
    background: rgba(0,0,0,.6); color: rgba(255,255,255,.7);
    padding: 6px 16px; border-radius: 20px; font-size: 13px; z-index: 2;
}

/* ===== 右侧边栏 ===== */
.gallery-sidebar { position: sticky; top: 20px; align-self: start; }

/* 信息卡片 */
.gallery-info-card { background: #fff; border-radius: 20px; overflow: hidden; box-shadow: 0 2px 16px rgba(0,0,0,.06); }
[data-bs-theme="dark"] .gallery-info-card { background: #1a1b23; border: 1px solid rgba(255,255,255,.06); }
.gallery-title { font-size: 20px; font-weight: 800; color: #1e293b; line-height: 1.4; padding: 24px 24px 0; margin: 0; }
[data-bs-theme="dark"] .gallery-title { color: #e2e8f0; }

/* 元信息 */
.gallery-meta { display: flex; gap: 16px; padding: 12px 24px; font-size: 12px; color: #94a3b8; }
.gallery-meta i { margin-right: 3px; }

/* 参数表 */
.gallery-params { padding: 0 24px 16px; }
.gallery-param-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #f5f5f5; font-size: 13px; }
[data-bs-theme="dark"] .gallery-param-row { border-color: rgba(255,255,255,.06); }
.gallery-param-row:last-child { border: none; }
.gallery-param-label { color: #94a3b8; }
.gallery-param-value { font-weight: 600; color: #334155; }
[data-bs-theme="dark"] .gallery-param-value { color: #e2e8f0; }

/* 标签 */
.gallery-tags { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 24px 16px; }
.gallery-tag { padding: 4px 10px; border-radius: 6px; font-size: 11px; font-weight: 600; background: linear-gradient(135deg, rgba(236,72,153,.08), rgba(139,92,246,.06)); color: #ec4899; border: 1px solid rgba(236,72,153,.12); }

/* 价格区 */
.gallery-price-section { padding: 0 24px 16px; }
.gallery-price-wrap { display: flex; align-items: baseline; gap: 4px; }
.gallery-price-val { font-size: 32px; font-weight: 900; color: #ec4899; line-height: 1; }
.gallery-price-unit { font-size: 14px; color: #ec4899; font-weight: 600; }
.gallery-price-free { display: inline-flex; align-items: center; gap: 6px; padding: 6px 16px; border-radius: 20px; background: linear-gradient(135deg, #10b981, #34d399); color: #fff; font-size: 13px; font-weight: 600; }
.gallery-vip-prices { margin-top: 8px; background: #f8fafc; border-radius: 10px; overflow: hidden; }
[data-bs-theme="dark"] .gallery-vip-prices { background: rgba(255,255,255,.04); }
.gallery-vip-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 14px; font-size: 12px; }
.gallery-vip-row + .gallery-vip-row { border-top: 1px solid #f0f0f0; }
[data-bs-theme="dark"] .gallery-vip-row + .gallery-vip-row { border-color: rgba(255,255,255,.06); }
.gallery-vip-label { color: #94a3b8; display: flex; align-items: center; gap: 5px; }
.gallery-vip-value { font-weight: 600; color: #334155; }
[data-bs-theme="dark"] .gallery-vip-value { color: #e2e8f0; }
.gallery-vip-value del { color: #94a3b8; font-size: 11px; margin-right: 4px; }

/* 按钮区 */
.gallery-action-area { padding: 0 24px 24px; }
.gallery-btn { display: flex; align-items: center; justify-content: center; width: 100%; padding: 14px; border-radius: 12px; font-size: 15px; font-weight: 700; cursor: pointer; border: none; transition: all .3s; gap: 8px; }
.gallery-btn i { font-size: 15px; }
.gallery-btn-download { background: linear-gradient(135deg, #ec4899, #f43f5e); color: #fff; box-shadow: 0 4px 20px rgba(236,72,153,.3); }
.gallery-btn-download:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(236,72,153,.4); }
.gallery-btn-buy { background: linear-gradient(135deg, #ec4899, #8b5cf6); color: #fff; box-shadow: 0 4px 20px rgba(236,72,153,.3); }
.gallery-btn-buy:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(236,72,153,.4); }
.gallery-btn-login { background: linear-gradient(135deg, #3b82f6, #60a5fa); color: #fff; text-decoration: none; }

/* 相关推荐 */
.gallery-related-card { background: #fff; border-radius: 20px; overflow: hidden; margin-top: 16px; padding: 20px; box-shadow: 0 2px 16px rgba(0,0,0,.06); }
[data-bs-theme="dark"] .gallery-related-card { background: #1a1b23; border: 1px solid rgba(255,255,255,.06); }
.gallery-related-title { font-size: 14px; font-weight: 700; color: #1e293b; margin-bottom: 14px; display: flex; align-items: center; gap: 6px; }
[data-bs-theme="dark"] .gallery-related-title { color: #e2e8f0; }
.gallery-related-title i { color: #ec4899; }
.gallery-related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.gallery-related-item { position: relative; border-radius: 10px; overflow: hidden; aspect-ratio: 1; display: block; }
.gallery-related-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.gallery-related-item:hover img { transform: scale(1.08); }
.gallery-related-overlay { position: absolute; inset: 0; background: linear-gradient(transparent 40%, rgba(0,0,0,.7)); display: flex; align-items: flex-end; padding: 8px; opacity: 0; transition: opacity .3s; }
.gallery-related-item:hover .gallery-related-overlay { opacity: 1; }
.gallery-related-overlay span { color: #fff; font-size: 11px; font-weight: 600; }

/* ===== 灯箱 ===== */
.gallery-lightbox { position: fixed; inset: 0; z-index: 99999; background: rgba(0,0,0,.95); display: none; align-items: center; justify-content: center; backdrop-filter: blur(12px); }
.gallery-lightbox.show { display: flex; }
.gallery-lightbox-overlay { position: absolute; inset: 0; }
.gallery-lightbox-img { max-width: 90vw; max-height: 85vh; object-fit: contain; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.5); transition: transform .3s; cursor: grab; z-index: 1; }
.gallery-lightbox-close { position: absolute; top: 20px; right: 24px; width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15); color: #fff; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all .2s; z-index: 2; }
.gallery-lightbox-close:hover { background: rgba(236,72,153,.8); border-color: transparent; transform: rotate(90deg); }
.gallery-lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); color: #fff; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all .2s; z-index: 2; }
.gallery-lightbox-nav:hover { background: rgba(236,72,153,.6); border-color: transparent; }
.gallery-lightbox-prev { left: 20px; }
.gallery-lightbox-next { right: 20px; }
.gallery-lightbox-counter { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,.6); color: rgba(255,255,255,.7); padding: 6px 16px; border-radius: 20px; font-size: 13px; z-index: 2; }
.gallery-lightbox-toolbar { position: absolute; bottom: 20px; right: 24px; display: flex; gap: 8px; z-index: 2; }
.gallery-lb-tool { width: 40px; height: 40px; border-radius: 10px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); color: #fff; font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all .2s; }
.gallery-lb-tool:hover { background: rgba(236,72,153,.5); border-color: transparent; }

/* ===== 响应式 ===== */
@media(max-width:991px) {
    .gallery-sidebar { position: static; }
    .gallery-related-grid { grid-template-columns: repeat(3, 1fr); }
}
@media(max-width:575px) {
    .gallery-container { padding: 10px; }
    .gallery-title { font-size: 17px; padding: 16px 16px 0; }
    .gallery-meta { padding: 10px 16px; }
    .gallery-params { padding: 0 16px 12px; }
    .gallery-tags { padding: 0 16px 12px; }
    .gallery-price-section { padding: 0 16px 12px; }
    .gallery-action-area { padding: 0 16px 16px; }
    .gallery-nav-btn { width: 36px; height: 36px; font-size: 13px; }
    .gallery-thumb-item { width: 56px; height: 56px; }
    .gallery-related-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
}

/* ===== 锁定缩略图 ===== */
.gallery-thumb-locked {
    width: 72px; height: 72px; border-radius: 10px; flex-shrink: 0;
    background: linear-gradient(135deg, #1e1e2e, #2a2a3e);
    border: 2.5px dashed rgba(236,72,153,.35);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; color: #94a3b8; font-size: 11px; cursor: default;
    position: relative; overflow: hidden;
    transition: all .2s;
}
.gallery-thumb-locked::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(236,72,153,.08), rgba(139,92,246,.06));
}
.gallery-thumb-locked i { font-size: 16px; color: #ec4899; position: relative; z-index: 1; }
.gallery-thumb-locked span { font-weight: 700; font-size: 12px; color: #ec4899; position: relative; z-index: 1; }
[data-bs-theme="dark"] .gallery-thumb-locked { background: linear-gradient(135deg, #0f0f1a, #1a1a2e); }
@media(max-width:575px) {
    .gallery-thumb-locked { width: 56px; height: 56px; }
    .gallery-thumb-locked i { font-size: 14px; }
    .gallery-thumb-locked span { font-size: 10px; }
}

/* ===== 付费提示条 ===== */
.gallery-paywall-hint {
    display: flex; align-items: center; gap: 14px;
    background: linear-gradient(135deg, rgba(236,72,153,.06), rgba(139,92,246,.04));
    border: 1px solid rgba(236,72,153,.15);
    border-radius: 12px; padding: 14px 20px; margin-top: 16px;
    position: relative; overflow: hidden;
}
.gallery-paywall-hint::before {
    content: ''; position: absolute; top: -50%; right: -20%; width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(236,72,153,.06) 0%, transparent 70%);
    border-radius: 50%; pointer-events: none;
}
[data-bs-theme="dark"] .gallery-paywall-hint {
    background: linear-gradient(135deg, rgba(236,72,153,.08), rgba(139,92,246,.05));
    border-color: rgba(236,72,153,.2);
}
.gallery-paywall-icon {
    width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 16px;
    box-shadow: 0 4px 12px rgba(236,72,153,.25);
}
.gallery-paywall-text { display: flex; flex-direction: column; gap: 2px; }
.gallery-paywall-text strong { font-size: 14px; color: #1e293b; }
[data-bs-theme="dark"] .gallery-paywall-text strong { color: #e2e8f0; }
.gallery-paywall-text span { font-size: 12px; color: #94a3b8; }
