/**
 * 商品榜单页面样式
 * Product Ranking Page Styles
 */

/* ==================== 商品榜单模块容器样式 ==================== */
#productRankingModule {
    display: none;
}

#productRankingModule[style*="display: block"],
#productRankingModule:not([style*="display: none"]) {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 80px);
    overflow: hidden;
}

#productRankingModule[style*="display: block"] .container-fluid,
#productRankingModule:not([style*="display: none"]) .container-fluid {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 1rem;
}

#rankingTabs {
    flex-shrink: 0;
    margin-bottom: 1rem !important;
}

#rankingTabContent {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
}

#rankingTabContent::-webkit-scrollbar {
    width: 6px;
}

#rankingTabContent::-webkit-scrollbar-track {
    background: transparent;
}

#rankingTabContent::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

#rankingTabContent::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 每个Tab面板的卡片布局 */
.tab-pane .card:last-of-type {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 280px);
}

.tab-pane .card:last-of-type .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
}

.tab-pane .card:last-of-type .card-body > .table-responsive {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
    padding: 0.75rem;
}

.tab-pane .card:last-of-type .card-body > .table-responsive::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.tab-pane .card:last-of-type .card-body > .table-responsive::-webkit-scrollbar-track {
    background: #f8fafc;
    border-radius: 3px;
}

.tab-pane .card:last-of-type .card-body > .table-responsive::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.tab-pane .card:last-of-type .card-body > .table-responsive::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 表格头部固定 */
.tab-pane .card:last-of-type .ranking-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.tab-pane .card:last-of-type .card-body > div:last-child {
    flex-shrink: 0;
    padding: 0.75rem 1rem;
    border-top: 1px solid #e9ecef;
    background: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ==================== 榜单Tab样式 ==================== */
.ranking-tabs .nav-link {
    color: #666;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.ranking-tabs .nav-link:hover {
    background-color: #f0f0f0;
    color: #333;
}

.ranking-tabs .nav-link.active {
    background-color: #667eea;
    color: white;
    font-weight: 600;
}

/* ==================== 筛选栏样式 ==================== */
.filter-bar {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    margin-bottom: 1rem;
}

.filter-bar .form-label {
    font-weight: 500;
    color: #333;
}

.filter-bar .input-group-text {
    background-color: white;
    border-color: #dee2e6;
    font-size: 13px;
}

.filter-bar .form-control,
.filter-bar .form-select {
    border-color: #dee2e6;
    font-size: 13px;
}

.filter-bar .form-control:focus,
.filter-bar .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15);
}

.filter-bar .btn-group .btn {
    font-size: 13px;
    padding: 0.375rem 0.75rem;
    border-color: #dee2e6;
}

.filter-bar .btn-group .btn-primary {
    background-color: #667eea;
    border-color: #667eea;
}

.filter-bar .btn-group .btn-outline-secondary {
    color: #666;
    background-color: white;
}

.filter-bar .btn-group .btn-outline-secondary:hover {
    background-color: #f8f9fa;
    color: #333;
}

/* ==================== 榜单表格样式 ==================== */
.ranking-table-container {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.ranking-table {
    margin-bottom: 0;
    table-layout: fixed;
    width: 100%;
    border-collapse: collapse;
}

.ranking-table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #333;
    vertical-align: middle;
    white-space: nowrap;
    padding: 12px 8px;
    font-size: 13px;
}

/* 排名列 */
.ranking-table th:nth-child(1),
.ranking-table td:nth-child(1) {
    width: 80px;
    text-align: center;
}

/* 商品信息列 */
.ranking-table th:nth-child(2),
.ranking-table td:nth-child(2) {
    width: 35%;
    min-width: 250px;
}

/* 店铺信息列 */
.ranking-table th:nth-child(3),
.ranking-table td:nth-child(3) {
    width: 18%;
    min-width: 150px;
}

/* 数据列 */
.ranking-table th:nth-child(4),
.ranking-table td:nth-child(4),
.ranking-table th:nth-child(5),
.ranking-table td:nth-child(5),
.ranking-table th:nth-child(6),
.ranking-table td:nth-child(6),
.ranking-table th:nth-child(7),
.ranking-table td:nth-child(7) {
    width: 11%;
    min-width: 100px;
    text-align: right;
}

