/* Js for , Version=1776077421 */
 v.lang = {"confirmDelete":"\u60a8\u786e\u5b9a\u8981\u6267\u884c\u5220\u9664\u64cd\u4f5c\u5417\uff1f","deleteing":"\u5220\u9664\u4e2d","doing":"\u5904\u7406\u4e2d","loading":"\u52a0\u8f7d\u4e2d","updating":"\u66f4\u65b0\u4e2d...","timeout":"\u7f51\u7edc\u8d85\u65f6,\u8bf7\u91cd\u8bd5","errorThrown":"<h4>\u6267\u884c\u51fa\u9519\uff1a<\/h4>","continueShopping":"\u7ee7\u7eed\u8d2d\u7269","required":"\u5fc5\u586b","back":"\u8fd4\u56de","continue":"\u7ee7\u7eed","importTip":"\u53ea\u5bfc\u5165\u4e3b\u9898\u7684\u98ce\u683c\u548c\u6837\u5f0f","fullImportTip":"\u5c06\u4f1a\u5bfc\u5165\u6d4b\u8bd5\u6570\u636e\u4ee5\u53ca\u66ff\u6362\u7ad9\u70b9\u6587\u7ae0\u3001\u4ea7\u54c1\u7b49\u6570\u636e"};;$(document).ready(function() {
    $('#zlight-nav').zlightMenu();
    
    i18next
         .use(i18nextHttpBackend)  // 使用 HTTP 后端
        .init({
            backend: {
                // 语言包路径配置
                // loadPath: './{{lng}}.json',  // 加载路径，{{lng}} 会被语言代码替换
                // 或者使用完整 URL
                loadPath: 'http://yunqiao-shop-oss.oss-cn-hangzhou.aliyuncs.com/{{lng}}.json',
                // 可选：添加请求头
                // ajax: function(url, options, callback, data) {
                //     // 自定义 AJAX 请求
                // }
            },
            lng: 'EN',  // 默认语言
            fallbackLng: 'EN',
            interpolation: {
                escapeValue: false
            }
        // resources: resources,
        // lng: 'CN',  // 默认语言
        // fallbackLng: 'CN',  // 降级语言
        // interpolation: {
        //     escapeValue: false
        // }
    }, function(err, t) {
        if (err) return console.error('i18next 初始化失败:', err);
        console.log("初始化成功")
        $('#zlight-main-nav > li > a').each(element => {
            const $a = $(this);
            const originalText = $a.text().trim();
            console.log("获取到", originalText)
            // const key = element.getAttribute('data-i18n');
            if (originalText) {
                
                let item = i18next.t(originalText);
               console.log("item",item);
               $a.text(item);
                // element.textContent = i18next.t(originalText);
                console.log(`${key}: ${element.textContent}`);
            }
        });
    });
});


