document.addEventListener('DOMContentLoaded', function() {
    const accordionItems = document.querySelectorAll('.accordion-item');
    
    // 为每个手风琴项添加点击事件
    accordionItems.forEach((item, index) => {
        const header = item.querySelector('.accordion-header');
        
        header.addEventListener('click', () => {
            // 获取当前是否激活
            const isActive = item.classList.contains('active');
            
            // 关闭所有项
            accordionItems.forEach(item => {
                item.classList.remove('active');
            });
            
            // 如果点击的不是当前激活项，则展开它
            if (!isActive) {
                item.classList.add('active');
            }
        });
        
        // 默认展开第一项
        if (index === 0) {
            item.classList.add('active');
        }
    });
});