.ranking-table tbody tr {
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.ranking-table tbody tr:hover {
    background-color: #f8f9fa;
}

.ranking-table tbody tr:last-child {
    border-bottom: none;
}

.ranking-table td {
    vertical-align: middle;
    padding: 12px 8px;
    font-size: 13px;
}

/* ==================== 商品信息样式 - 与商品列表保持一致 ==================== */
.product-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.product-info .product-image {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    object-fit: cover;
    border: none;
}

.product-info .product-details {
    flex: 1;
    min-width: 0;
}

.product-info .product-name {
    font-size: 15px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
    cursor: pointer;
    transition: color 0.2s ease;
}

.product-info .product-name:hover {
    color: #667eea;
    text-decoration: underline;
}

.product-info .product-price {
    font-size: 18px;
    font-weight: 600;
    color: #f56c6c;
}

.product-info .product-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* ==================== 店铺信息样式 ==================== */
.shop-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.shop-info .shop-logo {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 50%;
    border: 1px solid #e9ecef;
    flex-shrink: 0;
}

.shop-info .shop-details {
    flex: 1;
    min-width: 0;
}

.shop-info .shop-name {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shop-info .shop-id {
    font-size: 11px;
    color: #999;
}

/* ==================== 排名趋势样式 ==================== */
.ranking-trend {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.ranking-trend .rank-number {
    font-weight: 700;
    font-size: 18px;
    color: #333;
}

.ranking-trend .trend-arrow {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 2px;
    font-weight: 600;
}

/* 上升趋势 - 红色向上箭头（正数） */
.ranking-trend .trend-arrow.up {
    color: #f56c6c;
    font-weight: 600;
}

.ranking-trend .trend-arrow.up i {
    font-size: 14px;
}

/* 下降趋势 - 绿色向下箭头（负数） */
.ranking-trend .trend-arrow.down {
    color: #67c23a;
    font-weight: 600;
}

.ranking-trend .trend-arrow.down i {
    font-size: 14px;
}

/* 无变化（0或无数据） */
.ranking-trend .trend-arrow.no-change {
    color: #909399;
    font-size: 16px;
    font-weight: 500;
}

/* ==================== 排名徽章样式 ==================== */
.ranking-table .badge {
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
    font-weight: 600;
}

/* ==================== 排名箭头样式 ==================== */
.ranking-table .bi-arrow-up {
    margin-left: 0.5rem;
}

.ranking-table .bi-arrow-down {
    margin-left: 0.5rem;
}

.ranking-table .bi-dash {
    margin-left: 0.5rem;
}

/* ==================== 操作按钮样式 ==================== */
.ranking-table .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* ==================== 分页样式 - 完全参考商品列表 ==================== */
.ranking-pagination-container {
    padding: 1rem 0;
    border-top: 1px solid #e9ecef;
}

.ranking-pagination-container .ranking-total-count {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

/* 分页按钮样式 - 与商品列表保持完全一致 */
.ranking-pagination {
    --bs-pagination-padding-x: 0.75rem;
    --bs-pagination-padding-y: 0.375rem;
    --bs-pagination-font-size: 1rem;
    --bs-pagination-color: #667eea;
    --bs-pagination-bg: #fff;
    --bs-pagination-border-width: 1px;
    --bs-pagination-border-color: #dee2e6;
    --bs-pagination-border-radius: 0.375rem;
    --bs-pagination-hover-color: #667eea;
    --bs-pagination-hover-bg: #f8f9fa;
    --bs-pagination-hover-border-color: #dee2e6;
    --bs-pagination-focus-color: #667eea;
    --bs-pagination-focus-bg: #e9ecef;
    --bs-pagination-focus-box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.25);
    --bs-pagination-active-color: #fff;
    --bs-pagination-active-bg: #667eea;
    --bs-pagination-active-border-color: #667eea;
    --bs-pagination-disabled-color: #6c757d;
    --bs-pagination-disabled-bg: #fff;
    --bs-pagination-disabled-border-color: #dee2e6;
    display: flex;
    padding-left: 0;
    list-style: none;
}

.ranking-pagination .page-link {
    position: relative;
    display: block;
    padding: var(--bs-pagination-padding-y) var(--bs-pagination-padding-x);
    font-size: var(--bs-pagination-font-size);
    color: var(--bs-pagination-color);
    text-decoration: none;
    background-color: var(--bs-pagination-bg);
    border: var(--bs-pagination-border-width) solid var(--bs-pagination-border-color);
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.ranking-pagination .page-link:hover {
    z-index: 2;
    color: var(--bs-pagination-hover-color);
    background-color: var(--bs-pagination-hover-bg);
    border-color: var(--bs-pagination-hover-border-color);
}

.ranking-pagination .page-link:focus {
    z-index: 3;
    color: var(--bs-pagination-focus-color);
    background-color: var(--bs-pagination-focus-bg);
    outline: 0;
    box-shadow: var(--bs-pagination-focus-box-shadow);
}

.ranking-pagination .page-item:not(:first-child) .page-link {
    margin-left: -1px;
}

.ranking-pagination .page-item.active .page-link {
    z-index: 3;
    color: var(--bs-pagination-active-color);
    background-color: var(--bs-pagination-active-bg);
    border-color: var(--bs-pagination-active-border-color);
}

.ranking-pagination .page-item.disabled .page-link {
    color: var(--bs-pagination-disabled-color);
    pointer-events: none;
    background-color: var(--bs-pagination-disabled-bg);
    border-color: var(--bs-pagination-disabled-border-color);
}

.ranking-pagination .page-item:first-child .page-link {
    border-top-left-radius: var(--bs-pagination-border-radius);
    border-bottom-left-radius: var(--bs-pagination-border-radius);
}

.ranking-pagination .page-item:last-child .page-link {
    border-top-right-radius: var(--bs-pagination-border-radius);
    border-bottom-right-radius: var(--bs-pagination-border-radius);
}

/* 分页导航容器 */
.ranking-pagination-nav {
    display: flex;
    justify-content: center;
}

/* ==================== 日期范围选择器样式 ==================== */
#dateRangeInput {
    font-size: 0.875rem;
}

/* ==================== 时间粒度按钮组样式 ==================== */
.btn-group .btn {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
}

/* ==================== 加载占位样式 ==================== */
.text-center.py-5 .bi {
    font-size: 4rem;
    opacity: 0.5;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
    .ranking-tabs .nav-link {
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
    }

    .filter-bar .row > div {
        margin-bottom: 0.5rem;
    }

    .ranking-table {
        font-size: 0.875rem;
    }

    .product-thumb {
        width: 32px;
        height: 32px;
    }

    .shop-avatar {
        width: 20px;
        height: 20px;
    }
}

/* ==================== 表格排序指示器样式 ==================== */
.ranking-table th .bi-caret-down-fill {
    font-size: 0.75rem;
    margin-left: 0.25rem;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.ranking-table th .bi-caret-down-fill:hover {
    opacity: 1;
}

/* ==================== 空状态样式 ==================== */
.empty-state {
    padding: 3rem 1rem;
    text-align: center;
}

.empty-state .bi {
    font-size: 4rem;
    color: #dee2e6;
    margin-bottom: 1rem;
}

.empty-state h5 {
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: #adb5bd;
    margin-bottom: 1.5rem;
}

/* ==================== 🎬 视频缩略图组件样式（视频榜使用） ==================== */

/* 视频缩略图列表容器：5个并排 - 尺寸与商品主图一致 */
.video-thumb-list {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    justify-content: flex-start;
    /* 关键：允许容器在表格空间内自适应，不使用min-width撑破布局 */
    width: auto;
    max-width: 100%;
    height: auto;
    /* 强制不换行，保持一排 */
    white-space: nowrap;
}

/* 单个视频槽位 - 尺寸严格固定为80x80px，与商品主图完全一致 */
.video-thumb-slot {
    position: relative;
    /* 严格固定尺寸：绝对不允许超过80x80 */
    width: 80px !important;
    height: 80px !important;
    min-width: 80px !important;
    max-width: 80px !important;
    min-height: 80px !important;
    max-height: 80px !important;
    border-radius: 12px;
    overflow: hidden;
    border: none;
    background-color: #f8f9fa;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block !important;
    box-sizing: border-box;
    /* 关键：flex item允许微调收缩但不低于80px */
    flex: 0 0 80px;
    /* 清除object-fit：这个属性只对img/replaced元素有效 */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 0;
    padding: 0;
    vertical-align: top;
}

.video-thumb-slot:hover {
    box-shadow: 0 2px 16px rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
    text-decoration: none;
}

/* 视频封面图 - 严格限制在80x80内，绝不超出容器 */
.video-thumb-img {
    /* 关键：填充父容器的100%，而不是固定80px避免布局冲突 */
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: cover;
    display: block;
    border: none;
    padding: 0;
    margin: 0;
}

/* 播放图标浮层 */
.video-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 34px;
    height: 34px;
    background-color: rgba(0, 0, 0, 0.55);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: background-color 0.2s ease;
}

.video-thumb-slot:hover .video-play-icon {
    background-color: rgba(102, 126, 234, 0.92);
}

/* 最后一个"共N条"卡片样式 - 同样80x80px尺寸 - 🔴改为透明模板 */
.video-more-slot {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* 🔴🔴 透明模板：绝对保证透明，彻底去除紫蓝渐变，禁止任何background-image */
    background-color: rgba(255, 255, 255, 0.35) !important;
    background-image: none !important;
    background: rgba(255, 255, 255, 0.35) !important;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1.5px dashed #a0aec0 !important;
    color: #2d3748;
    cursor: pointer;
    padding: 4px;
    line-height: 1.1;
    box-sizing: border-box !important;
    box-shadow: none !important;
    transition: all 0.2s ease;
    /* 🔴 hover时提高层级，保证弹出层在最上 */
    z-index: auto;
}

/* 🔴 hover时整个slot以及它的祖先都要置顶，防止被同级别其他元素/菜单栏遮挡 */
.video-ranking-table tbody tr:hover td:nth-child(3),
.video-ranking-table tbody tr:hover,
.video-more-slot:hover {
    position: relative !important;
    z-index: 9999999998 !important;
}

.video-more-slot:hover {
    /* 🔴 hover时保持透明底，绝对不要有蓝色/紫蓝渐变 */
    background-color: rgba(255, 255, 255, 0.55) !important;
    background-image: none !important;
    background: rgba(255, 255, 255, 0.55) !important;
    border-color: #667eea !important;
    border-style: solid !important;
    color: #667eea !important;
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.25) !important;
    transform: translateY(-2px);
}

/* 🔴 悬浮弹出层组件：position:fixed 相对视口 → 彻底脱离父容器（td/tr/table/main）的overflow裁剪，
   永远能显示在所有页面元素（包括行业类目菜单栏）之上。位置由JS mouseenter动态计算fixed left/top。 */
.video-more-popup {
    position: fixed !important;
    /* 🔴 left/top由 JS 的 positionVideoMorePopup() 动态写入，保证和slot对齐且不超屏 */
    left: auto;
    top: auto;
    right: auto;
    bottom: auto;
    z-index: 9999999999 !important;
    display: none;
    /* 默认每排5个：5*80 + 4*8 + padding(16*2) = 400+32+32=464，多一点余量 */
    width: 480px;
    max-height: 520px;
    overflow-y: auto;
    /* 🔴 弹出层半透明毛玻璃（用户要求透明色非蓝/白实底） */
    background-color: rgba(255, 255, 255, 0.88) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 16px 48px rgba(15, 23, 42, 0.18), 0 4px 12px rgba(15, 23, 42, 0.08);
    /* 淡入动画 */
    animation: videoMorePopupFadeIn 0.18s ease-out;
}

/* 弹出层标题 */
.video-more-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f1f5f9;
}
.video-more-popup-title {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
}
.video-more-popup-subtitle {
    font-size: 12px;
    color: #64748b;
    font-weight: 400;
}

/* 弹出层视频列表容器：flex-wrap自然换行 → 每排5个(容器宽度480px正好5个80px+间距) */
.video-more-popup-list {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 8px;
}

/* 弹出层中的单个槽位与主列表缩略图尺寸一致：80x80 */
.video-more-popup-item {
    position: relative;
    display: inline-block;
    width: 80px !important;
    height: 80px !important;
    min-width: 80px !important;
    max-width: 80px !important;
    min-height: 80px !important;
    max-height: 80px !important;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    border: none;
    text-decoration: none;
    background-color: #f8f9fa;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
    transition: all 0.2s ease;
    flex: 0 0 80px;
}
.video-more-popup-item:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.3);
}
.video-more-popup-item img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: block;
    margin: 0;
    padding: 0;
    border: none;
}
/* 播放图标（复用） */
.video-more-popup-item .video-play-icon {
    width: 30px;
    height: 30px;
}