;(function($, window, document, undefined) {
    var pluginName = 'zlightMenu',
        defaults = {
            height: '71px',
            subMenuHeight: '20px',
            fontSize: '15px',
            subMenuWidth: '180px',
            floating: 'left',
            transform: 'on', //关闭浮动滑动
            transformBreak: '100',
            lablColor: '#ffffff',
            lablFontSize: '15px',
            iconColor: '#ffffff',
            iconSize: '20px',
            mobileMainColor: '#323231',
            mainColor: 'transparent',
            secondColor: '#FFB40C',
            fontColor: '#ffffff',
            activeFontColor: '#ffffff',
            borderLightColor: 'rgba(255,255,255,0.2)',
            borderDarkColor: 'rgba(0,0,0,0.2)',
            dropBorderLightColor: '#444444',
            dropBorderDarkColor: '#222222'
        };

    function Zmenu(element, options) {
        this.element = $(element);
        var ele = this;
        this.options = $.extend({}, defaults, options);
        this._defaults = defaults;
        this._name = pluginName;
        this.init(ele)
    };
    
    Zmenu.prototype.variables = function(ele) {
        this.op = this.options;
        this.mainNav = this.element.children('#zlight-main-nav');
        this.li = this.mainNav.children('li');
        this.links = this.mainNav.children('li').children('a');
        this.allLinks = this.mainNav.find('a');
        this.active = this.mainNav.find('.zlight-active');
        this.subMenu = this.mainNav.find('.zlight-submenu');
        this.subli = this.subMenu.children('li');
        this.subLinks = this.subMenu.children('li').children('a');
        this.mobileNav = this.element.children('#zlight-mobile-nav');
        this.mobileSelect = this.mobileNav.children('select');
        this.mobileSpan = this.mobileNav.children('span');
        this.mobileTxt = this.mobileSpan.text();
        this.mobileIcon = this.mobileNav.children('.zlight-icon');
        this.counter = 0;
        
        // 检测是否有Swiper实例
        this.hasSwiper = typeof window.mainSwiper !== 'undefined' && window.mainSwiper !== null;
    };
    
    Zmenu.prototype.setStyles = function(ele) {
        // 根据transform选项设置导航定位
        if (this.op.transform === 'on') {
            // 开启浮动：固定定位
            this.element.css({
                'height': this.op.height,
                'background-color': this.op.mainColor,
                'position': 'fixed',
                'top': '0',
                'left': '0',
                'width': '100%',
                'z-index': '999999',
                'transition': 'background-color 0.3s ease' // 添加过渡效果
            });
        } else {
            // 关闭浮动：静态定位
            this.element.css({
                'height': this.op.height,
                'background-color': this.op.mainColor,
                'position': 'absolute',
                'width': '100%',
                'z-index': '999999'
            });
        }
        this.mainNav.css({
            'border-right-color': this.op.borderDarkColor,
            'float': this.op.floating,
            'background-color': 'transparent'
        });
        this.links.css({
            'height': this.op.height,
            'line-height': this.op.height,
            'font-size': this.op.fontSize,
            'color': this.op.fontColor,
            'border-left-color': this.op.borderDarkColor,
            'border-right-color': this.op.borderLightColor
        });
        if (this.active) {
            this.active.css('background-color', this.op.secondColor).children('a').css('color', this.op.activeFontColor)
        };
        this.subMenu.css({
            'background-color': 'transparent',
            'width': this.op.subMenuWidth
        });
        this.subLinks.css({
            'color': this.op.fontColor,
            'font-size': this.op.fontSize,
            'border-top-color': this.op.dropBorderDarkColor,
            'border-bottom-color': this.op.dropBorderLightColor,
            'line-height': this.op.subMenuHeight
        });
        this.mobileSelect.fadeTo(0, 0).css({
            'height': this.op.height,
            'line-height': this.op.height
        });
        this.mobileSpan.css({
            'line-height': this.op.height,
            'color': this.op.lablColor,
            'font-size': this.op.lablFontSize
        });
        this.mobileIcon.css({
            'color': this.op.iconColor,
            'line-height': this.op.height,
            'font-size': this.op.iconSize
        });
        this.mobileNav.css('background-color', this.op.mobileMainColor)
    };
    
    Zmenu.prototype.createMobile = function(ele) {
        this.mobileSelect.append('<option>' + this.mobileTxt + '</option>');
        this.allLinks.each(function(indx, element) {
            var hrf = $(element).attr('href'),
                txt = $(element).text(),
                hclass = $(element).parents('.zlight-submenu').length,
                tr = '';
            if (hclass > 0) {
                for (i = 0; i < hclass; i++) {
                    tr += '-'
                }
            };
            ele.mobileSelect.append('<option value="' + hrf + '">' + tr + ' ' + txt + '</option>')
        })
    };
    
    // 新增：获取当前滚动位置的方法（兼容Swiper）
    Zmenu.prototype.getScrollPosition = function() {
        if (this.hasSwiper && window.mainSwiper) {
            // 在Swiper模式下，使用activeIndex来判断
            var activeIndex = window.mainSwiper.activeIndex;
            // 假设transformBreak对应第几屏，这里用activeIndex * 100作为近似值
            // 您可以根据实际需要调整这个计算方式
            return activeIndex * 100;
        } else {
            // 非Swiper模式，使用正常的scrollTop
            return $(document).scrollTop();
        }
    };
    
    // 新增：检查是否应该改变背景色的方法
    Zmenu.prototype.shouldChangeBackground = function() {
        var scrollPos = this.getScrollPosition();
        return scrollPos >= this.op.transformBreak;
    };
    
    // 新增：更新导航样式的方法
    Zmenu.prototype.updateNavStyle = function() {
        if (this.op.transform !== 'on') return;
        
        var shouldChange = this.shouldChangeBackground();
        
        if (shouldChange) {
            // 添加滚动样式类（白色背景）
            this.element.addClass('zlight-scrolled');
            // 可以在这里设置具体的背景色，如果您想要纯白色背景而不是通过类控制
            this.element.css('background-color', '#ffffff');
            
            // 可选：同时改变文字颜色为深色
            this.links.css('color', '#333333');
            this.mobileSpan.css('color', '#333333');
            this.mobileIcon.css('color', '#333333');
        } else {
            // 移除滚动样式类
            this.element.removeClass('zlight-scrolled');
            // 恢复原始背景色
            this.element.css('background-color', this.op.mainColor);
            
            // 恢复原始文字颜色
            this.links.css('color', this.op.fontColor);
            this.mobileSpan.css('color', this.op.lablColor);
            this.mobileIcon.css('color', this.op.iconColor);
            
            // 滚动到顶部时也移除悬停效果
            this.element.removeClass('zlight-hover');
        }
    };
    
    Zmenu.prototype.change = function(ele) {
        this.mobileSelect.on('change.zmenuChange', function() {
            location = this.options[this.selectedIndex].value
        });
        
        this.li.add(this.subli).on('mouseenter mouseleave.zmenuEnter', function(event) {
            if (event.type === 'mouseenter') {
                $(this).css('background-color', ele.op.secondColor).children('a').css('color', ele.op.activeFontColor)
            } else if (event.type === 'mouseleave') {
                if ($(this).hasClass('zlight-active') === false) {
                    $(this).css('background-color', 'transparent').children('a').css('color', ele.op.fontColor)
                }
            }
        });
        
        // 添加鼠标悬停效果
        this.element.on('mouseenter.zlightHover', function() {
            $(this).addClass('zlight-hover');
        }).on('mouseleave.zlightHover', function() {
            // 只有在没有达到切换条件的情况下才移除悬停效果
            if (!ele.shouldChangeBackground()) {
                $(this).removeClass('zlight-hover');
            }
        });
        
        // 滚动效果只在transform为'on'时生效
        if (this.op.transform === 'on') {
            if (this.hasSwiper) {
                // Swiper模式：监听Swiper的slideChange事件
                if (window.mainSwiper) {
                    // 保存原始onSlideChangeStart
                    var originalSlideChangeStart = window.mainSwiper.params.onSlideChangeStart;
                    
                    // 包装事件
                    window.mainSwiper.params.onSlideChangeStart = function(swiper) {
                        // 调用原始事件（如果存在）
                        if (originalSlideChangeStart) {
                            originalSlideChangeStart(swiper);
                        }
                        // 更新导航样式
                        ele.updateNavStyle();
                    };
                    
                    // 同样处理onInit
                    var originalInit = window.mainSwiper.params.onInit;
                    window.mainSwiper.params.onInit = function(swiper) {
                        if (originalInit) {
                            originalInit(swiper);
                        }
                        setTimeout(function() {
                            ele.updateNavStyle();
                        }, 100);
                    };
                    
                    // 立即更新一次样式
                    setTimeout(function() {
                        ele.updateNavStyle();
                    }, 200);
                }
            } else {
                // 非Swiper模式：使用滚动事件
                $(window).on('scroll.ZlightScrolling', function() {
                    ele.updateNavStyle();
                });
                
                // 立即执行一次
                ele.updateNavStyle();
            }
        }
    };
    
    Zmenu.prototype.init = function(ele) {
        this.variables(ele);
        this.setStyles(ele);
        this.createMobile(ele);
        this.change(ele)
    };
    
    $.fn[pluginName] = function(options) {
        return this.each(function() {
            if (!$.data(this, 'plugin_' + pluginName)) {
                $.data(this, 'plugin_' + pluginName, new Zmenu(this, options))
            }
        })
    }
})(jQuery, window, document);;    // 仅文字染色功能 - 独立无依赖
(function(w, d) {
    'use strict';

    /**
     * 安全替换指定文字的颜色
     * @param {String} targetText - 要染色的文字（此处固定为"有温度的"）
     * @param {String} color - 目标颜色值
     */
    function colorizeTargetText(targetText = '有温度的', color = 'rgba(41, 93, 182, 1)') {
        // 1. 获取所有需要处理的元素（可根据实际需求扩展选择器）
        const targetElements = d.querySelectorAll('.amup, .amup2, .amup3, .amup4');
        
        // 2. 遍历元素逐个处理
        targetElements.forEach(el => {
            // 跳过已处理过的元素，避免重复操作
            if (el.dataset.textColored === 'true') return;
            
            const originalText = el.textContent;
            // 只处理包含目标文字的元素
            if (!originalText.includes(targetText)) return;

            // 3. 安全拆分文字并拼接（纯DOM操作，不使用innerHTML）
            const textParts = originalText.split(targetText);
            const fragment = d.createDocumentFragment(); // 减少重绘
            
            textParts.forEach((part, index) => {
                // 添加普通文字节点
                fragment.appendChild(d.createTextNode(part));
                // 非最后一段，添加带颜色的span
                if (index < textParts.length - 1) {
                    const span = d.createElement('span');
                    span.style.color = color;
                    span.style.transition = 'color 0.3s ease'; // 可选：添加颜色过渡
                    span.textContent = targetText;
                    fragment.appendChild(span);
                }
            });

            // 4. 替换元素内容（保留原有样式/属性）
            const tempStyle = {
                cssText: el.style.cssText, // 保留原有行内样式
                className: el.className     // 保留原有类名
            };
            
            el.textContent = ''; // 清空原有内容
            el.appendChild(fragment);
            
            // 恢复原有样式，避免破坏布局
            el.style.cssText = tempStyle.cssText;
            el.className = tempStyle.className;

            // 5. 标记已处理，防止重复执行
            el.dataset.textColored = 'true';
        });
    }

    // 6. 初始化执行（确保DOM加载完成）
    function initTextColorize() {
        // DOM加载完成后执行
        if (d.readyState === 'complete' || d.readyState === 'interactive') {
            colorizeTargetText();
        } else {
            d.addEventListener('DOMContentLoaded', colorizeTargetText);
        }

        // 兜底：页面完全加载后再检测一次（防止动态加载的元素）
        w.addEventListener('load', () => {
            setTimeout(colorizeTargetText, 300);
        });

        // 轮播切换时重新检测（可选：适配动态切换的轮播元素）
        const swiperWrapper = d.querySelector('.swiper-wrapper');
        if (swiperWrapper) {
            const observer = new MutationObserver(() => {
                setTimeout(colorizeTargetText, 100);
            });
            observer.observe(swiperWrapper, { attributes: true, attributeFilter: ['style'] });
        }
    }

    // 启动文字染色
    initTextColorize();

})(window, document);;
document.addEventListener('DOMContentLoaded', function() {
    // 1. 核心变量
    const leftNumItems = document.querySelectorAll('.leftnum [class^="slide"]');
    const leftTitleItems = document.querySelectorAll('.lefttitle [class^="slide"]');
    const allLeftItems = [...leftNumItems, ...leftTitleItems];
    
    const carouselContainer = document.getElementById('slide269-100') || document.querySelector('.carousel.slide');
    const carouselInner = carouselContainer ? carouselContainer.querySelector('.carousel-inner') : null;
    if (!carouselInner || allLeftItems.length === 0) return;

    // 2. 全局变量：记录当前激活的slideID
    let currentActiveSlideId = '';

    // 3. 高亮更新：核心逻辑（极简且强制）
    function updateActiveTitle(slideId) {
        if (!slideId || slideId === currentActiveSlideId) return; // 避免重复执行
        currentActiveSlideId = slideId;
        
        // 强制清空所有高亮
        allLeftItems.forEach(li => li.classList.remove('active'));
        // 精准匹配并高亮
        allLeftItems.forEach(li => {
            if (li.classList.contains(`slide${slideId}`)) {
                li.classList.add('active');
            }
        });
    }

    // 4. 手动切换：保留原有逻辑（已验证正常）
    function switchToSlide(slideId) {
        const targetSlide = carouselInner.querySelector(`.item.slide${slideId}`);
        if (!targetSlide) return;
        
        carouselInner.querySelectorAll('.item').forEach(slide => {
            slide.classList.remove('active', 'carousel-item-next', 'carousel-item-prev', 'carousel-item-left', 'carousel-item-right');
        });
        targetSlide.classList.add('active');
        updateActiveTitle(slideId); // 手动切换时强制更新
    }

    // 5. 按钮点击事件（已验证正常）
    allLeftItems.forEach(function(item) {
        item.style.cursor = 'pointer';
        item.addEventListener('click', function() {
            const slideClass = Array.from(this.classList).find(cls => cls.startsWith('slide'));
            if (!slideClass) return;
            const targetSlideId = slideClass.replace('slide', '');
            
            switchToSlide(targetSlideId);
            if (carouselContainer && window.jQuery) {
                jQuery(carouselContainer).carousel('cycle');
            }
        });
    });

    // ========== 核心修复：自动切换检测（轮询替代事件监听） ==========
    if (carouselContainer && window.jQuery) {
        // 初始化轮播
        jQuery(carouselContainer).carousel({
            interval: 5000,
            wrap: true
        });

        // 初始化高亮
        setTimeout(() => {
            const initialSlide = carouselInner.querySelector('.item.active');
            const slideClass = Array.from(initialSlide?.classList || []).find(cls => cls.startsWith('slide'));
            if (slideClass) {
                updateActiveTitle(slideClass.replace('slide', ''));
            }
        }, 200);

        // 🔴 关键：轮询检测当前激活的幻灯片（每500ms检测一次，替代不可靠的事件监听）
        setInterval(() => {
            const activeSlide = carouselInner.querySelector('.item.active');
            if (!activeSlide) return;
            
            const slideClass = Array.from(activeSlide.classList).find(cls => cls.startsWith('slide'));
            const activeSlideId = slideClass ? slideClass.replace('slide', '') : '';
            
            // 检测到ID变化时，立即更新高亮
            if (activeSlideId && activeSlideId !== currentActiveSlideId) {
                updateActiveTitle(activeSlideId);
            }
        }, 500); // 500ms检测一次，兼顾性能和实时性
    }
});
;

