 [data-lang-placeholder-en]').forEach(el => {
        const placeholder = el.getAttribute(`data-lang-placeholder-${targetLang}`);
        if(placeholder !== null) el.setAttribute('placeholder', placeholder);
    });
    updateTextStats();
    updateHistoryUI();
}
function updateTextStats() {
    const text = textInput.value.trim();
    const count = text.length;
    const lang = document.documentElement.lang.startsWith('zh') ? 'zh' : 'en';
    charCount.textContent = lang === 'en' ? `Characters: ${count}` :