/* 案例墙样式 */

/* 基础样式 */
.gallery-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
}

/* 页面标题已移除 */

/* 标签筛选栏 */
.tag-filter-container {
    position: fixed;
    top: 80px; /* 为导航栏留出空间 */
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: top, background, box-shadow;
}

/* 当WordPress管理栏显示时，调整标签栏位置 */
.admin-bar .tag-filter-container {
    top: 112px; /* 32px (管理栏) + 80px (导航栏) */
}

/* 滚动状态下的标签栏样式 */
.tag-filter-container.scrolled {
    top: 0 !important; /* 滚动时固定在顶部 */
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transform: translateZ(0); /* 启用硬件加速 */
}

.admin-bar .tag-filter-container.scrolled {
    top: 32px !important; /* 管理栏高度 */
}

/* 添加更平滑的进入和退出动画 */
.tag-filter-container {
    transform: translateZ(0); /* 启用硬件加速 */
}

/* 优化移动端的滚动响应 */
@media (max-width: 768px) {
    .tag-filter-container {
        transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    }
}

/* 移动端调整 */
@media (max-width: 768px) {
    .tag-filter-container {
        top: 60px; /* 移动端导航栏高度 */
        padding: 10px 0;
    }
    
    .admin-bar .tag-filter-container {
        top: 92px; /* 32px (管理栏) + 60px (移动端导航栏) */
    }
}

.tag-filter-bar {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 0 20px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    /* 显示滚动条 */
    scrollbar-width: thin;
    scrollbar-color: #ccc #f5f5f5;
}

.tag-filter-bar::-webkit-scrollbar {
    height: 6px;
}

.tag-filter-bar::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 3px;
}

.tag-filter-bar::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.tag-filter-bar::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.tag-btn {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
    font-weight: 500;
}

.tag-btn:hover {
    background: #e3f2fd;
    border-color: #1296db;
    color: #1296db;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(18, 150, 219, 0.2);
}

.tag-btn.active {
    background: #1296db;
    border-color: #1296db;
    color: white;
    box-shadow: 0 2px 8px rgba(18, 150, 219, 0.3);
}

/* 多选状态指示 */
.tag-btn[data-tag="all"].active {
    background: #d81e06;
    border-color: #d81e06;
    box-shadow: 0 2px 8px rgba(216, 30, 6, 0.3);
}

/* 确保非激活状态的按钮样式正确 */
.tag-btn:not(.active) {
    background: #f8f9fa;
    border-color: #e9ecef;
    color: #6c757d;
    transform: none;
    box-shadow: none;
}

/* 清空按钮在无选中标签时的样式 */
.tag-btn[data-tag="all"]:not(.active) {
    background: #f8f9fa;
    border-color: #e9ecef;
    color: #6c757d;
}

/* 产品展示区域 - 瀑布流布局 */
#gallery-products {
    column-count: 4;
    column-gap: 10px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    margin-top: 120px; /* 为固定的标签栏和导航栏留出更多空间 */
}

.product-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    background: white;
    margin-bottom: 10px;
    break-inside: avoid;
    display: block;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

/* 产品图片 */
.product-image {
    position: relative;
    width: 100%;
    height: auto;
}

.product-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

/* 懒加载样式 */
.lazy-image {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lazy-image.loaded {
    opacity: 1;
}

.lazy-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #999;
    font-size: 20px;
    z-index: 1;
}

.lazy-loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 产品操作按钮 */
.product-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover .product-actions {
    opacity: 1;
}

.action-btn {
    width: 35px;
    height: 35px;
    border: none;
    border-radius: 0;
    background: transparent;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: transparent;
    transform: scale(1.1);
}

/* 小红书风格的收藏按钮 */
.action-btn.heart {
    background: transparent;
    border: none;
    box-shadow: none;
}

.action-btn.heart:hover {
    background: transparent;
    transform: scale(1.05);
    box-shadow: none;
}

.action-btn.heart.active {
    background: transparent;
    color: #ff4757;
    border: none;
    box-shadow: none;
    animation: heartBeat 0.3s ease-in-out;
}