var currentBlockID = 308;


if(typeof($('#block' + currentBlockID).parent('.col').data('grid')) === 'undefined' && $('#block' + currentBlockID).parent('.col').data('probability') === 'undefined')
{
    var grid = $('#block' + currentBlockID).parents('.blocks').data('grid');
    grid = typeof(grid) == 'undefined' ? 12 : grid;

    $('#block' + currentBlockID).parent('.col').attr('data-grid', grid).attr('class', 'col col-' + grid);
}

$('.articleTitleA').each(function()
{
    $(this).css('max-width', $(this).parents('li').width() - $(this).prev('.category').width() - $(this).next('.sticky').width() - $(this).parent().next('.article-date').width() - 10);
})
$('.articleTitleB').each(function()
{
    $(this).css('max-width', $(this).parent('li').width() - $(this).next('.sticky').width() - 10);
})
;

var currentBlockID = 258;


if(typeof($('#block' + currentBlockID).parent('.col').data('grid')) === 'undefined' && $('#block' + currentBlockID).parent('.col').data('probability') === 'undefined')
{
    var grid = $('#block' + currentBlockID).parents('.blocks').data('grid');
    grid = typeof(grid) == 'undefined' ? 12 : grid;

    $('#block' + currentBlockID).parent('.col').attr('data-grid', grid).attr('class', 'col col-' + grid);
}

