:root {
  color-scheme: light;
  --ink: #18263e;
  --muted: #536581;
  --line: #dfe6f1;
  --canvas: #f2f5fb;
  --navy: #142745;
  --blue: #2356c7;
  --blue-deep: #1743a5;
  --green: #176548;
  --green-bg: #e8f5ee;
  --amber: #875410;
  --amber-bg: #fff2d8;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: var(--ink);
  font-size: 15px;
  background: var(--canvas);
}
*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, p, dl, dd { margin: 0; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid #83a9fc; outline-offset: 3px; }
a { color: var(--blue-deep); }
[hidden] { display: none !important; }
.mono { font-family: "Cascadia Mono", Consolas, monospace; font-variant-numeric: tabular-nums; }
.frame { width: min(1160px, calc(100% - 56px)); margin-inline: auto; }
.top { background: var(--navy); color: #fff; }
.top-inner { display: flex; min-height: 66px; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 11px; }
.brand strong { font-size: 18px; white-space: nowrap; }
.brand-icon { width: 36px; height: 36px; border: 1px solid #5a82c8; border-radius: 9px; background: #28539e; display: grid; place-items: center; }
.test-badge { border: 1px solid #4b638a; border-radius: 5px; padding: 2px 6px; font-size: 11px; color: #d6e3ff; white-space: nowrap; }
.workbench-link { font-size: 13px; color: #e1eaff; text-decoration: none; }
.workbench-link:hover { text-decoration: underline; }
.printer { --icon-bg: #28539e; width: 17px; height: 10px; position: relative; border: 1.5px solid currentColor; border-radius: 3px; display: inline-block; }
.printer::before, .printer::after { content: ""; position: absolute; left: 3px; width: 9px; height: 6px; border: 1.4px solid currentColor; background: var(--icon-bg); }
.printer::before { bottom: 7px; border-radius: 2px 2px 0 0; }
.printer::after { top: 5px; border-radius: 0 0 2px 2px; }
main { padding-block: 27px 32px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 3px 10px #20375909; }
.search-card { padding: 23px 27px 20px; background: linear-gradient(110deg, #fff 27%, #eef4ff); }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
h1 { font-size: 27px; line-height: 1.35; letter-spacing: -.03em; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
.query { display: flex; gap: 10px; margin-top: 13px; max-width: 755px; align-items: start; }
.query input, .query textarea { flex: 1; min-width: 0; padding: 11px 14px; border: 1px solid #c7d4e9; border-radius: 8px; background: #fff; color: var(--ink); font-size: 16px; line-height: 1.5; }
.query textarea { resize: vertical; }
.query input::placeholder, .query textarea::placeholder { font: 14px "Microsoft YaHei UI", system-ui, sans-serif; color: var(--muted); }
.primary, .secondary { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; padding: 0 17px; border-radius: 8px; font-weight: 700; white-space: nowrap; }
.primary { border: 1px solid transparent; background: var(--blue); color: #fff; }
.primary .printer { --icon-bg: var(--blue); }
.primary:not(:disabled):hover { background: var(--blue-deep); }
.primary:disabled { background: #edf1f7; border-color: #dce4f0; color: #566881; }
.secondary { background: #fff; color: var(--blue-deep); border: 1px solid var(--line); min-height: 36px; padding-inline: 12px; font-size: 13px; }
.switch { display: flex; gap: 3px; padding: 3px; border: 1px solid #dce6f6; border-radius: 8px; background: #eaf0fc; }
.switch button { background: transparent; padding: 5px 9px; border: 1px solid transparent; border-radius: 5px; color: var(--muted); white-space: nowrap; font-size: 13px; }
.switch button[aria-pressed="true"] { background: #fff; border-color: #d6e2f4; color: var(--blue-deep); font-weight: 700; }
.sample-row { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; margin-top: 12px; color: var(--muted); font-size: 12px; }
.sample-row button { border: 1px solid #dce5f3; border-radius: 6px; padding: 4px 8px; background: #fff; color: #244c99; font-size: 12px; }
.sample-row button:hover, .secondary:hover { background: #edf3ff; }
.feedback, .receipt { margin-top: 15px; border-radius: 9px; padding: 11px 14px; font-size: 14px; line-height: 1.6; }
.feedback, .receipt.wait { background: var(--amber-bg); color: var(--amber); }
.receipt { background: var(--green-bg); color: var(--green); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 14px; }
.receipt a { font-weight: 700; }
.detail-head { margin: 22px 0 11px; }
.grid { display: grid; grid-template-columns: minmax(0, 1.63fr) minmax(300px, 1fr); gap: 15px; align-items: start; }
.order-card, .label-card, .batch { padding: 18px 20px; }
.small { color: var(--muted); font-size: 12px; }
.order-id { margin-top: 5px; display: block; font-size: 21px; overflow-wrap: anywhere; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
dt { margin-bottom: 4px; color: var(--muted); font-size: 12px; }
dd { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.items { padding-top: 14px; margin-top: 14px; border-top: 1px solid var(--line); }
.item { display: grid; grid-template-columns: minmax(106px, 142px) minmax(0, 1fr); gap: 14px; border: 1px solid var(--line); border-radius: 9px; padding: 12px; margin-top: 10px; background: #f8fafd; }
.art-button { padding: 0; overflow: hidden; border: 1px solid #d6e0eb; border-radius: 6px; background: #e9edf4; width: 100%; text-align: left; align-self: start; }
.art-button img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: contain; }
.art-button span { display: block; text-align: center; padding: 4px; font-size: 11px; color: #244c99; background: #fff; }
.art-button:hover { border-color: #8ca8e5; }
.item h3 { margin-bottom: 2px; }
.item .facts { gap: 9px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pill { display: inline-flex; align-items: center; border-radius: 6px; padding: 4px 8px; font-size: 12px; font-weight: 700; white-space: nowrap; background: #edf2ff; color: #284b8e; }
.pill.good { background: var(--green-bg); color: var(--green); }
.pill.wait { background: var(--amber-bg); color: var(--amber); }
.label-card p { line-height: 1.55; }
.ticket { display: grid; grid-template-columns: 35px minmax(0, 1fr); align-items: start; gap: 10px; border: 1px solid var(--line); border-radius: 9px; padding: 10px; margin-top: 11px; }
.pdf-icon { width: 34px; height: 39px; border: 1px solid #c7d7ef; border-radius: 5px; color: var(--blue-deep); background: #eff4ff; display: grid; place-items: center; font-size: 10px; font-weight: 750; }
.ticket a { display: inline-block; font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.ticket .small { margin-top: 4px; }
.ticket .factory-mark { color: var(--green); font-weight: 700; }
.print-one { width: 100%; margin-top: 13px; }
.label-empty { margin-top: 12px; }
.batch { margin-top: 15px; }
.batch-list { margin-top: 11px; }
.batch-row { display: grid; grid-template-columns: minmax(185px, 1fr) minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.batch-row label { display: flex; align-items: center; gap: 7px; }
.batch-row input { width: 16px; height: 16px; accent-color: var(--blue); }
.batch-row button { border: 0; padding: 3px 0; color: var(--blue-deep); background: transparent; font-size: 13px; text-decoration: underline; white-space: nowrap; }
.batch-row .order-title { color: var(--muted); font-size: 13px; }
.batch-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 11px; border-top: 1px solid var(--line); }
.mode-info { font-size: 12px; margin-top: 16px; color: var(--muted); }
dialog { max-width: min(720px, calc(100vw - 26px)); padding: 0; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); box-shadow: 0 18px 70px #13233f40; }
dialog::backdrop { background: #14274590; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 15px; }
dialog img { display: block; width: 100%; max-height: 75vh; object-fit: contain; }
@media (max-width: 760px) {
  .frame { width: calc(100% - 30px); }
  .grid { grid-template-columns: 1fr; }
  main { padding-top: 17px; }
  .search-card { padding: 16px; }
  .order-card, .label-card, .batch { padding: 15px; }
}
@media (max-width: 480px) {
  .frame { width: calc(100% - 22px); }
  .brand { gap: 6px; }
  .brand strong { font-size: 16px; }
  .brand-icon { width: 30px; height: 30px; }
  .top-inner { min-height: 54px; }
  .workbench-link { font-size: 11px; }
  h1 { font-size: 20px; }
  .switch button { font-size: 12px; padding-inline: 6px; }
  .query input { font-size: 14px; padding-inline: 8px; }
  .primary { padding-inline: 10px; }
  .item { grid-template-columns: minmax(83px, .55fr) minmax(0, 1fr); gap: 9px; }
  .item .facts { grid-template-columns: 1fr; }
  .batch-row { grid-template-columns: 1fr auto; gap: 5px 9px; }
  .batch-row .order-title { grid-row: 2; padding-left: 27px; }
  .batch-row button { grid-column: 2; grid-row: 1; }
}
