/*!
 * 首页「合作伙伴」跑马灯（纯 CSS，无 JS）
 *
 * 无缝原理：轨道内把 logo 列表渲染两遍，动画只位移 -50%，第二份正好接上第一份。
 * 因此条目间距必须用 margin-right（不能用 gap）——用 gap 时轨道总宽不含"末尾那一个间隙"，
 * -50% 会错开半个间隙、出现跳动。
 *
 * 注意：responsive.css 在 ≤1200px 会用 `body.site-body *{ … !important }` 扁平化，
 * 其中含 width:auto !important，会把轨道的 width:max-content 干掉导致无法滚动，
 * 所以本文件相关属性同样用 !important，并排在 responsive.css 之后加载。
 */

.site-partners {
    overflow: hidden;
    width: 100% !important;
    max-width: 100% !important;
    padding: 8px 0;
    box-sizing: border-box;
}

.site-partners__track {
    display: flex;
    align-items: center;
    width: max-content !important;   /* 必须 !important，否则被响应式层压成 auto */
    animation: site-partners-scroll 34s linear infinite;
    will-change: transform;
}

.site-partners:hover .site-partners__track {
    animation-play-state: paused;
}

.site-partners__item {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 150px !important;
    height: 84px !important;
    margin-right: 36px;              /* 用 margin 而非 gap，保证 -50% 无缝 */
    padding: 8px;
    box-sizing: border-box;
    background: #fff;
    border: 1px solid #eaeaea;
    border-radius: 6px;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.site-partners__item:hover {
    border-color: #1a4f9c;
    box-shadow: 0 4px 14px rgba(26, 79, 156, 0.14);
}

.site-partners__item img {
    display: block;
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain;
    /* 保持原始彩色显示，不做去色处理 */
    filter: none;
    opacity: 1;
}

@keyframes site-partners-scroll {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}

/* 窄屏：整体缩小并加快一点，避免拖动过久 */
@media (max-width: 1024px) {
    .site-partners__track {
        animation-duration: 26s;
    }
    .site-partners__item {
        width: 118px !important;
        height: 68px !important;
        margin-right: 22px;
        padding: 6px;
    }
}

/* 尊重系统"减少动态效果"设置：停止滚动，改为可换行平铺 */
@media (prefers-reduced-motion: reduce) {
    .site-partners__track {
        animation: none;
        flex-wrap: wrap;
        justify-content: center;
        width: 100% !important;
    }
    .site-partners__item {
        margin: 8px;
    }
}
