diff --git a/webui/app.js b/webui/app.js index 9eca3bc..c698720 100644 --- a/webui/app.js +++ b/webui/app.js @@ -1,3 +1,90 @@ +const UI_LIMITS = Object.freeze({ + runLogMaxLines: 50000, + runLogMaxChars: 200000, + actionsLogMaxLines: 5000, + scrollBottomThresholdPx: 5, + screenshotPollMs: 1500, + logPollMs: 800, + statsPollMs: 1200, +}); + +const UI_CLASS = Object.freeze({ + busy: "isBusy", + clickable: "isClickable", + collapsed: "isCollapsed", + listCollapsed: "isListCollapsed", + reservationHeader: "reservationHeader", + reservationBody: "reservationBody", + reservationsList: "reservationsList", + shotEmpty: "isShotEmpty", + statusRunning: "statusRunning", + statusIdle: "statusIdle", + statusError: "statusError", +}); + +const RUN_TONE = Object.freeze({ + running: "running", + idle: "idle", + error: "error", +}); + +const UI_COPY = Object.freeze({ + empty: "-", + device: { + autoOption: "(auto)", + autoLabel: "(auto)", + noOnline: "无在线设备", + adbReady: "ADB 已就绪", + adbMissing: "ADB 未找到", + autoOnline: (count) => `${count} 台在线 / 自动选择`, + }, + runOverview: { + starting: "启动中", + startingMeta: "正在向后端发送启动请求", + failed: "启动失败", + stopping: "停止中", + stoppingMeta: "已请求后端停止运行", + meta: (pid, uptimeSeconds) => `PID ${pid ?? "-"} / 运行时长 ${fmtDuration(uptimeSeconds)}`, + }, + overview: { + logLines: (count) => `${count ?? 0} 行`, + lastLog: (ts) => `最后日志 ${fmtTime(ts)}`, + fudaiState: (opened, attended) => `${opened} / ${attended}`, + fudaiMeta: (seen, wins) => `识别 ${seen} / 中奖 ${wins}`, + }, +}); + +const TIMELINE_SERIES_KEYS = Object.freeze([ + "fudai_open_detail", + "fudai_attend_ok", + "fudai_attend_fail", + "fudai_result_win", + "fudai_result_no_win", + "fudai_skip", + "switch_room", +]); + +const TIMELINE_LAYOUT = Object.freeze({ + width: 900, + height: 220, + paddingLeft: 36, + paddingRight: 14, + paddingTop: 10, + paddingBottom: 26, +}); + +const TIMELINE_STROKES = Object.freeze({ + fudai_open_detail: { stroke: "var(--primary)", dash: "" }, + fudai_attend_ok: { stroke: "var(--primary)", dash: "6 4" }, + fudai_attend_fail: { stroke: "var(--danger)", dash: "" }, + fudai_result_win: { stroke: "var(--danger)", dash: "6 4" }, + fudai_result_no_win: { stroke: "var(--muted)", dash: "" }, + fudai_skip: { stroke: "var(--muted)", dash: "6 4" }, + switch_room: { stroke: "var(--text)", dash: "2 4" }, +}); + +const BUSY_DISABLED_BUTTONS = new Set(["btnStart", "btnSave"]); + let logIdx = 0; let pollTimer = null; let statsTimer = null; @@ -8,7 +95,7 @@ let emptyResponseCount = 0; // 连续空响应计数(用于检测索引卡住 // 双日志缓冲与过滤 let runLogBuffer = []; let runLogFilter = ""; -const runLogMaxLines = 50000; +const runLogMaxLines = UI_LIMITS.runLogMaxLines; let runLogMode = 'filter'; // 'filter' or 'search' let runSearchResultsBuffer = []; @@ -16,7 +103,8 @@ let runSearchActive = false; let actionsLogBuffer = []; let actionsLogFilter = ""; -const actionsLogMaxLines = 5000; +const actionsLogMaxLines = UI_LIMITS.actionsLogMaxLines; +let deviceOverviewState = { devices: [], adb: "" }; const DEFAULTS = { // 筛选 @@ -109,6 +197,7 @@ const DEFAULTS = { "logging.beautify_output": true, "logging.color_output": true, "logging.show_timestamps": true, + "logging.use_dated_logs": true, "logging.enable_monitor": true, "logging.compress_logs": true, "logging.keep_days": 30, @@ -124,6 +213,10 @@ const DEFAULTS = { "logging.performance_tracking.enabled": true, "logging.performance_tracking.track_function_calls": true, "gui.theme": "litera", + "gui.realtime_status.refresh_interval_ms": 1000, + "gui.realtime_status.tail_items": 50, + log_unified_enabled: true, + log_unified_path: "logs/unified.log", }; function $(id) { return document.getElementById(id); } @@ -144,6 +237,7 @@ function initTabs() { panel.toggleAttribute("hidden", !isActive); panel.classList.toggle("active", isActive); } + document.body.dataset.activePanel = target || ""; }; for (const btn of tabButtons) { @@ -161,7 +255,7 @@ function appendLog(lines) { // 记录更新前与底部的距离,用于在非底部时保持视图位置 const distanceFromBottom = log.scrollHeight - log.scrollTop - log.clientHeight; // 是否严格位于底部(仅在几像素内视为底部),避免每次刷新都跳到底部 - const wasAtBottom = distanceFromBottom < 5; + const wasAtBottom = distanceFromBottom < UI_LIMITS.scrollBottomThresholdPx; // 性能优化:批量追加文本,减少重排次数 const newText = lines.join("\n") + "\n"; @@ -185,7 +279,7 @@ function appendLog(lines) { } // 性能优化:限制日志长度,避免内存溢出(保留最近较多字符以便桌面端查看) - const maxLength = 200000; + const maxLength = UI_LIMITS.runLogMaxChars; if (log.textContent.length > maxLength) { // 在截断文本时,保留用户原来的距离(除非用户确实在底部) log.textContent = log.textContent.slice(-maxLength); @@ -210,7 +304,7 @@ function renderRunLog() { const lines = runSearchResultsBuffer || []; const prevScrollBottom = el.scrollHeight - el.scrollTop - el.clientHeight; el.textContent = lines.join("\n") + (lines.length ? "\n" : ""); - if (prevScrollBottom < 5) el.scrollTop = el.scrollHeight; else el.scrollTop = Math.max(0, el.scrollHeight - el.clientHeight - prevScrollBottom); + if (prevScrollBottom < UI_LIMITS.scrollBottomThresholdPx) el.scrollTop = el.scrollHeight; else el.scrollTop = Math.max(0, el.scrollHeight - el.clientHeight - prevScrollBottom); return; } @@ -222,7 +316,7 @@ function renderRunLog() { const prevScrollBottom = el.scrollHeight - el.scrollTop - el.clientHeight; el.textContent = lines.join("\n") + (lines.length ? "\n" : ""); // 尽量保持原来滚动位置;若位于底部则滚到底部 - if (prevScrollBottom < 5) el.scrollTop = el.scrollHeight; else el.scrollTop = Math.max(0, el.scrollHeight - el.clientHeight - prevScrollBottom); + if (prevScrollBottom < UI_LIMITS.scrollBottomThresholdPx) el.scrollTop = el.scrollHeight; else el.scrollTop = Math.max(0, el.scrollHeight - el.clientHeight - prevScrollBottom); } function appendRunLogLines(lines) { @@ -275,12 +369,14 @@ function fmtDuration(seconds) { function pollShot() { const img = $("liveShot"); if (!img) return; + const preview = img.closest(".preview"); // 性能优化:避免重复加载相同的图片(如果正在加载中) if (img.dataset.loading === "true") return; const url = `/pic/screenshot.png?t=${Date.now()}`; img.dataset.loading = "true"; + if (preview) preview.classList.remove(UI_CLASS.shotEmpty); img.src = url; const status = $("liveShotStatus"); @@ -293,18 +389,27 @@ function startShotPolling() { const img = $("liveShot"); const status = $("liveShotStatus"); if (img) { + const preview = img.closest(".preview"); + const syncShotEmpty = () => { + if (!preview) return; + preview.classList.toggle(UI_CLASS.shotEmpty, img.complete && img.naturalWidth === 0); + }; + syncShotEmpty(); img.addEventListener("load", () => { img.dataset.loading = "false"; + if (preview) preview.classList.remove(UI_CLASS.shotEmpty); if (status) status.textContent = `已更新:${new Date().toLocaleTimeString()}`; }); img.addEventListener("error", () => { img.dataset.loading = "false"; + if (preview) preview.classList.add(UI_CLASS.shotEmpty); if (status) status.textContent = "暂无截图(等待脚本生成 pic/screenshot.png)"; }); + setTimeout(syncShotEmpty, 0); } // 性能优化:截图轮询间隔从 900ms 调整为 1500ms,减少服务器压力 - shotTimer = setInterval(pollShot, 1500); + shotTimer = setInterval(pollShot, UI_LIMITS.screenshotPollMs); } function setTextIfExists(id, text) { @@ -313,6 +418,36 @@ function setTextIfExists(id, text) { el.textContent = String(text ?? "-"); } +function setButtonBusy(id, busy) { + const btn = $(id); + if (!btn) return; + btn.classList.toggle(UI_CLASS.busy, !!busy); + btn.toggleAttribute("aria-busy", !!busy); + if (BUSY_DISABLED_BUTTONS.has(id)) btn.disabled = !!busy; +} + +function setRunOverview(state, meta, tone) { + setTextIfExists("topRunState", state || UI_COPY.empty); + setTextIfExists("topRunMeta", meta || UI_COPY.empty); + const dot = $("topRunDot"); + if (!dot) return; + dot.classList.remove(UI_CLASS.statusRunning, UI_CLASS.statusIdle, UI_CLASS.statusError); + dot.classList.add(tone === RUN_TONE.running ? UI_CLASS.statusRunning : tone === RUN_TONE.error ? UI_CLASS.statusError : UI_CLASS.statusIdle); +} + +function updateDeviceOverview() { + const devices = Array.isArray(deviceOverviewState.devices) ? deviceOverviewState.devices : []; + const selected = selectedDeviceId(); + if (selected) { + setTextIfExists("topDeviceState", selected); + } else if (devices.length > 0) { + setTextIfExists("topDeviceState", UI_COPY.device.autoOnline(devices.length)); + } else { + setTextIfExists("topDeviceState", UI_COPY.device.noOnline); + } + setTextIfExists("topAdbState", deviceOverviewState.adb ? UI_COPY.device.adbReady : UI_COPY.device.adbMissing); +} + function clearEl(el) { while (el && el.firstChild) el.removeChild(el.firstChild); } @@ -452,18 +587,8 @@ function renderTimeline(containerId, timeline) { return; } - const keys = [ - "fudai_open_detail", - "fudai_attend_ok", - "fudai_attend_fail", - "fudai_result_win", - "fudai_result_no_win", - "fudai_skip", - "switch_room", - ]; - let maxY = 0; - for (const k of keys) { + for (const k of TIMELINE_SERIES_KEYS) { const arr = Array.isArray(series[k]) ? series[k] : []; for (const v of arr) maxY = Math.max(maxY, Number(v) || 0); } @@ -475,18 +600,18 @@ function renderTimeline(containerId, timeline) { return; } - const W = 900; - const H = 220; - const padL = 36; - const padR = 14; - const padT = 10; - const padB = 26; + const W = TIMELINE_LAYOUT.width; + const H = TIMELINE_LAYOUT.height; + const padL = TIMELINE_LAYOUT.paddingLeft; + const padR = TIMELINE_LAYOUT.paddingRight; + const padT = TIMELINE_LAYOUT.paddingTop; + const padB = TIMELINE_LAYOUT.paddingBottom; const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg"); svg.setAttribute("viewBox", `0 0 ${W} ${H}`); svg.setAttribute("width", "100%"); svg.setAttribute("height", String(H)); - svg.style.display = "block"; + svg.classList.add("timelineSvg"); const axis = document.createElementNS("http://www.w3.org/2000/svg", "path"); axis.setAttribute("d", `M ${padL} ${H - padB} L ${W - padR} ${H - padB}`); @@ -529,17 +654,7 @@ function renderTimeline(containerId, timeline) { svg.appendChild(mkText((padL + (W - padR)) / 2, H - 8, fmtShort(startTs + Math.floor(bins / 2) * binSec), "middle")); svg.appendChild(mkText(W - padR, H - 8, fmtShort(startTs + (bins - 1) * binSec), "end")); - const strokes = { - fudai_open_detail: { stroke: "var(--primary)", dash: "" }, - fudai_attend_ok: { stroke: "var(--primary)", dash: "6 4" }, - fudai_attend_fail: { stroke: "var(--danger)", dash: "" }, - fudai_result_win: { stroke: "var(--danger)", dash: "6 4" }, - fudai_result_no_win: { stroke: "var(--muted)", dash: "" }, - fudai_skip: { stroke: "var(--muted)", dash: "6 4" }, - switch_room: { stroke: "var(--text)", dash: "2 4" }, - }; - - for (const k of keys) { + for (const k of TIMELINE_SERIES_KEYS) { const arr = Array.isArray(series[k]) ? series[k] : []; if (arr.length === 0) continue; let d = ""; @@ -551,9 +666,9 @@ function renderTimeline(containerId, timeline) { const p = document.createElementNS("http://www.w3.org/2000/svg", "path"); p.setAttribute("d", d); p.setAttribute("fill", "none"); - p.setAttribute("stroke", strokes[k]?.stroke || "var(--primary)"); + p.setAttribute("stroke", TIMELINE_STROKES[k]?.stroke || "var(--primary)"); p.setAttribute("stroke-width", "2"); - if (strokes[k]?.dash) p.setAttribute("stroke-dasharray", strokes[k].dash); + if (TIMELINE_STROKES[k]?.dash) p.setAttribute("stroke-dasharray", TIMELINE_STROKES[k].dash); p.setAttribute("stroke-linecap", "round"); p.setAttribute("stroke-linejoin", "round"); svg.appendChild(p); @@ -598,7 +713,7 @@ async function refreshDevices() { const optAuto = document.createElement("option"); optAuto.value = ""; - optAuto.textContent = "(auto)"; + optAuto.textContent = UI_COPY.device.autoOption; sel.appendChild(optAuto); for (const d of devices) { @@ -609,6 +724,8 @@ async function refreshDevices() { } $("adbStatus").textContent = data.adb ? `adb: ${data.adb}` : "未找到 adb.exe(请安装 platform-tools)"; + deviceOverviewState = { devices, adb: data.adb || "" }; + updateDeviceOverview(); } function getConfigBoundElements() { @@ -717,9 +834,14 @@ async function loadConfig() { } async function saveConfig() { - const cfgUpdate = collectConfigFromUI(); - await apiPost("/api/config", cfgUpdate); - appendLog(["[WEB] 配置已保存到 config.json"]); + setButtonBusy("btnSave", true); + try { + const cfgUpdate = collectConfigFromUI(); + await apiPost("/api/config", cfgUpdate); + appendLog(["[WEB] 配置已保存到 config.json"]); + } finally { + setButtonBusy("btnSave", false); + } } function selectedDeviceId() { @@ -782,6 +904,8 @@ async function wifiDisconnect() { } async function startRun() { + setButtonBusy("btnStart", true); + setRunOverview(UI_COPY.runOverview.starting, UI_COPY.runOverview.startingMeta, RUN_TONE.running); try { const deviceId = $("device").value || ""; const yPianyi = parseInt($("y_pianyi").value || "0", 10); @@ -836,7 +960,7 @@ async function startRun() { return; } - appendLog([`[WEB] 已开始运行:device=${deviceId || '(auto)'}`]); + appendLog([`[WEB] 已开始运行:device=${deviceId || UI_COPY.device.autoLabel}`]); // 启动时自动截图 if (deviceId) { @@ -872,10 +996,13 @@ async function startRun() { console.error("[WEB] startRun error:", e); const errorMsg = e.message || String(e); appendLog([`[WEB] 启动失败: ${errorMsg}`]); + setRunOverview(UI_COPY.runOverview.failed, errorMsg, RUN_TONE.error); // 如果是"running"错误,显示友好提示 if (errorMsg === "running" || (e.status === 409)) { appendLog([`[WEB] 提示:已有进程在运行中,请先点击"停止"按钮`]); } + } finally { + setButtonBusy("btnStart", false); } } @@ -883,17 +1010,18 @@ async function testYanghao() { const deviceId = $("device").value || ""; const seconds = parseInt($("yanghao_recommend_duration_seconds").value || "60", 10); await apiPost("/api/test-yanghao", { device_id: deviceId, seconds }); - appendLog([`[WEB] 已启动测试养号:device=${deviceId || '(auto)'} seconds=${seconds}`]); + appendLog([`[WEB] 已启动测试养号:device=${deviceId || UI_COPY.device.autoLabel} seconds=${seconds}`]); } async function testComment() { const deviceId = $("device").value || ""; const text = ""; await apiPost("/api/test-comment", { device_id: deviceId, text }); - appendLog([`[WEB] 已启动测试评论:device=${deviceId || '(auto)'}${text ? ' text=自定义' : ''}`]); + appendLog([`[WEB] 已启动测试评论:device=${deviceId || UI_COPY.device.autoLabel}${text ? ' text=自定义' : ''}`]); } async function stopRun() { + setRunOverview(UI_COPY.runOverview.stopping, UI_COPY.runOverview.stoppingMeta, RUN_TONE.idle); await apiPost("/api/stop", {}); appendLog(["[WEB] 已发送停止"]); // 重置并拉取日志,确保能看到后端的停止确认输出 @@ -1142,16 +1270,12 @@ async function pollHighValueRooms() { // 让每条记录的 header 可点击以折叠/展开本条详情 list.appendChild(card); try { - const header = card.querySelector('.reservationHeader'); - const body = card.querySelector('.reservationBody'); + const header = card.querySelector(`.${UI_CLASS.reservationHeader}`); + const body = card.querySelector(`.${UI_CLASS.reservationBody}`); if (header && body) { - header.style.cursor = 'pointer'; + header.classList.add(UI_CLASS.clickable); header.addEventListener('click', () => { - if (body.style.display === 'none') { - body.style.display = ''; - } else { - body.style.display = 'none'; - } + body.classList.toggle(UI_CLASS.collapsed); }); } } catch (e) { @@ -1168,12 +1292,12 @@ async function pollHighValueRooms() { const btnExpand = $('hv_expand_all'); const btnCollapse = $('hv_collapse_all'); if (btnExpand) btnExpand.addEventListener('click', () => { - const listEl = container.querySelector('.reservationsList'); - if (listEl) listEl.style.display = ''; + const listEl = container.querySelector(`.${UI_CLASS.reservationsList}`); + if (listEl) listEl.classList.remove(UI_CLASS.listCollapsed); }); if (btnCollapse) btnCollapse.addEventListener('click', () => { - const listEl = container.querySelector('.reservationsList'); - if (listEl) listEl.style.display = 'none'; + const listEl = container.querySelector(`.${UI_CLASS.reservationsList}`); + if (listEl) listEl.classList.add(UI_CLASS.listCollapsed); }); } catch (e) { // ignore @@ -1209,12 +1333,23 @@ async function pollStats() { const c = s.counters || {}; const getC = (k) => Number.isFinite(Number(c[k])) ? Number(c[k]) : 0; + setRunOverview( + running, + UI_COPY.runOverview.meta(s.pid, s.uptime_seconds), + s.running ? RUN_TONE.running : RUN_TONE.idle + ); + document.body.classList.toggle("is-running", !!s.running); + setTextIfExists("topLogState", UI_COPY.overview.logLines(s.log_len)); + setTextIfExists("topLogMeta", UI_COPY.overview.lastLog(s.last_log_ts)); + setTextIfExists("statFudaiSeen", getC("fudai_seen")); setTextIfExists("statFudaiOpen", getC("fudai_open_detail")); setTextIfExists("statFudaiAttendOk", getC("fudai_attend_ok")); setTextIfExists("statFudaiAttendFail", getC("fudai_attend_fail")); setTextIfExists("statFudaiNoWin", getC("fudai_result_no_win")); setTextIfExists("statFudaiWin", getC("fudai_result_win")); + setTextIfExists("topFudaiState", UI_COPY.overview.fudaiState(getC("fudai_open_detail"), getC("fudai_attend_ok"))); + setTextIfExists("topFudaiMeta", UI_COPY.overview.fudaiMeta(getC("fudai_seen"), getC("fudai_result_win"))); setTextIfExists("statSkipValueLow", getC("fudai_skip_value_low")); @@ -1307,7 +1442,7 @@ async function pollStats() { function startPolling() { if (pollTimer) clearInterval(pollTimer); // 性能优化:日志轮询间隔从 700ms 调整为 800ms,减少服务器压力同时保持实时性 - pollTimer = setInterval(pollLogs, 800); + pollTimer = setInterval(pollLogs, UI_LIMITS.logPollMs); } function startStatsPolling() { @@ -1316,7 +1451,7 @@ function startStatsPolling() { pollStats(); pollReservations(); pollHighValueRooms(); - }, 1200); + }, UI_LIMITS.statsPollMs); } window.addEventListener("DOMContentLoaded", async () => { @@ -1326,6 +1461,8 @@ window.addEventListener("DOMContentLoaded", async () => { $("btnSave").addEventListener("click", async () => { await saveConfig(); }); $("btnStart").addEventListener("click", async () => { await startRun(); }); $("btnStop").addEventListener("click", async () => { await stopRun(); }); + const deviceSelect = $("device"); + if (deviceSelect) deviceSelect.addEventListener("change", updateDeviceOverview); const btnForceStop = $("btnForceStop"); if (btnForceStop) btnForceStop.addEventListener("click", async () => { await forceStopRun(); }); const btnBackKey = $("btnBackKey"); diff --git a/webui/index.html b/webui/index.html index aabbc0b..190ea85 100644 --- a/webui/index.html +++ b/webui/index.html @@ -4,69 +4,102 @@ 抖音挂机 - Web GUI - +
-
-
-
抖音挂机控制台
-
配置与运行(纯坐标点击)
+
+
+ +
+
抖音挂机控制台
+
设备调度、运行控制与实时观察
+
- - - - - - - - +
+ + + +
+
+ + + + + +
-
-
+
+
+
运行状态
+
+ + 等待启动 +
+
PID - / 运行时长 -
+
+
+
设备连接
+
未刷新
+
ADB 状态待检测
+
+
+
福袋处理
+
0 / 0
+
打开详情 / 成功参与
+
+
+
日志缓存
+
-
+
最后日志 -
+
+
+ +
+ + +
+
+
+
Configuration
+