$('.articleTitleA').each(function()
{
    $(this).css('max-width', $(this).parents('li').width() - $(this).prev('.category').width() - $(this).next('.sticky').width() - $(this).parent().next('.article-date').width() - 10);
})
$('.articleTitleB').each(function()
{
    $(this).css('max-width', $(this).parent('li').width() - $(this).next('.sticky').width() - 10);
})
;$(document).ready(function()
{          
    // add "index" class to the body element.
    $('body').addClass('index');

    $('.nav-system-home:first').addClass('active');
})
// 确保DOM加载完成后再执行此脚本  
document.addEventListener('DOMContentLoaded', function() {  
    // 获取具有特定ID的链接  
    var noJumpLink = document.getElementById('fullid0');  
      
    // 为链接添加点击事件监听器  
    noJumpLink.addEventListener('click', function(event) {  
        // 阻止链接的默认跳转行为  
        event.preventDefault();  
        // 可以在这里添加其他处理逻辑，例如显示一个提示或执行其他操作  
        return false;  
    });  
});


// 禁止所有 dropdown-toggle 点击，但排除 .nav-system-contact 下的元素
document.querySelectorAll('.dropdown-toggle').forEach(function(el) {
    // 检查当前元素是否在 .nav-system-contact 内部
    if (!el.closest('.nav-system-contact')) {
        // 不在 .nav-system-contact 内，禁止点击
        el.removeAttribute('href');
        el.style.cursor = 'default';
        el.style.pointerEvents = 'none';
    } else {
        // 在 .nav-system-contact 内，保持可点击
        console.log('保留可点击:', el); // 可选：调试用
    }
});

