/* Desktop workspace only. Phone/tablet layouts continue to use native.css. */
@media (min-width:1000px){
  :root{--desktop-header:72px;--desktop-ink:#27313d;--desktop-muted:#657180;--desktop-line:#e1e5ea;--desktop-accent:#315f9c;--desktop-accent-dark:#274e83;--green:var(--desktop-accent);--muted:var(--desktop-muted);--border:var(--desktop-line);--red:#b13e3e;background:#f5f6f7;color:var(--desktop-ink)}
  body{background:#f5f6f7;color:var(--desktop-ink)}
  .desktop-only{display:flex}
  button,input,select,textarea,.file-button{font-size:15px}
  button,.file-button{min-height:40px;border-radius:7px;border-color:var(--desktop-line);color:#414d5c;font-weight:500;padding:9px 16px;box-shadow:none}
  button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible{outline:3px solid #a6bddb;outline-offset:2px}
  button:active{background:#e9edf2}
  .primary{background:var(--desktop-accent);border-color:var(--desktop-accent);color:#fff}
  .primary:hover{background:var(--desktop-accent-dark)}
  .primary:active{background:#214372}
  .text-button{color:var(--desktop-accent);font-size:14px;min-height:36px;padding:6px 8px}
  input,textarea,select{border:1px solid #d6dce3;border-radius:6px;color:#34404e;background:#fff;padding:10px 12px;font-size:15px}
  input::placeholder,textarea::placeholder{color:#6b7179}
  .muted{color:var(--desktop-muted);font-size:14px}.small{font-size:13px}
  h1{font-size:27px;line-height:1.35;font-weight:650;letter-spacing:0;color:var(--desktop-ink)}
  h2{font-size:18px;font-weight:600;color:var(--desktop-ink)}

  .workspace{height:100vh;height:100dvh;padding-bottom:0;margin:0;background:#f5f6f7}
  .topbar{height:var(--desktop-header);padding:0 488px 0 30px;gap:16px;background:#fff;border-bottom:1px solid var(--desktop-line);color:var(--desktop-ink)}
  .product-brand{display:flex;align-items:center;gap:9px;flex:none;border:0;border-right:1px solid var(--desktop-line);border-radius:0;padding:0 24px 0 0;margin-right:2px;background:transparent;color:#26313e;font-size:19px;letter-spacing:-.4px;font-weight:650;min-height:34px}
  .product-brand svg{width:26px;height:26px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
  .product-brand:hover{background:transparent;color:var(--desktop-accent)}
  .topbar #breadcrumb{font-size:16px;font-weight:500;color:#586474;min-width:40px}
  .topbar #backToDevices{font-size:27px;min-width:30px;min-height:36px;color:#586474}
  .topbar>div{gap:12px;flex:none}
  #openControlMore{font-size:14px;min-height:36px;padding:6px 10px;border:1px solid var(--desktop-line);border-radius:6px;background:#fff;color:#586474}
  .connection-summary{font-size:13px;color:#92651f}

  .app-nav{position:fixed;left:auto;right:30px;top:0;bottom:auto;width:420px;height:var(--desktop-header);display:flex;align-items:center;justify-content:flex-end;gap:8px;padding:0;border:0;background:transparent;box-shadow:none;z-index:30}
  .app-nav .nav{flex:none;position:relative;display:flex;flex-direction:row;align-items:center;justify-content:center;gap:8px;min-height:44px;min-width:86px;padding:10px 13px;margin:0;border:0;border-radius:6px;background:transparent;color:#687281;font-size:15px;font-weight:500}
  .app-nav .nav>span{display:none}
  .app-nav .nav-desktop-icon{display:block;width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex:none}
  .app-nav .nav.active{background:#edf2f8;color:var(--desktop-accent);font-weight:600}
  .app-nav .nav b{display:inline-block;position:static;margin:0;padding:1px 5px;min-width:18px;border:0;border-radius:4px;background:#e1e8f1;font-size:11px;line-height:17px;color:#506a8a}
  .workspace main{width:100%;max-width:1400px;margin:0 auto;padding:0;min-height:0;overflow:hidden}
  .page{padding:32px 38px 40px;height:100%;overflow:auto}
  .page-heading{gap:16px;margin:0 0 26px;align-items:center}
  .page-heading h1{display:block;margin:0 0 8px;font-size:27px}
  .page-heading .muted{font-size:14px;margin:0;color:var(--desktop-muted)}
  #page-devices>.page-heading>div:first-child{display:block;flex:1}
  .native-home-actions{width:auto;display:flex;align-items:center;gap:12px}
  .native-home-actions #addDevice{order:1;font-size:15px;padding:10px 16px;min-height:42px;border-radius:7px}
  .native-home-actions #manageDevices{font-size:14px;border:1px solid var(--desktop-line);padding:9px 14px;min-height:42px;border-radius:7px;background:#fff;color:#596574}
  #deviceSearchRow{margin-bottom:18px}
  #deviceSearchRow>h2{display:none}
  #deviceSearchRow .search{max-width:380px;border:1px solid var(--desktop-line);border-radius:7px;background:#fff;padding:0 12px}
  #deviceSearchRow input{font-size:14px;padding:10px 0}
  .device-table-head.desktop-only{display:grid;grid-template-columns:62px minmax(0,1fr) 170px 92px;gap:22px;padding:12px 24px;border:1px solid var(--desktop-line);border-bottom:0;border-radius:8px 8px 0 0;background:#eef1f4;color:#697585;font-size:13px}
  .device-table-head>span:first-child{grid-column:2}
  #page-devices:has(#emptyDevices:not([hidden])) .device-table-head{display:none}
  .device-grid{display:flex;flex-direction:column;gap:0;background:#fff;border:1px solid var(--desktop-line);border-radius:0 0 8px 8px;overflow:hidden}
  .device-grid:empty{display:none}
  .device-card{border:0;border-bottom:1px solid #e9edf1;border-radius:0;background:#fff;padding:0;box-shadow:none}
  .device-card:last-child{border-bottom:0}
  .device-card>.open-device{display:grid;grid-template-columns:62px minmax(0,1fr) 170px 92px;align-items:center;justify-content:flex-start;gap:22px;width:100%;min-height:92px;padding:14px 24px;border:0;border-radius:0;text-align:left;background:#fff;color:var(--desktop-ink)}
  .device-card>.open-device:hover{background:#f9fafb}
  .device-card>.open-device:active{background:#eef2f6}
  .device-card>.open-device:focus-visible{outline-offset:-3px}
  .device-card img{width:62px;height:64px;object-fit:contain;padding:8px;background:#f4f6f8;border:1px solid #edf0f3;border-radius:7px;flex:none}
  .device-info{display:contents}
  .device-card h2{flex:1;margin:0;color:#2d3846;font-size:18px;line-height:1.5;font-weight:600;text-align:left;overflow-wrap:anywhere}
  .device-card .device-state{display:block;flex:0 0 170px;color:#67727e;font-size:14px;line-height:1.6;font-weight:400}
  .device-card .dot{background:#b8c1ca}.device-card .dot.online{background:#368064}
  .device-arrow{display:flex;align-items:center;justify-content:flex-end;gap:12px;color:#69737e;font-size:25px;font-weight:400}
  .device-arrow:before{content:'进入控制';font-size:13px;color:#68737e;font-weight:400}
  .device-actions{padding:0 24px 16px 108px;gap:10px;background:#fff;justify-content:flex-start}
  .device-actions button{min-height:34px;font-size:13px;padding:6px 12px;background:#fff;border-color:var(--desktop-line);border-radius:5px;color:#596574}
  .device-actions .danger{color:#ae4040}
  .empty-state{max-width:760px;margin:22px auto 0;padding:62px 32px;border:1px dashed #d4dce5;border-radius:9px;background:#fff}
  .empty-robot{width:90px;height:105px;background:transparent url('./images/robot-agv.png') center / contain no-repeat;font-size:0;border-radius:0;color:transparent}
  .empty-robot span{display:none}
  .empty-state h2{font-size:23px;margin-top:26px;font-weight:600}
  .empty-state p{font-size:15px;color:#6a737e;margin:10px 0 24px}
  .empty-state .button-row{flex-direction:row;justify-content:center;gap:14px}
  .empty-state .button-row .primary{width:auto;min-width:160px;min-height:44px;font-size:16px}
  .empty-state #emptyRestore{border:1px solid var(--desktop-line);border-radius:7px;background:#fff;font-size:14px;min-height:44px;padding:10px 16px}

  #page-control{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:38px 48px minmax(0,1fr);gap:18px 20px;padding:24px 38px 30px;min-height:0;overflow:hidden}
  #page-control>.page-heading{grid-column:2;grid-row:1;min-height:0;margin:0}
  #page-control>.page-heading>div:first-child{display:none}
  .switch-device{font-size:13px;gap:10px;margin:0;color:#677382;white-space:nowrap}
  .switch-device select{font-size:14px;max-width:220px;min-height:38px;padding:6px 10px;border-radius:6px;color:#455363;background:#fff}
  .status-strip{grid-column:1;grid-row:1;display:flex;align-items:center;gap:20px;min-height:38px;margin:0;padding:0;background:none;color:#69737e;font-size:14px}
  .status-strip b{font-weight:500;color:#536372}
  .status-strip .dot{width:6px;height:6px}.status-strip .dot.online{background:#368064}
  .mode-tabs{grid-column:1 / -1;grid-row:2;display:flex;align-items:stretch;justify-content:flex-start;height:48px;margin:0;padding:0;gap:24px;border:0;border-bottom:1px solid #dce2e9;border-radius:0;background:transparent;box-shadow:none}
  .mode-tabs button{flex:none;position:relative;min-height:48px;min-width:84px;padding:8px 10px 13px;border:0;border-radius:0;background:transparent;font-size:16px;font-weight:500;color:#6a727e;box-shadow:none}
  .mode-tabs button.active{background:transparent;color:var(--desktop-accent);font-weight:650;box-shadow:none}
  .mode-tabs button.active:after{content:'';position:absolute;left:0;right:0;bottom:-1px;height:3px;background:var(--desktop-accent);border-radius:2px 2px 0 0}
  .control-layout,#page-control .control-layout{grid-column:1 / -1;grid-row:3;display:grid;grid-template-columns:minmax(0,1fr) 330px;gap:20px;min-height:0;overflow:hidden}
  #page-control .control-layout:not(:has(.selection-panel:not([hidden]))){grid-template-columns:minmax(0,1fr)}
  .panel{background:#fff;border:1px solid var(--desktop-line);border-radius:9px;padding:22px;box-shadow:none}
  #page-control .point-panel{display:flex;flex-direction:column;min-height:0;padding:20px;overflow:hidden;flex:initial}
  .point-panel-heading{display:flex;align-items:center;justify-content:space-between;margin:0 0 8px;flex:none}
  .point-panel-heading h2{font-size:17px;margin:0;font-weight:600;color:#374453}
  #page-control #modeHint{display:block;font-size:13px;color:#6a737e;margin:0 0 20px;line-height:1.6}
  #page-control .point-tools{margin:4px 0 14px;max-width:430px;flex:none}
  .point-tools input{font-size:14px;padding:10px 12px;min-height:40px;border:1px solid #d8dfe7;border-radius:6px;background:#fff}
  .point-layout{gap:18px;min-height:0}
  .map-list{flex-basis:96px;padding-right:14px;gap:6px;border-right:1px solid #e8edf2}
  .map-list button{min-height:42px;font-size:14px;padding:9px 7px;border:0;border-radius:5px;background:transparent;color:#677280;line-height:1.5}
  .map-list button.active{background:#edf2f8;color:#315f9c;font-weight:600}
  .point-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(145px,1fr));gap:12px;align-content:start;margin:0;min-height:0;overflow:auto}
  .point-button{min-height:58px;font-size:16px;font-weight:500;line-height:1.5;padding:15px 12px;border:1px solid #dce3eb;border-radius:7px;background:#fff;color:#495767;text-align:center;box-shadow:none}
  .point-button:hover{background:#f3f6f9;border-color:#b9c9db}
  .point-button.selected{background:#edf3fb;border-color:#6a8fbe;color:#2e5c97;box-shadow:inset 0 0 0 1px #6a8fbe}
  #page-control .point-panel>.section-bar{margin-top:14px;font-size:13px;color:#6a737e}
  #page-control .point-panel #pointsMessage{font-size:15px;line-height:1.8;color:#6a737e;padding:32px 12px}
  #page-control .selection-panel{display:flex;flex-direction:column;min-height:0;max-height:none;min-width:0;padding:20px;flex:initial;overflow:hidden}
  #page-control .selection-panel .section-bar{flex:none;margin:0 0 16px;min-height:30px}
  #page-control .selection-panel h2{font-size:17px;font-weight:600}
  #page-control .selection-panel h2 span{font-size:12px;line-height:20px;padding:1px 6px;margin-left:6px;border-radius:4px;background:#eff2f5;color:#657383;vertical-align:2px}
  #page-control .selection-panel .section-bar button{font-size:13px;min-height:30px;padding:4px 0;color:#6a737e}
  #page-control .selection-list{display:flex;flex-direction:column;gap:0;overflow:auto;min-height:0;flex:1;counter-reset:steps}
  #page-control .selection-list li{display:flex;align-items:center;gap:12px;flex:none;padding:8px 0;min-height:54px;margin:0;border:0;border-bottom:1px solid #eef1f5;border-radius:0;background:transparent;font-size:15px;color:#4c5c6d}
  #page-control .selection-list li:before{background:transparent;color:#6a727a;width:18px;height:24px;font-size:13px;border-radius:0}
  #page-control .selection-list li>div{font-size:15px;min-width:0;flex:1}
  #page-control .selection-list li small{font-size:12px;color:#6b727a;line-height:1.6;margin:3px 0 0}
  #page-control .selection-list li button{font-size:19px;min-width:30px;min-height:32px;padding:3px;color:#6b7279;border-radius:5px;background:transparent}
  #page-control #selectionEmpty{font-size:14px;color:#6a727c;margin:4px 0 20px;line-height:1.7}
  #page-control .selection-panel .send-area{display:flex;flex-direction:column;align-items:stretch;gap:12px;flex:none;margin-top:16px;padding:16px 0 0;border-top:1px solid #e7edf3}
  #page-control .selection-panel .send-area p{font-size:13px;line-height:1.6;margin:0;color:#69737e}
  #page-control .selection-panel #sendTask{width:100%;min-height:46px;font-size:17px;border-radius:7px;padding:10px;background:var(--desktop-accent);border-color:var(--desktop-accent);color:#fff}

  #page-tasks{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);grid-template-rows:auto minmax(0,max-content);gap:22px;align-content:start}
  #page-tasks>.page-heading{grid-column:1 / -1;margin:0 0 2px}
  #page-tasks .queue-panel{margin:0}
  #page-tasks .panel .section-bar{margin-bottom:18px}
  #page-tasks .task-target{font-size:26px;color:#354252;line-height:1.5;font-weight:600;margin:22px 0}
  #page-tasks .task-actions{margin-top:22px;padding-top:20px;gap:12px}
  #page-tasks .task-actions button{min-height:42px;font-size:15px;border-radius:7px}
  #page-tasks .task-actions #pauseTask{background:var(--desktop-accent);border-color:var(--desktop-accent);color:#fff}
  #page-tasks .task-actions #cancelTask{border-color:#e4c9c9;color:#ad4848;background:#fff}
  .task-details{font-size:14px;grid-template-columns:90px 1fr;gap:12px;line-height:1.7;color:#607183}
  .task-details dt{color:#68727c}.task-details dd{color:#607183}
  .queue-item{font-size:15px;padding:16px 0;border-color:#e8edf2}
  .queue-item span{font-size:12px;color:#6b737b;margin-top:7px}
  .badge{font-size:12px;color:#69737e;background:#f1f3f5;border-radius:4px;padding:5px 8px;font-weight:500}
  .badge.online{color:#47745d;background:#f0f7f3}.badge.connecting{color:#8c6d36;background:#fbf6eb}

  #page-settings{max-width:1000px;margin:0 auto}
  .desktop-page-heading{display:block;margin:0 0 8px}.desktop-page-heading h1{font-size:27px;margin:0}
  .settings-caption{font-size:14px;margin:0 0 28px;color:#69727c}
  .settings-menu,.settings-group{max-width:none;background:#fff;border:1px solid var(--desktop-line);border-radius:0;margin:0;overflow:hidden}
  .settings-menu{border-radius:8px 8px 0 0}.settings-group{border-top:0}.settings-group:last-child{border-radius:0 0 8px 8px}
  .settings-row{font-size:16px;font-weight:500;min-height:66px;padding:20px 24px;color:#4b5b6c;background:#fff;border-radius:0}
  .settings-row:after{color:#6b727b;font-size:21px}
  .settings-group>summary{position:relative;font-size:16px;font-weight:500;min-height:66px;padding:20px 24px;color:#4b5b6c;list-style:none}
  .settings-group>summary::-webkit-details-marker{display:none}
  .settings-group>summary:after{content:'';width:7px;height:7px;margin:6px 4px 0 0;border-right:1.5px solid #9da9b6;border-bottom:1.5px solid #9da9b6;transform:rotate(45deg);float:right}
  .settings-group[open]>summary:after{content:'';transform:rotate(225deg);margin-top:10px}
  .settings-group[open]>summary{border-bottom:1px solid #edf1f5}
  .settings-content{padding:22px 24px 26px;background:#fcfdfe}
  .settings-content>p{font-size:14px;color:#687380;line-height:1.8;margin:0 0 18px;max-width:650px}
  .settings-content button{font-size:14px;min-height:40px}
  .settings-panel{max-width:680px;margin:18px 0 0;padding:0;background:transparent;border:0;box-shadow:none}
  .settings-panel label{font-size:14px;font-weight:500;color:#607183}
  .settings-panel input,.settings-panel select{font-size:14px;min-height:42px}
  .settings-panel p{font-size:13px;color:#69737d;line-height:1.8}
  .settings-panel .button-row button{font-size:14px;min-height:40px}
  .support-details>summary{font-size:14px;color:#637383;font-weight:400;padding:9px 0;min-height:38px}
  .backup-notice{border-radius:6px;background:#f3f6fa;border:1px solid #e3e9f0;padding:16px;max-width:650px}
  .backup-notice p{font-size:13px;color:#647483;margin-bottom:12px}
  .backup-notice button{background:var(--desktop-accent);border-color:var(--desktop-accent);border-radius:6px}
  #storageState.storage-result{max-width:650px;border-radius:6px;font-size:14px;padding:14px;background:#f2f5f9;color:#607488}
  #storageState[data-state=granted]{background:#f1f7f3;color:#4b795e}
  #storageState[data-state=error],#storageState[data-state=timeout]{background:#faf5ec;color:#886d3f}
  .install-entry{max-width:650px;background:#f4f6f8;border-radius:6px}
  .settings-content .button-row{gap:12px}
  .settings-content>.support-details{margin-top:24px}
  .log-list{font-size:13px;line-height:1.8;max-height:none}.log-line{padding:14px 0;border-color:#e9eef3;color:#607183}.log-line time{color:#69727b;margin-right:20px}
  #page-logs .page-heading .muted{margin-top:8px;line-height:1.8}
  .demo-banner{max-width:none;margin:12px 38px 0;padding:8px 14px;font-size:12px;background:#faf6ec;border:1px solid #ece0c6;border-radius:6px;color:#876e3c}
  .demo-banner button{font-size:12px;min-height:30px}

  dialog{border:1px solid #e0e5eb;border-radius:10px;padding:26px;background:#fff;color:#465769;box-shadow:0 16px 60px #1b2b3d24}
  dialog::backdrop{background:#263a4e55;backdrop-filter:blur(3px)}
  .dialog-heading h2{font-size:22px;font-weight:600;color:#354556}
  .dialog-actions button{font-size:15px;min-height:42px}
  dialog label{font-size:14px;color:#627486}dialog input,dialog textarea{font-size:15px}
  #confirmText{font-size:16px;line-height:1.8;color:#647482}
  .more-actions{gap:10px}.more-actions button{font-size:16px;min-height:48px;padding:12px 16px;border-radius:6px;background:#fff;color:#536a7f;border-color:#e0e6ed}
  .ai-entry input{font-size:15px}.ai-entry button{font-size:15px;min-height:40px}#aiState{font-size:14px;color:#657481}
  #addDialog{border-radius:12px}.pairing-header h2{font-size:22px}.pairing-header p{font-size:14px;color:#647381}
  #addDialog .scan-actions .primary{background:var(--desktop-accent);border-color:var(--desktop-accent);border-radius:7px;font-size:16px;min-height:46px}
  #addDialog[data-scan-phase=ready] #cameraScan{background:#f4f6f8;border-color:#e0e6ed;color:#607488}
  .scan-alternatives>*{border-radius:6px;background:#f7f9fb;border-color:#e3e8ee;color:#5e7387;font-size:14px;min-height:42px}
  .pairing-footer button{border-radius:7px;font-size:16px;min-height:44px}.pairing-footer>button:first-child{color:#627486;background:#f3f6f8}
  .pairing-footer .primary:disabled{background:#afc0d5;border-color:#afc0d5;color:#fff}
  .pairing-header button{border-radius:7px;background:#f3f6f8;color:#67737f}
  #addDialog .scan-feedback{font-size:14px;color:#657482}
  #addDialog .pairing-result{border-radius:8px}.pairing-result strong{font-size:20px}
  .pairing-help>summary,#manualPairing summary{font-size:14px;color:#66737f}
  dialog.install-guide{color:#51687d;border:1px solid #e0e6ed;border-radius:10px;padding:26px}
  dialog.install-guide h2{font-size:22px;color:#3f566b}dialog.install-guide p{font-size:14px;line-height:1.8;color:#637482}
  dialog.install-guide h3{font-size:16px;color:#5c748a}
  dialog.install-guide button{font-size:14px;min-height:42px;border-radius:6px}
  .install-platforms button[aria-pressed=true]{background:var(--desktop-accent);border-color:var(--desktop-accent);color:white}
  .install-guide .install-status{background:#f1f5f9;color:#5f7487;border-radius:6px}
  .install-steps>li{border:1px solid #e4eaf0;border-radius:8px;background:#fafbfd;padding:18px}
  .install-step-image{border-color:#e2e8ef;border-radius:6px}
  .install-step-controls span{font-size:13px;color:#657480}
  .install-permission{border-color:#e3e9f0;border-radius:6px;padding:14px}
  .install-permission summary{font-size:14px;color:#657481;font-weight:500}
  .install-check.passed:before{color:#527a66}.install-check.attention:before{color:#81704b}
  .install-notice{background:#faf7ef;border-color:#ece2cf;border-radius:6px;color:#817051}
  .toast,body[data-page=control] .toast{top:86px;background:#344f6b;border-radius:7px;font-size:14px;padding:11px 18px;max-width:600px;line-height:1.7}
  .toast.error{background:#985951}
}
