// ==================== 冷却函数 ==================== function refreshCoolDownDisplay(which) { if (which === 'mexc') { if (mexcCountdown > 0) { if (timerMEXC) timerMEXC.textContent = `${mexcElapsed} ⏱️ MEXC冷却 ${mexcCountdown}s`; } else { if (timerMEXC) timerMEXC.textContent = ''; } } else if (which === 'binance') { if (binanceCountdown > 0) { if (timerBinance) timerBinance.textContent = `${binanceElapsed} ⏱️ Binance冷却 ${binanceCountdown}s`; } else { if (timerBinance) timerBinance.textContent = ''; } } } function startCoolDown(which, seconds) { if (which === 'mexc') { if (mexcInterval) clearInterval(mexcInterval); mexcCountdown = seconds; if (mexcBtn) mexcBtn.disabled = true; refreshCoolDownDisplay('mexc'); mexcInterval = setInterval(() => { if (mexcCountdown > 0) { mexcCountdown--; if (mexcCountdown <= 0) { clearInterval(mexcInterval); mexcInterval = null; if (mexcBtn) mexcBtn.disabled = false; if (timerMEXC) timerMEXC.textContent = ''; mexcElapsed = ''; } else { refreshCoolDownDisplay('mexc'); } } else { clearInterval(mexcInterval); mexcInterval = null; if (mexcBtn) mexcBtn.disabled = false; if (timerMEXC) timerMEXC.textContent = ''; mexcElapsed = ''; } }, 1000); } else if (which === 'binance') { if (binanceInterval) clearInterval(binanceInterval); binanceCountdown = seconds; if (binanceBtn) binanceBtn.disabled = true; refreshCoolDownDisplay('binance'); binanceInterval = setInterval(() => { if (binanceCountdown > 0) { binanceCountdown--; if (binanceCountdown <= 0) { clearInterval(binanceInterval); binanceInterval = null; if (binanceBtn) binanceBtn.disabled = false; if (timerBinance) timerBinance.textContent = ''; binanceElapsed = ''; } else { refreshCoolDownDisplay('binance'); } } else { clearInterval(binanceInterval); binanceInterval = null; if (binanceBtn) binanceBtn.disabled = false; if (timerBinance) timerBinance.textContent = ''; binanceElapsed = ''; } }, 1000); } }