@@ -1215,20 +1215,37 @@ ${commonRules}`;
12151215 --error: #f44747;
12161216 --warn: #cca700;
12171217 --info: var(--vscode-descriptionForeground, #9d9d9d);
1218+ --editor-bg: var(--vscode-editor-background, #252526);
12181219 }
12191220 body.light-mode {
1220- --bg: #f3f3f3 ;
1221+ --bg: #e8e8e8 ;
12211222 --fg: #1e1e1e;
1222- --input-bg: #ffffff ;
1223- --input-border: rgba(0,0,0,0.25 );
1223+ --input-bg: #f5f5f5 ;
1224+ --input-border: rgba(0,0,0,0.2 );
12241225 --input-fg: #1e1e1e;
12251226 --btn-bg: #007acc;
12261227 --btn-fg: #ffffff;
12271228 --btn-hover: #005a9e;
12281229 --muted: rgba(0,0,0,0.45);
12291230 --info: #5a5a5a;
1231+ --editor-bg: #dedede;
12301232 }
12311233 body.light-mode { background: var(--bg); color: var(--fg); }
1234+ body.light-mode button {
1235+ border-color: rgba(0,0,0,0.18);
1236+ }
1237+ body.light-mode button:hover {
1238+ border-color: rgba(0,0,0,0.35);
1239+ }
1240+ body.light-mode .btn-secondary {
1241+ background: rgba(0,0,0,0.06);
1242+ border-color: rgba(0,0,0,0.18);
1243+ color: var(--fg);
1244+ }
1245+ body.light-mode .btn-secondary:hover {
1246+ background: rgba(0,0,0,0.12);
1247+ border-color: rgba(0,0,0,0.3);
1248+ }
12321249 /* Toggle switch */
12331250 .toggle-switch { position:relative; display:inline-block; width:40px; height:22px; }
12341251 .toggle-switch input { opacity:0; width:0; height:0; }
@@ -1307,7 +1324,7 @@ ${commonRules}`;
13071324 .tab-content.active { display: block; }
13081325
13091326 .log-area {
1310- background: var(--vscode- editor-background );
1327+ background: var(--editor-bg );
13111328 border: 1px solid var(--input-border);
13121329 border-radius: 3px;
13131330 padding: 8px;
@@ -1324,7 +1341,7 @@ ${commonRules}`;
13241341 .log-entry.warn { color: var(--warn); }
13251342
13261343 .result-card {
1327- background: var(--vscode- editor-background );
1344+ background: var(--editor-bg );
13281345 border: 1px solid var(--input-border);
13291346 border-radius: 3px;
13301347 padding: 10px;
@@ -1361,7 +1378,7 @@ ${commonRules}`;
13611378
13621379 /* Bug列表样式 */
13631380 .bug-item {
1364- background: var(--vscode- editor-background );
1381+ background: var(--editor-bg );
13651382 border: 1px solid var(--input-border);
13661383 border-radius: 3px;
13671384 padding: 8px;
@@ -1412,7 +1429,7 @@ ${commonRules}`;
14121429 </div>
14131430 <button class="btn-secondary hidden" id="btnCheckEngine">检查连接</button>
14141431 <!-- 设备状态提示(仅Android/iOS项目显示) -->
1415- <div id="deviceStatusRow" class="hidden" style="background:var(--bg-secondary,#1e1e1e );border:1px solid var(--border);border-radius:3px;padding:6px 8px;margin:6px 0;font-size:11px">
1432+ <div id="deviceStatusRow" class="hidden" style="background:var(--editor-bg );border:1px solid var(--input -border);border-radius:3px;padding:6px 8px;margin:6px 0;font-size:11px">
14161433 <div style="display:flex;align-items:flex-start;gap:4px;margin-bottom:4px">
14171434 <span id="deviceStatusIcon" style="flex-shrink:0;line-height:1.4">📱</span>
14181435 <span id="deviceStatusText" style="color:var(--muted);word-break:break-word;line-height:1.4">检测中...</span>
@@ -2781,8 +2798,14 @@ ${commonRules}`;
27812798 }
27822799 });
27832800
2784- // 初始检查
2801+ // 初始检查 + 轮询(最长60秒/每5秒,连接后自动停止,解决Trae等IDE WebView渲染慢导致按钮状态不更新的问题)
27852802 vscode.postMessage({ command: "checkEngine" });
2803+ let _initPollCount = 0;
2804+ const _initPollId = setInterval(() => {
2805+ _initPollCount++;
2806+ if (wasConnected || _initPollCount >= 12) { clearInterval(_initPollId); return; }
2807+ vscode.postMessage({ command: "checkEngine" });
2808+ }, 5000);
27862809 </script>
27872810</body>
27882811</html>` ;
0 commit comments