/* Device operation pages share one visual contract; business state remains in existing controllers. */
body:has(#workspace>section.device-page:not([hidden])) #header-back{order:-1;margin:0 4px 0 0!important;padding:6px 10px;border:1px solid #e4defb;background:#faf8ff;color:#603bfa;font-size:12px;flex-shrink:0}
body:has(#workspace>section.device-page:not([hidden])) #page-context{margin-right:auto;font-size:12px}
.device-page{--page-line:#e5e8f1;--page-muted:#7c879b;--page-purple:#603bfa;max-width:none!important}
.device-page :is(h1,h2,h3){color:#182239;letter-spacing:0}.device-page h1{font-size:25px;line-height:34px;font-weight:650}.device-page h2{font-size:15px;line-height:22px;font-weight:600}.device-page h3{font-size:14px;font-weight:600}
.device-page :is(.package-heading,.operation-heading,.subpage-heading){display:flex;justify-content:space-between;align-items:flex-start;gap:20px;margin:0 0 22px}.device-page :is(.package-heading,.operation-heading,.subpage-heading) p{font-size:12px;line-height:20px;color:var(--page-muted);margin:6px 0 0}
.device-page p,.device-page small{font-size:12px;line-height:20px;color:var(--page-muted)}.device-page label{font-size:12px;font-weight:500;gap:7px;color:#46516a}.device-page form{gap:16px}.device-page input,.device-page select,.device-page textarea{border:1px solid #dfe4ef;border-radius:6px;min-height:36px;padding:7px 10px;font-size:12px;line-height:20px;background:#fff}.device-page input:focus,.device-page textarea:focus{border-color:#9279fa}.device-page input[type=checkbox]{min-height:15px;width:15px;height:15px;padding:0;accent-color:#603bfa}.device-page .ui-select-trigger{min-height:36px;font-size:12px;border-color:#dfe4ef}
.device-page button{min-height:34px;border:1px solid #dcdff0;border-radius:6px;padding:6px 12px;font-size:12px;font-weight:500;line-height:20px;background:#fff;color:#5c3be4;box-shadow:none}.device-page button:hover:enabled{background:#f5f1ff;border-color:#ae98ff;color:#5430dd}.device-page button:disabled{background:#f2f3f7;color:#9ba1b0;border-color:#e6e8f0}.device-page button:focus-visible{outline:2px solid #8e71fa;outline-offset:2px}.device-page button .ui-icon{width:16px;height:16px}
.device-page :is(form>button:not([type=button]),#package-upload,#package-release,#package-prepare,#package-result,#apply,#ingest-add,#upload-file):enabled{background:#603bfa;border-color:#603bfa;color:#fff}.device-page :is(form>button:not([type=button]),#package-upload,#package-release,#package-prepare,#package-result,#apply,#ingest-add,#upload-file):enabled:hover{background:#5130db;border-color:#5130db;color:#fff}
.device-page details{border:1px solid var(--page-line);border-radius:8px;background:#fff;margin:14px 0;padding:0;max-width:none!important}.device-page details>summary{padding:13px 16px;font-size:12px;color:#64718a;font-weight:500;cursor:pointer}.device-page details[open]>summary{border-bottom:1px solid var(--page-line);margin-bottom:14px;color:#603bfa}.device-page details>:not(summary){margin-left:16px;margin-right:16px}.device-page details>:last-child{margin-bottom:16px}.device-page details details{background:#fafbfe}.device-page pre{border:1px solid #e5e8f1;border-radius:6px;background:#f8f9fc;color:#52617b;padding:14px;font-size:12px;line-height:1.7;max-width:100%;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere}.device-page .warning{background:#fffbef;border:1px solid #f1dda4;border-radius:6px;color:#96691d;padding:12px;font-size:12px}
.device-page table{width:100%;border-collapse:collapse;font-size:12px}.device-page th{background:#f6f7fb;color:#7c879b;font-weight:500;font-size:11px;padding:10px 12px;text-align:left}.device-page td{border-bottom:1px solid #edf0f5;padding:12px;font-size:12px;color:#4e5b72;overflow-wrap:anywhere}.device-page tr:last-child td{border-bottom:0}.device-page .empty-state{border:1px dashed #e1e4ee;border-radius:6px;padding:22px;color:#8792a6;text-align:center}
/* Upload stages and the version library have independent, aligned cards. */
#packages .package-layout{grid-template-columns:minmax(360px,1fr) minmax(320px,.95fr);max-width:none;gap:20px;align-items:start}#packages #package-upload-form,#packages .package-stage{padding:20px!important;margin:0 0 14px;border:1px solid var(--page-line)!important;border-radius:8px;background:white}#packages .stage-heading{display:flex;align-items:center;gap:10px;margin:0 0 14px}.stage-number{display:inline-flex;align-items:center;justify-content:center;width:25px;height:25px;border-radius:50%;background:#ede8ff;color:#603bfa;font-size:12px;flex-shrink:0}#package-upload-form .stage-number{background:#603bfa;color:white}#packages .package-stage p{margin:8px 0 12px}#packages .package-layout .columns{grid-template-columns:1fr;gap:14px}#packages .package-layout input[type=file]{padding:14px!important;border:1px dashed #c7b9fa;background:#fcfbff;border-radius:7px;min-height:70px;width:100%;color:#7a8498;font-size:12px}#packages input[type=file]::file-selector-button,.device-page input[type=file]::file-selector-button{font:inherit;background:#f0ebff;color:#603bfa;border:1px solid #dcd0ff;border-radius:5px;padding:6px 10px;margin-right:12px;cursor:pointer}.device-page input[type=file]::file-selector-button:hover{background:#e5dcff}#packages .package-layout small{margin:0;font-size:11px}#packages .package-library{border:1px solid var(--page-line);padding:20px;min-height:360px;border-radius:8px}.device-page #package-preview{margin:0;background:#f8f6ff;border-radius:6px;padding:10px 12px;color:#78669e}#package-upload-form .toolbar{margin:0}#package-upload-status:empty,#package-catalog-status:empty{display:none}#packages .package-stage #package-target{font-weight:500;color:#603bfa}#package-catalog>section,#package-catalog>div{border:1px solid #e7e9f2;border-radius:7px;margin-top:10px;padding:12px;background:#fff}#package-catalog button[aria-pressed=true]{background:#eee9ff;border-color:#ad94ff;color:#603bfa}
/* Operation records, tabs and progression use the same compact card language. */
#operations .operation-record-layout{grid-template-columns:minmax(300px,1fr) minmax(360px,1.15fr);gap:20px}.device-page .operation-record-list{min-height:240px}.device-page .operation-record-detail .operation-main{border:1px solid var(--page-line);padding:18px!important;border-radius:8px}.device-page :is(.operation-tabs,.device-state-tabs){display:flex;gap:20px;margin:0 0 16px;padding:0;border-bottom:1px solid var(--page-line)}.device-page :is(.operation-tabs,.device-state-tabs) button{border:0;border-bottom:2px solid transparent;border-radius:0;background:transparent;padding:10px 3px;color:#768298;min-height:40px;font-size:12px}.device-page :is(.operation-tabs,.device-state-tabs) button[aria-selected=true]{background:transparent;color:#603bfa;border-bottom-color:#603bfa}.device-page :is(.operation-tabs,.device-state-tabs) button:hover:enabled{background:#faf8ff;color:#603bfa}.device-page .operation-help{padding:16px!important;margin-top:14px}.device-page #operation-flow{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;list-style:none;background:#faf8ff;padding:12px;margin:12px 0;border-radius:6px}.device-page #operation-flow li{font-size:11px;padding:4px 0;line-height:18px;color:#8a93a6}.device-page #operation-flow li.active{color:#603bfa;font-weight:600}.device-page .flow-guidance{font-size:12px;background:#f8f6ff;padding:12px;border:1px solid #ece6ff;border-radius:6px;margin:0 0 16px}.device-page .record-scope{font-size:11px;padding:12px 14px}.device-page #operation-list:not(:has(button)){padding:14px;color:#8994a8}.device-page #operation-list button{color:#4d5a73}.device-page #operation-list button[aria-current=true]{color:#603bfa}.device-page #operation-list-more{margin:12px}.device-page .action-group{display:flex;gap:8px;margin:14px 0}.device-page .operation-help h2{margin-bottom:8px}
/* Status panels and all expanded advanced sections retain the same form/table styling. */
#devices .resource-cards{margin:0 0 18px}.device-page .device-state-panel{padding:18px;border:1px solid var(--page-line);border-radius:8px}.device-page #device-state>p{margin:12px 0}.device-page #state-verification .columns{border:0;padding:0;background:none;grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.device-page #verification-form{grid-template-columns:repeat(2,minmax(0,1fr))}.device-page #verification-form>:is(h2,p,button,.inline){grid-column:1/-1}.device-page .device-advanced{padding:0}.device-page #component-logs{min-height:180px;background:#142034;color:#cbd7eb;border-color:#24344e}.device-page #state-logs .toolbar{align-items:end;margin-bottom:12px}.device-page #state-logs label{min-width:180px}
/* Camera form: one main path, paired credentials and a distinct confirmation card. */
#ingest .camera-layout{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:20px;margin:16px 0;align-items:start}#ingest .camera-card{padding:20px;border:1px solid var(--page-line);border-radius:8px;margin:0 0 14px;min-width:0}#ingest .camera-card h2{font-size:15px;margin-bottom:12px}#ingest .camera-card p{font-size:12px;margin:8px 0 14px}#ingest-source{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px!important;margin-top:20px}#ingest-source label:has([name=camera_name]),#ingest-source label:has([name=rtsp_url]),#ingest-source .field-help,#ingest-source button{grid-column:1/-1}#ingest-source button{justify-self:end;min-width:120px}#ingest-source .field-help{background:#f7f8fc;border-radius:6px;padding:10px 12px;margin:0}#ingest-source label:has([type=checkbox]){grid-column:1/-1}#ingest-discovery{grid-template-columns:minmax(0,1fr) max-content;gap:10px!important;margin-bottom:16px}#ingest .camera-side>.camera-card>label{margin-top:14px}#ingest .camera-side>.camera-card>button{margin-top:8px}#ingest-status{padding:10px 12px;border-radius:6px;background:#f7f8fc;font-size:12px;margin:0 0 16px}#ingest-probe-result:empty::before{content:'尚未检查连接';display:block;color:#8c96a8;font-size:12px;padding:12px;background:#f7f8fc;border-radius:6px}#ingest-probe-result{margin:0 0 16px}#ingest-add{width:100%;margin-top:10px}#ingest-policy{grid-template-columns:repeat(3,minmax(0,1fr))}
/* Terminal stays dark; file controls inherit the common light surface. */
#maintenance .maintenance-heading{margin-bottom:14px}#maintenance .maintenance-heading h1{font-size:25px}#maintenance .maintenance-terminal button{background:transparent;color:#cbd7eb;border-color:transparent}#maintenance .maintenance-terminal button:hover:enabled{background:#2b3b55;color:#fff}#maintenance .maintenance-pane-title{min-height:43px}#maintenance .maintenance-pane-title strong{font-size:13px}#maintenance .terminal-tools button{padding:4px;min-height:25px}#maintenance .maintenance-files .maintenance-pane-title{background:#fafbfe}#maintenance .file-navigation input{font-size:12px;min-height:34px}#maintenance .file-actions button{min-height:34px}#maintenance .maintenance-consoles button{border:0;background:none;color:#603bfa}#maintenance #close-maintenance{border:1px solid #f49aa3;color:#e34959;background:#fff}#maintenance #close-maintenance:hover:enabled{background:#fff4f5}#maintenance #terminal-output{color:#cbd7eb}#maintenance .maintenance-file-row button{color:#4d5a73;border:0;padding:0;font-weight:400}#maintenance .maintenance-file-row button:hover{background:#f5f1ff}#maintenance #terminal-note{color:#9cabc0}
@media(max-width:1150px){#operations .operation-record-layout{grid-template-columns:minmax(240px,.8fr) minmax(320px,1fr)}#packages .package-layout{grid-template-columns:minmax(300px,1fr) minmax(260px,.9fr)}}
@media(max-width:900px){#packages .package-layout,#operations .operation-record-layout,#ingest .camera-layout{grid-template-columns:1fr}.device-page :is(.package-heading,.operation-heading,.subpage-heading){flex-wrap:wrap}.device-page #state-verification .columns{grid-template-columns:1fr}.device-page #operation-flow{grid-template-columns:repeat(2,1fr)}.device-page .package-library{min-height:180px}#ingest-policy{grid-template-columns:1fr}body:has(#workspace>section.device-page:not([hidden]))>header{gap:8px}body:has(#workspace>section.device-page:not([hidden])) #page-context{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}}
@media(max-width:600px){#ingest-source,#ingest-discovery,.device-page #verification-form{grid-template-columns:1fr}#ingest-source>*,.device-page #verification-form>*{grid-column:1!important}.device-page :is(.operation-tabs,.device-state-tabs){gap:10px}body:has(#workspace>section.device-page:not([hidden])) #header-back{font-size:11px;padding:5px}}
/* Device metadata is edited in one bounded dialog, not nested disclosure rows. */
.device-dialog{width:min(560px,calc(100vw - 32px));max-width:calc(100vw - 32px)!important;max-height:calc(100dvh - 48px);overflow:auto;border:1px solid #e1e4ef;border-radius:12px;padding:22px;background:#fff;color:#182239;box-shadow:0 20px 70px #18223930}.device-dialog::backdrop{background:#17203355}.device-dialog .dialog-heading{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:12px}.device-dialog .dialog-heading h2{margin:0;font-size:18px}.device-dialog .dialog-heading button{font-size:22px;border:0;background:transparent;color:#8390a5;padding:0;width:30px;min-height:30px}.device-dialog .dialog-target{color:#7a68a7;background:#f7f4ff;padding:10px 12px;border-radius:6px;margin:0 0 18px}.device-dialog #inventory-form{display:grid;gap:18px}.device-dialog .toolbar{justify-content:flex-end;margin:6px 0 0;flex-wrap:wrap}.device-dialog #inventory-save:enabled{background:#603bfa;color:white;border-color:#603bfa}.device-dialog #inventory-edit-status{margin:0;font-size:11px}.device-dialog .detail-properties{display:grid;grid-template-columns:100px 1fr;gap:12px;font-size:12px}.device-dialog .detail-tabs{display:flex;gap:8px;margin-top:20px}.fleet-dialog-actions{margin-top:16px}.fleet-dialog-actions button{font-size:12px;color:#75628f;border:1px solid #e5dff2;background:#faf8ff;padding:7px 12px}.device-dialog .ui-select-popover{z-index:10}
.device-page .settings-dialog-trigger{display:inline-flex;margin:6px 10px 6px 0;align-items:center;background:#faf8ff;border-color:#e4ddfa;color:#6b50b5}.settings-dialog{width:min(720px,calc(100vw - 32px));box-sizing:border-box}.settings-dialog>form{margin:16px 0}.settings-dialog>.columns{display:grid;grid-template-columns:1fr!important;border:0!important;padding:0!important}.settings-dialog .dialog-footer{display:flex;justify-content:flex-end;margin-top:20px;padding-top:14px;border-top:1px solid #e6e9f2}.settings-dialog #ingest-policy{grid-template-columns:1fr}.settings-dialog .ui-select-popover{max-width:calc(100vw - 32px)}

.device-page label.inline{display:flex;align-items:center;gap:8px}.device-dialog .dialog-footer button{min-width:72px}
.fleet-console-entry{display:flex;align-items:center;flex-wrap:wrap;gap:12px;margin:14px 0}.fleet-console-entry button{flex:none;white-space:nowrap;display:inline-flex;align-items:center;gap:8px;background:#faf8ff;border:1px solid #c4b2ff;border-radius:6px;color:#603bfa;font-size:12px;padding:7px 12px}.fleet-console-entry .ui-icon{filter:none}.fleet-console-entry button:disabled{color:#999;background:#f5f5f7;border-color:#e5e5e9}
.deployment-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin-bottom:20px}.deployment-heading h1,.deployment-heading h2{margin-top:0}.deployment-heading p{color:#7b849b;margin:8px 0}.deployment-table{width:100%;border-collapse:collapse}.deployment-table th,.deployment-table td{padding:14px 12px;border-bottom:1px solid #e8eaf2;text-align:left;vertical-align:middle}.deployment-table input:not([type=checkbox]){min-width:160px;width:190px}.deployment-table th{font-weight:500;color:#7b849b;background:#f8f9fc}.deployment-record{padding:18px;border:1px solid #e3e6f0;border-radius:10px;margin:12px 0}.deployment-record>button{margin-left:24px}#deployment-connect,#deployment-business,#deployment-records{padding-top:22px}#deployment-scan #discovery-location,#deployment-scan>p:last-child{display:none}#deployment-scan{border:1px solid #e3e6f0;border-radius:10px;padding:20px;margin-bottom:20px}#deployment-scan form{display:flex;align-items:end;gap:16px}#deployment-scan form label{max-width:420px;flex:1}#deployment-scan pre:empty{display:none}#deployment-advanced{margin-top:28px}#deployment-settings-dialog form{padding:24px}#deployment-settings-dialog .dialog-heading{display:flex;justify-content:space-between;align-items:center}#deployment-settings-dialog .dialog-footer{display:flex;justify-content:flex-end;gap:12px;margin-top:24px}#settings>details{max-width:1000px}#deployment-business select[multiple]{min-height:190px}#bootstrap .table-scroll{max-width:100%;overflow:auto}@media(max-width:1000px){.deployment-heading{flex-direction:column}#deployment-scan form{align-items:stretch;flex-direction:column}}
#batches{padding:24px 32px}#batches>.flow-track,#batches>p:first-of-type{display:none}.bulk-panel:not(.show-advanced) .bulk-scroll th:nth-child(n+9),.bulk-panel:not(.show-advanced) .bulk-scroll td:nth-child(n+9){display:none}#discovery-network-state{white-space:normal;background:transparent;padding:0;margin:12px 0}#discovery-network-state button{margin-right:12px}#deployment-settings-dialog{max-height:90vh;overflow:auto}
#deployment-confirm-dialog form{padding:24px}#deployment-confirm-dialog ul{padding:18px 24px;background:#f8f7ff;border-radius:8px;max-height:35vh;overflow:auto}#deployment-confirm-dialog li{padding:8px 0}#deployment-confirm-dialog .dialog-footer{display:flex;justify-content:flex-end;gap:12px}
body[data-view=bootstrap] #workspace>.context,body[data-view=batches] #workspace>.context,body[data-view=settings] #workspace>.context,body[data-view=artifact-cache] #workspace>.context{display:none}
#package-delivery-progress{width:100%;height:8px;accent-color:#7046ff}

#service-log-output{background:#101828;color:#dce4f5;min-height:280px;max-height:65vh;overflow:auto;padding:18px;border-radius:8px;white-space:pre-wrap;overflow-wrap:anywhere}#fleet .detail-actions{grid-template-columns:repeat(3,minmax(0,1fr))}
/* Camera discovery: selected device expands in the list. */
#ingest .ingest-heading{display:flex;align-items:center;justify-content:space-between;gap:24px;margin:12px 0 28px}#ingest .ingest-heading h1{font-size:30px;margin:0 0 12px;color:#111b35}#ingest .ingest-heading p{color:#7b87a0;margin:10px 0}#ingest #ingest-discovery{display:block;margin:0;padding:0;border:0;background:none;width:auto}#ingest-discovery>button{background:#603bfa;color:white;border-color:#603bfa;white-space:nowrap;padding:14px 22px}#ingest-discovery>button .ui-icon{filter:brightness(0) invert(1)}#ingest-status:empty{display:none}#ingest .ingest-list{border:1px solid #e3e6f0;border-radius:10px;overflow:hidden}#ingest .ingest-list-heading,#ingest .ingest-device-row{display:grid;grid-template-columns:2fr 1.2fr 1.2fr 100px;align-items:center;gap:20px;padding:24px 28px}#ingest .ingest-list-heading{background:#f8f9fc;font-size:14px;color:#66738e}#ingest .ingest-device{border-top:1px solid #e3e6f0}#ingest .ingest-device.is-selected{background:#f6f3ff}#ingest .ingest-device-row strong{display:flex;align-items:center;gap:16px;font-weight:600}#ingest .ingest-row-status{color:#7b87a0}#ingest .ingest-device-row button{background:transparent;color:#603bfa;border-color:#ded6fb}#ingest .ingest-empty{padding:60px 24px;text-align:center;color:#7b87a0}#ingest #ingest-source{display:block;border:0;background:none;padding:0 28px 24px;margin:0;max-width:none}#ingest .ingest-fields{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:24px}#ingest .ingest-fields label{display:grid;gap:10px;font-size:14px;color:#27334b}#ingest input,#ingest select{box-sizing:border-box;width:100%;min-width:0}#ingest input[type=checkbox]{width:auto}#ingest .ingest-support{display:flex;flex-wrap:wrap;align-items:center;gap:20px;margin:24px 0}#ingest .ingest-support details{border:0;background:none;padding:0;flex:1;min-width:220px}#ingest .ingest-support summary{padding:0;font-size:14px}#ingest-manual label{display:block;margin-top:12px}#ingest .ingest-editor-footer{display:flex;align-items:center;justify-content:space-between;gap:20px;padding-top:24px;border-top:1px solid #e1dcf4}#ingest .ingest-editor-footer p{margin:0;color:#71809b}#ingest .ingest-editor-footer .toolbar{flex-shrink:0}#ingest .ingest-editor-footer button{padding:12px 20px}#ingest #ingest-add:not(:disabled){background:#603bfa;color:white;border-color:#603bfa}#ingest .ingest-manual-add{margin-top:20px;background:none;border:0;color:#603bfa}#ingest #ingest-editor[hidden]{display:none!important}#ingest .device-back{margin-bottom:18px}
@media(max-width:1000px){#ingest .ingest-fields{grid-template-columns:repeat(2,minmax(0,1fr))}#ingest .ingest-heading{align-items:flex-start;flex-direction:column}#ingest .ingest-list-heading,#ingest .ingest-device-row{grid-template-columns:1.6fr 1.2fr 1fr 70px;padding:18px 16px;gap:12px}#ingest .ingest-editor-footer{align-items:flex-start;flex-direction:column}}
@media(max-width:650px){#ingest .ingest-fields{grid-template-columns:1fr}#ingest .ingest-list-heading{display:none}#ingest .ingest-device-row{grid-template-columns:1fr auto}#ingest .ingest-device-row strong{grid-column:1/-1}#ingest #ingest-source{padding:0 16px 20px}}
#ingest{font-size:14px}#ingest input,#ingest select,#ingest button{font-size:14px}#ingest .ingest-heading p,#ingest-status{font-size:14px}#ingest #ingest-source .ingest-fields>label{grid-column:auto}#ingest .ingest-fields input,#ingest .ingest-fields select{min-height:44px}#ingest .ingest-editor-footer .toolbar{display:flex;gap:16px;align-items:center;flex-wrap:wrap}#ingest #ingest-add{width:auto;margin:0}#ingest .ingest-device-row .ui-icon{width:24px;height:24px}#ingest-status{background:none;padding:0;margin:0 0 16px;color:#7b87a0}

#ingest #ingest-discovery{display:flex;flex-wrap:wrap;align-items:flex-end;gap:12px;max-width:740px;margin:0}
#ingest #ingest-discovery label{margin:0;flex:1;min-width:230px;font-size:12px}
#ingest #ingest-discovery small{font-size:11px;color:#71809b}
#ingest #ingest-discovery button{margin:0}

#ingest .ingest-heading{align-items:stretch;flex-direction:column;gap:12px}
#ingest #ingest-discovery{max-width:none;width:100%}
#ingest #ingest-discovery .ui-select-trigger{background:white;color:#25314e;border-color:#dce1ed;padding:7px 12px}

#ingest #ingest-network-help{flex-basis:100%;margin:0}