// jQuery 版本（如果使用 jQuery）
$('.dropdown-toggle').not('.nav-system-contact .dropdown-toggle').each(function() {
    $(this).removeAttr('href').css({
        'cursor': 'default',
        'pointer-events': 'none'
    });
});// 数字跳动动画 - 兼容Swiper整屏切换
(function(w, d, $, und) {
    'use strict';

    // 数字动画状态管理
    const counterStore = {
        counterAnimating: false,
        counterInView: false,
        swiperMode: false
    };

    // 检测是否在Swiper环境中
    function checkSwiperMode() {
        return typeof w.mainSwiper !== 'undefined' && w.mainSwiper !== null;
    }

    // 数字动画相关函数
    function resetCounterNum() {
        const counters = d.querySelectorAll('.counter');
        for (let i = 0; i < counters.length; i++) {
            counters[i].innerText = '0';
        }
        counterStore.counterAnimating = false;
    }

    function runCounterNum(counter) {
        if (!counter) return;
        const target = parseInt(counter.getAttribute('data-target')) || 0;
        const current = parseInt(counter.innerText) || 0;
        const step = Math.max(1, Math.floor(target / 50));

        if (current < target) {
            const nextVal = Math.min(current + step, target);
            counter.innerText = nextVal;
            setTimeout(() => runCounterNum(counter), 16);
        } else {
            counter.innerText = target;
            let allDone = true;
            const counters = d.querySelectorAll('.counter');
            for (let i = 0; i < counters.length; i++) {
                if (parseInt(counters[i].innerText) !== parseInt(counters[i].getAttribute('data-target'))) {
                    allDone = false;
                    break;
                }
            }
            if (allDone) counterStore.counterAnimating = false;
        }
    }

    function startCounterAnimate() {
        if (counterStore.counterAnimating) return;
        counterStore.counterAnimating = true;
        const counters = d.querySelectorAll('.counter');
        for (let i = 0; i < counters.length; i++) {
            runCounterNum(counters[i]);
        }
    }

    // 检测元素是否在当前激活的slide中（Swiper模式）
    function isInActiveSlide(el) {
        if (!el || !w.mainSwiper) return false;
        const activeSlide = w.mainSwiper.slides[w.mainSwiper.activeIndex];
        return activeSlide && (activeSlide.contains(el) || activeSlide === el);
    }

    // 视口检测函数（非Swiper模式使用）
    function checkElementInView(el, triggerRatio) {
        if (!el) return false;
        triggerRatio = triggerRatio || 0.33;
        const rect = el.getBoundingClientRect();
        const viewH = w.innerHeight || d.documentElement.clientHeight;
        return rect.top <= viewH - (rect.height * triggerRatio) && rect.top >= 0 && rect.bottom >= 0;
    }

    // 检查是否应该触发数字动画
    function shouldTriggerCounter() {
        const counterBox = d.getElementById('counter-section');
        if (!counterBox) return false;
        
        if (counterStore.swiperMode && w.mainSwiper) {
            // Swiper模式：检查数字区块是否在当前激活的slide中
            return isInActiveSlide(counterBox);
        } else {
            // 普通模式：检查数字区块是否在视口中
            return checkElementInView(counterBox, 0.5);
        }
    }

    // 更新数字动画状态
    function updateCounterState() {
        const counterBox = d.getElementById('counter-section');
        if (!counterBox) return;
        
        const shouldTrigger = shouldTriggerCounter();
        
        if (shouldTrigger && !counterStore.counterAnimating) {
            // 进入视图且未播放动画时，开始动画
            startCounterAnimate();
            counterStore.counterInView = true;
        } else if (!shouldTrigger && counterStore.counterInView) {
            // 离开视图时，重置数字
            resetCounterNum();
            counterStore.counterInView = false;
        }
    }

    // Swiper事件监听
    function setupSwiperListeners() {
        if (!w.mainSwiper) return;
        
        // 保存原始事件
        const originalSlideChange = w.mainSwiper.params.onSlideChangeEnd;
        const originalInit = w.mainSwiper.params.onInit;
        
        // 包装slideChange事件
        w.mainSwiper.params.onSlideChangeEnd = function(swiper) {
            // 调用原始事件
            if (originalSlideChange) {
                originalSlideChange(swiper);
            }
            // 更新数字动画
            setTimeout(updateCounterState, 100);
        };
        
        // 包装init事件
        w.mainSwiper.params.onInit = function(swiper) {
            if (originalInit) {
                originalInit(swiper);
            }
            setTimeout(updateCounterState, 300);
        };
        
        // 立即执行一次
        setTimeout(updateCounterState, 200);
    }

    // 普通模式滚动监听
    function setupScrollListener() {
        if (counterStore.swiperMode) return;
        
        let ticking = false;
        
        function scrollHandler() {
            if (!ticking) {
                w.requestAnimationFrame(function() {
                    updateCounterState();
                    ticking = false;
                });
                ticking = true;
            }
        }
        
        w.addEventListener('scroll', scrollHandler);
        w.addEventListener('resize', scrollHandler);
        
        // 立即执行一次
        setTimeout(updateCounterState, 200);
        
        return function cleanup() {
            w.removeEventListener('scroll', scrollHandler);
            w.removeEventListener('resize', scrollHandler);
        };
    }

    // 初始化数字动画
    function initCounter() {
        // 检测运行环境
        counterStore.swiperMode = checkSwiperMode();
        
        if (counterStore.swiperMode) {
            // Swiper模式：监听Swiper事件
            setupSwiperListeners();
        } else {
            // 普通模式：监听滚动事件
            setupScrollListener();
        }
        
        // 为动态加载的内容保留接口
        w.counterSystem = {
            refresh: updateCounterState,
            reset: resetCounterNum,
            start: startCounterAnimate
        };
    }

    // 页面加载完成后初始化
    if (d.readyState === 'complete' || d.readyState === 'interactive') {
        setTimeout(initCounter, 100);
    } else {
        d.addEventListener('DOMContentLoaded', function() {
            setTimeout(initCounter, 100);
        });
    }

    // 页面加载完成后二次检测
    w.addEventListener('load', function() {
        setTimeout(updateCounterState, 200);
    });

    // 为Swiper提供手动触发接口
    w.triggerCounterUpdate = updateCounterState;

})(window, document, window.jQuery);
;
    if ($(window).width() > 996) {
        // 保留数字动画效果
        $('.home-a .txt .list .li').each(function(index, el) {
            $(el).find('.num').leoTextAnimate({
                fixed: [',', ':', '.', '-', '~', " "],
                start: '0'
            });
        })

        // 主Swiper
        var mainSwiper = new Swiper('.main-container', {
            slidesPerView: 'auto',
            direction: 'vertical',
            mousewheelControl: true,
            speed: 1300,
            wrapperClass: 'swiper-wrapper',
            slideClass: 'swiper-slide',
            calculateHeight: true,
            onTransitionEnd: function(swiper) {
                if (swiper.progress == 1) {
                    swiper.activeIndex = swiper.slides.length - 1
                    $(".banner-nav").hide()
                }
            },
            onSlideChangeStart: function(swiper) {
                console.log('Active Index:', swiper.activeIndex);
                
                // 统一的高亮规则：只有0-4屏有对应的导航项
                if (swiper.activeIndex <= 4) {
                    $(".banner-nav .li").eq(swiper.activeIndex).addClass('on').siblings().removeClass('on');
                }
                // 第4屏（索引4）保持上一个导航高亮，不做任何操作
                
                // 统一的样式切换规则
                if (swiper.activeIndex == 0) {
                    $(".banner-nav").removeClass("b");
                }
                if (swiper.activeIndex == 1) {
                    $(".banner-nav").addClass("b");
                    setTimeout(function() {
                        $('.home-a .txt .list .li').each(function(index, el) {
                            var txt = String($(el).find('.num').data('num'));
                            $(el).find('.num').leoTextAnimate({
                                fixed: [',', ':', '.', '-', '~'],
                                start: '0'
                            });
                        })
                    }, 2000)
                }
                if (swiper.activeIndex == 2) {
                    $(".banner-nav").removeClass("b");
                }
                if (swiper.activeIndex == 3) {
                    $(".banner-nav").addClass("b");
                    $(".banner-nav").show();
                }
                // 第4屏（索引4）保持上一个导航的b类状态
            },
            onInit: function(swiper) {
                console.log('Swiper initialized');
                $('.main-container').addClass('swiper-container-vertical');
                $('.main-container .swiper-slide').css('opacity', '1');
                
                // 初始化时设置第一屏高亮
                $(".banner-nav .li").eq(0).addClass('on').siblings().removeClass('on');
            }
        });
    }
    
    // 导航点击事件
    $(".banner-nav .li").click(function() {
        var index = $(this).index();
        console.log('Nav clicked:', index);
        if (mainSwiper) {
            // 先手动更新高亮
            $(".banner-nav .li").removeClass('on');
            $(this).addClass('on');
            
            // 再滑动到对应索引
            mainSwiper.slideTo(index);
        }
    })

    var interleaveOffset = 0.5;

    // 业务领域Swiper
    var mySwiper = new Swiper('.hb-container', {
        slidesPerView: 'auto',
        speed: 1300,
        prevButton: '.hb-container .prev',
        nextButton: '.hb-container .next',
        breakpoints: {
            640: {
                loop: true
            }
        }
    })

    // 新闻资讯Swiper
    var newsSwiper = new Swiper('.home-c .hc-container', {
        slidesPerView: 'auto',
        initialSlide: 1,
        centeredSlides: true,
        scrollbar: '.botn-box .scrollbar',
        scrollbarHide: false,
        scrollbarDraggable: true,
        prevButton: '.main-prev',
        nextButton: '.main-next',
    })

    $(function() {
        if ($(window).width() > 996) {
            let isLoad = sessionStorage.getItem("loading");
            if (isLoad == 1) {
                $(".main-container").addClass("in show")
                $("header").addClass("on")
                $('.main-container .swiper-slide').css('opacity', '1');
                
                if (mainSwiper) {
                    setTimeout(function() {
                        mainSwiper.update(true);
                        // 确保高亮状态正确
                        var currentIndex = mainSwiper.activeIndex;
                        if (currentIndex <= 3) {
                            $(".banner-nav .li").eq(currentIndex).addClass('on').siblings().removeClass('on');
                        }
                    }, 100);
                }
            } else {
                sessionStorage.setItem("loading", 1);
                $(".loading").show()
                for (let i = 1; i <= 100; i++) {
                    setTimeout(function() {
                        if (i == 100) {
                            setTimeout(function() {
                                $(".main-container").addClass("show")
                                $(".loading .c").addClass("show")
                            }, 500)

                            setTimeout(function() {
                                $(".main-container").addClass("on")
                                $(".loading .c").addClass("on")
                                
                                $('.main-container .swiper-slide').css('opacity', '1');
                                
                                if (mainSwiper) {
                                    setTimeout(function() {
                                        mainSwiper.update(true);
                                        // 确保高亮状态正确
                                        var currentIndex = mainSwiper.activeIndex;
                                        if (currentIndex <= 3) {
                                            $(".banner-nav .li").eq(currentIndex).addClass('on').siblings().removeClass('on');
                                        }
                                    }, 100);
                                }
                            }, 700)
                            setTimeout(function() {
                                $("header").addClass("on")
                                $(".loading .c").hide()
                            }, 2000)
                        }
                        $(".timer").html(i + "%")
                    }, i * 30);
                }
            }
        } else {
            $(".video").remove()
        }
    })