/* 🔴 触发显示：hover时弹出层显示 */
.video-more-slot:hover .video-more-popup,
.video-more-popup:hover {
    display: block;
}

/* 淡入动画 keyframes - 向上弹出用（从下往上浮入） */
@keyframes videoMorePopupFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* 滚动条美化（popup内） */
.video-more-popup::-webkit-scrollbar { width: 6px; }
.video-more-popup::-webkit-scrollbar-track { background: #f8fafc; border-radius: 3px; }
.video-more-popup::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.video-more-popup::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.video-more-text {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.5px;
    opacity: 0.85;
}

/* 格式：只显示「+M」，一行居中大字红色醒目 */
.video-more-count {
    font-size: 20px;
    font-weight: 700;
    color: inherit;
    line-height: 1;
    margin: 2px 0;
}
.video-more-plus {
    font-size: 28px;
    font-weight: 800;
    color: #ef4444;
    line-height: 1;
    margin: 0;
    text-align: center;
    letter-spacing: -1px;
    text-shadow: 0 1px 2px rgba(239, 68, 68, 0.25);
}

/* 🔴 hover bridge：弥合卡片和弹出层之间10px间隙，保证鼠标能滑入 - z-index同步极端高 */
.video-more-slot::after {
    content: '';
    position: absolute;
    right: 0;
    /* 向上悬浮：bridge在卡片顶部和弹出层底部之间（高度10px填充视觉间隙） */
    bottom: 100%;
    width: 480px;
    height: 10px;
    background: transparent;
    z-index: 9999999998 !important;
    pointer-events: auto;
    display: block;
}

/* 🔴🔴 关键：视频榜表格相关祖先全部overflow:visible + position:relative，防止向上悬浮被裁切
   否则哪怕z-index再高，父元素overflow:hidden也会把弹出层上方裁掉 */
.video-ranking-table,
.video-ranking-table tbody,
.video-ranking-table thead,
.video-ranking-table tr,
.video-ranking-table td:nth-child(3),
.video-ranking-table th:nth-child(3),
.ranking-table-container {
    overflow: visible !important;
    position: relative;
}

/* 响应式适配 - 1500px以下略微缩小（与主图同步72px） */
@media (max-width: 1500px) {
    .video-thumb-list {
        /* 不使用硬编码min-width，让flex自动根据空间调整 */
        min-height: auto;
        gap: 6px;
    }

    .video-thumb-slot {
        /* 严格72x72，与主图完全一致 */
        width: 72px !important;
        height: 72px !important;
        min-width: 72px !important;
        max-width: 72px !important;
        min-height: 72px !important;
        max-height: 72px !important;
        flex: 0 0 72px;
    }

    .video-thumb-img {
        /* img填充容器，而不是硬编码像素 */
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
    }

    .video-more-count {
        font-size: 18px;
    }

    .video-more-text {
        font-size: 10px;
    }

    .video-more-plus {
        font-size: 24px;
    }

    .video-play-icon {
        width: 30px;
        height: 30px;
    }

    /* 弹出层：1500px时槽位72，每排5个 → 5*72+4*6+padding*2 = 360+24+32 = 416px */
    .video-more-popup {
        width: 432px;
    }
    /* bridge宽度和popup保持一致 */
    .video-more-slot::after {
        width: 432px;
    }
    .video-more-popup-item {
        width: 72px !important; height: 72px !important;
        min-width: 72px !important; max-width: 72px !important;
        min-height: 72px !important; max-height: 72px !important;
        flex: 0 0 72px;
    }
    .video-more-popup-item .video-play-icon { width: 28px; height: 28px; }

    /* 商品主图与视频缩略图同步缩小 */
    .product-info .product-image {
        width: 72px;
        height: 72px;
    }
}

/* ==================== 📊 视频榜表格专属列宽样式 ==================== */
/* 🔴 关键：使用 table-layout: fixed 强制固定列宽，彻底禁止自动布局撑破 */
.video-ranking-table {
    table-layout: fixed !important;
    width: 100% !important;
    /* 🔴 8列最小总宽度：80+340+480+160*5 = 1700px，第4-8列（店铺+4数据列）均匀160px */
    min-width: 1700px !important;
    max-width: none !important;
}

/* th/td统一设置：消除Bootstrap默认padding差异，保证左右对齐 */
.video-ranking-table thead th,
.video-ranking-table tbody td {
    padding: 12px 8px !important;
    box-sizing: border-box;
    vertical-align: middle !important;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    /* 明确的border-box计算，避免padding导致th和td总宽度不一致 */
}

/* 但带货短视频列不能裁剪flex容器，允许可见 */
.video-ranking-table th:nth-child(3),
.video-ranking-table td:nth-child(3) {
    overflow: visible;
    white-space: normal;
}

/* 覆盖通用 ranking-table 的 nth-child 规则，确保视频缩略图展示完整 */
.video-ranking-table th:nth-child(1),
.video-ranking-table td:nth-child(1) {
    width: 80px !important;
    min-width: 80px !important;
    max-width: 80px !important;
    text-align: center !important;
}

.video-ranking-table th:nth-child(2),
.video-ranking-table td:nth-child(2) {
    width: 340px !important;
    min-width: 340px !important;
    max-width: 340px !important;
    text-align: left !important;
}

.video-ranking-table th:nth-child(3),
.video-ranking-table td:nth-child(3) {
    /* 带货短视频列缩短：520→480px */
    width: 480px !important;
    min-width: 480px !important;
    max-width: 480px !important;
    text-align: left !important;
}

/* 🔴 第4-8列（店铺名称 + 4个数据列）统一160px，完全均匀 */
.video-ranking-table th:nth-child(4),
.video-ranking-table td:nth-child(4),
.video-ranking-table th:nth-child(5),
.video-ranking-table td:nth-child(5),
.video-ranking-table th:nth-child(6),
.video-ranking-table td:nth-child(6),
.video-ranking-table th:nth-child(7),
.video-ranking-table td:nth-child(7),
.video-ranking-table th:nth-child(8),
.video-ranking-table td:nth-child(8) {
    width: 160px !important;
    min-width: 160px !important;
    max-width: 160px !important;
}

/* 第4列（店铺名称）单独左对齐 */
.video-ranking-table th:nth-child(4),
.video-ranking-table td:nth-child(4) {
    text-align: left !important;
}

/* 🔴 第5-8列（数据列）右对齐 */
.video-ranking-table th:nth-child(5),
.video-ranking-table td:nth-child(5),
.video-ranking-table th:nth-child(6),
.video-ranking-table td:nth-child(6),
.video-ranking-table th:nth-child(7),
.video-ranking-table td:nth-child(7),
.video-ranking-table th:nth-child(8),
.video-ranking-table td:nth-child(8) {
    text-align: right !important;
}

/* 响应式适配：1500px以下缩小视频榜表格列宽（5个72px视频 + 4个6px间距 = 384px + 余量） */
@media (max-width: 1500px) {
    .video-ranking-table {
        /* 🔴 8列总宽度：80+300+410+150*5 = 1540px，第4-8列均匀150px */
        min-width: 1540px !important;
    }

    .video-ranking-table th:nth-child(3),
    .video-ranking-table td:nth-child(3) {
        /* 带货短视频缩短：440→410px */
        width: 410px !important;
        min-width: 410px !important;
        max-width: 410px !important;
    }

    .video-ranking-table th:nth-child(2),
    .video-ranking-table td:nth-child(2) {
        width: 300px !important;
        min-width: 300px !important;
        max-width: 300px !important;
    }

    /* 1500px以下：第4-8列统一150px，完全均匀 */
    .video-ranking-table th:nth-child(4),
    .video-ranking-table td:nth-child(4),
    .video-ranking-table th:nth-child(5),
    .video-ranking-table td:nth-child(5),
    .video-ranking-table th:nth-child(6),
    .video-ranking-table td:nth-child(6),
    .video-ranking-table th:nth-child(7),
    .video-ranking-table td:nth-child(7),
    .video-ranking-table th:nth-child(8),
    .video-ranking-table td:nth-child(8) {
        width: 150px !important;
        min-width: 150px !important;
        max-width: 150px !important;
    }
}

/* 响应式适配：768px以下进一步压缩视频榜表格列宽（5个48px视频 + 4个6px间距 = 264px） */
@media (max-width: 768px) {
    .video-ranking-table {
        /* 🔴 压缩后8列总宽度：60+260+270+126*5 = 1220px，第4-8列均匀126px */
        min-width: 1220px !important;
    }

    .video-ranking-table th:nth-child(1),
    .video-ranking-table td:nth-child(1) {
        width: 60px !important;
        min-width: 60px !important;
        max-width: 60px !important;
    }

    .video-ranking-table th:nth-child(2),
    .video-ranking-table td:nth-child(2) {
        width: 260px !important;
        min-width: 260px !important;
        max-width: 260px !important;
    }

    .video-ranking-table th:nth-child(3),
    .video-ranking-table td:nth-child(3) {
        /* 带货短视频缩短：300→270px */
        width: 270px !important;
        min-width: 270px !important;
        max-width: 270px !important;
    }

    /* 768px以下：第4-8列统一126px，完全均匀 */
    .video-ranking-table th:nth-child(4),
    .video-ranking-table td:nth-child(4),
    .video-ranking-table th:nth-child(5),
    .video-ranking-table td:nth-child(5),
    .video-ranking-table th:nth-child(6),
    .video-ranking-table td:nth-child(6),
    .video-ranking-table th:nth-child(7),
    .video-ranking-table td:nth-child(7),
    .video-ranking-table th:nth-child(8),
    .video-ranking-table td:nth-child(8) {
        width: 126px !important;
        min-width: 126px !important;
        max-width: 126px !important;
    }

    .video-thumb-list {
        /* 移除硬编码min-width */
        min-width: auto;
        min-height: auto;
        gap: 6px;
    }

    .video-thumb-slot {
        /* 严格48x48，与主图完全一致 */
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
        max-width: 48px !important;
        min-height: 48px !important;
        max-height: 48px !important;
        border-radius: 8px;
        flex: 0 0 48px;
    }

    .video-thumb-img {
        /* img填充容器，而不是硬编码像素 */
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
    }

    .video-more-count {
        font-size: 14px;
    }

    .video-more-text {
        font-size: 9px;
    }

    .video-more-plus {
        font-size: 18px;
    }

    .video-play-icon {
        width: 22px;
        height: 22px;
    }

    /* 弹出层：768px时槽位48，每排5个 → 5*48+4*6+padding*2 = 240+24+32 = 296px */
    .video-more-popup {
        width: 304px;
    }
    /* bridge宽度和popup保持一致 */
    .video-more-slot::after {
        width: 304px;
    }
    .video-more-popup-item {
        width: 48px !important; height: 48px !important;
        min-width: 48px !important; max-width: 48px !important;
        min-height: 48px !important; max-height: 48px !important;
        flex: 0 0 48px;
        border-radius: 8px !important;
    }
    .video-more-popup-item .video-play-icon { width: 20px; height: 20px; }

    /* 商品主图与视频缩略图同步缩小到48px */
    .product-info .product-image {
        width: 48px;
        height: 48px;
        border-radius: 8px;
    }
}
