n');

            if (!username || !password) {
                showMessage('Please enter both username and password', 'error');
                return;
            }

            // 禁用按钮
            loginBtn.disabled = true;
            loginBtn.innerHTML = '<span class="spinner-border spinner-border-sm me-2"></span>Logging in...';

            try {
                await login(username, password);
            } finally {
                // 重新启用按钮
                loginBtn.disabled = fal