script>
/**
* 切换内容显示状态
* @param {HTMLElement} button - 点击的按钮元素
*/
function toggleContent(button) {
const content = document.getElementById('collapsible-content');
const icon = button.querySelector('.toggle-icon');
const isExpanded = button.getAttribute('aria-expanded') === 'true';
// 更新状态
button.setAttribute('aria-expanded', !isExpanded);
content.setAttribute('aria-hidden', isExpanded);
// 更新图标旋转状态
icon.classList.toggle('transform', true);
icon.classList.toggle('rotate-0', isExpanded);
icon.classList.toggle('rotate-180', !isExpanded);
}
script>