/**
 * 精工之声（视频）- 参考“精工佳品”复刻样式
 * 目标：
 * - 大屏幕（> 1800px）：容器最大宽度 1800px，居中，左右留白
 * - 中等屏幕（768px - 1800px）：容器宽度自适应，左右各 15px 内边距
 * - 小屏幕（< 768px）：容器占满宽度，左右各 10px 内边距
 *
 * 说明：
 * - 该 CSS 仅在精工之声页面引入，不影响其他页面
 * - 基于 product-gallery.css 的关键布局/筛选/瀑布流样式抽取与复刻
 */

/* ========================================
   容器宽度限制（与参考站点一致）
   ======================================== */
.container-fluid {
    max-width: 1800px;
    margin: 0 auto;
    padding-left: 15px;
    padding-right: 15px;
}

@media (max-width: 768px) {
    .container-fluid {
        max-width: 100%;
        padding-left: 10px;
        padding-right: 10px;
    }
}

/* page_pos容器宽度限制（与瀑布流容器对齐，参考精工佳品） */
.voice-video-page .page_pos {
    max-width: 1800px !important;
    width: auto !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
    margin-bottom: 20px;
    /* 保持原有的 flex 布局（用于面包屑和搜索表单） */
    display: flex;
    align-items: center;
    justify-content: space-between;
}

