disconnected");
                    if (recorder) recorder.stop();
                    startBtn.disabled = false;
                    stopBtn.disabled = true;
                    interruptBtn.disabled = true;
                };

            } catch (error) {
                addLog(`连接失败: ${error}`);
                updateStatus("连接失败", "disconnected");
            }
        });

        stopBtn.addEventListener('click', () => {
            if (websocket) websocket.close();
            if (re