/**
 * 子栏目单行横向滚动导航
 * - 始终保持一行
 * - 鼠标、触摸板、触摸屏均可左右滚动
 * - 两侧按钮用于快速滚动
 */

.huacai-category-tabs-section {
    position: relative;
    z-index: 80;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #fff;
    border-top: 1px solid rgba(18, 35, 49, .07);
    border-bottom: 1px solid rgba(18, 35, 49, .09);
    box-sizing: border-box;
}

.huacai-category-tabs-inner {
    position: relative;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 36px;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 1920px;
    margin: 0 auto;
    padding: 10px clamp(12px, 2vw, 32px);
    box-sizing: border-box;
}

.huacai-category-tabs-viewport {
    position: relative;
    min-width: 0;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-behavior: smooth;
    scroll-snap-type: x proximity;
    outline: none;
}

.huacai-category-tabs-viewport::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.huacai-category-tabs-viewport:focus-visible {
    border-radius: 12px;
    box-shadow: 0 0 0 3px rgba(232, 133, 35, .18);
}

.huacai-category-tabs-list {
    display: inline-flex;
    flex-flow: row nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    width: max-content;
    min-width: 100%;
    margin: 0;
    padding: 0 2px;
    list-style: none;
    white-space: nowrap;
    box-sizing: border-box;
}

.huacai-category-tab {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    margin: 0;
    padding: 8px 16px;
    color: #142331;
    background: #fff;
    border: 1px solid #dfe4e8;
    border-radius: 999px;
    box-shadow: 0 1px 2px rgba(20, 35, 49, .03);
    text-decoration: none;
    white-space: nowrap;
    scroll-snap-align: start;
    box-sizing: border-box;
    transition: color .18s ease, border-color .18s ease, background-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.huacai-category-tab:hover,
.huacai-category-tab:focus-visible {
    color: #bd5d00;
    border-color: #efb36f;
    background: #fff9f2;
    box-shadow: 0 5px 14px rgba(195, 101, 8, .08);
    transform: translateY(-1px);
    text-decoration: none;
    outline: none;
}

.huacai-category-tab.is-active {
    color: #bd5d00;
    border-color: #f0ad63;
    background: #fff5e8;
    box-shadow: inset 0 0 0 1px rgba(240, 173, 99, .16);
}

.huacai-category-tab > i {
    flex: 0 0 auto;
    font-size: 15px;
    line-height: 1;
}

.huacai-category-tab-name {
    display: block;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.huacai-category-tab-count {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 7px;
    color: #6f7c86;
    background: #f3f5f6;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    box-sizing: border-box;
}

.huacai-category-tab.is-active .huacai-category-tab-count {
    color: #bd5d00;
    background: #ffead0;
}

.huacai-category-tabs-arrow {
    position: relative;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin: 0;
    padding: 0;
    color: #34434f;
    background: #fff;
    border: 1px solid #dfe4e8;
    border-radius: 50%;
    box-shadow: 0 3px 10px rgba(20, 35, 49, .08);
    cursor: pointer;
    transition: color .18s ease, border-color .18s ease, background-color .18s ease, opacity .18s ease;
}

.huacai-category-tabs-arrow:hover,
.huacai-category-tabs-arrow:focus-visible {
    color: #bd5d00;
    border-color: #efb36f;
    background: #fff8ef;
    outline: none;
}

.huacai-category-tabs-arrow:disabled {
    opacity: .26;
    cursor: default;
    box-shadow: none;
}

.huacai-category-tabs-section.is-not-overflowing .huacai-category-tabs-arrow {
    visibility: hidden;
    pointer-events: none;
}

@media (max-width: 767.98px) {
    .huacai-category-tabs-inner {
        grid-template-columns: 30px minmax(0, 1fr) 30px;
        gap: 5px;
        padding: 8px 8px;
    }

    .huacai-category-tabs-list {
        gap: 8px;
    }

    .huacai-category-tab {
        min-height: 42px;
        padding: 7px 13px;
        gap: 7px;
    }

    .huacai-category-tab-name {
        font-size: 14px;
    }

    .huacai-category-tab-count {
        min-width: 25px;
        height: 25px;
        padding: 0 6px;
        font-size: 12px;
    }

    .huacai-category-tabs-arrow {
        width: 30px;
        height: 30px;
        font-size: 13px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .huacai-category-tabs-viewport {
        scroll-behavior: auto;
    }

    .huacai-category-tab,
    .huacai-category-tabs-arrow {
        transition: none;
    }
}

/**
 * 栏目目录标题区域：访客友好的“内容导览”卡片。
 * 替代原来面向开发者的栏目 ID 自动获取说明。
 */
.hjk-product-catalog .hjk-product-catalog-heading {
    display: grid !important;
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr) !important;
    align-items: center !important;
    gap: clamp(32px, 5vw, 82px) !important;
}

.hjk-product-catalog .hjk-product-catalog-heading > div:first-child {
    min-width: 0;
}

.hjk-product-catalog .huacai-catalog-guide {
    position: relative;
    justify-self: end;
    width: 100%;
    max-width: 560px;
    margin: 0;
    padding: 20px 22px;
    overflow: hidden;
    color: #142331;
    background:
        radial-gradient(circle at 100% 0, rgba(241, 169, 91, .16), transparent 38%),
        linear-gradient(135deg, rgba(255, 255, 255, .98), rgba(248, 250, 251, .96));
    border: 1px solid rgba(20, 35, 49, .10);
    border-radius: 20px;
    box-shadow: 0 14px 38px rgba(20, 35, 49, .08);
    box-sizing: border-box;
}

.hjk-product-catalog .huacai-catalog-guide::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, #ef9b45, #bf5d00);
}

.huacai-catalog-guide-heading {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 16px;
}

.huacai-catalog-guide-icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    color: #bd5d00;
    background: #fff2df;
    border: 1px solid rgba(232, 133, 35, .22);
    border-radius: 13px;
    font-size: 17px;
    box-sizing: border-box;
}

