:root{font-family:Inter,"Microsoft YaHei",system-ui,sans-serif;color:#20354a;background:#f3f6fa;font-synthesis:none;--blue:#1763ba;--line:#dde5ee;--muted:#607388}
*{box-sizing:border-box}body{margin:0}a{color:var(--blue);text-decoration:none}button,input,select{font:inherit}button,.button{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:40px;padding:9px 15px;border:1px solid var(--line);border-radius:9px;background:white;color:#243d56;cursor:pointer;font-size:14px;font-weight:600}button:hover:not(:disabled),.button:hover{background:#edf4fc}button:disabled{cursor:not-allowed;opacity:.55}.primary{background:var(--blue);border-color:var(--blue);color:white}.primary:hover:not(:disabled){background:#124d91}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #56a5fa;outline-offset:3px}[hidden]{display:none!important}.boot{padding:60px;text-align:center}.shell{display:grid;grid-template-columns:218px minmax(0,1fr);min-height:100vh}.sidebar{background:white;border-right:1px solid var(--line);padding:30px 20px;display:flex;flex-direction:column;gap:42px}.brand{display:flex;align-items:center;gap:10px;color:#20354a;font-size:19px}.brand img{width:37px;height:37px}.brand b{color:var(--blue)}.brand small{display:block;font-size:11px;color:var(--muted);margin-top:6px}.sidebar nav{display:grid;gap:8px}.sidebar nav a{padding:13px 15px;border-radius:10px;color:#52677c}.sidebar nav a[aria-current]{background:#eaf2fc;color:var(--blue);font-weight:700}.sidebar-bottom{margin-top:auto;display:grid;gap:14px;font-size:13px}.sidebar-bottom small{color:var(--muted)}main{min-width:0;padding:32px clamp(20px,4vw,64px) 60px}.topbar{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:28px}.eyebrow{font-size:11px;letter-spacing:2px;color:var(--muted);margin:0 0 8px}h1{font-size:26px;margin:0}h2{font-size:18px;margin:0 0 18px}h3{font-size:15px;margin:0 0 10px}p{line-height:1.7}.top-actions,.actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.top-actions>span{font-size:13px;color:var(--muted)}.card{background:white;border:1px solid var(--line);border-radius:14px;padding:24px;margin-bottom:20px;min-width:0}.card p:last-child{margin-bottom:0}.muted,small{color:var(--muted)}.notice{background:#eaf2fc;border:1px solid #c7dbf5;color:#30577e;padding:15px 18px;border-radius:10px;margin-bottom:18px;font-size:14px;line-height:1.65;overflow-wrap:anywhere}.notice.warning{background:#fff6df;border-color:#efdda7;color:#715319}.notice.error{background:#fff1ef;border-color:#f1c5bf;color:#a33729}.notice button{margin-left:12px}.stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}.stat strong{display:block;font-size:30px;margin-top:12px}.stat span{font-size:13px;color:var(--muted)}.grid-two{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}.grid-two>.card{margin-bottom:0}.section-head{display:flex;justify-content:space-between;gap:16px;align-items:center;margin-bottom:18px}.section-head h2{margin:0}.steps{display:flex;gap:10px;flex-wrap:wrap;margin:0 0 24px;padding:0;list-style:none}.steps li{padding:9px 13px;border-radius:7px;background:#eef2f6;font-size:13px}.steps b{color:var(--blue);margin-right:7px}.field{display:grid;gap:8px;min-width:0}.field>span{font-size:13px;font-weight:600}input,select{width:100%;min-height:42px;border:1px solid #cbd6e2;border-radius:8px;padding:9px 12px;background:white;color:#20354a}input:disabled,select:disabled{background:#f2f4f7}.form-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;margin-bottom:22px}.full{grid-column:1/-1}.upload-area{border:1px dashed #a9c2dc;border-radius:12px;background:#f7faff;padding:24px;margin-bottom:20px}.upload-area input{margin-top:12px;background:white}.upload-area small{display:block;margin-top:12px}.file-list{margin:16px 0 0;padding:0;list-style:none}.file-list li{padding:12px 0;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:14px;overflow-wrap:anywhere}.file-list li:last-child{border:0}.file-list small{display:block;font-size:12px;margin-top:5px}.badge{display:inline-block;border-radius:6px;background:#edf2f7;color:#52697e;padding:4px 9px;font-size:12px;white-space:nowrap}.badge.good{background:#e7f5ed;color:#27744d}.badge.bad{background:#fceceb;color:#9e3b31}.badge.progress{background:#eaf2fc;color:#225e9b}.table-wrap{overflow-x:auto}table{border-collapse:collapse;width:100%;text-align:left;font-size:13px}th{color:var(--muted);font-size:12px;background:#f7f9fc;font-weight:500}th,td{padding:15px 12px;border-bottom:1px solid #e9eef4;vertical-align:middle}td{overflow-wrap:anywhere;max-width:320px}td small{display:block;margin-top:5px}.empty{text-align:center;padding:42px 16px;color:var(--muted)}.empty strong{display:block;color:#3b5269;margin-bottom:10px}.filters{display:flex;gap:12px;align-items:end;flex-wrap:wrap;margin-bottom:20px}.filters .field{flex:1;min-width:160px}.filters .field>span{font-size:12px}.pager{display:flex;justify-content:flex-end;align-items:center;gap:14px;margin-top:18px;font-size:13px}.facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;margin:0}.facts dt{color:var(--muted);font-size:12px;margin-bottom:6px}.facts dd{margin:0;overflow-wrap:anywhere;font-size:14px;line-height:1.6}.subtle{font-size:13px;color:var(--muted);line-height:1.7}.device-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:18px}.device-grid .card{margin-bottom:0}.device-title{display:flex;justify-content:space-between;gap:10px;margin-bottom:22px}.device-title h2{margin:0}.device-id{font-size:12px;color:var(--muted);margin-top:7px}.device-grid .actions{margin-top:20px}.progress-line{height:7px;background:#e9eef5;border-radius:5px;overflow:hidden;margin:14px 0}.progress-line i{display:block;height:100%;background:var(--blue)}dialog{border:1px solid var(--line);border-radius:16px;padding:28px;width:min(480px,calc(100vw - 32px));color:#20354a}dialog::backdrop{background:#182d4566}dialog p{white-space:pre-line;overflow-wrap:anywhere}.toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);background:#20354a;color:white;border-radius:10px;padding:13px 20px;max-width:90vw;z-index:20}.danger{color:#a33729}.loading{padding:45px;color:var(--muted);text-align:center}.form-error{color:#a33729;line-height:1.7}.tag-row{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:20px}.tag-row a{padding:10px 14px;background:#eef3f8;border-radius:8px;font-size:13px}.tag-row a[aria-current]{background:#dfeeff;font-weight:700}.device-select{max-width:500px;margin:16px 0}.route-back{display:inline-block;font-size:13px;margin-bottom:18px}
@media(max-width:900px){.shell{grid-template-columns:180px minmax(0,1fr)}.sidebar{padding:24px 14px}.brand{font-size:16px}main{padding:24px 20px}.form-grid{grid-template-columns:1fr 1fr}.grid-two{grid-template-columns:1fr}.topbar{align-items:flex-start}.top-actions>span{display:none}}
@media(max-width:600px){.shell{display:block}.sidebar{padding:16px;border-right:0;border-bottom:1px solid var(--line);gap:15px}.brand small{display:none}.sidebar nav{display:flex;justify-content:space-between;gap:4px}.sidebar nav a{padding:10px;font-size:13px}.sidebar-bottom{margin:0;font-size:12px;display:flex;justify-content:space-between}.topbar{gap:10px}.top-actions{gap:6px}.top-actions .button,.top-actions button{padding:8px 10px;font-size:12px}h1{font-size:21px}.eyebrow{font-size:10px}.card{padding:18px}.stats{gap:8px}.stats .card{padding:14px}.stat strong{font-size:24px}.form-grid,.facts{grid-template-columns:1fr}.topbar{margin-bottom:20px}.file-list li{align-items:flex-start;flex-wrap:wrap}main{padding:22px 14px 40px}.notice button{margin:8px 0 0}.steps{gap:6px}.steps li{font-size:12px;padding:8px}.filters .field{min-width:120px}th,td{min-width:95px}.section-head{flex-wrap:wrap}}

/* 用户打印工作台：约束内容宽度，保留任务页既有表单网格。 */
#printShell > main {
  width:100%;
  max-width:1320px;
  justify-self:center;
}
#printShell > .sidebar {
  position:sticky;
  top:0;
  align-self:start;
  width:218px;
  min-height:100vh;
  max-height:100vh;
  max-height:100dvh;
  overflow-y:auto;
  overflow-wrap:anywhere;
}
#printContent, #printContent > *, .topbar > div {
  min-width:0;
}
#printContent {
  overflow-wrap:anywhere;
}
.section-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:16px;
  margin-bottom:20px;
}
.section-heading h2 {
  margin:0;
  min-width:0;
}
.section-heading .button {
  flex-shrink:0;
}
.printer-grid {
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(min(100%,360px),1fr));
  gap:20px;
  align-items:start;
}
.printer-card {
  display:flex;
  flex-direction:column;
  gap:20px;
  width:100%;
  max-width:430px;
  min-width:0;
  margin:0;
  padding:22px;
  background:white;
  border:1px solid var(--line);
  border-radius:14px;
  font-size:15px;
  line-height:1.65;
  overflow-wrap:anywhere;
}
.printer-card-header {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:12px;
}
.printer-card-header > div {
  min-width:0;
}
.printer-card-header h2, .printer-card-header h3 {
  margin:0;
  font-size:18px;
  line-height:1.5;
}
.card > .printer-card-header {
  margin-bottom:20px;
}
.printer-meta {
  display:block;
  margin-top:6px;
  font-size:14px;
  line-height:1.6;
  color:var(--muted);
  overflow-wrap:anywhere;
}
.device-statuses {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:8px;
}
.device-statuses .badge {
  font-size:14px;
  padding:4px 9px;
}
.device-state {
  display:inline-flex;align-items:center;gap:8px;padding:7px 12px;
  border:1px solid transparent;border-radius:8px;font-size:15px;
  font-weight:700;line-height:1.4;white-space:normal;
}
.device-state i {width:8px;height:8px;border-radius:50%;background:currentColor;flex-shrink:0;}
.device-state-success {background:#e8f5ed;color:#17633e;border-color:#bddfc9;}
.device-state-info {background:#e9f2ff;color:#1859a1;border-color:#c3d9f5;}
.device-state-warning {background:#fff3d9;color:#775005;border-color:#ebd298;}
.device-state-danger {background:#fcecec;color:#a32c32;border-color:#eebfc1;}
.device-state-neutral {background:#edf0f4;color:#4d5b6b;border-color:#d5dce5;}
.device-state-facts {margin-top:20px;}
.current-print {
  min-width:0;
  padding:16px;
  border:1px solid #e1eaf5;
  border-radius:10px;
  background:#f7faff;
}
.current-print h3, .current-print p {
  margin:0 0 10px;
}
.current-print p:last-child {
  margin-bottom:0;
}
.current-print .progress-line {
  margin:12px 0;
}
.current-print .section-heading {
  margin-bottom:12px;
}
.current-print .section-heading h3 {
  margin:0;
}
.current-print .badge, .history-item .badge {
  font-size:14px;
}
.printer-card .subtle, .current-print .subtle, .account-grid .subtle {
  font-size:14px;
}
.card > .current-print + .device-details {
  margin-top:18px;
}
.printer-empty-current, .control-note {
  margin:0;
  color:var(--muted);
  font-size:14px;
  line-height:1.7;
}
.printer-card > .actions {
  margin-top:auto;
}
.device-details, .runtime-details {
  min-width:0;
  border-top:1px solid var(--line);
}
.device-details summary, .runtime-details summary {
  min-height:40px;
  padding:10px 0;
  cursor:pointer;
  color:var(--blue);
  font-size:14px;
  font-weight:600;
  line-height:1.6;
}
.device-details .facts {
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:16px;
  margin:8px 0 0;
}
.device-details .facts dt {
  font-size:14px;
}
.device-details .facts dd {
  font-size:14px;
}
.history-list {
  display:grid;
  gap:14px;
  min-width:0;
  margin:0;
  padding:0;
  list-style:none;
}
.history-item {
  min-width:0;
  padding:18px;
  border:1px solid var(--line);
  border-radius:10px;
  overflow-wrap:anywhere;
}
.history-item .facts {
  margin:16px 0;
}
.history-item small {
  display:block;
  margin-top:6px;
}
.history-item .badge {
  margin-top:10px;
}
.account-grid {
  display:grid;
  grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);
  gap:20px;
  align-items:stretch;
}
.account-grid > .card {
  margin:0;
  min-width:0;
  font-size:15px;
}
.account-profile .facts {
  grid-template-columns:1fr;
  gap:18px;
}
.account-profile .facts dt {
  font-size:14px;
}
.account-profile .facts dd {
  font-size:16px;
}
.account-points .stat strong {
  font-size:34px;
  line-height:1.3;
  color:var(--blue);
}
.account-points .facts {
  gap:18px;
}
.account-security {
  grid-column:1/-1;
}
.account-security p {
  margin:0 0 18px;
  max-width:64ch;
}
.account-security .actions {
  margin-top:16px;
}
dialog.password-dialog {
  width:min(500px,calc(100vw - 32px));
  max-width:calc(100vw - 32px);
  max-height:calc(100vh - 32px);
  max-height:calc(100dvh - 32px);
  padding:28px;
  overflow-y:auto;
  overscroll-behavior:contain;
}
.password-dialog h2 {
  margin:0 44px 12px 0;
  font-size:20px;
  line-height:1.5;
}
.password-dialog p {
  margin:0 0 14px;
  font-size:14px;
  line-height:1.7;
}
.password-dialog .dialog-close {
  position:absolute;
  top:16px;
  right:16px;
  width:40px;
  height:40px;
  padding:0;
  background:transparent;
  border-color:transparent;
  font-size:22px;
  font-weight:400;
}
.password-form {
  display:grid;
  grid-template-columns:minmax(0,1fr);
  gap:18px;
  min-width:0;
  margin-top:22px;
}
.password-form .field > span, .password-form .field > label {
  font-size:14px;
  font-weight:600;
}
.password-form input {
  min-width:0;
  min-height:46px;
  font-size:15px;
}
.password-form .code-row {
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:10px;
  min-width:0;
}
.password-form .code-row button {
  min-width:108px;
  min-height:46px;
  padding:9px 12px;
  white-space:nowrap;
}
.password-form .dialog-actions {
  display:flex;
  justify-content:flex-end;
  flex-wrap:wrap;
  gap:10px;
  margin-top:4px;
}
.password-form .dialog-actions button {
  min-height:44px;
  max-width:100%;
}
.password-dialog .form-error {
  margin:0;
  padding:12px 14px;
  border:1px solid #f1c5bf;
  border-radius:8px;
  background:#fff1ef;
  font-size:14px;
  overflow-wrap:anywhere;
}
.password-dialog .form-error:empty, .password-dialog .subtle:empty {
  display:none;
}
.stl-size-result { margin:8px 0 0; color:#49637a; font-size:14px; line-height:1.6; overflow-wrap:anywhere; }
.stl-size-result.stl-size-error { color:#a33b32; }
.send-blocked-reason {
  margin:0 0 24px;
  padding:14px 16px;
  border:1px solid #dde5ee;
  border-radius:8px;
  background:#f4f6f9;
  color:#20354a;
  font-size:16px;
  font-weight:600;
  line-height:1.6;
  overflow-wrap:anywhere;
}
.send-blocked-reason[hidden] { display:none; }
.send-actions {
  display:flex;
  justify-content:flex-end;
  margin-top:24px;
  padding-top:20px;
  border-top:1px solid #e5ebf2;
}
.send-actions button { min-width:160px; min-height:44px; font-size:15px; }
.send-actions button:disabled {
  color:#6b7785;
  background:#e9edf2;
  border-color:#e9edf2;
  opacity:1;
}
@media(max-width:600px) { .send-actions button { width:100%; } }

@media(max-width:900px) {
  #printShell > .sidebar { width:180px; }
  .account-grid { grid-template-columns:1fr; }
}
@media(max-width:600px) {
  #printShell > .sidebar {
    position:static;
    width:auto;
    min-height:0;
    max-height:none;
    overflow:visible;
  }
  #printShell .topbar { flex-wrap:wrap; }
  #printShell .top-actions .button, #printShell .top-actions button { font-size:14px; }
  .section-heading { gap:12px; }
  .section-heading h2 { font-size:18px; }
  .printer-grid { gap:16px; }
  .printer-card { max-width:none; padding:18px; gap:16px; }
  .device-details .facts { grid-template-columns:1fr; }
  .account-grid { gap:16px; }
  dialog.password-dialog { padding:24px 20px; }
  .password-dialog .dialog-close { top:12px; right:12px; }
  .password-form { gap:16px; }
}

/* 打印机列表：单台和多台使用相同横向信息布局，详情页保持原样。 */
.devices-workspace { min-width:0; }
.devices-toolbar { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:0 0 18px; margin-bottom:4px; }
.devices-toolbar p { margin:0; color:var(--muted); font-size:14px; }
.devices-toolbar strong { color:#20354a; font-weight:600; }
.printer-grid.printer-list { grid-template-columns:minmax(0,1fr); gap:16px; }
.printer-list-card { display:grid; grid-template-columns:minmax(220px,1fr) minmax(240px,1.4fr) 164px; align-items:center; gap:28px; max-width:none; padding:26px; border-radius:16px; box-shadow:0 3px 12px #20354a04; }
.printer-identity, .printer-task, .printer-name-row > div { min-width:0; }
.printer-name-row { display:flex; align-items:center; gap:14px; }
.printer-brand-mark { width:48px; height:48px; flex-shrink:0; padding:10px; background:#edf4fd; border:1px solid #e2ecf8; border-radius:12px; }
.printer-list-card h2 { margin:0; font-size:20px; line-height:1.5; }
.printer-list-card h2 a { color:#20354a; }
.printer-list-card h2 a:hover { color:var(--blue); }
.printer-list-card .printer-meta { margin:5px 0 0; font-size:13px; }
.printer-list-card .device-statuses { margin-top:20px; }
.printer-list-card .device-statuses .badge { font-size:13px; padding:4px 10px; border-radius:7px; }
.printer-task .current-print { padding:18px 20px; min-height:110px; background:#f6f8fb; border-color:#e8edf4; border-radius:12px; display:flex; flex-direction:column; justify-content:center; }
.printer-task .current-print > strong { overflow-wrap:anywhere; font-size:14px; }
.printer-task .current-print .button { align-self:flex-start; }
.printer-list-actions { display:flex; flex-direction:column; align-items:stretch; gap:17px; }
.printer-list-actions > .button { min-height:42px; font-size:14px; }
.printer-last-seen { margin:0; color:var(--muted); font-size:12px; line-height:1.7; text-align:center; }
.printer-last-seen span { display:block; font-variant-numeric:tabular-nums; }
@media(max-width:1200px) and (min-width:601px) {
 .printer-list-card { grid-template-columns:minmax(0,1fr) minmax(0,1.2fr); gap:22px; }
 .printer-list-actions { grid-column:1/-1; flex-direction:row; justify-content:space-between; align-items:center; border-top:1px solid #edf1f5; padding-top:18px; gap:16px; }
 .printer-list-actions > .button { min-width:140px; }
 .printer-last-seen { text-align:right; }
}
@media(max-width:600px) {
 .devices-toolbar { gap:10px; padding-bottom:16px; }
 .devices-toolbar .button { padding:9px 12px; }
 .printer-list-card { grid-template-columns:minmax(0,1fr); padding:20px; gap:18px; }
 .printer-list-card h2 { font-size:18px; }
 .printer-list-card .device-statuses { margin-top:16px; }
 .printer-task .current-print { min-height:90px; padding:16px; }
 .printer-list-actions { flex-direction:row; align-items:center; justify-content:space-between; gap:12px; border-top:1px solid #edf1f5; padding-top:16px; }
 .printer-list-actions > .button { flex-shrink:0; padding:8px 12px; font-size:13px; }
 .printer-last-seen { text-align:right; font-size:11px; }
}
