�，请重新生成。', 'error');
    }
}
function updateHistoryUI(newItemId) {
    const lang = document.documentElement.lang.startsWith('zh') ? 'zh' : 'en';
    if (history.length === 0) {
        const noHistoryText = lang === 'en' ? 'No history records' : '暂无历史记录';
        historyList.innerHTML = `<p class="no-history" data-lang-zh="暂无历史记录" data-lang-en="No history records">${noHistoryText}</p>`;
        return;
    }
    historyList.innerHTML = '';
    history.forEach(item => {