@media (max-width: 768px) {
    .voice-video-page .page_pos {
        max-width: 100% !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
}

/* ========================================
   Bootstrap 常用工具类（最小集）
   ======================================== */
.d-flex { display: flex !important; }
.align-items-center { align-items: center !important; }
.justify-content-between { justify-content: space-between !important; }
.flex-wrap { flex-wrap: wrap !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 1rem !important; }
.me-1 { margin-right: 0.25rem !important; }
.me-2 { margin-right: 0.5rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }

/* ========================================
   工具栏（复刻精工佳品风格）
   ======================================== */
.toolbar {
    background: #f2f2f2;
    padding: 12px 16px;
    border-radius: 6px;
    border: 1px solid rgba(207, 156, 126, 0.3);
    box-shadow: none;
    margin-top: 12px;
}
.toolbar.mb-4 { margin-bottom: 12px !important; }
.toolbar-info { font-size: 14px; color: #666; }
.toolbar-info strong { color: #cf9c7e; }

/* 工具栏操作区域：间隙缩减50% */
.toolbar-actions.gap-2 {
    gap: 0.25rem !important; /* 从 0.5rem 缩减到 0.25rem（50%） */
}

/* 搜索框 */
.search-wrapper { position: relative; }
/* 工具栏内搜索：样式对齐顶部 page_pos 通用搜索栏 */
.search-wrapper .toolbar-search-form {
    width: 360px;
    height: 31px; /* 与工具栏按钮高度一致 */
    position: relative;
    margin: 0;
}
.search-wrapper .toolbar-search-form input[type="text"] {
    display: block;
    width: 100%;
    height: 100%;
    line-height: 29px;
    font-size: 13px;
    color: #333;
    padding-left: 15px;
    padding-right: 40px;
    border: 1px solid rgba(207, 156, 126, 0.9); /* 金色边框 */
    border-radius: 16px;
    background: #f2f2f2;
    outline: none;
    box-sizing: border-box;
}
.search-wrapper .toolbar-search-form input[type="text"]::placeholder { color: #858585; }
.search-wrapper .toolbar-search-form input[type="submit"] {
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: 1px solid rgba(207, 156, 126, 0.3);
    border-radius: 50%;
    background: url("../images/search.png") #cf9c7e center no-repeat;
    background-size: 60%;
    outline: none;
    cursor: pointer;
    transition: border-color 0.25s;
}
.search-wrapper .toolbar-search-form input[type="submit"]:hover {
    border-color: #cf9c7e;
}

.search-wrapper .toolbar-search-form input[type="text"]::placeholder { color: #999; }
.search-wrapper .toolbar-search-form input[type="text"]:hover { border-color: #cf9c7e; }
.search-wrapper .toolbar-search-form input[type="text"]:focus {
    background: #f2f2f2;
    border-color: #a67a5a;
    box-shadow: 0 0 0 2px rgba(207, 156, 126, 0.18);
}

@media (max-width: 768px) {
    .search-wrapper .toolbar-search-form {
        width: 240px;
        height: 31px;
    }
    .search-wrapper .toolbar-search-form input[type="text"] {
        line-height: 29px;
        padding-left: 12px;
        padding-right: 38px;
    }
    .search-wrapper .toolbar-search-form input[type="submit"] {
        width: 24px;
        height: 24px;
        right: 2px;
    }
}

/* 排序按钮组 - 基础样式 */
.btn-group .btn {
    background: #f2f2f2;
    border: 1px solid rgba(207, 156, 126, 0.3);
    color: #333;
    font-size: 13px;
    height: 31px;
    padding: 6px 12px;
    border-radius: 6px;
}
.btn-group .btn:hover {
    background: rgba(207, 156, 126, 0.1);
    border-color: #cf9c7e;
    color: #cf9c7e;
}
/* 注意：.btn-outline-secondary.active 会覆盖 .btn-group .btn.active */
.btn-group .btn.active {
    background: #a67a5a;
    border-color: #a67a5a;
    color: #333;
}
/* 排序按钮 - 未激活状态 */
.btn-outline-secondary {
    background: #f2f2f2; /* 浅灰色背景 */
    border-color: rgba(207, 156, 126, 0.3); /* 半透明金色边框 */
    color: #666; /* 灰色字体 */
    border-radius: 6px;
}

.btn-outline-secondary i {
    color: #666; /* 灰色图标 */
}

.btn-outline-secondary:hover {
    background: rgba(207, 156, 126, 0.1);
    border-color: #cf9c7e;
    color: #cf9c7e;
}

.btn-outline-secondary:hover i {
    color: #cf9c7e; /* hover 时图标变金色 */
}

/* 排序按钮 - 激活状态 */
.btn-group .btn-outline-secondary.active,
.btn-outline-secondary.active {
    background: transparent !important; /* 透明背景（覆盖基础样式） */
    border-color: #cf9c7e !important; /* 金色边框 */
    color: #cf9c7e !important; /* 金色字体 */
}

.btn-group .btn-outline-secondary.active i,
.btn-outline-secondary.active i {
    color: #cf9c7e !important; /* 金色图标 */
}

/* ========================================
   筛选按钮 + 面板（复刻精工佳品）
   ======================================== */
.btn-filter-minimal,
.btn-filter-reset {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    height: 31px;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    background: #f2f2f2;
    border: 1px solid rgba(207, 156, 126, 0.3);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.25s;
    white-space: nowrap;
}
.btn-filter-minimal:hover,
.btn-filter-reset:hover {
    background: rgba(207, 156, 126, 0.15);
    border-color: #cf9c7e;
    color: #cf9c7e;
}

.filter-slide-panel { display: none; align-items: center; gap: 8px; }
.filter-slide-panel.active { display: flex; }
.filter-separator { width: 1px; height: 24px; background: rgba(207, 156, 126, 0.3); }

.filter-dimension-item { position: relative; flex-shrink: 0; }
.filter-dimension-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    height: 31px;
    background: #f2f2f2;
    border: 1px solid rgba(207, 156, 126, 0.18);
    border-radius: 6px;
    color: #333;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.filter-dimension-btn:hover,
.filter-dimension-btn.active {
    background: rgba(207, 156, 126, 0.1);
    border-color: #cf9c7e;
    color: #cf9c7e;
}
.filter-dimension-btn.selected {
    background: rgba(207, 156, 126, 0.1);
    border-color: #cf9c7e;
    color: #cf9c7e;
    font-weight: 600;
}
.filter-dimension-btn i { font-size: 11px; transition: transform 0.2s; }
.filter-dimension-btn.active i { transform: rotate(180deg); }

.filter-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 400px;
    margin-top: 8px;
    padding: 16px;
    background: #fff;
    border: 1px solid rgba(207, 156, 126, 0.3);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(207, 156, 126, 0.2);
    max-height: 400px;
    overflow-y: auto;
    z-index: 100;
}
.filter-dropdown-grid { display: flex; flex-direction: column; gap: 2px; }
.filter-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid rgba(207, 156, 126, 0.2);
    border-radius: 6px;
    color: #333;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.25s ease;
}
.filter-dropdown-item:hover {
    background: rgba(207, 156, 126, 0.1);
    color: #cf9c7e;
    border-color: #cf9c7e;
    transform: translateX(2px);
}
.filter-dropdown-item.has-children { cursor: pointer; }
.filter-children-container { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.filter-children-container.show { max-height: 1000px; }
.filter-dropdown-item-level-1 { background: rgba(207, 156, 126, 0.05); font-size: 13px; border-left: 3px solid rgba(207, 156, 126, 0.5); margin-left: 15px; }
.filter-dropdown-item-level-2 { background: rgba(207, 156, 126, 0.03); font-size: 12px; border-left: 3px solid rgba(207, 156, 126, 0.35); margin-left: 30px; }
.filter-dropdown-item-level-3 { background: rgba(207, 156, 126, 0.02); font-size: 11px; border-left: 3px solid rgba(207, 156, 126, 0.25); margin-left: 45px; }
.filter-view-all {
    background: rgba(207, 156, 126, 0.1) !important;
    border-style: dashed !important;
    font-style: italic;
    margin-bottom: 4px;
    color: #cf9c7e !important;
}

/* ========================================
   瀑布流（Justified 等高布局）复刻
   ======================================== */
.masonry-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-start;
    justify-content: flex-start;
    margin-bottom: 40px;
    min-height: 200px;
}
.masonry-grid::after { content: ''; flex-grow: 999; }
.masonry-item { position: relative; display: block; opacity: 0; animation: vvFadeIn 0.3s ease-in-out forwards; }
@keyframes vvFadeIn { to { opacity: 1; } }

.masonry-item .minimal-image-thumb {
    height: 200px;
    width: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}
@media (max-width: 1400px) { .masonry-item .minimal-image-thumb { height: 180px; } }
@media (max-width: 992px) { .masonry-item .minimal-image-thumb { height: 160px; } }
@media (max-width: 768px) { .masonry-item .minimal-image-thumb { height: 140px; } .masonry-grid { gap: 8px; } }
@media (max-width: 576px) { .masonry-item .minimal-image-thumb { height: 120px; } .masonry-grid { gap: 6px; } }

.minimal-image-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(207, 156, 126, 0.3);
    background: #f5f5f5;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    will-change: transform, box-shadow, border-color;
}
.minimal-image-card:hover {
    border-color: #cf9c7e;
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(207, 156, 126, 0.1), 0 4px 12px rgba(207, 156, 126, 0.15);
}
.minimal-image-card:hover .minimal-image-thumb { transform: scale(1.05); }

.image-info-overlay {
    position: static;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.98) 100%);
    backdrop-filter: blur(12px);
    padding: 10px 12px;
    border-top: 1px solid rgba(207, 156, 126, 0.12);
    width: 100%;
    box-sizing: border-box;
    min-height: 44px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.minimal-image-card:hover .image-info-overlay {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 1) 100%);
    border-top-color: rgba(207, 156, 126, 0.25);
}
.image-title-minimal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    width: 100%;
}
.image-category-tags {
    flex: 1;
    min-width: 0;
    color: #333;
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.minimal-image-card:hover .image-category-tags { color: #b88a6a; }
.image-file-size {
    flex-shrink: 0;
    color: #cf9c7e;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(207, 156, 126, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.minimal-image-card:hover .image-file-size { background: rgba(207, 156, 126, 0.15); color: #b88a6a; }

/* 悬停按钮组（用于播放） */
.image-hover-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 6px;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-4px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
@media (min-width: 768px) {
    .minimal-image-card:hover .image-hover-actions {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }
}
@media (max-width: 767px) {
    .image-hover-actions {
        opacity: 1 !important;
        pointer-events: auto !important;
        transform: translateY(0) !important;
    }
}
.image-action-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
}
.image-action-btn:hover {
    background: rgba(207, 156, 126, 0.9);
    border-color: rgba(207, 156, 126, 1);
    color: #ffffff;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(207, 156, 126, 0.4);
}
.image-action-btn i { font-size: 16px; }



