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97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title data-i18n="pageTitle">常见问题 - Antigravity Tools</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <script src="https://unpkg.com/lucide@latest"></script>
    <style>
        @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap');

        body {
            font-family: 'Inter', sans-serif;
            background-color: #0a0a0a;
            color: #d1d1d1;
        }

        .glass {
            background: rgba(18, 18, 18, 0.7);
            backdrop-filter: blur(12px);
            border: 1px solid rgba(16, 185, 129, 0.1);
        }

        .emerald-gradient {
            background: linear-gradient(135deg, #10b981 0%, #059669 100%);
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        .faq-item {
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .faq-item:hover {
            border-color: rgba(16, 185, 129, 0.4);
            background: rgba(16, 185, 129, 0.05);
        }

        .faq-answer {
            max-height: 0;
            overflow: hidden;
            transition: max-height 0.3s ease-out;
        }

        .faq-item.active .faq-answer {
            max-height: 800px;
            margin-top: 1rem;
        }

        .faq-item.active .chevron {
            transform: rotate(180deg);
        }

        .search-bar:focus-within {
            border-color: #10b981;
            box-shadow: 0 0 15px rgba(16, 185, 129, 0.1);
        }
    </style>
</head>

<body class="pb-20">
    <!-- 导航栏 -->
    <nav
        class="sticky top-0 w-full z-50 glass border-b border-emerald-900/30 px-6 py-4 flex justify-between items-center">
        <div class="flex items-center space-x-3 cursor-pointer" onclick="location.href='index.html'">
            <img src="logo.png" alt="Logo" class="w-8 h-8 rounded-lg shadow-lg shadow-emerald-500/20">
            <span class="text-xl font-bold emerald-gradient uppercase tracking-wider">Antigravity</span>
        </div>
        <div class="flex items-center space-x-4 md:space-x-8">
            <div class="hidden md:flex space-x-8 text-sm font-medium">
                <a href="index.html" class="hover:text-emerald-400 transition-colors" data-i18n="navHome">首页</a>
                <a href="#" class="text-emerald-400 transition-colors font-bold" data-i18n="navFaq">常见问题</a>
            </div>
            <!-- 语言切换器 -->
            <button id="lang-toggle" onclick="toggleLanguage()"
                class="glass px-3 py-1 rounded-lg text-xs font-bold border border-emerald-500/30 hover:bg-emerald-500/10 transition-all uppercase">
                EN
            </button>
        </div>
    </nav>

    <!-- 页头 -->
    <header class="py-20 px-6 text-center max-w-4xl mx-auto">
        <h1 class="text-4xl md:text-5xl font-bold mb-6 text-white uppercase tracking-tight">
            <span data-i18n="headerTitlePre">QA 专题页</span> / <span class="emerald-gradient"
                data-i18n="headerTitlePost">常见问题</span>
        </h1>
        <p class="text-gray-500 text-lg mb-10" data-i18n="headerSub">在这里查找您在使用过程中遇到的各类问题及解决方案。</p>

        <!-- 搜索框 -->
        <div
            class="search-bar max-w-2xl mx-auto flex items-center glass rounded-2xl p-2 border border-emerald-900/30 transition-all">
            <i data-lucide="search" class="w-5 h-5 ml-4 text-emerald-500/50"></i>
            <input type="text" id="faq-search" placeholder="搜索问题关键字..." data-i18n-placeholder="searchPlaceholder"
                class="bg-transparent border-none focus:ring-0 text-white w-full px-4 py-3 placeholder-gray-600 outline-none">
        </div>
    </header>

    <!-- 问题列表容器 -->
    <main class="max-w-4xl mx-auto px-6">
        <div class="space-y-4" id="faq-container">
            <!-- 动态渲染内容 -->
        </div>

        <!-- 空状态展示 -->
        <div id="no-results" class="hidden py-20 text-center text-gray-600">
            <i data-lucide="circle-dashed" class="w-12 h-12 mx-auto mb-4 opacity-20"></i>
            <p data-i18n="noResults">未找到相关问题,请尝试更换关键词。</p>
        </div>
    </main>

    <footer class="mt-20 py-12 border-t border-emerald-900/30 px-6 text-center">
        <p class="text-gray-600 text-sm">
            <span data-i18n="footerHelp">需要更多帮助?</span>
            <a href="https://github.com/lbjlaq/Antigravity-Manager/issues" class="text-emerald-500 hover:underline ml-1"
                data-i18n="footerIssue">前往 GitHub 提交 Issue</a>
        </p>
    </footer>

    <script>
        const translations = {
            zh: {
                pageTitle: "常见问题 - Antigravity Tools",
                navHome: "首页",
                navFaq: "常见问题",
                headerTitlePre: "QA 专题页",
                headerTitlePost: "常见问题",
                headerSub: "在这里查找您在使用过程中遇到的各类问题及解决方案。",
                searchPlaceholder: "搜索问题关键字...",
                noResults: "未找到相关问题,请尝试更换关键词。",
                footerHelp: "需要更多帮助?",
                footerIssue: "前往 GitHub 提交 Issue",
                toggleLabel: "EN"
            },
            en: {
                pageTitle: "FAQ - Antigravity Tools",
                navHome: "Home",
                navFaq: "FAQ",
                headerTitlePre: "QA Portal",
                headerTitlePost: "FAQ",
                headerSub: "Find answers and solutions to common questions here.",
                searchPlaceholder: "Search for keywords...",
                noResults: "No results found. Try different keywords.",
                footerHelp: "Need more help?",
                footerIssue: "Open an Issue on GitHub",
                toggleLabel: "中文"
            }
        };

        const faqData = [
            {
                id: 1,
                title: {
                    zh: "macOS 提示“应用已损坏,无法打开”?",
                    en: "macOS says 'The app is damaged and can't be opened'?"
                },
                answer: {
                    zh: `
                        <p class="mb-4">由于 macOS 的安全机制,非 App Store 下载的应用可能会触发此提示。您可以执行以下命令快速修复:</p>
                        <code class="block bg-black/50 p-3 rounded-lg border border-emerald-900/30 text-emerald-400 font-mono mb-4 text-xs">
                            sudo xattr -rd com.apple.quarantine "/Applications/Antigravity Tools.app"
                        </code>
                        <p>如果您使用 Homebrew 安装,建议添加 <code class="text-emerald-500">--no-quarantine</code> 参数。</p>
                    `,
                    en: `
                        <p class="mb-4">Due to macOS security mechanisms, apps not from the App Store may trigger this. Fix it with this command:</p>
                        <code class="block bg-black/50 p-3 rounded-lg border border-emerald-900/30 text-emerald-400 font-mono mb-4 text-xs">
                            sudo xattr -rd com.apple.quarantine "/Applications/Antigravity Tools.app"
                        </code>
                        <p>If using Homebrew, try adding the <code class="text-emerald-500">--no-quarantine</code> flag.</p>
                    `
                }
            },
            {
                id: 2,
                title: {
                    zh: "遇到 HTTP 403 Forbidden 错误怎么办?",
                    en: "What to do with HTTP 403 Forbidden errors?"
                },
                answer: {
                    zh: `
                        <p class="mb-4">403 错误通常分以下几种情况:</p>
                        <div class="space-y-4">
                            <div class="bg-black/30 p-4 rounded-xl border border-emerald-900/20">
                                <h4 class="text-emerald-400 font-bold mb-1 text-sm">情况 A: VALIDATION_REQUIRED (身份验证)</h4>
                                <p class="text-xs mb-2">表现:能登录应用但无法发消息,收到包含验证链接的提示。</p>
                                <p class="text-xs font-bold text-gray-300">解决方法:点击链接并在浏览器配合手机验证码完成验证即可。</p>
                            </div>
                            <div class="bg-black/30 p-4 rounded-xl border border-emerald-900/20">
                                <h4 class="text-emerald-400 font-bold mb-1 text-sm">情况 B: 临时风控 / Unexpected Issue</h4>
                                <p class="text-xs mb-2">表现:登录时提示 "There was an unexpected issue..."。</p>
                                <p class="text-xs font-bold text-gray-300 italic">经验建议:静置账号 1-2 周,谷歌系统通常会周期性评估并自动恢复权限。</p>
                            </div>
                            <div class="bg-black/30 p-4 rounded-xl border border-red-900/20">
                                <h4 class="text-red-400 font-bold mb-1 text-sm">情况 C: Violation of Terms of Service (封禁)</h4>
                                <p class="text-xs font-bold text-gray-300 italic">建议:邮件申述或更换账号。</p>
                            </div>
                        </div>
                    `,
                    en: `
                        <p class="mb-4">403 errors usually fall into these categories:</p>
                        <div class="space-y-4">
                            <div class="bg-black/30 p-4 rounded-xl border border-emerald-900/20">
                                <h4 class="text-emerald-400 font-bold mb-1 text-sm">Case A: VALIDATION_REQUIRED</h4>
                                <p class="text-xs mb-2">Symptom: Can log in but fail to send messages, receiving a link.</p>
                                <p class="text-xs font-bold text-gray-300">Fix: Click the link and complete mobile verification in browser.</p>
                            </div>
                            <div class="bg-black/30 p-4 rounded-xl border border-emerald-900/20">
                                <h4 class="text-emerald-400 font-bold mb-1 text-sm">Case B: Account Risk / Unexpected Issue</h4>
                                <p class="text-xs mb-2">Symptom: Login prompt "There was an unexpected issue..."</p>
                                <p class="text-xs font-bold text-gray-300 italic">Advice: Wait 1-2 weeks. Google systems often restore access periodically.</p>
                            </div>
                            <div class="bg-black/30 p-4 rounded-xl border border-red-900/20">
                                <h4 class="text-red-400 font-bold mb-1 text-sm">Case C: Violation of Terms (Banned)</h4>
                                <p class="text-xs font-bold text-gray-300 italic">Advice: Email appeal or switch account.</p>
                            </div>
                        </div>
                    `
                }
            },
            {
                id: 3,
                title: {
                    zh: "提示 “FAILED_PRECONDITION” 或 400 错误?",
                    en: "Getting 'FAILED_PRECONDITION' or 400 error?"
                },
                answer: {
                    zh: `
                        <p class="mb-2">当显示 <strong>"Agent terminated due to error"</strong> 且返回 400 预检查失败时,通常是因为 IP 被风控。</p>
                        <p class="emerald-gradient font-bold text-sm">解决方法:切换一个干净的出口 IP 即可恢复。</p>
                    `,
                    en: `
                        <p class="mb-2">If you see <strong>"Agent terminated due to error"</strong> with a 400 check failure, it's usually an IP risk issue.</p>
                        <p class="emerald-gradient font-bold text-sm">Fix: Switch to a cleaner proxy/IP to restore service.</p>
                    `
                }
            },
            {
                id: 4,
                title: {
                    zh: "为什么提示 “Resource projects/... not found” (404)?",
                    en: "Why 'Resource projects/... not found' (404)?"
                },
                answer: {
                    zh: `
                        <p class="mb-4">未找到有效项目。请尝试:</p>
                        <ul class="list-disc pl-5 space-y-2 text-xs">
                            <li>在应用中“删除账户”并“重新添加”以重置会话。</li>
                            <li>手动配置有效的 Google Cloud Project ID。</li>
                        </ul>
                    `,
                    en: `
                        <p class="mb-4">Valid project not found. Try:</p>
                        <ul class="list-disc pl-5 space-y-2 text-xs">
                            <li>Remove and re-add the account in the app.</li>
                            <li>Manually configure a valid Google Cloud Project ID.</li>
                        </ul>
                    `
                }
            },
            {
                id: 5,
                title: {
                    zh: "如何接入 Claude Code CLI?",
                    en: "How to connect Claude Code CLI?"
                },
                answer: {
                    zh: `
                        <p class="mb-4">在开启代理后,在终端执行:</p>
                        <code class="block bg-black/50 p-3 rounded-lg border border-emerald-900/30 text-emerald-400 font-mono text-xs mb-4">
                            export ANTHROPIC_API_KEY="sk-antigravity"<br>
                            export ANTHROPIC_BASE_URL="http://127.0.0.1:8045"<br>
                            claude
                        </code>
                    `,
                    en: `
                        <p class="mb-4">Enable proxy, then run in terminal:</p>
                        <code class="block bg-black/50 p-3 rounded-lg border border-emerald-900/30 text-emerald-400 font-mono text-xs mb-4">
                            export ANTHROPIC_API_KEY="sk-antigravity"<br>
                            export ANTHROPIC_BASE_URL="http://127.0.0.1:8045"<br>
                            claude
                        </code>
                    `
                }
            },
            {
                id: 6,
                title: {
                    zh: "提示 “Invalid project resource name projects/” 错误?",
                    en: "Getting 'Invalid project resource name projects/' error?"
                },
                answer: {
                    zh: `
                        <p class="mb-4">这通常是因为 Google 对于通过第三方工具登录的账号加强了风控,缺少官方客户端登录后的初始化操作,导致服务端的项目绑定关系缺失。</p>
                        <div class="space-y-4">
                            <div class="bg-black/30 p-4 rounded-xl border border-emerald-900/20">
                                <h4 class="text-emerald-400 font-bold mb-2 text-sm">方案一(最简单):</h4>
                                <p class="text-xs">重新通过 antigravity 应用登录获取授权即可恢复。</p>
                            </div>
                            <div class="bg-black/30 p-4 rounded-xl border border-emerald-900/20">
                                <h4 class="text-emerald-400 font-bold mb-2 text-sm">方案二:</h4>
                                <ol class="list-decimal pl-5 space-y-2 text-xs">
                                    <li>使用官方客户端手动登录一次该账号,触发服务端的初始化和项目绑定。</li>
                                    <li>登录成功后即可退出,之后再切回本工具使用旧的 Refresh Token 即可恢复正常。</li>
                                </ol>
                            </div>
                        </div>
                    `,
                    en: `
                        <p class="mb-4">This usually occurs because Google has strengthened risk control for accounts logged in via third-party tools, skipping necessary initialization. This results in missing project bindings on the server side.</p>
                        <div class="space-y-4">
                            <div class="bg-black/30 p-4 rounded-xl border border-emerald-900/20">
                                <h4 class="text-emerald-400 font-bold mb-2 text-sm">Option 1 (Easiest):</h4>
                                <p class="text-xs">Simply re-login via the antigravity app to refresh your authorization.</p>
                            </div>
                            <div class="bg-black/30 p-4 rounded-xl border border-emerald-900/20">
                                <h4 class="text-emerald-400 font-bold mb-2 text-sm">Option 2:</h4>
                                <ol class="list-decimal pl-5 space-y-2 text-xs">
                                    <li>Manually log in to the account once using the official client to trigger server-side initialization and project binding.</li>
                                    <li>After a successful login, you can log out and return to this tool. Using your existing Refresh Token should now work correctly.</li>
                                </ol>
                            </div>
                        </div>
                    `
                }
            }
        ];

        let currentLang = 'zh';

        function initLanguage() {
            const browserLang = navigator.language.split('-')[0];
            currentLang = (browserLang === 'zh') ? 'zh' : 'en';
            updateUI();
        }

        function toggleLanguage() {
            currentLang = (currentLang === 'zh') ? 'en' : 'zh';
            updateUI();
        }

        function updateUI() {
            // 更新静态文本
            document.querySelectorAll('[data-i18n]').forEach(el => {
                const key = el.getAttribute('data-i18n');
                el.innerText = translations[currentLang][key];
            });

            document.querySelectorAll('[data-i18n-placeholder]').forEach(el => {
                const key = el.getAttribute('data-i18n-placeholder');
                el.placeholder = translations[currentLang][key];
            });

            document.getElementById('lang-toggle').innerText = translations[currentLang].toggleLabel;

            renderFaqs();
            lucide.createIcons();
        }

        function renderFaqs() {
            const container = document.getElementById('faq-container');
            const searchTerm = document.getElementById('faq-search').value.toLowerCase();
            container.innerHTML = '';

            let hasResults = false;
            faqData.forEach(item => {
                const title = item.title[currentLang];
                const answer = item.answer[currentLang];

                // 搜索过滤
                if (title.toLowerCase().includes(searchTerm) || answer.toLowerCase().includes(searchTerm)) {
                    hasResults = true;
                    const el = document.createElement('div');
                    el.className = 'faq-item glass rounded-2xl p-6 border border-emerald-900/20 cursor-pointer';
                    el.onclick = () => toggleFaq(el);
                    el.innerHTML = `
                        <div class="flex justify-between items-center text-sm md:text-base">
                            <h3 class="font-bold text-white pr-4">${title}</h3>
                            <i data-lucide="chevron-down" class="chevron w-5 h-5 text-emerald-500 transition-transform"></i>
                        </div>
                        <div class="faq-answer text-gray-400 text-sm leading-relaxed border-t border-emerald-900/10 pt-4">
                            ${answer}
                        </div>
                    `;
                    container.appendChild(el);
                }
            });

            document.getElementById('no-results').classList.toggle('hidden', hasResults);
            lucide.createIcons();
        }

        function toggleFaq(element) {
            const isActive = element.classList.contains('active');
            document.querySelectorAll('.faq-item').forEach(item => item.classList.remove('active'));
            if (!isActive) element.classList.add('active');
        }

        document.getElementById('faq-search').addEventListener('input', renderFaqs);

        // 初始化
        initLanguage();
    </script>
</body>

</html>