.action-btn.heart.active:hover {
    background: transparent;
    transform: scale(1.05);
    box-shadow: none;
}

/* 心跳动画 */
@keyframes heartBeat {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* 收藏按钮图标样式 */
.action-btn.heart i {
    font-size: 16px;
    transition: all 0.3s ease;
}

.action-btn.heart.active i {
    animation: heartPulse 0.6s ease-in-out;
}

@keyframes heartPulse {
    0% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.3);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* 权重指示器 */
.weight-indicator {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    z-index: 10;
    backdrop-filter: blur(5px);
}

.weight-value {
    color: #ffd700;
    font-weight: 600;
}

/* 右下角心形按钮样式 */
.heart-button {
    position: absolute;
    bottom: 10px;
    right: 10px;
    z-index: 10;
}

.heart-btn {
    width: 40px;
    height: 40px;
    border-radius: 0;
    border: none;
    background: transparent;
    color: #ff6b6b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: none;
}

.heart-btn:hover {
    background: #ff6b6b;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.heart-btn.active {
    background: #ff6b6b;
    color: white;
    animation: heartBeat 0.6s ease-in-out;
}

.heart-btn.active:hover {
    background: #ff5252;
    transform: scale(1.1);
}

.heart-btn i {
    font-size: 16px;
    transition: all 0.3s ease;
}

.heart-btn.active i {
    animation: heartPulse 1s ease-in-out infinite;
}

/* 右键菜单样式 */
.context-menu {
    position: fixed;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 8px 0;
    min-width: 180px;
    z-index: 10000;
    font-size: 14px;
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    color: #333;
}

.context-menu-item:hover {
    background-color: #f5f5f5;
}

.context-menu-item i {
    width: 16px;
    color: #666;
}

.context-menu-item span {
    flex: 1;
}

/* 显示模式样式 */

/* 拼图模式（默认）- 瀑布流布局，增强视觉冲击力 */
.gallery-products.mosaic-mode {
    column-count: 4;
    column-gap: 10px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.gallery-products.mosaic-mode .product-card {
    break-inside: avoid;
    margin-bottom: 10px;
    display: block;
}

/* 拼图模式 - 不规则排列，强烈视觉冲击力 */
.gallery-products.mosaic-mode {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(8, 150px);
    gap: 8px;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* 第一行 - 大尺寸突出 */
.gallery-products.mosaic-mode .product-card:nth-child(1) {
    grid-column: span 6;
    grid-row: span 3;
    transform: scale(1.05);
    z-index: 10;
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
    border-radius: 15px;
}

.gallery-products.mosaic-mode .product-card:nth-child(2) {
    grid-column: span 3;
    grid-row: span 2;
    transform: scale(0.9);
    z-index: 9;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    border-radius: 12px;
}

.gallery-products.mosaic-mode .product-card:nth-child(3) {
    grid-column: span 3;
    grid-row: span 2;
    transform: scale(0.85);
    z-index: 8;
    box-shadow: 0 6px 18px rgba(0,0,0,0.15);
    border-radius: 10px;
}

/* 第二行 - 中等尺寸 */
.gallery-products.mosaic-mode .product-card:nth-child(4) {
    grid-column: span 4;
    grid-row: span 2;
    transform: scale(1.1);
    z-index: 7;
    box-shadow: 0 12px 28px rgba(0,0,0,0.25);
    border-radius: 14px;
}

.gallery-products.mosaic-mode .product-card:nth-child(5) {
    grid-column: span 2;
    grid-row: span 1;
    transform: scale(0.8);
    z-index: 6;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-radius: 8px;
}

.gallery-products.mosaic-mode .product-card:nth-child(6) {
    grid-column: span 3;
    grid-row: span 2;
    transform: scale(0.95);
    z-index: 5;
    box-shadow: 0 7px 16px rgba(0,0,0,0.18);
    border-radius: 11px;
}

.gallery-products.mosaic-mode .product-card:nth-child(7) {
    grid-column: span 3;
    grid-row: span 1;
    transform: scale(0.75);
    z-index: 4;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    border-radius: 6px;
}

/* 第三行 - 小尺寸点缀 */
.gallery-products.mosaic-mode .product-card:nth-child(8) {
    grid-column: span 2;
    grid-row: span 1;
    transform: scale(0.7);
    z-index: 3;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border-radius: 5px;
}

.gallery-products.mosaic-mode .product-card:nth-child(9) {
    grid-column: span 4;
    grid-row: span 2;
    transform: scale(1.15);
    z-index: 2;
    box-shadow: 0 14px 32px rgba(0,0,0,0.28);
    border-radius: 16px;
}

.gallery-products.mosaic-mode .product-card:nth-child(10) {
    grid-column: span 3;
    grid-row: span 1;
    transform: scale(0.85);
    z-index: 1;
    box-shadow: 0 5px 14px rgba(0,0,0,0.12);
    border-radius: 9px;
}

/* 悬停效果增强 */
/* 拼图模式图片显示优化 */
.gallery-products.mosaic-mode .product-image {
    width: 100%;
    height: 100%;
    min-height: 120px;
    overflow: hidden;
    border-radius: inherit;
}

.gallery-products.mosaic-mode .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    min-height: 120px;
}

.gallery-products.mosaic-mode .product-card:hover {
    transform: scale(1.1) !important;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4) !important;
    z-index: 100 !important;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 悬停时放大效果 */
.gallery-products.mosaic-mode .product-card:hover {
    transform: scale(1.1) !important;
}

/* 拼图模式悬停效果 */
.gallery-products.mosaic-mode .product-card:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    z-index: 20;
}

/* 平铺模式已移除 */

/* 瀑布流模式 - 等宽不等高 */
.gallery-products.waterfall-mode {
    column-count: 4;
    column-gap: 15px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.gallery-products.waterfall-mode .product-card {
    break-inside: avoid;
    margin-bottom: 15px;
    display: block;
}

/* 网格模式 - 等宽等高，电脑端四列 */
.gallery-products.grid-mode {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.gallery-products.grid-mode .product-card {
    margin-bottom: 0;
    display: block;
}

.gallery-products.grid-mode .product-image img {
    height: 300px;
    object-fit: cover;
}

/* 缩略图模式 - 紧凑小图 */
/* 缩略图模式 - 全屏图片查看器 */
.gallery-products.thumbnail-mode {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.95) !important;
    z-index: 9999 !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* 主图片区域 */
.thumbnail-main-image {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    position: relative;
    min-height: 0; /* 确保flex子元素可以收缩 */
}

.thumbnail-main-image img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 0;
    box-shadow: none;
}

/* 关闭按钮 */
.thumbnail-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    color: white;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10000;
}

.thumbnail-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

/* 缩略图底部区域 */
.thumbnail-bottom-bar {
    height: 100px !important;
    background: rgba(0, 0, 0, 0.9) !important;
    padding: 10px 20px !important;
    overflow-x: auto !important;
    display: flex !important;
    gap: 10px !important;
    align-items: center !important;
    flex-shrink: 0 !important; /* 防止被压缩 */
    position: relative !important;
    z-index: 10000 !important;
}

.thumbnail-bottom-bar::-webkit-scrollbar {
    height: 6px;
}

.thumbnail-bottom-bar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.thumbnail-bottom-bar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.thumbnail-bottom-bar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* 缩略图项 */
.thumbnail-item {
    flex-shrink: 0;
    width: 70px;
    height: 70px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.thumbnail-item.active {
    border-color: #007cba;
    opacity: 1;
    transform: scale(1.05);
}

.thumbnail-item:hover {
    opacity: 1;
    transform: scale(1.05);
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 缩略图模式隐藏原有内容 */
.gallery-products.thumbnail-mode .product-card {
    display: none;
}

/* 缩略图模式显示新的结构 */
.thumbnail-main-image,
.thumbnail-bottom-bar {
    display: block;
}

/* 风车控制按钮 */
.floating-control-button {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 1000;
    transition: all 0.3s ease;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* 风车外观 - 更像真实风车 */
.control-icon {
    width: 42px;
    height: 42px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 1;
}

/* 风车SVG样式 */
.windmill-svg {
    width: 100%;
    height: 100%;
    transform-origin: center;
    transition: all 0.3s ease;
}

/* 风车中心点 - SVG中已包含 */

/* 激活状态 - 快速旋转（1秒一圈） */
.control-icon.active {
    animation: windmill-spin 1s linear infinite;
    opacity: 1;
}

/* 静默状态 - 慢速旋转（3秒一圈），透明度70% */
.control-icon.silent {
    animation: windmill-spin 3s linear infinite;
    opacity: 0.7;
    transition: opacity 1s ease;
}

/* 风车旋转动画 */
@keyframes windmill-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.control-icon:hover {
    transform: scale(1.1);
    opacity: 1;
}

.control-menu {
    position: absolute;
    bottom: 70px;
    left: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    padding: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    min-width: 150px;
    z-index: 1001;
}

.floating-control-button:hover .control-menu,
.floating-control-button.menu-open .control-menu,
.control-menu:hover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.control-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-align: left;
}

.control-option:hover {
    background: #f5f5f5;
}

.control-option.active {
    background: #007cba;
    color: white;
}

.control-option.active:hover {
    background: #005a8b;
}

.control-option i {
    width: 20px;
    color: #666;
}

.control-option span {
    color: #333;
    font-size: 14px;
}

/* 分享弹窗 */
.share-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.share-modal.active {
    display: flex;
}

.share-modal-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
}

.share-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.share-modal-header h3 {
    margin: 0;
    color: #333;
}

.close-modal {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
}

.share-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.share-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px;
    border: none;
    border-radius: 0;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

.share-option:hover {
    background: #f5f5f5;
    border-color: #2196f3;
}

.share-option i {
    font-size: 24px;
    color: #666;
}

.share-option span {
    font-size: 12px;
    color: #666;
}

/* 分页样式 */
.gallery-pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.pagination-btn {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: white;
    color: #666;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.pagination-btn:hover,
.pagination-btn.active {
    background: #2196f3;
    color: white;
    border-color: #2196f3;
}

/* 加载动画 */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 40px;
    color: #666;
    flex-direction: row; /* 确保横向显示 */
}

.loading-spinner i {
    font-size: 30px;
    margin: 0;
}

.loading-spinner p {
    margin: 0;
    font-size: 16px;
}

/* 响应式设计 */

/* 平板端：3列瀑布流 */
@media (max-width: 1024px) and (min-width: 769px) {
    #gallery-products {
        column-count: 3;
        column-gap: 8px;
        padding: 15px;
    }
    
    .product-card {
        margin-bottom: 8px;
    }
    
    .gallery-products.mosaic-mode {
        column-count: 3;
    }
    
    .gallery-products.waterfall-mode {
        column-count: 3;
    }
    
    .floating-control-button {
        bottom: 20px;
        left: 20px;
    }
    
    .control-icon {
        width: 35px;
        height: 35px;
    }
}

/* 手机端：2列瀑布流 */
@media (max-width: 768px) {
    .gallery-wall-container {
        padding: 15px;
    }
    
    .gallery-header h1 {
        font-size: 2rem;
    }
    
    .tag-filter-container {
        top: 70px; /* 移动端为导航栏留出空间 */
        padding: 10px 0;
    }
    
    .tag-filter-bar {
        padding: 0 15px;
    }
    
    #gallery-products {
        column-count: 2;
        column-gap: 8px;
        padding: 10px;
        margin-top: 90px; /* 移动端为标签栏留出空间 */
    }
    
    .product-card {
        margin-bottom: 8px;
    }
    
    .gallery-products.mosaic-mode {
        column-count: 2;
    }
    
    .gallery-products.waterfall-mode {
        column-count: 2;
    }
    
    .floating-control-button {
        bottom: 20px;
        left: 20px;
    }
    
    .control-icon {
        width: 35px;
        height: 35px;
    }
    
    .action-btn {
        width: 30px;
        height: 30px;
    }
    
    .share-options {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    #gallery-products {
        column-gap: 4px;
        padding: 5px;
    }
    
    .product-card {
        margin-bottom: 4px;
    }
    
    .action-btn {
        width: 25px;
        height: 25px;
    }
} 