:root {
  color-scheme: light;
  font-family: Inter, "SF Pro Display", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --ink: #15191e;
  --muted: #747b86;
  --line: #e6e8ec;
  --soft: #f5f6f8;
  --panel: #ffffff;
  --brand: #ff5a36;
  --brand-dark: #df3d1e;
  --brand-soft: #fff0eb;
  --night: #11151b;
  --night-2: #1a2029;
  --green: #19a46b;
  --danger: #c83c3c;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { color: var(--ink); background: #f3f4f6; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { border: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
input, textarea, select { border: 1px solid var(--line); outline: 0; background: white; }
input:focus, textarea:focus, select:focus { border-color: #ff9d88; box-shadow: 0 0 0 3px rgba(255,90,54,.1); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 7px; color: var(--brand); font-size: 10px; font-weight: 850; letter-spacing: .16em; }
.brand-lockup { display: flex; align-items: center; gap: 11px; font-size: 18px; }
.brand-glyph { display: grid; width: 35px; height: 35px; place-items: center; border-radius: 11px; color: white; background: var(--brand); font-weight: 900; box-shadow: 0 8px 20px rgba(255,90,54,.28); }

/* 登录 */
.auth-screen { display: grid; min-height: 100vh; grid-template-columns: minmax(420px, 1.2fr) minmax(390px, .8fr); background: white; }
.auth-brand { position: relative; display: flex; min-height: 100vh; flex-direction: column; overflow: hidden; padding: 48px clamp(45px, 7vw, 110px); color: white; background: var(--night); }
.auth-brand::before { content: ""; position: absolute; width: 560px; height: 560px; right: -180px; top: -210px; border: 1px solid rgba(255,255,255,.09); border-radius: 50%; box-shadow: 0 0 0 80px rgba(255,255,255,.025), 0 0 0 160px rgba(255,255,255,.018); }
.auth-brand::after { content: ""; position: absolute; width: 300px; height: 300px; left: -150px; bottom: -150px; border-radius: 50%; background: radial-gradient(circle, rgba(255,90,54,.42), transparent 68%); }
.auth-brand .brand-lockup { position: relative; z-index: 1; }
.auth-copy { position: relative; z-index: 1; margin: auto 0; max-width: 650px; }
.auth-copy h1 { margin: 0; font-size: clamp(47px, 6vw, 82px); line-height: .98; letter-spacing: -.065em; }
.auth-copy > p:last-child { max-width: 540px; margin: 28px 0 0; color: #aeb6c2; font-size: 17px; line-height: 1.8; }
.trust-row { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 10px; }
.trust-row span { border: 1px solid #303844; border-radius: 999px; padding: 8px 12px; color: #aeb6c2; font-size: 12px; }
.auth-form-wrap { display: grid; place-items: center; padding: 35px; background: linear-gradient(145deg, #fff, #f7f7f8); }
.auth-form-card { width: min(410px, 100%); }
.auth-kicker { margin: 0 0 9px; color: var(--brand); font-size: 12px; font-weight: 800; }
.auth-form-card h2 { margin: 0; font-size: 35px; letter-spacing: -.045em; }
.auth-form-card > .muted { margin: 10px 0 28px; }
.auth-form-card form { display: grid; gap: 15px; }
.remember-login { display: flex !important; grid-template-columns: auto 1fr; align-items: center; gap: 8px !important; }
.remember-login input { width: 15px; height: 15px; margin: 0; accent-color: var(--brand); }
.auth-form-card label { display: grid; gap: 8px; color: #535a65; font-size: 13px; font-weight: 650; }
.auth-form-card input { height: 52px; border-radius: 12px; padding: 0 15px; }
.auth-form-card form button { height: 52px; border-radius: 12px; color: white; background: var(--brand); font-weight: 800; box-shadow: 0 12px 28px rgba(255,90,54,.22); }
.auth-form-card form button:hover { background: var(--brand-dark); }
.error { min-height: 20px; margin: 9px 0 0; color: var(--danger); font-size: 13px; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0 14px; color: #a0a5ad; font-size: 11px; }
.auth-divider::before, .auth-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.customer-download-entry { display: flex; height: 48px; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 12px; color: #3d444e; background: white; font-size: 14px; font-weight: 750; text-decoration: none; }

/* 主框架 */
.app-layout { display: grid; min-height: 100vh; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; display: flex; height: 100vh; flex-direction: column; overflow: hidden; border-right: 1px solid #272d36; padding: 24px 18px 18px; color: white; background: var(--night); }
.sidebar-brand { padding: 0 7px 23px; }
.primary-nav { display: grid; gap: 5px; padding-bottom: 22px; border-bottom: 1px solid #292f38; }
.nav-item { display: flex; height: 42px; align-items: center; gap: 11px; border-radius: 10px; padding: 0 12px; color: #9da6b3; background: transparent; font-size: 13px; font-weight: 700; text-align: left; text-decoration: none; }
.nav-item.active, .nav-item:hover { color: white; background: #242a33; }
.nav-mark { width: 13px; height: 13px; border: 2px solid currentColor; border-radius: 4px; }
.download-mark { border-radius: 50%; }
.remote-mark { border-color: #6ed4bb; border-radius: 50%; box-shadow: inset 0 0 0 3px #11151b; background: #6ed4bb; }
.sidebar-section { min-height: 0; flex: 1; padding-top: 23px; }
.sidebar-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 7px; color: #747f8d; font-size: 10px; font-weight: 850; letter-spacing: .12em; }
.sidebar-heading button { padding: 4px; color: #8e98a5; background: transparent; font-size: 11px; }
.session-summary { display: flex; align-items: baseline; gap: 4px; padding: 13px 7px 12px; color: #7f8996; font-size: 11px; }
.session-summary strong { color: white; font-size: 17px; }
.session-summary i { width: 1px; height: 12px; margin: 0 7px; background: #343b45; }
.session-list { display: grid; max-height: calc(100vh - 310px); gap: 6px; overflow: auto; padding-right: 2px; }
.session { width: 100%; border: 1px solid transparent; border-radius: 12px; padding: 12px; color: #d8dde4; background: transparent; text-align: left; }
.session:hover { background: #20262e; }
.session.active { border-color: #404955; background: #282f38; box-shadow: inset 3px 0 var(--brand); }
.session > strong { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.session > strong::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(25,164,107,.14); }
.session span { display: block; margin-top: 6px; color: #7f8996; font-size: 10px; line-height: 1.4; }
.session em { display: inline-block; margin-top: 7px; border-radius: 999px; padding: 3px 7px; color: #ffc0b1; background: #4b2b28; font-size: 9px; font-style: normal; }
.sidebar-foot { border-top: 1px solid #292f38; padding: 17px 6px 0; }
.secure-indicator { display: flex; align-items: center; gap: 10px; }
.secure-indicator > span { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(25,164,107,.12); }
.secure-indicator strong, .secure-indicator small { display: block; }
.secure-indicator strong { color: #dce1e7; font-size: 11px; }
.secure-indicator small { margin-top: 2px; color: #737d89; font-size: 9px; }
.text-button { margin-top: 14px; padding: 0; color: #6f7985; background: transparent; font-size: 11px; }

.main-workspace { min-width: 0; padding: 0 27px 42px; }
.topbar { display: flex; min-height: 91px; align-items: center; justify-content: space-between; }
.topbar h1 { margin: 0; font-size: 25px; letter-spacing: -.04em; }
.topbar-meta { display: flex; align-items: center; gap: 15px; color: var(--muted); font-size: 11px; }
.status-dot { display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 999px; padding: 7px 11px; color: #4d555f; background: white; }
.status-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }

/* 邀请条 */
.connection-bar { display: grid; grid-template-columns: auto minmax(380px, 1fr) auto; align-items: center; gap: 18px; border: 1px solid var(--line); border-radius: 17px; padding: 16px 18px; background: white; box-shadow: 0 9px 28px rgba(29,35,42,.045); }
.connection-intro { display: flex; align-items: center; gap: 12px; }
.step-number { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 11px; color: var(--brand); background: var(--brand-soft); font-size: 11px; font-weight: 900; }
.connection-intro strong, .connection-intro p { display: block; margin: 0; }
.connection-intro strong { font-size: 13px; }
.connection-intro p { margin-top: 3px; color: var(--muted); font-size: 10px; }
.connect-form { display: grid; grid-template-columns: .72fr .7fr 1.2fr auto; gap: 8px; }
#customerCode { color: var(--brand-dark); font-family: ui-monospace, Consolas, monospace; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.connect-form input { min-width: 0; height: 42px; border-radius: 10px; padding: 0 12px; font-size: 12px; }
.connect-form button, .download-link, .code-result button { height: 42px; border-radius: 10px; padding: 0 14px; color: white; background: var(--brand); font-size: 11px; font-weight: 800; white-space: nowrap; }
.code-result { display: flex; align-items: center; gap: 10px; }
.code-result div span, .code-result div strong { display: block; }
.code-result div span { color: var(--muted); font-size: 9px; }
.code-result div strong { margin-top: 2px; color: var(--ink); font: 850 18px ui-monospace, Consolas, monospace; letter-spacing: .1em; }
.code-result .secondary { color: #4b535e; background: var(--soft); }
.download-link { display: flex; align-items: center; text-decoration: none; }

/* 工作区 */
.workbench-grid { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 14px; align-items: start; margin-top: 18px; }
.desktop-workbench, .assist-panel { border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: 0 9px 28px rgba(29,35,42,.045); }
.desktop-workbench { min-width: 0; min-height: calc(100vh - 225px); overflow: hidden; }
.empty-workbench { display: grid; min-height: 620px; place-items: center; align-content: center; padding: 50px; text-align: center; }
.empty-orbit { position: relative; display: grid; width: 92px; height: 92px; margin-bottom: 25px; place-items: center; border: 1px solid #e8e9ec; border-radius: 50%; box-shadow: 0 0 0 17px #f7f7f8; }
.empty-orbit::before, .empty-orbit::after, .empty-orbit span { content: ""; position: absolute; border-radius: 50%; background: var(--brand); }
.empty-orbit::before { width: 8px; height: 8px; transform: translate(-20px, -10px); }
.empty-orbit::after { width: 12px; height: 12px; transform: translate(17px, 12px); opacity: .35; }
.empty-orbit span { width: 22px; height: 22px; }
.empty-workbench h2 { margin: 0; font-size: 23px; letter-spacing: -.035em; }
.empty-workbench > p:last-child { max-width: 420px; margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.session-detail { padding: 18px; }
.session-header { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 2px 2px 16px; }
.device-identity { display: flex; align-items: center; gap: 12px; }
.device-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 12px; color: #e3e7eb; background: var(--night-2); font-size: 10px; font-weight: 900; }
.device-identity h2, .device-identity p { margin: 0; }
.device-identity h2 { font-size: 17px; }
.device-identity p { margin-top: 4px; color: var(--muted); font-size: 10px; }
.session-actions { display: flex; align-items: center; gap: 9px; }
.live-badge { display: flex; align-items: center; gap: 6px; border-radius: 999px; padding: 6px 9px; color: #167f57; background: #e9f7f1; font-size: 9px; font-weight: 800; }
.live-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.danger-ghost { padding: 7px 9px; color: var(--danger); background: #fff0f0; border-radius: 8px; font-size: 10px; font-weight: 750; }

/* 一体化实时桌面 */
.desktop-panel { overflow: hidden; border-radius: 15px; background: var(--night); }
.desktop-toolbar { display: flex; min-height: 58px; align-items: center; justify-content: space-between; gap: 12px; overflow-x: auto; padding: 10px 13px; border-bottom: 1px solid #2a3039; }
.desktop-state { display: flex; min-width: 0; flex: 1 1 auto; align-items: center; gap: 10px; }
.desktop-state > div { min-width: 0; }
.viewer-light { width: 8px; height: 8px; border-radius: 50%; background: #65707e; }
.desktop-state strong, .desktop-state span { display: block; }
.desktop-state strong { color: #f0f2f5; font-size: 12px; }
.desktop-state span { width: min(420px, 34vw); min-height: 12px; margin-top: 3px; overflow: hidden; color: #7f8996; font-size: 9px; line-height: 12px; text-overflow: ellipsis; white-space: nowrap; }
.desktop-buttons { display: flex; flex: 0 0 auto; flex-wrap: nowrap; align-items: center; justify-content: flex-end; gap: 6px; white-space: nowrap; }
.desktop-buttons button { height: 32px; border-radius: 8px; padding: 0 10px; color: white; background: var(--brand); font-size: 9px; font-weight: 800; }
.desktop-buttons .dark-secondary { color: #bec5ce; background: #282f38; }
.desktop-buttons .dark-danger { color: #f1a39f; background: #3a2427; }
.quality-picker { display: flex; align-items: center; gap: 5px; color: #747e8a; font-size: 9px; }
.quality-picker select { height: 31px; border-color: #343b46; border-radius: 8px; padding: 0 7px; color: #cdd2d9; background: #242a33; font-size: 9px; }
.desktop-stage { position: relative; display: grid; min-height: clamp(480px, calc(100vh - 355px), 760px); place-items: center; overflow: hidden; background: #090c10; }
.desktop-stage::before { content: ""; position: absolute; inset: 0; opacity: .17; background-image: linear-gradient(#252b33 1px, transparent 1px), linear-gradient(90deg, #252b33 1px, transparent 1px); background-size: 30px 30px; }
.desktop-stage canvas { position: relative; z-index: 1; display: none; width: 100%; height: auto; outline: 0; }
.desktop-stage canvas.visible { display: block; }
.desktop-stage:fullscreen { width: 100vw; height: 100vh; border-radius: 0; background: black; }
.desktop-stage:fullscreen canvas { width: 100%; height: 100%; object-fit: contain; }
.desktop-placeholder { position: relative; z-index: 1; display: grid; place-items: center; color: #5f6975; text-align: center; }
.desktop-placeholder strong, .desktop-placeholder small { display: block; }
.desktop-placeholder strong { margin-top: 14px; color: #747e89; font-size: 12px; }
.desktop-placeholder small { margin-top: 6px; font-size: 9px; }
.screen-outline { width: 55px; height: 37px; border: 2px solid #3d4651; border-radius: 6px; box-shadow: 0 15px 0 -13px #3d4651; }
.desktop-footer { display: flex; min-height: 42px; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 13px; border-top: 1px solid #242a33; }
.desktop-footer p { margin: 0; color: #626c78; font-size: 9px; }
.latency-badge { flex: 0 0 auto; border: 1px solid #334250; border-radius: 999px; padding: 4px 8px; color: #8bd4b1; background: #15231e; font-size: 9px; font-weight: 800; }
.latency-badge.warning { border-color: #634638; color: #f1ad82; background: #2b1e19; }
.control-toggle { display: flex; align-items: center; gap: 7px; color: #9ca5b0; font-size: 9px; }
.control-toggle input { position: absolute; opacity: 0; }
.control-toggle span { position: relative; width: 27px; height: 15px; border-radius: 999px; background: #3a414b; }
.control-toggle span::after { content: ""; position: absolute; width: 11px; height: 11px; left: 2px; top: 2px; border-radius: 50%; background: #9aa3ae; transition: .15s; }
.control-toggle input:checked + span { background: var(--brand); }
.control-toggle input:checked + span::after { left: 14px; background: white; }

/* 当前会话持久终端 */
.terminal-panel { overflow: hidden; margin-top: 12px; border: 1px solid #252d36; border-radius: 15px; background: #0d1117; box-shadow: 0 12px 30px rgba(0,0,0,.1); }
.terminal-head { display: flex; min-height: 48px; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border-bottom: 1px solid #252d36; background: #131820; }
.terminal-title { display: flex; align-items: center; gap: 9px; }
.terminal-title strong, .terminal-title span { display: block; }
.terminal-title strong { color: #edf2f7; font-size: 11px; }
.terminal-title span { margin-top: 2px; color: #75808d; font-size: 8px; }
.terminal-light { width: 7px; height: 7px; border-radius: 50%; background: #687382; box-shadow: 0 0 0 4px rgba(104,115,130,.12); }
.terminal-panel.online .terminal-light { background: #38c987; box-shadow: 0 0 0 4px rgba(56,201,135,.12); }
.terminal-actions { display: flex; align-items: center; gap: 6px; }
.terminal-actions button, .terminal-badge { min-height: 27px; border-radius: 7px; padding: 0 8px; color: #aab4c0; background: #222a34; font-size: 8px; }
.terminal-badge { display: inline-flex; align-items: center; }
.terminal-actions .terminal-stop { color: #ffaaa5; background: #392428; }
.terminal-output { min-height: 190px; max-height: 310px; overflow: auto; margin: 0; padding: 13px 14px; color: #c9d1d9; background: #0d1117; white-space: pre-wrap; overflow-wrap: anywhere; font: 10px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace; tab-size: 4; }
.terminal-output .stderr { color: #ff9c96; }
.terminal-composer { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 9px; border-top: 1px solid #252d36; padding: 9px 11px; background: #131820; }
.terminal-composer > span { max-width: 180px; overflow: hidden; padding-top: 8px; color: #59d69a; font: 9px ui-monospace, Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.terminal-composer textarea { width: 100%; resize: vertical; border: 1px solid #303946; border-radius: 8px; padding: 7px 9px; color: #e6edf3; background: #0d1117; outline: 0; font: 10px/1.5 ui-monospace, Consolas, monospace; }
.terminal-composer textarea:focus { border-color: #536273; }
.terminal-composer button { min-height: 34px; border-radius: 8px; padding: 0 12px; color: white; background: var(--brand); font-size: 9px; font-weight: 850; }

/* 诊断与工具 */
.diagnostic-section, .timeline-section { padding: 24px 2px 4px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; }
.section-heading h3 { margin: 0; font-size: 16px; }
.section-heading > span { color: var(--muted); font-size: 9px; }
.actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 13px; }
.actions button { min-height: 45px; border: 1px solid var(--line); border-radius: 11px; padding: 9px; color: #444b54; background: #fafafb; font-size: 10px; font-weight: 750; text-align: left; }
.actions button:hover { border-color: #ffc2b5; color: var(--brand-dark); background: var(--brand-soft); }
.actions button.repair { color: #9a5f22; background: #fff8ec; }
.tools-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.tool-card { border: 1px solid var(--line); border-radius: 13px; background: #fafafb; }
.tool-card summary { cursor: pointer; list-style: none; padding: 14px; }
.tool-card summary::-webkit-details-marker { display: none; }
.tool-card summary span, .tool-card summary small { display: block; }
.tool-card summary span { font-size: 12px; font-weight: 800; }
.tool-card summary small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.tool-content { display: grid; gap: 8px; border-top: 1px solid var(--line); padding: 13px; }
.tool-content p { margin: 0 0 2px; color: var(--muted); font-size: 9px; line-height: 1.6; }
.tool-content input, .tool-content textarea, .tool-content select { width: 100%; border-radius: 9px; padding: 9px 10px; font-size: 10px; }
.tool-content textarea { resize: vertical; font-family: ui-monospace, Consolas, monospace; }
.tool-content button { min-height: 35px; border-radius: 9px; color: white; background: #2a3039; font-size: 10px; font-weight: 800; }
.transfer-status { min-height: 14px; color: var(--muted); font-size: 9px; }
.jobs { display: grid; gap: 8px; margin-top: 13px; }
.job { border: 1px solid var(--line); border-radius: 11px; padding: 12px; background: #fafafb; }
.job-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.job-head strong { font-size: 11px; }
.job-status { border-radius: 999px; padding: 4px 7px; color: #58616c; background: #eceef1; font-size: 8px; }
.job time { color: var(--muted); font-size: 8px; }
.job pre { max-height: 300px; overflow: auto; margin: 10px 0 0; border-radius: 9px; padding: 11px; color: #cbd2db; background: #171c22; white-space: pre-wrap; word-break: break-word; font: 9px/1.6 ui-monospace, Consolas, monospace; }
.result-conclusion { margin-top: 9px; border-radius: 8px; padding: 8px 9px; color: #49525d; background: #f0f3f5; font-size: 9px; line-height: 1.55; }
.result-conclusion.ok { color: #216b4d; background: #edf8f2; }
.result-conclusion.warn { color: #865525; background: #fff5e8; }
.result-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.result-metric { min-width: 0; border: 1px solid #e6e8ec; border-radius: 8px; padding: 7px 8px; background: white; }
.result-metric span, .result-metric strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-metric span { color: var(--muted); font-size: 8px; }
.result-metric strong { margin-top: 3px; color: #303842; font-size: 9px; }
.result-metric.ok strong { color: #19744e; }
.result-metric.warn strong { color: #a35d21; }
.result-list { display: grid; gap: 5px; margin-top: 8px; }
.result-list-row { display: flex; min-width: 0; justify-content: space-between; gap: 10px; border: 1px solid #e6e8ec; border-radius: 8px; padding: 7px 8px; background: white; font-size: 8px; line-height: 1.45; }
.result-list-row strong { flex: 0 0 auto; color: #39424c; }
.result-list-row span { min-width: 0; overflow: hidden; color: #6d7681; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.result-message, .result-note { margin: 6px 2px 0; color: #68717c; font-size: 8px; line-height: 1.5; }
.result-error { margin: 8px 0 0; color: var(--danger); font-size: 9px; white-space: pre-wrap; }
.job-raw { margin-top: 8px; border-top: 1px solid #eceef1; padding-top: 7px; }
.job-raw summary { cursor: pointer; color: #89929d; font-size: 8px; }
.job-raw pre { margin-top: 7px; }
.empty { padding: 40px; color: var(--muted); font-size: 11px; text-align: center; }

/* 智能排查 */
.assist-panel { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; padding: 17px; scrollbar-width: thin; }
.assist-head { display: flex; align-items: center; gap: 11px; }
.assist-symbol { display: grid; width: 39px; height: 39px; place-items: center; border-radius: 12px; color: white; background: var(--brand); box-shadow: 0 9px 22px rgba(255,90,54,.25); }
.assist-head h2 { margin: 0; font-size: 18px; letter-spacing: -.03em; }
.assist-copy { margin: 17px 0 18px; color: var(--muted); font-size: 10px; line-height: 1.7; }
.assist-flow { display: grid; gap: 5px; margin-bottom: 16px; }
.assist-flow > div { display: flex; align-items: center; gap: 10px; border-radius: 10px; padding: 9px; background: #f6f7f8; }
.assist-flow > div > span { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 8px; color: var(--brand); background: var(--brand-soft); font-size: 9px; font-weight: 900; }
.assist-flow p, .assist-flow strong, .assist-flow small { display: block; margin: 0; }
.assist-flow strong { font-size: 10px; }
.assist-flow small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.assist-primary, .assist-secondary { width: 100%; min-height: 42px; border-radius: 10px; font-size: 10px; font-weight: 850; }
.assist-primary { color: white; background: var(--brand); }
.assist-secondary { margin-top: 7px; color: var(--brand-dark); background: var(--brand-soft); }
.assist-status { min-height: 30px; margin: 10px 2px 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.assist-note { margin-top: 17px; border-radius: 12px; padding: 13px; color: #d9dde3; background: var(--night-2); }
.assist-note strong { font-size: 10px; }
.assist-note p { margin: 6px 0 0; color: #8f99a5; font-size: 9px; line-height: 1.65; }
.permission-note { display: flex; gap: 8px; margin-top: 14px; }
.permission-note span { flex: 0 0 auto; width: 7px; height: 7px; margin-top: 3px; border-radius: 50%; background: var(--green); }
.permission-note p { margin: 0; color: var(--muted); font-size: 8px; line-height: 1.6; }
.assistant-context { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; background: #fafafb; }
.assistant-context span { color: var(--muted); font-size: 9px; }
.assistant-context strong { max-width: 240px; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.assistant-messages { display: flex; min-height: 250px; max-height: 36vh; align-items: flex-start; flex-direction: column; gap: 9px; overflow-y: auto; margin-top: 10px; border: 1px solid var(--line); border-radius: 13px; padding: 11px; background: #f8f9fa; scroll-behavior: smooth; }
.assistant-empty { margin: auto 4px; color: var(--muted); text-align: center; }
.assistant-empty strong { color: #404852; font-size: 11px; }
.assistant-empty p { margin: 7px 0 0; font-size: 9px; line-height: 1.65; }
.chat-message { width: fit-content; max-width: 91%; min-height: 0; flex: 0 0 auto; border-radius: 12px; padding: 9px 11px; font-size: 10px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.chat-message.user { align-self: flex-end; color: white; background: var(--brand); border-bottom-right-radius: 4px; }
.chat-message.assistant { align-self: flex-start; border: 1px solid #e3e5e8; color: #303842; background: white; border-bottom-left-radius: 4px; }
.chat-message time { display: block; margin-top: 5px; color: inherit; font-size: 7px; opacity: .62; }
.assistant-composer { margin-top: 9px; border: 1px solid #dfe2e5; border-radius: 12px; padding: 8px; background: white; }
.assistant-composer textarea { width: 100%; resize: vertical; border: 0; padding: 4px; font-size: 10px; line-height: 1.55; outline: 0; }
.assistant-composer > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 5px; }
.assistant-composer span { color: var(--muted); font-size: 8px; }
.assistant-composer button { border-radius: 8px; padding: 8px 13px; color: white; background: var(--brand); font-size: 9px; font-weight: 850; }
.assistant-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 9px; }
.assistant-quick .assist-secondary { margin: 0; min-height: 36px; }
.side-section { margin-top: 9px; border: 1px solid var(--line); border-radius: 11px; background: #fafafb; }
.side-section > summary { display: flex; cursor: pointer; list-style: none; align-items: center; justify-content: space-between; gap: 10px; padding: 11px; font-size: 10px; font-weight: 850; }
.side-section > summary::-webkit-details-marker { display: none; }
.side-section > summary span { color: var(--muted); font-size: 8px; font-weight: 500; }
.side-section .actions { grid-template-columns: 1fr 1fr; margin: 0; border-top: 1px solid var(--line); padding: 9px; }
.side-section .actions button { min-height: 37px; padding: 8px; font-size: 9px; }
.side-section .tool-content { border-top: 1px solid var(--line); }
.customer-feed-section .tool-content p { margin-bottom: 0; }
.customer-feed-section textarea { min-height: 68px; resize: vertical; }
.customer-message-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.customer-message-actions span { min-width: 0; overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.customer-message-actions button { flex: 0 0 auto; padding: 0 12px; }
.side-section .jobs { max-height: 320px; overflow-y: auto; margin: 0; border-top: 1px solid var(--line); padding: 9px; }
.side-section .job { padding: 9px; background: white; }
.side-section .job pre { max-height: 190px; font-size: 8px; }
.toast { position: fixed; z-index: 30; right: 24px; bottom: 24px; max-width: 360px; border-radius: 11px; padding: 12px 15px; color: white; background: #20262e; box-shadow: 0 14px 40px #0004; font-size: 11px; }

/* 桌面专注模式：保留控制工具栏，隐藏与当前桌面无关的区域 */
.app-layout.desktop-focus-mode { grid-template-columns: minmax(0, 1fr); background: #090c10; }
.desktop-focus-mode .sidebar,
.desktop-focus-mode .topbar,
.desktop-focus-mode .connection-bar,
.desktop-focus-mode .assist-panel,
.desktop-focus-mode .diagnostic-section,
.desktop-focus-mode .tools-grid,
.desktop-focus-mode .timeline-section { display: none; }
.desktop-focus-mode .terminal-panel { display: none; }
.desktop-focus-mode .main-workspace { padding: 0; }
.desktop-focus-mode .workbench-grid { display: block; margin: 0; }
.desktop-focus-mode .desktop-workbench { min-height: 100vh; border: 0; border-radius: 0; background: #090c10; box-shadow: none; }
.desktop-focus-mode .session-detail { padding: 10px; }
.desktop-focus-mode .session-header { min-height: 48px; padding: 0 4px 9px; color: white; }
.desktop-focus-mode .device-identity p { color: #7e8793; }
.desktop-focus-mode .desktop-stage { height: calc(100vh - 177px); min-height: 0; }
.desktop-focus-mode .desktop-panel { border: 1px solid #262d36; }

@media (max-width: 1220px) {
  .app-layout { grid-template-columns: 220px minmax(0, 1fr); }
  .workbench-grid { grid-template-columns: 1fr; }
  .assist-panel { position: static; display: block; max-height: none; }
  .assistant-messages { max-height: 420px; }
}
@media (max-width: 900px) {
  .auth-screen { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .app-layout { display: block; }
  .sidebar { position: static; width: 100%; height: auto; }
  .primary-nav, .sidebar-foot { display: none; }
  .sidebar-section { padding-top: 5px; }
  .session-list { max-height: 190px; }
  .main-workspace { padding: 0 13px 30px; }
  .connection-bar { grid-template-columns: 1fr; }
  .connect-form { grid-template-columns: 1fr; }
  .actions { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .topbar { align-items: flex-start; flex-direction: column; justify-content: center; gap: 8px; }
  .topbar-meta { width: 100%; justify-content: space-between; }
  .session-header, .desktop-toolbar, .desktop-footer, .terminal-head { align-items: flex-start; flex-direction: column; }
  .desktop-buttons { justify-content: flex-start; }
  .desktop-state span { max-width: 80vw; }
  .desktop-stage { min-height: 310px; }
  .terminal-actions { flex-wrap: wrap; }
  .terminal-composer { grid-template-columns: 1fr; }
  .tools-grid, .assist-panel, .assist-flow { grid-template-columns: 1fr; }
  .remote-engine-card { grid-template-columns: auto 1fr; }
  .remote-engine-actions { grid-column: 1 / -1; }
  .assist-head, .assist-copy, .assist-flow, .assist-status, .permission-note { grid-column: 1; }
}
