/* Reuse the formal console stylesheet; only adapt remote-only components. */
:root{--ui-font:"Microsoft YaHei UI","Microsoft YaHei","PingFang SC","Noto Sans CJK SC",sans-serif;--mono:var(--ui-font)}
html{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizeLegibility}
body{font-family:var(--ui-font);font-weight:400}
button,input,textarea,select{font-family:var(--ui-font)}
.stats strong,.nav-count,.query-usage{font-variant-numeric:tabular-nums}
.device-table .connection-data{font-family:var(--ui-font);font-weight:400;line-height:1.65}
.device-table .connection-data .meta,.device-table .account-data .meta{font-size:12px;line-height:1.65;color:#7c8982}
.device-table .tag{font-size:12px;font-weight:400}
.device-table .account-name{font-size:13px;font-weight:400}
.row{display:flex;align-items:center;gap:12px}
.compact-form select{display:block;width:100%;margin-top:4px;min-height:34px;padding:6px 9px;border:1px solid var(--line);border-radius:4px;background:white;color:var(--ink);font:inherit}
.stats>div{flex-direction:column;gap:6px;justify-content:center;text-align:center}
.stats strong{margin:0}
.stats{grid-template-columns:repeat(7,minmax(0,1fr))}
.stats span{white-space:nowrap}
.stats strong{font-size:23px;letter-spacing:0}
.sidebar .sidebar-bottom{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;min-height:74px;padding:12px 0;gap:4px}
.sidebar-status{display:flex;align-items:center;justify-content:center;gap:6px}
.sidebar-status .dot{margin:0}
.sidebar .sidebar-bottom small{margin:0;line-height:1.5}
#search-form{display:flex;flex-direction:column;min-height:0;background:white;border:1px solid var(--line);border-radius:6px}
.test-form-header,.test-form-footer{flex-shrink:0}
.test-parameters-scroll{min-height:0;flex:1;overflow:auto;scrollbar-width:none}
.test-form-footer p{margin:12px 0}
#devices{display:contents}
.device-table{grid-template-columns:28px 310px max-content 100px max-content max-content max-content minmax(max-content,1fr);column-gap:16px}
.batch-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:8px 10px;padding:10px 16px;border-top:1px solid var(--line);flex-shrink:0;min-width:0;background:white}
.batch-toolbar button{min-height:30px;padding:4px 10px;font-size:12px;flex-shrink:0}
#batch-count{color:var(--green);font-weight:500;font-variant-numeric:tabular-nums}
#batch-hint{font-size:11px;color:var(--muted);margin-left:auto;min-width:0;overflow-wrap:anywhere}
.batch-feedback{padding:10px 16px;border-top:1px solid var(--line);background:#f8faf7;font-size:12px;flex-shrink:0;min-width:0;max-height:25dvh;overflow:auto;overflow-wrap:anywhere}
.batch-feedback[hidden],.batch-feedback [hidden]{display:none}
#batch-details{margin-top:6px}#batch-details summary{cursor:pointer;color:var(--green)}
#batch-results{max-height:140px;overflow:auto;margin:8px 0 0;padding-left:22px;line-height:1.8;overflow-wrap:anywhere}
.device-table .device-select{display:flex;align-items:center;justify-content:center;min-width:28px}
.device-select input{width:16px;height:16px;margin:0;accent-color:var(--green);cursor:pointer}
.device-select input:disabled{cursor:default}
.device-select input:focus-visible{outline:2px solid var(--green);outline-offset:3px}
.device-table .identity{align-items:stretch}
.device-table .device-icon{font:500 10px var(--ui-font);width:40px;min-width:40px;height:auto;min-height:44px;letter-spacing:0;font-variant-numeric:tabular-nums}
.device-table .device-icon:after{left:16px}
.card-label{display:flex;align-items:center;gap:6px;white-space:nowrap;font:500 14px/1.5 var(--ui-font);letter-spacing:.1px}
.card-edit{display:inline-flex;align-items:center;justify-content:center;flex:0 0 20px;width:20px;height:24px;padding:0;border:0;background:transparent;color:var(--muted);opacity:0;pointer-events:none}
.card-label:hover .card-edit,.card-label:focus-within .card-edit{opacity:1;pointer-events:auto}
.card-edit svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.device-table .identity .device-ip{display:inline-flex;white-space:nowrap;word-break:normal;overflow-wrap:normal;font:11px/1.5 var(--mono);padding:1px 6px;background:#f1f5ef;border:1px solid #e6ece2;border-radius:4px;margin-top:4px;color:#768572}
.device-meta-tags{display:flex;align-items:center;gap:6px;margin-top:4px;white-space:nowrap}
.device-table .identity .device-meta-tags .device-ip{margin-top:0}
.device-version{display:inline-flex;flex-shrink:0;white-space:nowrap;font:11px/1.5 var(--mono);padding:1px 6px;background:#f1f5ef;border:1px solid #e6ece2;border-radius:4px;color:#536b50}
.device-resources{display:flex;flex-direction:column;justify-content:center;gap:2px;color:var(--muted);font-size:11px;line-height:18px;white-space:nowrap}
.resource-metric{display:grid;grid-template-columns:28px 6ch;align-items:baseline;gap:6px}
.resource-cpu,.resource-memory{color:var(--ink);font-family:Consolas,"Courier New",monospace;font-variant-numeric:tabular-nums;text-align:right}
.device-table .query-data{display:flex;align-items:center}
.device-table .query-status{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-width:76px;height:26px;padding:0 8px;border:1px solid transparent;border-radius:4px;font:400 12px/24px var(--ui-font);white-space:nowrap}
.query-status.ready{color:#35734c;background:#eef6ed;border-color:#d9e8d6}
.query-status.busy{color:#426786;background:#f2f7fb;border-color:#d8e3eb}
.query-status.paused,.query-status.offline{color:var(--muted);background:#f4f6f3;border-color:#e5eae2}
.query-status.blocked{color:var(--red);background:#fff5f3;border-color:#ecd8d3}
#cardDialog{width:400px;max-width:calc(100vw - 32px);padding:22px 24px}
#cardDialog h2{font-size:20px;margin:0 0 14px}
#cardDialog .dialog-actions{margin-top:20px}
#save-card{min-width:100px}
.device-row>.actions button{flex-basis:60px;width:60px;height:31px}
.device-row>.actions button[data-action="delete-device"]{color:var(--red);background:#fff5f3;border-color:#ecd8d3}
.device-row>.actions button[data-action="extract-cookie"]{color:#426786;background:#f2f7fb;border-color:#d8e3eb}
.device-table .device-row>.actions{flex-wrap:nowrap;gap:5px}
.device-row>.actions button[data-action="upgrade-device"]{color:#426786;background:#f2f7fb;border-color:#d8e3eb}
.device-table .account-name{white-space:nowrap}
#save-settings{margin-top:0;min-width:100px}
#settings-page .settings-workspace{display:block;min-width:0;padding:0;background:transparent;border:0;border-radius:0}
.settings-stack{width:100%;max-width:760px;display:grid;gap:16px;padding:1px}
#settings-form{display:grid;gap:16px;min-width:0}
#settings-page .settings-card{min-width:0;padding:20px;background:white;border:1px solid var(--line);border-radius:10px;overflow-wrap:anywhere}
#settings-page .settings-section-title{margin:0 0 14px;padding:0;border:0}
#settings-page .settings-card p:last-child{margin-bottom:0}
#settings-page .settings-card.session-panel{margin:0;gap:16px;flex-wrap:wrap}
#settings-page .session-panel p{flex-wrap:wrap;margin:0}
.settings-actions{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px 16px;padding:16px 0 4px;border-top:1px solid var(--line)}
.settings-actions p{margin:0;flex:1 1 160px}
.settings-actions #save-settings{flex-shrink:0;margin-left:auto;white-space:nowrap}
#settings-page .settings-switch{position:relative;display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:36px;margin:4px 0 8px;cursor:pointer;color:var(--ink)}
#settings-page .settings-switch input{position:absolute;right:0;top:50%;transform:translateY(-50%);width:40px;height:24px;margin:0;padding:0;opacity:0;cursor:pointer}
.settings-switch-track{display:block;flex:0 0 40px;width:40px;height:24px;padding:3px;border-radius:24px;background:#b3beb6;transition:background .18s;pointer-events:none}
.settings-switch-track::after{content:"";display:block;width:18px;height:18px;border-radius:50%;background:white;box-shadow:0 1px 3px #203d2226;transition:transform .18s}
.settings-switch input:checked+.settings-switch-track{background:var(--green)}
.settings-switch input:checked+.settings-switch-track::after{transform:translateX(16px)}
.settings-switch input:focus-visible+.settings-switch-track{outline:2px solid var(--green);outline-offset:3px}
@media(max-width:600px){#settings-page .settings-card{padding:16px}.settings-stack,#settings-form{gap:12px}}
.session-panel{display:flex;align-items:center;justify-content:space-between;gap:24px;padding:18px;background:#f7faf5;border:1px solid var(--line);border-radius:8px;margin-bottom:22px}
.session-panel h3{margin:0 0 8px}.session-panel p{display:flex;align-items:center;gap:8px}
.session-badge{background:#e6f1e1;color:var(--green);border-radius:4px;padding:2px 6px}
.logout-button{display:flex;align-items:center;justify-content:center;gap:7px;color:var(--red);background:white;border:1px solid #eadbd5;min-width:116px;white-space:nowrap}
.logout-button svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.secret-input{position:relative}
.compact-form .secret-input input{padding-right:46px}
#show-client-key{position:absolute;right:4px;top:50%;transform:translateY(-50%);width:34px;height:30px;display:grid;place-items:center;border:0;background:transparent;color:var(--muted);padding:0}
#show-client-key svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
#show-client-key .eye-slash{display:none}
#show-client-key[aria-pressed="true"] .eye-slash{display:block}
.device-row>.identity .meta{font-size:10px;overflow-wrap:anywhere;word-break:break-all}
.device-row .tag{white-space:nowrap}
.list-table .empty{margin:0}
#logs{flex:1;min-height:0;background:#101b15;color:#9cdbb2;padding:16px 18px;font:12px/1.9 var(--mono);overflow-wrap:anywhere}
.log-error{color:#ff9790}
#search-result{background:#101412;color:#9cdbb2;overflow:auto;white-space:pre-wrap}
#message,#enrollDialog{width:400px;max-width:calc(100vw - 32px);padding:22px 24px}
#message h2,#enrollDialog h2,#cookieDialog h2{font-size:20px;margin:0 0 14px}
#message p,#cookieDialog p{font-size:14px;line-height:1.75;white-space:pre-wrap;overflow-wrap:anywhere}
#message .dialog-actions,#enrollDialog .dialog-actions{margin-top:20px}
#message button,#enrollDialog button,#cookieDialog button,#rawDialog button{font-size:14px;min-height:36px;padding:7px 16px;white-space:nowrap}
#cookieDialog{width:480px;max-width:calc(100vw - 32px);padding:22px 24px}
#cookie,#raw{width:100%;font:13px/1.75 var(--mono);border:1px solid var(--line);border-radius:5px;padding:12px;resize:vertical}
#cookie{min-height:150px;margin-top:14px}
#cookie-types{margin:16px 0 0}
#cookie-validation{margin-top:10px;font-size:12px;min-height:36px}
#importCookie{width:100px}
#rawDialog{width:680px;max-width:calc(100vw - 32px);padding:22px 24px}
#raw{height:50dvh;margin-top:14px;background:#f5f7f3}
#extractDialog{width:580px;max-width:calc(100vw - 32px);padding:22px 24px}
#extractDialog h2{font-size:20px;margin:0 0 14px}
#extract-description{font-size:13px;line-height:1.75;color:var(--muted)}
#extracted-cookie{width:100%;height:220px;max-height:45dvh;margin:14px 0;font:13px/1.75 var(--mono);border:1px solid var(--line);border-radius:5px;padding:12px;background:#f5f7f3;resize:vertical}
#extractDialog button{font-size:14px;min-height:36px;min-width:90px;padding:7px 16px;white-space:nowrap}
#toast{inset:50% auto auto 50%;transform:translate(-50%,-50%);max-width:calc(100vw - 32px);background:#edf6ef;color:var(--ink)}
.doc-notice{margin:16px 0;font-size:13px;line-height:1.9}
.doc-table{margin:16px 0}
@media(max-width:800px){
  .stats>div{display:flex}
  .device-table{grid-template-columns:28px 310px max-content 100px max-content max-content max-content minmax(390px,1fr)}
  .device-table .device-row>.actions{position:static;width:390px;box-shadow:none}
  .device-table .table-heading>span:last-child{position:static}
  .stats{grid-template-columns:repeat(3,minmax(0,1fr));row-gap:12px}
  .runtime-log-tools{flex-wrap:wrap}
  .batch-toolbar,.batch-feedback{padding:8px}
  .batch-feedback{max-height:18dvh}
  #batch-hint{flex-basis:100%;margin-left:0}
  #devices-page footer{flex-wrap:wrap;gap:4px 8px}
}
@media(hover:none){.card-edit{opacity:1;pointer-events:auto}}
.verification-actions{display:flex;align-items:center;gap:10px;white-space:nowrap}
.verification-actions button,.verification-actions a{font-size:13px;white-space:nowrap;padding-inline:8px}
#verification-toggle{min-width:100px;min-height:34px}
#verification-toggle[aria-checked="true"]{background:#edf6ef;color:#286342;border-color:#b6d3be}
.verification-section p{font-size:12px;line-height:1.7;margin:10px 0 0}
.verification-section [hidden]{display:none}
#search-form #search,#search-form #stop-search{min-width:100px;white-space:nowrap}