;
var hash = window.location.hash.substring(1);
var browserLanguage = navigator.language || navigator.userLanguage; 
var resolution      = screen.availWidth + ' X ' + screen.availHeight;
$.get(createLink('log', 'record', "hash=" + hash), {browserLanguage:browserLanguage, resolution:resolution});
;
// 纯轮播动画逻辑 - 复用内页生效机制（剥离文字染色）
(function (w, d, $, und) {
    'use strict';

    // 1. 全局状态
    const dataStore = {
        counterAnimating: false,
        counterInView: false
    };

    // 2. 核心视口检测函数
    function checkViewInit(el) {
        if (!el) return false;
        const rect = el.getBoundingClientRect();
        const viewH = w.innerHeight || d.documentElement.clientHeight;
        const viewW = w.innerWidth || d.documentElement.clientWidth;
        return !(rect.bottom < 0 || rect.top > viewH || rect.right < 0 || rect.left > viewW);
    }

    function checkViewScroll(el, triggerRatio) {
        if (!el) return false;
        triggerRatio = triggerRatio || 0.33;
        const rect = el.getBoundingClientRect();
        const viewH = w.innerHeight || d.documentElement.clientHeight;
        return rect.top <= viewH - (rect.height * triggerRatio) && rect.top >= 0 && rect.bottom >= 0;
    }

    // 3. 动画播放逻辑
    function playAnimation(el) {
        if (!el || el.classList.contains('animated')) return;

        el.classList.add('animated');
        el.offsetHeight;

        const animType = el.getAttribute('data-anim') || '';
        let animClass = '';
        if (animType === 'fade-in') animClass = 'animate-fade-in';
        if (animType === 'slide-left') animClass = 'animate-slide-left';
        if (animType === 'slide-right') animClass = 'animate-slide-right';
        if (animType === 'slide-up-strong') animClass = 'animate-slide-up-strong';
        if (animType === 'scale-in') animClass = 'animate-scale-in';
        if (animType === 'slide-down-fade') animClass = 'animate-slide-down-fade';
        if (animType === 'scale-up-fade') animClass = 'animate-scale-up-fade';

        if (animClass) el.classList.add(animClass);

        if (el.id === 'counter-section' && !dataStore.counterAnimating) {
            setTimeout(startCounterAnimate, 500);
        }
    }

    // 4. 数字动画
    function resetCounterNum() {
        const counters = d.querySelectorAll('.counter');
        for (let i = 0; i < (counters.length || 0); i++) {
            counters[i].innerText = '0';
        }
        dataStore.counterAnimating = false;
    }

    function runCounterNum(counter) {
        if (!counter) return;
        const target = parseInt(counter.getAttribute('data-target')) || 0;
        const current = parseInt(counter.innerText) || 0;
        const step = Math.max(1, Math.floor(target / 50));

        if (current < target) {
            const nextVal = Math.min(current + step, target);
            counter.innerText = nextVal;
            setTimeout(() => runCounterNum(counter), 16);
        } else {
            counter.innerText = target;
            let allDone = true;
            const counters = d.querySelectorAll('.counter');
            for (let i = 0; i < (counters.length || 0); i++) {
                if (parseInt(counters[i].innerText) !== parseInt(counters[i].getAttribute('data-target'))) {
                    allDone = false;
                    break;
                }
            }
            if (allDone) dataStore.counterAnimating = false;
        }
    }

    function startCounterAnimate() {
        if (dataStore.counterAnimating) return;
        dataStore.counterAnimating = true;
        const counters = d.querySelectorAll('.counter');
        for (let i = 0; i < (counters.length || 0); i++) {
            runCounterNum(counters[i]);
        }
    }

    // 5. 初始化动画（✅ 等布局稳定）
    function initAnimations() {
        requestAnimationFrame(() => {
            setTimeout(() => {
                const animElements = d.querySelectorAll(
                    '.loadable:not(.animated), .amup:not(.animated), .amup2:not(.animated)'
                );
                for (let i = 0; i < animElements.length; i++) {
                    if (checkViewInit(animElements[i])) {
                        playAnimation(animElements[i]);
                    }
                }

                const counterBox = d.getElementById('counter-section');
                if (counterBox) {
                    dataStore.counterInView = checkViewInit(counterBox);
                    if (dataStore.counterInView && !dataStore.counterAnimating) {
                        setTimeout(startCounterAnimate, 800);
                    }
                }
            }, 0);
        });
    }

    // 6. 滚动 / 轮播检测
    function handleScrollEvent() {
        const animElements = d.querySelectorAll(
            '.loadable:not(.animated), .amup:not(.animated), .amup2:not(.animated)'
        );
        for (let i = 0; i < animElements.length; i++) {
            if (checkViewScroll(animElements[i])) {
                playAnimation(animElements[i]);
            }
        }

        const counterBox = d.getElementById('counter-section');
        if (counterBox) {
            const nowInView = checkViewScroll(counterBox, 0.5);
            if (!nowInView && dataStore.counterInView) resetCounterNum();
            else if (nowInView && !dataStore.counterAnimating && !dataStore.counterInView)
                startCounterAnimate();
            dataStore.counterInView = nowInView;
        }
    }

    // 7. 节流
    function throttleFunc(func, delay) {
        if (typeof func !== 'function') return function () {};
        delay = delay || 100;
        let lastTime = 0;
        return function () {
            const now = Date.now();
            if (now - lastTime >= delay) {
                func.call(this, arguments);
                lastTime = now;
            }
        };
    }

    // 8. 轮播切换监听（✅ 强制触发）
    function bindSwiperEvents() {
        const swiperWrapper = d.querySelector('.swiper-wrapper');
        if (swiperWrapper) {
            const observer = new MutationObserver(() => {
                requestAnimationFrame(() => {
                    handleScrollEvent();
                });
            });
            observer.observe(swiperWrapper, {
                attributes: true,
                attributeFilter: ['style']
            });
        }
    }

    // 9. 初始化入口（✅ 首屏强检）
    function initMain() {
        initAnimations();
        bindSwiperEvents();

        const scrollHandler = throttleFunc(handleScrollEvent);
        w.addEventListener('scroll', scrollHandler);

        requestAnimationFrame(() => {
            handleScrollEvent();
        });

        w.addEventListener('beforeunload', function () {
            w.removeEventListener('scroll', scrollHandler);
        });
    }

    // 10. 兼容初始化
    if (typeof $ === 'function') {
        $(d).ready(function () {
            setTimeout(initMain, 50);
        });
    } else {
        if (d.readyState === 'complete' || d.readyState === 'interactive') {
            initMain();
        } else {
            d.addEventListener('DOMContentLoaded', initMain);
        }
    }

    // 11. 页面恢复处理
    w.addEventListener('load', function () {
        setTimeout(initAnimations, 100);
    });
    w.addEventListener('pageshow', function () {
        setTimeout(handleScrollEvent, 200);
    });

})(window, document, window.jQuery);
