下载" data-lang-en="Download">${downloadText}</span>
            </button>`;
        historyList.appendChild(historyItemEl);
    });
    document.querySelectorAll('.history-download').forEach(btn => btn.addEventListener('click', e => downloadHistoryItem(parseInt(e.currentTarget.dataset.id))));
}
function clearHistory() {
    const lang = document.documentElement.lang.startsWith('zh') ? 'zh' : 'en';
    const confirmMessage = lang === 'en' ? 'Are you sure you want to clear all history? This action cannot b