/* 远程工作台布局。颜色来自 theme.css，与登录、设备工具和管理页一致。 */
.remote-mode .sidebar, .remote-mode #sidebar-toggle { display: none; }
.remote-mode #device-status-text, .remote-mode header > .dot, .remote-mode #mouse-status-dot,
.remote-mode #mouse-status-text, .remote-mode #mouse-header-sep { display: none !important; }
#tab-remote { padding: 0; overflow: auto; }
.remote-shell { width: 100%; max-width: 1440px; margin: 0 auto; padding: 24px 32px 32px; }
.remote-shell button, .remote-dialog button { min-height: 42px; border-radius: 8px; padding: 10px 15px; font-size: 13px; font-weight: 550; }
.remote-heading, .remote-workbench-heading, .remote-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.remote-heading h2 { font-size: 26px; font-weight: 650; letter-spacing: -.7px; margin: 4px 0 6px; }
.remote-eyebrow { font-size: 10px; letter-spacing: 1.6px; font-weight: 650; color: var(--kp-accent-text); }
.remote-muted { color: var(--kp-muted); font-size: 13px; line-height: 1.7; }
.remote-computers { display: flex; gap: 10px; margin: 18px 0; overflow-x: auto; padding: 2px 2px 4px; }
.remote-shell .remote-computer { display: grid; grid-template-columns: 32px 1fr; column-gap: 12px; min-width: 205px; max-width: 340px; text-align: left; background: var(--kp-surface); color: var(--kp-text); border: 1px solid var(--kp-line); padding: 15px 18px; }
.remote-shell .remote-computer:hover { background: var(--kp-surface-raised); border-color: var(--kp-line-strong); }
.remote-shell .remote-computer.selected { background: var(--kp-accent-soft); border-color: #5f86c7; }
.remote-computer-icon { grid-row: span 2; color: var(--kp-accent-text); font-size: 26px; align-self: center; }
.remote-computer strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.remote-computer span:last-child { font-size: 11px; color: var(--kp-muted); margin-top: 6px; }
.remote-computer.selected span:last-child { color: var(--kp-accent-text); }
.remote-workbench { border: 1px solid var(--kp-line); background: var(--kp-surface); border-radius: 14px; overflow: clip; box-shadow: 0 8px 24px #0002; }
.remote-workbench-heading { padding: 18px 24px; }
.remote-workbench h3 { font-size: 20px; margin-bottom: 12px; overflow-wrap: anywhere; }
.remote-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.remote-badge { padding: 4px 9px; background: var(--kp-neutral-soft); color: var(--kp-muted); border: 1px solid #ffffff08; border-radius: 5px; font-size: 11px; line-height: 1.5; }
.remote-badge.online { color: var(--kp-success-text); background: var(--kp-success-soft); }
.remote-controlbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; background: var(--kp-surface-sunken); border-top: 1px solid var(--kp-line); border-bottom: 1px solid var(--kp-line); padding: 14px 24px; position: relative; z-index: 3; }
.remote-choices { display: flex; gap: 20px; margin-right: auto; }
.remote-choices label { display: flex; gap: 8px; align-items: center; min-height: 42px; font-size: 13px; margin: 0; }
.remote-shell input[type=checkbox] { width: 16px; height: 16px; margin: 0; }
.remote-shell [data-role=state] { font-size: 12px; color: var(--kp-muted); width: 58px; flex: 0 0 58px; white-space: nowrap; }
.remote-controlbar > button { width: 88px; flex: 0 0 88px; white-space: nowrap; }
.remote-error { color: var(--kp-danger-text); background: var(--kp-danger-soft); border: 1px solid var(--kp-danger-line); padding: 12px 16px; margin: 16px 24px; border-radius: 8px; font-size: 13px; line-height: 1.65; }
.remote-error:empty, .remote-error[hidden] { display: none; }
.remote-workspace { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 24px; padding: 24px; }
.remote-video-panel, .remote-input-panel { min-width: 0; }
.remote-section-heading { min-height: 44px; margin-bottom: 14px; flex-wrap: wrap; }
.remote-section-heading h4 { font-size: 14px; font-weight: 600; }
.remote-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.remote-video-placeholder { display: flex; width: 100%; min-height: 280px; max-height: 340px; aspect-ratio: 16/9; align-items: center; justify-content: center; flex-direction: column; gap: 12px; border-radius: 10px; background: var(--kp-surface-sunken); border: 1px solid var(--kp-line); color: var(--kp-text-secondary); text-align: center; padding: 20px; font-size: 14px; }
.remote-video-placeholder small { font-size: 12px; color: var(--kp-muted); line-height: 1.7; }
.remote-video-placeholder.loaded { padding: 0; background: #050607; min-height: 360px; max-height: none; }
.remote-video-placeholder iframe { border: 0; width: 100%; height: 100%; min-height: 360px; border-radius: 10px; }
.remote-touchpad { min-height: 230px; border: 1px solid var(--kp-line-strong); border-radius: 10px; background: radial-gradient(#98a7bc20 .8px, transparent .8px) 0 0/18px 18px, var(--kp-surface-sunken); display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 12px; color: var(--kp-muted); touch-action: none; user-select: none; -webkit-user-select: none; padding: 18px; text-align: center; }
.remote-touchpad.controlling { border-color: var(--kp-accent-text); box-shadow: inset 0 0 0 1px var(--kp-accent-text); background-color: #1a2b44; }
.remote-touchpad-mark { font-size: 30px; font-weight: 200; color: #7188a8; }
.remote-touchpad strong { font-size: 14px; font-weight: 550; color: var(--kp-text-secondary); }
.remote-touchpad span, .remote-touchpad small { font-size: 12px; line-height: 1.5; }
.remote-mouse-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 8px; }
.remote-shell .remote-mouse-buttons button { flex: 1 0 auto; min-width: 40px; padding-inline: 6px; white-space: nowrap; }
.remote-input-panel button:not(.btn-outline), .remote-key-tools button:not(.btn-primary) { background: var(--kp-surface-raised); color: var(--kp-text-secondary); border: 1px solid var(--kp-line-strong); }
.remote-input-panel button:not(:disabled):hover, .remote-key-tools button:not(.btn-primary):not(:disabled):hover { background: var(--kp-surface-hover); color: var(--kp-text); }
.remote-shell button:disabled { opacity: .42; }
.remote-shell button[aria-pressed=true] { color: var(--kp-accent-text); background: var(--kp-accent-soft); border-color: var(--kp-accent-text); }
.remote-sensitivity { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--kp-muted); margin: 0 0 0 auto; }
.remote-sensitivity select { width: auto; padding: 8px; min-height: 42px; }
.remote-dialog.mouse-settings-dialog { width: min(620px, 94vw); }
.mouse-settings-dialog form { max-height: calc(90dvh - 56px); }
.mouse-settings-dialog .remote-section-heading > div { min-width: 0; }
.mouse-settings-dialog .remote-section-heading p { margin: 5px 0 0; overflow-wrap: anywhere; }
.mouse-settings-tabs { display: flex; gap: 4px; padding: 4px; background: var(--kp-bg); border: 1px solid var(--kp-line); border-radius: 10px; }
.mouse-settings-tabs button { flex: 1; background: transparent; color: var(--kp-muted); border: 1px solid transparent; }
.mouse-settings-tabs button[aria-selected=true] { background: var(--kp-accent-soft); color: var(--kp-accent-text); border-color: var(--kp-line-strong); }
.mouse-setting-row { display: flex; gap: 18px; align-items: center; justify-content: space-between; padding: 16px 0; border-bottom: 1px solid var(--kp-line); }
.mouse-setting-row strong { font-size: 13px; font-weight: 550; }
.mouse-setting-row p { font-size: 12px; color: var(--kp-muted); line-height: 1.6; margin: 5px 0 0; }
.mouse-setting-row > select { width: auto; min-width: 120px; font-size: 12px; }
.mouse-settings-dialog .mouse-inline-label { margin: 0; flex-direction: row; align-items: center; gap: 10px; min-width: 155px; width: 45%; }
.mouse-inline-label input[type=range] { padding: 0; accent-color: var(--kp-accent-text); }
.mouse-inline-label output { min-width: 42px; text-align: right; font-variant-numeric: tabular-nums; }
.mouse-settings-dialog input[type=checkbox] { width: 18px; height: 18px; min-height: 18px; flex-shrink: 0; accent-color: var(--kp-accent-text); }
.mouse-setting-note { background: var(--kp-neutral-soft); padding: 12px 14px; border-radius: 8px; margin: 18px 0; color: var(--kp-muted); font-size: 12px; line-height: 1.8; }
.mouse-settings-dialog .remote-link { background: none; border: 0; padding: 8px 0; color: var(--kp-accent-text); }
.mouse-settings-status { color: var(--kp-muted); font-size: 12px; line-height: 1.6; margin: 0; }
.mouse-settings-status[data-error=true] { color: var(--kp-danger-text, #f5a3a3); }
.mouse-settings-footer { display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--kp-line); padding-top: 14px; }
.mouse-settings-footer [data-cancel], .mouse-servo-card button, .mouse-advanced button { background: var(--kp-surface-raised); color: var(--kp-text-secondary); border: 1px solid var(--kp-line-strong); }
.mouse-servo-card { border: 1px solid var(--kp-line); border-radius: 10px; padding: 16px; margin: 16px 0; }
.mouse-servo-card h4 { font-size: 14px; margin: 0; }
.mouse-calibration-badge { font-size: 11px; color: var(--kp-muted); background: var(--kp-neutral-soft); border-radius: 5px; padding: 4px 7px; }
.mouse-stepper { display: flex; align-items: center; gap: 8px; }
.mouse-stepper button { padding: 8px 10px; }
.mouse-stepper output { min-width: 60px; text-align: center; color: var(--kp-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.mouse-servo-card > button { margin-top: 12px; width: 100%; }
.mouse-settings-dialog details { margin-top: 16px; }
.mouse-settings-dialog summary { cursor: pointer; color: var(--kp-accent-text); font-size: 12px; padding: 8px 0; }
.mouse-bound-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mouse-bound-fields label { min-width: 0; margin: 10px 0; }
.mouse-settings-dialog .mouse-check { flex-direction: row; align-items: center; line-height: 1.6; font-size: 12px; }
.mouse-settings-dialog button:disabled { opacity: .45; }
.mouse-settings-dialog :focus-visible { outline: 2px solid var(--kp-accent-text); outline-offset: 3px; }
@media (max-width: 480px) {
  .mouse-settings-dialog form { max-height: calc(90dvh - 44px); }
  .mouse-servo-card { padding: 12px; }
  .mouse-servo-card .mouse-setting-row { align-items: flex-start; flex-direction: column; gap: 10px; }
  .mouse-stepper { width: 100%; }
  .mouse-stepper button { flex: 1; }
  .mouse-setting-row > select { min-width: 110px; max-width: 55%; }
}
.remote-key-tools { padding: 22px 24px; border-top: 1px solid var(--kp-line); }
.remote-key-tools h4 { margin-bottom: 14px; font-size: 14px; }
.remote-key-tools details { margin-top: 20px; border-top: 1px solid var(--kp-line); padding-top: 12px; }
.remote-key-tools summary { cursor: pointer; color: var(--kp-accent-text); padding: 8px 0; font-size: 13px; }
.remote-key-tools textarea { display: block; margin: 12px 0; width: 100%; min-height: 110px; padding: 12px; }
.remote-key-tools details > label { display: inline-flex; align-items: center; gap: 8px; margin-right: 16px; font-size: 13px; }
.remote-footer { margin-top: 24px; font-size: 12px; color: var(--kp-muted); display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; line-height: 1.6; }
.remote-shell .remote-link { border: 0; color: var(--kp-accent-text); padding: 0 8px; background: none; font-size: 12px; }
.remote-empty { text-align: center; background: var(--kp-surface); border: 1px solid var(--kp-line); border-radius: 14px; padding: 64px 24px; }
.remote-empty h3 { font-size: 22px; }
.remote-empty p { color: var(--kp-muted); margin: 16px 0 24px; line-height: 1.7; }
.remote-empty button { margin: 4px; }
.remote-dialog { margin: auto; background: var(--kp-surface); border: 1px solid var(--kp-line-strong); border-radius: 14px; padding: 28px; width: min(480px, 94vw); color: var(--kp-text); max-height: 90dvh; overflow: hidden; box-shadow: 0 24px 80px #0008; }
.remote-dialog::backdrop { background: #060a12b8; backdrop-filter: blur(5px); }
.remote-dialog h3 { font-size: 20px; }
.remote-dialog label { display: flex; flex-direction: column; gap: 8px; font-size: 13px; margin: 18px 0; }
.remote-dialog input, .remote-dialog select { padding: 12px; width: 100%; min-height: 44px; }
.remote-dialog small { display: block; margin-top: 16px; line-height: 1.7; }
.remote-dialog [data-close] { background: var(--kp-surface-raised); border: 1px solid var(--kp-line-strong); color: var(--kp-text-secondary); }
.remote-dialog .remote-error { margin: 12px 0; }

@media (max-width: 1050px) {
  .remote-workspace { grid-template-columns: 1fr; }
  .remote-video-placeholder { min-height: 180px; max-height: 360px; }
  .remote-shell { padding: 24px; }
}
@media (max-width: 640px) {
  .remote-shell { padding: 24px 12px calc(36px + env(safe-area-inset-bottom)); }
  .remote-heading { align-items: flex-start; gap: 12px; }
  .remote-heading h2 { font-size: 24px; }
  .remote-heading .remote-muted { max-width: 220px; }
  .remote-heading > button { flex-shrink: 0; }
  .remote-computers { margin: 20px 0 12px; }
  .remote-shell .remote-computer { min-width: 185px; padding: 13px 16px; }
  .remote-workbench-heading, .remote-workspace, .remote-key-tools { padding: 16px; }
  .remote-workbench-heading { align-items: flex-start; gap: 12px; }
  .remote-workbench-heading h3 { font-size: 18px; }
  .remote-workbench-heading button { flex-shrink: 0; }
  .remote-controlbar { padding: 12px 16px; gap: 8px; }
  .remote-choices { width: 100%; }
  .remote-video-placeholder.loaded, .remote-video-placeholder iframe { min-height: 270px; }
  .remote-touchpad { min-height: 220px; }
  .remote-error { margin: 12px 16px; }
  .remote-key-tools details > label { display: flex; margin: 12px 0; }
  .remote-shell button { min-height: 44px; padding: 10px 12px; }
  .remote-sensitivity { flex: 1; justify-content: flex-end; }
  .remote-dialog { padding: 22px 18px; }
}
@media (max-height: 550px) and (orientation: landscape) {
  .remote-workspace { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; padding: 12px; }
  .remote-touchpad { min-height: 180px; }
  .remote-heading, .remote-computers { display: none; }
  .remote-shell { padding: 12px; }
}
.remote-shell [hidden], .remote-dialog [hidden], #numpad-test-box[hidden] { display: none !important; }
.remote-dpad { display: grid; grid-template-columns: repeat(3, minmax(44px, 1fr)); gap: 8px; max-width: 280px; margin: 16px auto; }
.remote-dpad button { min-height: 48px; touch-action: none; }
.tools-workspace { grid-template-columns: minmax(0, 1.4fr) minmax(260px, 1fr); align-items: start; }
.tools-keyboard-slot { min-width: 0; }
.tools-advanced { border: 1px solid var(--kp-line); border-radius: 12px; padding: 16px; }
.tools-advanced>summary { cursor: pointer; padding: 8px 0; font-weight: 600; }
.tools-advanced .relay-box { margin-top: 16px; }
.remote-dialog[open] { display: flex; flex-direction: column; }
.remote-dialog form { display: flex; flex-direction: column; min-height: 0; gap: 12px; }
.remote-dialog-fields { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 3px; }
.remote-dialog .remote-error:empty { display: none; }
@media(max-width: 800px) { .tools-workspace { grid-template-columns: minmax(0, 1fr); } .tools-keyboard-slot { order: 2; } }
.tools-shell .remote-key-tools { display: none; }
.remote-shell .remote-computer { grid-template-columns: 1fr; }

/* 健康提示与页面卡片共用字号、边距和主题色。 */
.remote-health { display: flex; align-items: flex-start; gap: 9px; margin: 0 24px 16px; padding: 10px 14px; border: 1px solid var(--kp-line); border-radius: 8px; background: var(--kp-surface-sunken); color: var(--kp-muted); font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; }
.remote-health::before { content: ''; flex: 0 0 6px; height: 6px; margin-top: 7px; border-radius: 50%; background: currentColor; }
.remote-health[hidden], .remote-health:empty { display: none; }
.remote-health[data-tone=success] { color: var(--kp-success-text); background: var(--kp-success-soft); border-color: var(--kp-success-line); }
.remote-health[data-tone=info] { color: var(--kp-accent-text); background: var(--kp-accent-soft); }
.remote-health[data-tone=warning] { color: var(--kp-warning-text); background: var(--kp-warning-soft); border-color: var(--kp-warning-line); }
.remote-health[data-tone=danger] { color: var(--kp-danger-text); background: var(--kp-danger-soft); border-color: var(--kp-danger-line); }
@media (max-width: 720px) { .remote-health { margin: 0 16px 12px; padding: 10px 12px; } }

/* 透传时停止入口固定可见；全屏容器自身滚动。 */
.remote-capture-hint { margin: 10px 24px; color: var(--kp-muted); font-size: 12px; line-height: 1.7; }
.remote-capture-hint[hidden], .remote-controlbar [hidden] { display: none; }
:fullscreen:has(> .remote-shell) { overflow: auto; background: var(--kp-bg, #15181e); width: 100%; height: 100%; }

.remote-capture-hint > span { display: block; }

/* 收纳设置沿用既有弹窗主题，正文独立滚动。 */
.typing-settings-dialog { margin: auto; width: min(480px, calc(100vw - 24px)); max-height: 90dvh; padding: 22px; border: 1px solid var(--kp-line-strong); border-radius: 14px; background: var(--kp-surface); color: var(--kp-text); box-sizing: border-box; overflow: hidden; }
.typing-settings-dialog[open] { display: flex; flex-direction: column; gap: 16px; }
.typing-settings-dialog::backdrop { background: #060a12b8; backdrop-filter: blur(5px); }
.typing-settings-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-shrink: 0; }
.typing-settings-fields { display: flex; flex-direction: column; gap: 14px; overflow-y: auto; min-height: 0; overscroll-behavior: contain; }

.typing-settings-dialog summary, .remote-gesture-help summary { cursor: pointer; padding: 8px 0; }
.typing-settings-dialog input, .typing-settings-dialog select { max-width: 100%; }
.remote-gesture-help { color: var(--kp-muted); font-size: 12px; line-height: 1.7; }
.remote-gesture-help p { margin: 4px 0 12px; }


.typing-settings-fields > div > label { display: block; margin-bottom: 6px; }

.typing-composer { display: flex; flex-direction: column; gap: 10px; }
.typing-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.typing-composer > textarea { width: 100%; min-height: 110px; margin: 0; }
.typing-composer > [role=status]:empty { display: none; }
.typing-composer > label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--kp-text-secondary); }
