tn = document.getElementById('save-token-btn');
const themeToggle = document.getElementById('theme-toggle'); 

const MAX_HISTORY_ITEMS = 10;
const CHARS_PER_MINUTE = 150;
const voiceDescriptions = {
    'alloy': { zh: '平衡中性', en: 'Balanced' }, 'echo': { zh: '深沉有力', en: 'Deep' }, 'fable': { zh: '温暖讲述', en: 'Narrative' },
    'onyx': { zh: '威严庄重', en: 'Authoritative' }, 'nova': { zh: '友好专业', en: 'Friendly' }, 'shimmer': { zh: '轻快明亮', en: 'Bright' },
    'coral':