.huacai-catalog-guide-heading > div {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.huacai-catalog-guide-heading strong {
    color: #142331;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.25;
}

.huacai-catalog-guide-heading span:not(.huacai-catalog-guide-icon) {
    color: #71808b;
    font-size: 13px;
    line-height: 1.45;
}

.huacai-catalog-guide-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    padding: 13px 0;
    background: rgba(255, 255, 255, .72);
    border: 1px solid rgba(20, 35, 49, .07);
    border-radius: 14px;
}

.huacai-catalog-guide-stats > div {
    display: grid;
    justify-items: center;
    gap: 4px;
    min-width: 0;
    padding: 0 10px;
    text-align: center;
    box-sizing: border-box;
}

.huacai-catalog-guide-stats > div + div {
    border-left: 1px solid rgba(20, 35, 49, .08);
}

.huacai-catalog-guide-stats strong {
    color: #bd5d00;
    font-size: clamp(20px, 2vw, 26px);
    font-weight: 850;
    line-height: 1;
}

.huacai-catalog-guide-stats span {
    color: #687782;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.3;
    white-space: nowrap;
}

.hjk-product-catalog .huacai-catalog-guide-tip {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    width: auto;
    max-width: none;
    margin: 14px 0 0 !important;
    padding: 0 !important;
    color: #687782;
    border: 0 !important;
    font-size: 13px;
    line-height: 1.65;
}

.huacai-catalog-guide-tip i {
    flex: 0 0 auto;
    margin-top: .28em;
    color: #d67618;
}

@media (max-width: 991.98px) {
    .hjk-product-catalog .hjk-product-catalog-heading {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 24px !important;
    }

    .hjk-product-catalog .huacai-catalog-guide {
        justify-self: stretch;
        max-width: none;
    }
}

@media (max-width: 575.98px) {
    .hjk-product-catalog .huacai-catalog-guide {
        padding: 17px 16px;
        border-radius: 16px;
    }

    .huacai-catalog-guide-heading {
        margin-bottom: 13px;
    }

    .huacai-catalog-guide-icon {
        width: 38px;
        height: 38px;
        border-radius: 11px;
    }

    .huacai-catalog-guide-heading strong {
        font-size: 16px;
    }

    .huacai-catalog-guide-stats > div {
        padding: 0 5px;
    }

    .huacai-catalog-guide-stats strong {
        font-size: 20px;
    }

    .huacai-catalog-guide-stats span {
        font-size: 11px;
    }
}