运行策略工作区

+
+
配置项按当前标签自然铺排,短页不再继承长页高度。
+
@@ -467,7 +525,7 @@
TraceId(请求追踪)
-
-
+
-
-
@@ -967,6 +1025,24 @@
+
+
+
+
+ + +
+
+
+
+ + +
+
+ + +
+
@@ -1030,11 +1106,9 @@
-
-
- + + + -
+ -
+
+ - + diff --git a/webui/styles.css b/webui/styles.css index 124cae3..6bd9144 100644 --- a/webui/styles.css +++ b/webui/styles.css @@ -1,546 +1,1633 @@ :root { - --bg: #f6f7fb; - --card: #ffffff; - --card2: #fbfcfe; - --border: #e6e8ef; - --text: #111827; - --muted: #6b7280; - --primary: #2563eb; - --danger: #dc2626; - --shadow: 0 12px 30px rgba(17,24,39,0.08); + --bg: #f4f7fb; + --surface: rgba(255, 255, 255, 0.9); + --surface-solid: #ffffff; + --surface-soft: rgba(248, 250, 252, 0.86); + --surface-muted: #edf3f8; + --surface-elevated: rgba(255, 255, 255, 0.96); + --border: rgba(130, 151, 178, 0.26); + --border-strong: rgba(103, 124, 152, 0.42); + --hairline: rgba(255, 255, 255, 0.72); + --text: #1b2435; + --text-strong: #101828; + --muted: #64748b; + --muted-soft: #94a3b8; + --primary: #2359c7; + --primary-hover: #1d4aa7; + --primary-soft: #edf4ff; + --primary-border: #b8cdf6; + --success: #168456; + --success-soft: #eaf8f2; + --warning: #b7791f; + --warning-soft: #fff8e8; + --warning-border: #f4d58b; + --danger: #d43f3f; + --danger-hover: #b83232; + --danger-soft: #fff1f1; + --danger-border: #f4b8b8; + --on-primary: #ffffff; + --bg-start: #f8fbff; + --bg-mid: #eef4fa; + --bg-end: #e7edf5; + --header-bg: rgba(255, 255, 255, 0.78); + --primary-action-bg: rgba(244, 248, 255, 0.82); + --primary-accent-text: #174ea6; + --accent-cyan: #0891b2; + --accent-emerald: #159a68; + --hover-border: rgba(75, 98, 128, 0.5); + --primary-soft-hover: #e1ecff; + --primary-soft-hover-border: #91b2ee; + --danger-soft-hover: #ffe4e4; + --danger-soft-hover-border: #ee9a9a; + --overview-primary-bg: linear-gradient(135deg, rgba(245, 249, 255, 0.95), rgba(237, 247, 255, 0.82)); + --chart-track: #dde7f0; + --preview-bg: linear-gradient(145deg, #f7faff, #edf2f8); + --shadow: 0 18px 44px rgba(36, 48, 72, 0.12), 0 2px 0 rgba(255, 255, 255, 0.84) inset; + --shadow-soft: 0 10px 28px rgba(36, 48, 72, 0.08); + --shadow-hover: 0 24px 54px rgba(36, 48, 72, 0.15), 0 2px 0 rgba(255, 255, 255, 0.9) inset; + --shadow-primary: 0 14px 28px rgba(35, 89, 199, 0.26); + --shadow-primary-soft: 0 12px 28px rgba(35, 89, 199, 0.2); + --shadow-danger-soft: 0 12px 28px rgba(212, 63, 63, 0.18); + --focus-ring: 0 0 0 3px rgba(35, 89, 199, 0.14); + --status-muted-ring: 0 0 0 4px rgba(148, 163, 184, 0.14); + --status-success-ring: 0 0 0 4px rgba(21, 154, 104, 0.14); + --status-danger-ring: 0 0 0 4px rgba(212, 63, 63, 0.14); + --radius: 8px; + --control-height: 36px; + --page-max: 1760px; + --page-pad: 18px; + --layout-gap: 12px; + --shell-gap: 14px; + --rail-width: 216px; + --live-rail-width: 440px; + --panel-max: 980px; + --overview-gap: 12px; + --right-panel-min: 360px; + --config-nav-width: 168px; + --shot-height-desktop: clamp(240px, 28vh, 340px); + --shot-height-tablet: clamp(220px, 30vh, 320px); + --shot-height-mobile: clamp(220px, 32vh, 320px); + --queue-height-desktop: clamp(170px, 24vh, 280px); + --log-height-desktop: clamp(280px, 34vh, 420px); + --log-height-mobile: clamp(240px, 31vh, 360px); + --log-bg: rgba(248, 250, 252, 0.94); + --log-border: rgba(130, 151, 178, 0.24); + --log-text: #243044; + --motion-fast: 140ms ease; + --motion: 220ms cubic-bezier(0.2, 0.8, 0.2, 1); + --motion-slow: 520ms cubic-bezier(0.16, 1, 0.3, 1); +} + +* { + box-sizing: border-box; +} + +html, +body { + min-height: 100%; } -* { box-sizing: border-box; } -html, body { height: 100%; } body { margin: 0; - font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial; - background: radial-gradient(1200px 600px at 18% 10%, rgba(37,99,235,0.10), transparent 55%), - radial-gradient(900px 520px at 82% 16%, rgba(220,38,38,0.07), transparent 60%), - var(--bg); + font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; color: var(--text); + background: + linear-gradient(135deg, rgba(255, 255, 255, 0.55) 0 1px, transparent 1px 28px), + linear-gradient(180deg, var(--bg-start) 0%, var(--bg-mid) 48%, var(--bg-end) 100%); + background-attachment: fixed; + letter-spacing: 0; } -.app { max-width: 1360px; margin: 0 auto; padding: 16px; } +body::before { + position: fixed; + inset: 0; + z-index: -1; + content: ""; + pointer-events: none; + background: + linear-gradient(120deg, rgba(35, 89, 199, 0.08), transparent 38%), + linear-gradient(250deg, rgba(8, 145, 178, 0.08), transparent 42%), + repeating-linear-gradient(90deg, rgba(16, 24, 40, 0.035) 0 1px, transparent 1px 96px); + mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.72) 48%, transparent 100%); +} + +@keyframes surfaceIn { + from { + opacity: 0; + transform: translateY(10px); + } + to { + opacity: 1; + transform: translateY(0); + } +} + +@keyframes sheen { + 0%, + 72% { + transform: translateX(-120%); + } + 86%, + 100% { + transform: translateX(120%); + } +} + +@keyframes statusPulse { + 0%, + 100% { + filter: saturate(1); + transform: scale(1); + } + 50% { + filter: saturate(1.35); + transform: scale(1.12); + } +} + +@keyframes previewScan { + 0% { + transform: translateX(-100%); + } + 55%, + 100% { + transform: translateX(100%); + } +} + +button, +input, +select, +textarea { + font: inherit; +} + +button { + cursor: pointer; +} + +svg { + display: block; +} + +.app { + width: min(var(--page-max), 100%); + margin: 0 auto; + padding: var(--page-pad); +} .header { + position: sticky; + top: 12px; + z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px; - padding: 12px 14px; + padding: 14px; border: 1px solid var(--border); - background: linear-gradient(180deg, var(--card2), var(--card)); - border-radius: 14px; + background: var(--header-bg); + border-radius: var(--radius); box-shadow: var(--shadow); + backdrop-filter: blur(18px) saturate(1.2); + animation: surfaceIn var(--motion-slow) both; } -.title { font-size: 19px; font-weight: 700; letter-spacing: 0.2px; } -.subtitle { font-size: 13px; color: var(--muted); margin-top: 4px; } - -.header-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; } - -.grid { - margin-top: 14px; +.brandBlock { display: flex; - flex-direction: column; + align-items: center; gap: 12px; + min-width: 220px; } -.cardLog { order: 0; } -.cardShot { order: 1; } -.cardConfig { order: 2; } - -/* 关键:避免日志超长行撑爆 grid 导致页面变形 */ -.grid > * { min-width: 0; } - -.card { - border: 1px solid var(--border); - background: linear-gradient(180deg, var(--card2), var(--card)); - border-radius: 14px; - padding: 12px; - min-height: 520px; - box-shadow: var(--shadow); - min-width: 0; -} - -.cardScroll { max-height: calc(100vh - 132px); overflow: auto; } - -.configLayout { - display: grid; - grid-template-columns: 1fr; - grid-template-rows: auto minmax(0, 1fr); - gap: 12px; - margin-top: 10px; -} - -.sideNav { - border: 1px solid var(--border); - border-radius: 14px; - background: var(--card); - padding: 8px; - display: flex; - flex-direction: row; - gap: 8px; +.brandMark { position: relative; - overflow-x: auto; - overflow-y: hidden; - white-space: nowrap; + overflow: hidden; + display: grid; + place-items: center; + flex: 0 0 42px; + width: 42px; + height: 42px; + color: var(--on-primary); + background: linear-gradient(135deg, var(--primary), var(--accent-cyan)); + border-radius: var(--radius); + font-size: 17px; + font-weight: 800; + box-shadow: var(--shadow-primary); } -@supports ((-webkit-backdrop-filter: blur(6px)) or (backdrop-filter: blur(6px))) { - .sideNav { - background: rgba(255,255,255,0.78); - -webkit-backdrop-filter: blur(6px); - backdrop-filter: blur(6px); - } +.brandMark::after { + position: absolute; + inset: 0; + content: ""; + background: linear-gradient(130deg, transparent 0 36%, rgba(255, 255, 255, 0.42) 48%, transparent 60% 100%); + transform: translateX(-120%); + animation: sheen 5.6s ease-in-out infinite; } -.tabBtn { - border: 1px solid transparent; - background: transparent; - color: rgba(17,24,39,0.78); - border-radius: 12px; - padding: 8px 10px; - font-weight: 700; - cursor: pointer; - display: flex; - flex-direction: row; - align-items: center; - justify-content: center; - gap: 6px; - min-height: 40px; - flex: 0 0 auto; +.title { + color: var(--text-strong); + font-size: 18px; + font-weight: 760; + line-height: 1.25; } -.tabText { font-size: 12px; line-height: 1; } - -.tabBtn:hover { background: #eef2ff; color: rgba(17,24,39,0.92); } - -.tabBtn.active { - background: #eaf0ff; - color: rgba(17,24,39,0.92); - border-color: rgba(37,99,235,0.30); - box-shadow: 0 6px 16px rgba(37,99,235,0.10); -} - -.tabIcon { - width: 18px; - height: 18px; - display: inline-flex; - color: rgba(37,99,235,0.85); -} - -.tabIcon svg { width: 18px; height: 18px; } - -.panels { min-width: 0; } - -.panel { padding-top: 2px; } - -.panel[hidden] { display: none; } - -.cardTitle { - font-weight: 700; - margin-bottom: 12px; - font-size: 13px; - color: rgba(17,24,39,0.88); - display: flex; - align-items: center; - gap: 8px; -} - -.sectionTitle { - margin: 14px 0 8px; - font-weight: 700; +.subtitle { + margin-top: 4px; + color: var(--muted); font-size: 12px; - color: rgba(17,24,39,0.78); - display: flex; - align-items: center; - gap: 8px; -} - -.sectionIcon { - width: 18px; - height: 18px; - color: #6b7280; - display: inline-flex; -} - -.sectionIcon svg { width: 18px; height: 18px; } - -.row { margin-bottom: 10px; } -.label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 7px; } -.input { - width: 100%; - padding: 10px 12px; - border-radius: 10px; - border: 1px solid var(--border); - background: #ffffff; - color: var(--text); - outline: none; - font-size: 13px; line-height: 1.35; } -.input:focus { border-color: rgba(37,99,235,0.65); box-shadow: 0 0 0 3px rgba(37,99,235,0.16); } - -.textarea { resize: vertical; min-height: 110px; } - -.hint { font-size: 12px; color: var(--muted); margin-top: 6px; } - -.rowActions { display: flex; gap: 10px; flex-wrap: wrap; } -.rowActions .btn { flex: 1 1 140px; } - -.btn { - padding: 10px 12px; - border-radius: 10px; - border: 1px solid var(--border); - background: #f3f4f6; - color: var(--text); - cursor: pointer; - font-weight: 600; - display: inline-flex; - align-items: center; - gap: 8px; - font-size: 13px; -} - -.btn:hover { background: #e9edf3; } -.btn:active { transform: translateY(1px); } - -.btnPrimary { background: var(--primary); border-color: rgba(37,99,235,0.65); color: #ffffff; } -.btnPrimary:hover { filter: brightness(0.96); } - -.btnDanger { background: var(--danger); border-color: rgba(220,38,38,0.55); color: #ffffff; } -.btnDanger:hover { filter: brightness(0.96); } - -.btnIcon { - width: 18px; - height: 18px; - display: inline-flex; -} - -.btnIcon svg { width: 18px; height: 18px; } - -.divider { height: 1px; background: var(--border); margin: 12px 0; } - -.log { - height: 100%; - /* 增大日志面板的初始可视高度,便于桌面端查看更多行为日志 */ - min-height: 700px; - /* 最大高度使用视窗计算,避免在超大屏幕下被限制得太短 */ - max-height: calc(100vh - 120px); - overflow: auto; - margin: 0; - padding: 10px; - border-radius: 10px; - border: 1px solid var(--border); - background: #0b1220; - color: rgba(255,255,255,0.92); - font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; - font-size: 13px; - line-height: 1.55; - min-width: 0; - max-width: 100%; -} - -/* 双日志面板布局与搜索框样式 */ -.logRow { display: flex; gap: 12px; } -.logSection { flex: 1 1 0; display: flex; flex-direction: column; } -.logHeader { display:flex; align-items:center; justify-content:space-between; margin-bottom:6px; } -.logTitle { font-weight:600; color:var(--text); } -.logHeaderActions { display:flex; gap:8px; align-items:center; } -.logSearchBox { border:1px solid var(--border); padding:6px 8px; border-radius:4px; min-width:220px; background:var(--card); color:var(--text); } -.logSearchBox:focus { outline:2px solid rgba(37,99,235,0.12); } -.btn.small { padding:4px 8px; font-size:12px; } - -.preview { - border: 1px solid var(--border); - background: #f3f4f6; - border-radius: 12px; - padding: 8px; - height: 260px; +.header-actions { display: flex; align-items: center; + justify-content: flex-end; + gap: 8px; + flex-wrap: wrap; + min-width: 0; +} + +.actionGroup { + display: flex; + align-items: center; + justify-content: flex-end; + gap: 8px; + flex-wrap: wrap; + padding: 4px; + border: 1px solid var(--border); + border-radius: var(--radius); + background: var(--surface-soft); + box-shadow: 0 1px 0 var(--hairline) inset; +} + +.primaryActions { + border-color: var(--primary-border); + background: var(--primary-action-bg); +} + +.btn { + display: inline-flex; + align-items: center; justify-content: center; + gap: 7px; + min-width: 0; + min-height: var(--control-height); + padding: 0 12px; + border: 1px solid var(--border-strong); + border-radius: var(--radius); + color: var(--text); + background: var(--surface-elevated); + box-shadow: var(--shadow-soft); + font-size: 13px; + font-weight: 650; + line-height: 1; + white-space: nowrap; + transition: background var(--motion-fast), border-color var(--motion-fast), color var(--motion-fast), box-shadow var(--motion), transform var(--motion); } -.cardShot .preview { - height: min(520px, 60vh); +.btn:hover { + border-color: var(--hover-border); + background: var(--surface-solid); + box-shadow: var(--shadow-hover); + transform: translateY(-1px); } -/* 移除旧的 stickyBar(开始运行已在顶部栏) */ - -.preview img { - max-width: 100%; - max-height: 100%; - border-radius: 8px; +.btn:active { + transform: translateY(1px); } -@media (max-width: 980px) { - .grid { flex-direction: column; } - .card { min-height: unset; } - .log { min-height: 360px; } - .configLayout { grid-template-columns: 1fr; } - .sideNav { position: static; flex-wrap: nowrap; } +.btn:disabled { + cursor: not-allowed; + opacity: 0.55; + transform: none; } -@media (max-width: 520px) { - .app { padding: 12px; } - .header-actions { gap: 8px; } - .btn { padding: 9px 10px; } +.btn.isBusy { + cursor: progress; + opacity: 0.78; } -.grid2 { +.btnIcon { + display: inline-flex; + flex: 0 0 16px; + width: 16px; + height: 16px; +} + +.btnIcon svg { + width: 16px; + height: 16px; +} + +.btnPrimary { + color: var(--on-primary); + border-color: var(--primary); + background: linear-gradient(135deg, var(--primary), #2769df); + box-shadow: var(--shadow-primary-soft); +} + +.btnPrimary:hover { + color: var(--on-primary); + border-color: var(--primary-hover); + background: var(--primary-hover); +} + +.btnSoft { + color: var(--primary-accent-text); + border-color: var(--primary-border); + background: linear-gradient(180deg, #f5f9ff, var(--primary-soft)); +} + +.btnSoft:hover { + border-color: var(--primary-soft-hover-border); + background: var(--primary-soft-hover); +} + +.btnGhost { + color: var(--text); + border-color: transparent; + background: transparent; + box-shadow: none; +} + +.btnGhost:hover { + border-color: var(--border); + background: var(--surface); +} + +.btnDanger { + color: var(--on-primary); + border-color: var(--danger); + background: var(--danger); + box-shadow: var(--shadow-danger-soft); +} + +.btnDanger:hover { + color: var(--on-primary); + border-color: var(--danger-hover); + background: var(--danger-hover); +} + +.btnDangerSoft { + color: var(--danger); + border-color: var(--danger-border); + background: var(--danger-soft); +} + +.btnDangerSoft:hover { + border-color: var(--danger-soft-hover-border); + background: var(--danger-soft-hover); +} + +.btn.small { + min-height: 30px; + padding: 0 9px; + font-size: 12px; + box-shadow: none; +} + +.overview { display: grid; - grid-template-columns: 1fr 1fr; - gap: 10px; + grid-template-columns: repeat(4, minmax(0, 1fr)); + gap: var(--overview-gap); + margin-top: 14px; } -.grid3 { +.overviewCard { + position: relative; + overflow: hidden; + min-width: 0; + padding: 14px; + border: 1px solid var(--border); + border-radius: var(--radius); + background: var(--surface); + box-shadow: var(--shadow-soft); + animation: surfaceIn var(--motion-slow) both; + transition: border-color var(--motion), box-shadow var(--motion), transform var(--motion); +} + +.overviewCard:nth-child(2) { + animation-delay: 45ms; +} + +.overviewCard:nth-child(3) { + animation-delay: 90ms; +} + +.overviewCard:nth-child(4) { + animation-delay: 135ms; +} + +.overviewCard::before { + position: absolute; + inset: 0 0 auto; + height: 2px; + content: ""; + background: linear-gradient(90deg, var(--primary), var(--accent-cyan), var(--accent-emerald)); + opacity: 0.56; +} + +.overviewCard:hover { + border-color: var(--hover-border); + box-shadow: var(--shadow-hover); + transform: translateY(-2px); +} + +.overviewPrimary { + border-color: var(--primary-border); + background: var(--overview-primary-bg); +} + +.overviewLabel { + color: var(--muted); + font-size: 12px; + font-weight: 650; + line-height: 1.3; +} + +.overviewValue { + display: flex; + align-items: center; + gap: 8px; + min-width: 0; + margin-top: 7px; + color: var(--text-strong); + font-size: 20px; + font-weight: 760; + line-height: 1.2; + overflow-wrap: anywhere; +} + +.overviewMeta { + min-height: 18px; + margin-top: 7px; + color: var(--muted); + font-size: 12px; + line-height: 1.35; + overflow-wrap: anywhere; +} + +.statusDot { + flex: 0 0 9px; + width: 9px; + height: 9px; + border-radius: 50%; + background: var(--muted-soft); + box-shadow: var(--status-muted-ring); +} + +.statusDot:not(.statusRunning):not(.statusError) { + background: var(--muted-soft); + box-shadow: var(--status-muted-ring); +} + +.statusRunning { + background: var(--success); + box-shadow: var(--status-success-ring); + animation: statusPulse 1.8s ease-in-out infinite; +} + +.statusIdle { + background: var(--muted-soft); + box-shadow: var(--status-muted-ring); +} + +.statusError { + background: var(--danger); + box-shadow: var(--status-danger-ring); + animation: statusPulse 1.8s ease-in-out infinite; +} + +.workspaceShell { display: grid; - grid-template-columns: 1fr 1fr 1fr; - gap: 10px; + grid-template-columns: var(--rail-width) minmax(0, 1fr); + grid-template-areas: + "rail workspace"; + align-items: start; + gap: var(--shell-gap); + margin-top: 14px; +} + +.workspaceShell > * { + min-width: 0; +} + +.configRail { + position: sticky; + top: 106px; + grid-area: rail; + max-height: calc(100vh - 124px); + overflow: auto; +} + +.workspaceShell .configRail { + position: sticky; + top: 106px; + align-self: start; +} + +.configWorkspace { + grid-area: workspace; + min-width: 0; +} + +.liveRail { + grid-area: workspace; + display: grid; + gap: var(--shell-gap); + min-width: 0; +} + +.activityDock { + grid-area: workspace; + display: grid; + grid-template-columns: 1fr; + gap: var(--shell-gap); + min-width: 0; +} + +.monitorPanel { + display: grid; + grid-template-columns: minmax(320px, 640px); + gap: var(--shell-gap); +} + +.monitorPanel[hidden] { + display: none !important; +} + +.cardShot { + display: flex; + flex-direction: column; +} + +.card { + position: relative; + overflow: hidden; + min-width: 0; + min-height: 0; + padding: 16px; + border: 1px solid var(--border); + border-radius: var(--radius); + background: var(--surface); + box-shadow: var(--shadow); + backdrop-filter: blur(14px) saturate(1.08); + animation: surfaceIn var(--motion-slow) both; + transition: border-color var(--motion), box-shadow var(--motion), transform var(--motion); +} + +.cardShot { + animation-delay: 70ms; +} + +.cardReservations { + animation-delay: 120ms; +} + +.cardLog { + animation-delay: 170ms; +} + +.card::before { + position: absolute; + inset: 0; + content: ""; + pointer-events: none; + border-radius: inherit; + background: + linear-gradient(180deg, rgba(255, 255, 255, 0.74), transparent 28%), + linear-gradient(120deg, rgba(35, 89, 199, 0.07), transparent 34%); + opacity: 0.72; +} + +.card > * { + position: relative; + z-index: 1; +} + +.card:hover { + border-color: var(--hover-border); + box-shadow: var(--shadow-hover); + transform: translateY(-1px); +} + +.cardScroll { + max-height: none; + overflow: visible; +} + +.cardTitle { + display: flex; + align-items: center; + gap: 9px; + min-width: 0; + padding-bottom: 12px; + border-bottom: 1px solid var(--border); + color: var(--text-strong); + font-size: 15px; + font-weight: 760; + line-height: 1.25; +} + +.sectionIcon { + display: inline-flex; + flex: 0 0 18px; + width: 18px; + height: 18px; + color: var(--primary); +} + +.sectionIcon svg { + width: 18px; + height: 18px; +} + +.configLayout { + display: contents; +} + +.workspaceHeader { + display: flex; + align-items: flex-end; + justify-content: space-between; + gap: 16px; + min-width: 0; + margin-bottom: 12px; + padding: 14px 16px; + border: 1px solid var(--border); + border-radius: var(--radius); + background: var(--surface); + box-shadow: var(--shadow-soft); + backdrop-filter: blur(14px) saturate(1.08); +} + +.workspaceEyebrow { + color: var(--primary-accent-text); + font-size: 11px; + font-weight: 760; + letter-spacing: 0.08em; + text-transform: uppercase; +} + +.workspaceTitle { + margin: 4px 0 0; + color: var(--text-strong); + font-size: 20px; + line-height: 1.2; +} + +.workspaceHint { + max-width: 360px; + color: var(--muted); + font-size: 12px; + line-height: 1.45; + text-align: right; +} + +.sideNav { + position: static; + display: flex; + flex-direction: column; + gap: 4px; + min-width: 0; + margin-top: 14px; + padding: 6px; + border: 1px solid var(--border); + border-radius: var(--radius); + background: var(--surface-soft); + box-shadow: 0 1px 0 var(--hairline) inset; +} + +.tabBtn { + position: relative; + display: flex; + align-items: center; + justify-content: flex-start; + gap: 8px; + width: 100%; + min-width: 0; + min-height: 38px; + padding: 0 10px; + border: 1px solid transparent; + border-radius: var(--radius); + color: var(--muted); + background: transparent; + font-size: 13px; + font-weight: 650; + text-align: left; + white-space: nowrap; + transition: color var(--motion-fast), background var(--motion-fast), transform var(--motion-fast), border-color var(--motion-fast); +} + +.tabBtn:hover { + color: var(--text); + background: var(--surface); + transform: translateX(2px); +} + +.tabBtn.active { + color: var(--primary-accent-text); + border-color: var(--primary-border); + background: linear-gradient(90deg, rgba(226, 238, 255, 0.98), rgba(248, 252, 255, 0.86)); + box-shadow: inset 3px 0 0 var(--primary); +} + +.tabIcon { + display: inline-flex; + flex: 0 0 16px; + width: 16px; + height: 16px; +} + +.tabIcon svg { + width: 16px; + height: 16px; +} + +.tabText { + overflow: hidden; + text-overflow: ellipsis; +} + +.panels { + min-width: 0; + max-width: var(--panel-max); +} + +.panel { + min-width: 0; + padding: 16px; + border: 1px solid var(--border); + border-radius: var(--radius); + background: var(--surface); + box-shadow: var(--shadow); + backdrop-filter: blur(14px) saturate(1.08); + animation: surfaceIn var(--motion-slow) both; +} + +.panel.cardLog { + overflow: hidden; +} + +.panel[hidden] { + display: none !important; +} + +.sectionTitle { + display: flex; + align-items: center; + gap: 8px; + min-width: 0; + margin: 16px 0 8px; + color: var(--text-strong); + font-size: 14px; + font-weight: 740; + line-height: 1.3; +} + +.panel > .sectionTitle:first-child { + margin-top: 0; +} + +.row { + display: flex; + flex-direction: column; + gap: 6px; + min-width: 0; + margin-top: 12px; +} + +.row.grid2, +.row.grid3 { + display: grid; + align-items: start; + gap: 12px; +} + +.row.grid2 { + grid-template-columns: repeat(2, minmax(0, 1fr)); +} + +.row.grid3 { + grid-template-columns: repeat(3, minmax(0, 1fr)); } .inline2 { display: grid; - grid-template-columns: 1fr 1fr; + grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; + min-width: 0; +} + +.rowActions { + display: flex; + flex-wrap: wrap; + gap: 8px; + margin-top: 12px; +} + +.label { + color: var(--muted); + font-size: 12px; + font-weight: 650; + line-height: 1.35; +} + +.input, +.small, +.logSearchBox { + width: 100%; + min-width: 0; + min-height: var(--control-height); + padding: 0 10px; + border: 1px solid var(--border-strong); + border-radius: var(--radius); + color: var(--text); + background: var(--surface-elevated); + font-size: 13px; + outline: none; + transition: border-color var(--motion-fast), box-shadow var(--motion-fast), background var(--motion-fast), transform var(--motion-fast); +} + +.input:hover, +.small:hover, +.logSearchBox:hover { + border-color: var(--hover-border); +} + +.input:focus, +.small:focus, +.logSearchBox:focus { + border-color: var(--primary); + box-shadow: var(--focus-ring); + transform: translateY(-1px); +} + +.textarea { + min-height: 96px; + padding: 9px 10px; + line-height: 1.55; + resize: vertical; } .check { - display: inline-flex; + display: flex; align-items: center; gap: 8px; + min-width: 0; + min-height: var(--control-height); padding: 8px 10px; border: 1px solid var(--border); - border-radius: 10px; - background: #ffffff; + border-radius: var(--radius); + color: var(--text); + background: var(--surface-soft); + font-size: 13px; + line-height: 1.35; +} + +.check:hover { + border-color: var(--hover-border); + background: var(--surface-elevated); +} + +.check input[type="checkbox"] { + flex: 0 0 auto; + width: 15px; + height: 15px; + margin: 0; + accent-color: var(--primary); +} + +.check span { + min-width: 0; + overflow-wrap: anywhere; +} + +.hint { + min-width: 0; + color: var(--muted); + font-size: 12px; + line-height: 1.45; + overflow-wrap: anywhere; +} + +.divider { + height: 1px; + margin: 16px 0; + background: var(--border); } .statsGrid { display: grid; - grid-template-columns: 1fr 1fr; + grid-template-columns: repeat(auto-fit, minmax(154px, 1fr)); gap: 10px; + margin-top: 10px; } .stat { - border: 1px solid var(--border); - background: linear-gradient(180deg, var(--card2), var(--card)); - border-radius: 12px; - padding: 10px; min-width: 0; + padding: 12px; + border: 1px solid var(--border); + border-radius: var(--radius); + background: var(--surface-soft); + box-shadow: 0 1px 0 var(--hairline) inset; + transition: border-color var(--motion-fast), transform var(--motion-fast), background var(--motion-fast); +} + +.stat:hover { + border-color: var(--hover-border); + background: var(--surface-elevated); + transform: translateY(-1px); } .statLabel { - font-size: 11px; color: var(--muted); - margin-bottom: 6px; + font-size: 12px; + font-weight: 650; + line-height: 1.35; } .statValue { - font-weight: 800; + min-width: 0; + margin-top: 6px; + color: var(--text-strong); + font-size: 19px; + font-weight: 760; + line-height: 1.25; + overflow-wrap: anywhere; +} + +.statTrace { font-size: 14px; - color: rgba(17,24,39,0.92); } .statHint { - margin-top: 6px; - font-size: 11px; + min-width: 0; + margin-top: 5px; color: var(--muted); + font-size: 12px; + line-height: 1.35; + overflow-wrap: anywhere; } .chartsGrid { display: grid; - grid-template-columns: 1fr 1fr; + grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; -} - -@media (max-width: 980px) { - .chartsGrid { grid-template-columns: 1fr; } + margin-top: 12px; } .chartBlock { - border: 1px solid var(--border); - border-radius: 14px; - background: linear-gradient(180deg, var(--card2), var(--card)); + min-width: 0; padding: 12px; - box-shadow: var(--shadow); + border: 1px solid var(--border); + border-radius: var(--radius); + background: var(--surface-soft); + box-shadow: 0 1px 0 var(--hairline) inset; } .chartTitle { - font-weight: 800; - font-size: 12px; - color: rgba(17,24,39,0.88); - margin-bottom: 10px; + color: var(--text-strong); + font-size: 13px; + font-weight: 720; + line-height: 1.35; } .chart { - width: 100%; - min-height: 140px; min-width: 0; + min-height: 76px; + margin-top: 10px; +} + +.chart svg { + width: 100%; + height: auto; +} + +.timelineSvg { + display: block; } .barRow { - display: flex; + display: grid; + grid-template-columns: minmax(78px, 0.9fr) minmax(80px, 2fr) 42px; align-items: center; - gap: 10px; - margin: 8px 0; + gap: 8px; + min-width: 0; + min-height: 26px; +} + +.barRow + .barRow { + margin-top: 8px; } .barLabel { - width: 190px; - white-space: nowrap; + min-width: 0; + color: var(--text); + font-size: 12px; overflow: hidden; text-overflow: ellipsis; - color: rgba(17,24,39,0.78); - font-size: 12px; + white-space: nowrap; } .barTrack { - flex: 1; - height: 10px; - border-radius: 999px; - background: #ffffff; - border: 1px solid var(--border); + height: 8px; overflow: hidden; + border-radius: 99px; + background: var(--chart-track); } .barFill { height: 100%; - width: 0%; - background: rgba(37,99,235,0.22); + border-radius: 99px; + background: linear-gradient(90deg, var(--primary), var(--accent-cyan)); + transition: width var(--motion-slow); } .barValue { - width: 70px; - text-align: right; - font-variant-numeric: tabular-nums; - color: rgba(17,24,39,0.85); + color: var(--muted); + font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; font-size: 12px; + text-align: right; } .table { - border: 1px solid var(--border); - border-radius: 14px; + min-width: 0; overflow: hidden; - background: #ffffff; - box-shadow: var(--shadow); + margin-top: 10px; + border: 1px solid var(--border); + border-radius: var(--radius); + background: var(--surface); } .tableRow { display: grid; - grid-template-columns: 170px 1fr 100px; - gap: 12px; - padding: 10px 12px; + grid-template-columns: minmax(92px, 0.65fr) minmax(0, 1.7fr) minmax(54px, 0.45fr); + gap: 10px; + min-width: 0; + padding: 9px 11px; border-top: 1px solid var(--border); - align-items: center; + color: var(--text); + font-size: 12px; + line-height: 1.45; } -.tableRow:first-child { border-top: none; } +.tableRow:first-child { + border-top: 0; +} + +.tableRow > div { + min-width: 0; + overflow-wrap: anywhere; +} .tableHead { - font-weight: 800; - background: #f8fafc; + color: var(--muted); + background: var(--surface-soft); + font-weight: 720; } .mono { - font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; - font-size: 12px; - color: rgba(17,24,39,0.75); + font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; } -/* 预约队列样式 */ -.cardReservations { order: 1.5; } +.preview { + position: relative; + display: flex; + align-items: center; + justify-content: center; + height: var(--shot-height-desktop); + min-height: 0; + max-height: none; + width: 100%; + aspect-ratio: 9 / 16; + margin-top: 14px; + overflow: hidden; + border: 1px solid var(--border); + border-radius: var(--radius); + background: var(--preview-bg); + box-shadow: 0 1px 0 var(--hairline) inset, 0 14px 32px rgba(36, 48, 72, 0.08); + transition: border-color var(--motion), box-shadow var(--motion), transform var(--motion); +} + +.preview::before { + position: absolute; + inset: 0; + content: ""; + pointer-events: none; + background: + linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent), + repeating-linear-gradient(0deg, rgba(35, 89, 199, 0.035) 0 1px, transparent 1px 18px); + opacity: 0; + transform: translateX(-100%); +} + +.preview:hover { + border-color: var(--primary-border); + box-shadow: 0 1px 0 var(--hairline) inset, 0 18px 38px rgba(35, 89, 199, 0.12); + transform: translateY(-1px); +} + +.preview.isShotEmpty { + border-style: dashed; + background: + linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(248, 250, 252, 0.92)), + var(--preview-bg); +} + +.preview.isShotEmpty::before { + opacity: 1; + animation: previewScan 2.8s ease-in-out infinite; +} + +.preview img { + display: block; + width: 100%; + height: 100%; + object-fit: contain; + opacity: 0; + color: transparent; + font-size: 0; +} + +.preview img[src*="screenshot.png"][data-loading="false"] { + opacity: 1; +} + +.preview.isShotEmpty img { + display: none; +} + +#liveShotStatus { + align-self: flex-start; + margin-top: 10px; +} .reservationsContent { + display: flex; + flex-direction: column; + gap: 8px; + min-width: 0; margin-top: 12px; } .reservationsInfo { - padding: 12px; - background: #f8fafc; - border-radius: 8px; - margin-bottom: 16px; + display: grid; + grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); + gap: 6px 10px; + min-width: 0; + padding: 9px; border: 1px solid var(--border); + border-radius: var(--radius); + background: var(--surface-soft); + color: var(--text); + font-size: 12px; + line-height: 1.45; } .reservationsInfo > div { - margin: 6px 0; - font-size: 14px; -} - -.reservationsInfo strong { - font-weight: 600; - color: var(--text); + min-width: 0; + overflow-wrap: anywhere; } .reservationsList { - display: flex; - flex-direction: row; /* 横向排列 */ - gap: 12px; - align-items: flex-start; - /* 横向滚动,垂直方向固定高度以便卡片一致 */ - max-height: 320px; - overflow-x: auto; - overflow-y: hidden; - padding-bottom: 6px; - -webkit-overflow-scrolling: touch; -} - -/* 每个项固定最小宽度,横向排列时按卡片显示 */ -.reservationItem { - flex: 0 0 320px; - min-width: 280px; + display: grid; + grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); + gap: 8px; + min-width: 0; + max-height: var(--queue-height-desktop); + overflow: auto; + padding-right: 2px; } .reservationItem { + min-width: 0; + overflow: hidden; border: 1px solid var(--border); - border-radius: 10px; - padding: 12px; - background: linear-gradient(135deg, rgba(37,99,235,0.03), rgba(255,255,255,0.8)); - transition: all 0.2s; + border-radius: var(--radius); + background: var(--surface); + transition: border-color var(--motion-fast), box-shadow var(--motion), transform var(--motion); } .reservationItem:hover { - box-shadow: 0 4px 12px rgba(37,99,235,0.1); - transform: translateY(-2px); + border-color: var(--hover-border); + box-shadow: var(--shadow-soft); + transform: translateY(-1px); } .reservationHeader { display: flex; - justify-content: space-between; align-items: center; - margin-bottom: 10px; - padding-bottom: 8px; + justify-content: space-between; + gap: 10px; + min-width: 0; + padding: 9px 10px; border-bottom: 1px solid var(--border); + background: var(--surface-soft); +} + +.reservationHeader.isClickable { + cursor: pointer; } .reservationIndex { - font-size: 15px; - font-weight: 700; color: var(--primary); + font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; + font-size: 12px; + font-weight: 760; } .reservationValue { - font-size: 16px; - font-weight: 700; - color: #dc2626; + max-width: 68%; + padding: 3px 8px; + overflow: hidden; + border: 1px solid var(--warning-border); + border-radius: 99px; + color: var(--warning); + background: var(--warning-soft); + font-size: 12px; + font-weight: 720; + text-overflow: ellipsis; + white-space: nowrap; } .reservationBody { - font-size: 13px; - line-height: 1.8; + display: grid; + gap: 5px; + min-width: 0; + padding: 9px 10px; + color: var(--text); + font-size: 12px; + line-height: 1.45; } .reservationBody > div { - margin: 4px 0; + min-width: 0; + overflow-wrap: anywhere; } -.reservationBody strong { - font-weight: 600; - color: var(--muted); - min-width: 80px; - display: inline-block; +.reservationBody.isCollapsed, +.reservationsList.isListCollapsed { + display: none; +} + +details { + min-width: 0; +} + +summary { + cursor: pointer; +} + +summary::-webkit-details-marker { + display: none; +} + +summary.sectionTitle { + justify-content: space-between; + gap: 10px; +} + +.summaryActions { + display: inline-flex; + align-items: center; + justify-content: flex-end; + gap: 6px; + flex-wrap: wrap; + margin-left: auto; + font-weight: 500; +} + +.logRow { + display: grid; + grid-template-columns: 1fr; + gap: 12px; + margin-top: 14px; +} + +.singleLogSection { + margin-top: 14px; +} + +.logSection { + min-width: 0; + overflow: hidden; + border: 1px solid var(--border); + border-radius: var(--radius); + background: var(--surface); + box-shadow: 0 1px 0 var(--hairline) inset; +} + +.logHeader { + display: flex; + align-items: center; + justify-content: space-between; + gap: 10px; + min-width: 0; + padding: 10px; + border-bottom: 1px solid var(--border); + background: var(--surface-soft); +} + +.logTitle { + color: var(--text-strong); + font-size: 13px; + font-weight: 740; + white-space: nowrap; +} + +.logHeaderActions { + display: flex; + align-items: center; + justify-content: flex-end; + flex-wrap: wrap; + gap: 7px; + min-width: 0; +} + +.logHeaderActions .small { + width: auto; + min-height: 30px; + font-size: 12px; +} + +.logSearchBox { + width: 230px; + min-height: 30px; + font-size: 12px; +} + +.log { + min-width: 0; + min-height: clamp(250px, 32vh, 390px); + max-height: clamp(250px, 32vh, 390px); + margin: 0; + padding: 12px; + overflow: auto; + border-top: 1px solid var(--log-border); + color: var(--log-text); + background: var(--log-bg); + font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; + font-size: 12px; + line-height: 1.55; + overflow-wrap: anywhere; + white-space: pre-wrap; +} + +.panel.cardLog .log { + min-height: clamp(430px, 58vh, 720px); + max-height: clamp(430px, 58vh, 720px); +} + +.log::selection { + color: var(--text-strong); + background: rgba(184, 205, 246, 0.42); +} + +@media (max-width: 900px) { + :root { + --page-pad: 14px; + } + + .app { + padding: var(--page-pad); + } + + .header { + align-items: flex-start; + flex-direction: column; + } + + .brandBlock { + min-width: 0; + } + + .header-actions, + .actionGroup { + width: 100%; + justify-content: flex-start; + } + + .overview { + grid-template-columns: repeat(2, minmax(0, 1fr)); + } + + .workspaceShell { + grid-template-columns: 1fr; + grid-template-areas: + "rail" + "workspace"; + } + + .configRail, + .liveRail, + .cardLog { + position: static; + max-height: none; + } + + .activityDock, + .monitorPanel { + grid-template-columns: 1fr; + } + + .configLayout { + display: contents; + } + + .sideNav { + position: static; + flex-direction: row; + overflow-x: auto; + scrollbar-width: thin; + } + + .tabBtn { + flex: 0 0 auto; + width: auto; + min-width: 104px; + } + + .preview { + width: min(520px, 100%); + height: var(--shot-height-tablet); + } +} + +@media (max-width: 640px) { + :root { + --page-pad: 10px; + --layout-gap: 10px; + --overview-gap: 8px; + } + + .app { + padding: var(--page-pad); + } + + .header { + top: 0; + padding: 10px; + } + + .brandBlock { + align-items: flex-start; + } + + .brandMark { + flex-basis: 36px; + width: 36px; + height: 36px; + font-size: 15px; + } + + .title { + font-size: 16px; + } + + .subtitle { + font-size: 12px; + } + + .actionGroup { + gap: 6px; + padding: 0; + border: 0; + background: transparent; + } + + .header-actions { + display: grid; + grid-template-columns: repeat(2, minmax(0, 1fr)); + gap: 6px; + } + + .primaryActions, + .secondaryActions { + display: contents; + } + + .btn { + width: 100%; + min-height: 34px; + padding: 0 8px; + } + + .btn.small { + flex: 0 0 auto; + } + + .overview { + grid-template-columns: repeat(2, minmax(0, 1fr)); + gap: 8px; + } + + .overviewCard { + padding: 12px; + } + + .overviewValue { + font-size: 17px; + } + + .workspaceShell { + gap: 10px; + } + + .card { + padding: 12px; + } + + .row.grid2, + .row.grid3, + .inline2 { + grid-template-columns: 1fr; + } + + .statsGrid { + grid-template-columns: repeat(2, minmax(0, 1fr)); + } + + .chartsGrid, + .logRow { + grid-template-columns: 1fr; + } + + .preview { + width: 100%; + height: var(--shot-height-mobile); + } + + .logHeader { + align-items: stretch; + flex-direction: column; + } + + .logHeaderActions { + justify-content: flex-start; + } + + .logSearchBox { + flex: 1 1 100%; + width: 100%; + } + + .log { + min-height: var(--log-height-mobile); + max-height: var(--log-height-mobile); + } + + .summaryActions { + width: 100%; + justify-content: flex-start; + margin-left: 0; + } + + summary.sectionTitle { + align-items: flex-start; + flex-direction: column; + } +} + +@media (max-width: 430px) { + .actionGroup { + padding: 3px; + } + + .statsGrid { + grid-template-columns: 1fr; + } + + .overview { + grid-template-columns: 1fr; + } + + .tableRow { + grid-template-columns: 1fr; + gap: 4px; + } + + .tableHead { + display: none; + } + + .barRow { + grid-template-columns: minmax(0, 1fr) minmax(80px, 1fr) 34px; + } + + .preview { + width: 100%; + } +} + +@media (prefers-reduced-motion: reduce) { + *, + *::before, + *::after { + animation-duration: 1ms !important; + animation-iteration-count: 1 !important; + scroll-behavior: auto !important; + transition-duration: 1ms !important; + } }