/* ==========================================================================
   设备借还登记 · 设计语言
   基调：工业资产标签。冷灰中性色 + 墨黑主操作 + 单一钴蓝强调色；
   颜色只用于表达状态（空闲 / 借出 / 逾期），不做装饰。
   圆角规则：控件 8px，容器 14px，状态胶囊全圆角。
   ========================================================================== */

:root {
  --bg: #f3f4f6;
  --surface: #fdfdfe;
  --surface-2: #f0f1f4;
  --line: #e2e4e9;
  --line-strong: #cdd1d8;
  --text: #16181d;
  --text-2: #464c58;
  --text-3: #626a78;

  --ink: #17191e;          /* 主按钮 */
  --ink-hover: #2c3038;
  --on-ink: #f7f8fa;
  --accent: #2f54eb;       /* 钴蓝：链接、焦点、选中 */
  --accent-soft: #e8edfe;

  --ok: #177245;   --ok-soft: #e4f3ea;
  --warn: #a8520a; --warn-soft: #fcefdc;
  --bad: #b42318;  --bad-soft: #fcebe9;

  --r-ctl: 8px;
  --r-box: 14px;
  --shadow: 0 1px 2px rgb(22 24 29 / .05), 0 4px 16px rgb(22 24 29 / .05);
  --shadow-pop: 0 12px 40px rgb(22 24 29 / .16);
  --ease: cubic-bezier(.16, 1, .3, 1);

  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1014;
    --surface: #161920;
    --surface-2: #1c2028;
    --line: #272c35;
    --line-strong: #353b46;
    --text: #eceef2;
    --text-2: #b6bcc7;
    --text-3: #8e96a4;
    --ink: #eceef2;
    --ink-hover: #d5d9e0;
    --on-ink: #121418;
    --accent: #8ba2ff;
    --accent-soft: #1e2542;
    --ok: #5fd08f;   --ok-soft: #13291d;
    --warn: #f0a44b; --warn-soft: #2e2213;
    --bad: #ff8a80;  --bad-soft: #341a19;
    --shadow: 0 1px 2px rgb(0 0 0 / .3);
    --shadow-pop: 0 16px 48px rgb(0 0 0 / .5);
    color-scheme: dark;
  }
}

/* ---------- 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 15px/1.6 var(--font);
  color: var(--text);
  background: var(--bg);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; line-height: 1.3; letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 650; }
h2 { font-size: 16px; font-weight: 600; }
p { margin: 0; }
.ic { flex: none; vertical-align: -.2em; }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: 0; }
.muted { color: var(--text-3); }
.small { font-size: 13px; }
.grow { flex: 1; }
.hide { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 14px;
  font: inherit; font-size: 14px; font-weight: 550; white-space: nowrap;
  border: 1px solid transparent; border-radius: var(--r-ctl);
  background: var(--ink); color: var(--on-ink);
  cursor: pointer; text-decoration: none !important;
  transition: background .15s, border-color .15s, transform .1s var(--ease);
}
.btn:hover { background: var(--ink-hover); }
.btn:active { transform: scale(.98); }
.btn-quiet { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.btn-quiet:hover { background: var(--surface-2); }
.btn-danger { background: var(--surface); color: var(--bad); border-color: var(--line-strong); }
.btn-danger:hover { background: var(--bad-soft); border-color: var(--bad); }
.btn-sm { height: 32px; padding: 0 10px; font-size: 13px; }
.btn-lg { height: 54px; font-size: 17px; font-weight: 600; border-radius: 12px; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px;
  border: 0; border-radius: var(--r-ctl); background: transparent; color: var(--text-2);
  cursor: pointer; transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

/* ---------- 表单 ---------- */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field > label, .label { font-size: 13px; font-weight: 550; color: var(--text-2); }
.hint { font-size: 12.5px; color: var(--text-3); }
.input, textarea.input, select.input {
  width: 100%; height: 40px; padding: 0 12px;
  font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-ctl);
  transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 240px; padding: 10px 12px; font-family: var(--mono); font-size: 13px; line-height: 1.7; resize: vertical; }
.input::placeholder { color: var(--text-3); opacity: .8; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input-icon { position: relative; }
.input-icon .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-icon .input { padding-left: 36px; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--text-2); }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch i { width: 34px; height: 20px; border-radius: 99px; background: var(--line-strong); position: relative; transition: background .2s; flex: none; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgb(0 0 0 / .2); transition: transform .2s var(--ease); }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(14px); }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }

input[type=checkbox].check { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

/* ---------- 状态胶囊 ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 9px; border-radius: 99px;
  font-size: 12.5px; font-weight: 550; white-space: nowrap;
  background: var(--ok-soft); color: var(--ok);
}
.pill.out { background: var(--warn-soft); color: var(--warn); }
.pill.late { background: var(--bad-soft); color: var(--bad); }
.pill.plain { background: var(--surface-2); color: var(--text-2); }

/* ---------- 容器 ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-box); box-shadow: var(--shadow); }
.panel-pad { padding: 20px; }
.panel-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.stack > * + * { margin-top: 16px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- 提示 ---------- */
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-ctl); font-size: 14px; background: var(--ok-soft); color: var(--ok); }
.notice.err { background: var(--bad-soft); color: var(--bad); }
.notice .ic { margin-top: 2px; }

.toasts { position: fixed; z-index: 30; bottom: calc(24px + env(safe-area-inset-bottom)); right: 24px; left: 24px; display: grid; justify-items: end; gap: 8px; pointer-events: none; }
.toast {
  display: flex; gap: 10px; align-items: center; max-width: 420px;
  padding: 12px 16px; border-radius: 12px; pointer-events: auto;
  background: var(--ink); color: var(--on-ink); box-shadow: var(--shadow-pop); font-size: 14px;
}
.toast.err .ic { color: #ff8a80; }
.toast.ok .ic { color: #5fd08f; }

/* ---------- 对话框 ---------- */
dialog {
  width: min(400px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: var(--r-box);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-pop);
}
dialog::backdrop { background: rgb(14 16 20 / .45); }
.dialog-body { padding: 22px 22px 8px; }
.dialog-body p { color: var(--text-2); margin-top: 6px; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 22px 20px; }
.qr-box { display: grid; justify-items: center; gap: 12px; padding: 8px 0 4px; }
.qr-box img { width: 220px; height: 220px; border-radius: 10px; background: #fff; padding: 8px; border: 1px solid var(--line); }
.linkline { display: flex; gap: 6px; width: 100%; }
.linkline .input { height: 34px; font-family: var(--mono); font-size: 12.5px; }

/* ---------- 空状态 ---------- */
.empty { display: grid; justify-items: center; gap: 10px; padding: 56px 20px; text-align: center; }
.empty .ic { color: var(--text-3); }
.empty p { color: var(--text-3); max-width: 36ch; }

/* ==========================================================================
   扫码页（手机优先）
   ========================================================================== */
.scan { max-width: 520px; margin: 0 auto; padding: 16px 16px calc(180px + env(safe-area-inset-bottom)); }


.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 22px; font-size: 14px; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }
.timeline li::after { content: ""; position: absolute; left: 7px; top: 18px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::after { display: none; }
.timeline li.open::before { background: var(--warn); }
.timeline .when { color: var(--text-3); font-size: 12.5px; }

.dock {
  position: fixed; z-index: 20; left: 0; right: 0; bottom: 0;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.dock form { max-width: 488px; margin: 0 auto; display: grid; gap: 8px; }
.dock .input { height: 46px; font-size: 16px; }
.btn-return { background: var(--warn); color: #fff; }
.btn-return:hover { background: color-mix(in srgb, var(--warn) 88%, #000); }
@media (prefers-color-scheme: dark) { .btn-return { color: #1b1206; } }

/* 扫码页：顶部状态带 + 紧凑信息区（无卡片堆叠） */
.dv-wrap { max-width: 520px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }
.dv-band { background: var(--ok-soft); --tone: var(--ok); padding: 14px 0 26px; padding-top: calc(14px + env(safe-area-inset-top)); }
.dv-band.dv-out { background: var(--warn-soft); --tone: var(--warn); }
.dv-band.dv-late { background: var(--bad-soft); --tone: var(--bad); }
.dv-band.dv-wait { background: var(--accent-soft); --tone: var(--accent); }
.dv-top { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--text-2); }
.dv-top span { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.dv-flash { display: flex; align-items: center; gap: 6px; margin-top: 14px; padding: 8px 12px; border-radius: var(--r-ctl);
  font-size: 14px; font-weight: 550; background: var(--surface); color: var(--ok); box-shadow: var(--shadow); }
.dv-flash.err { color: var(--bad); }
.dv-name { margin-top: 22px; font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.dv-code { margin-top: 4px; font-size: 14px; color: var(--text-2); }
.dv-status { display: flex; gap: 12px; align-items: center; margin-top: 22px; color: var(--tone); }
.dv-status b { display: block; font-size: 21px; line-height: 1.3; }
.dv-status span { display: block; margin-top: 2px; font-size: 14px; color: var(--text-2); }
.dv-info { padding-top: 20px; padding-bottom: 40px; }
.dv-info.has-dock { padding-bottom: calc(130px + env(safe-area-inset-bottom)); }
.dv-specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; margin: 0 0 20px; }
.dv-specs dt { font-size: 12.5px; color: var(--text-3); }
.dv-specs dd { margin: 1px 0 0; font-weight: 600; word-break: break-word; }
.dv-hist { border-top: 1px solid var(--line); }
.dv-hist summary { display: flex; align-items: center; gap: 8px; padding: 14px 0; list-style: none; cursor: pointer; font-weight: 600; color: var(--text-2); }
.dv-hist summary::-webkit-details-marker { display: none; }
.dv-hist summary .muted { font-weight: 400; font-size: 13px; }
.dv-chev { margin-left: auto; color: var(--text-3); transition: transform .2s var(--ease); }
.dv-hist[open] .dv-chev { transform: rotate(90deg); }
.dv-hist .timeline { padding-bottom: 8px; }
.dv-link { display: block; width: 100%; padding: 6px; border: 0; background: none; font: inherit; font-size: 14px; color: var(--text-3); cursor: pointer; }

/* ==========================================================================
   管理后台
   ========================================================================== */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100dvh; }
.side {
  position: sticky; top: 0; height: 100dvh;
  display: flex; flex-direction: column; gap: 4px; padding: 18px 12px;
  background: var(--surface); border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-weight: 650; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--ink); color: var(--on-ink); flex: none; }
.brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav a {
  display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px;
  border-radius: var(--r-ctl); color: var(--text-2); font-size: 14px; font-weight: 500; text-decoration: none;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.on { background: var(--surface-2); color: var(--text); font-weight: 600; }
.nav a.on .ic { color: var(--accent); }
.side .foot { margin-top: auto; }

.main { padding: 28px 32px 64px; max-width: 1280px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { color: var(--text-3); margin-top: 4px; font-size: 14px; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat {
  display: block; padding: 14px 16px; border-radius: var(--r-box);
  background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none !important;
  transition: border-color .15s, box-shadow .15s;
}
.stat:hover { border-color: var(--line-strong); }
.stat.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.stat .k { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-3); }
.stat .v { font-size: 26px; font-weight: 650; margin-top: 2px; letter-spacing: -.02em; }
.stat.s-out .v { color: var(--warn); }
.stat.s-late .v { color: var(--bad); }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar .input-icon { flex: 1; min-width: 200px; max-width: 360px; }

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
.data th {
  position: sticky; top: 0; text-align: left; font-size: 12.5px; font-weight: 550; color: var(--text-3);
  padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap;
}
.data td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.data tr:last-child td { border-bottom: 0; }
.data tbody tr { transition: background .12s; }
.data tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.data tr.sel { background: var(--accent-soft) !important; }
.data .name { font-weight: 600; color: var(--text); }
.data .sub { font-size: 12.5px; color: var(--text-3); }
.data .actions { text-align: right; }
.data .actions .row { justify-content: flex-end; gap: 2px; flex-wrap: nowrap; }
.data th:first-child, .data td:first-child { padding-right: 0; width: 1%; }
.data.plain th:first-child, .data.plain td:first-child { padding-right: 14px; width: auto; }

.selbar {
  position: fixed; z-index: 25; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 18px;
  background: var(--ink); color: var(--on-ink); border-radius: 14px; box-shadow: var(--shadow-pop);
  transform: translate(-50%, 0); transition: transform .25s var(--ease), opacity .2s;
}
.selbar.off { transform: translate(-50%, 140%); opacity: 0; pointer-events: none; }
.selbar .btn { background: var(--on-ink); color: var(--ink); }
.selbar .icon-btn { color: var(--on-ink); }
.selbar .icon-btn:hover { background: rgb(255 255 255 / .12); }

.split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.section-title { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.danger-zone { border-color: color-mix(in srgb, var(--bad) 30%, var(--line)); }

.field-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px auto auto; gap: 12px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.field-row:last-child { border-bottom: 0; }
.field-row .input { height: 36px; }

.example { width: 100%; white-space: nowrap; border-collapse: collapse; font-size: 13px; }
.example th, .example td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; }
.example th { background: var(--surface-2); font-weight: 550; }

.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.login .panel { width: min(380px, 100%); padding: 28px; }

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side {
    position: sticky; z-index: 15; height: auto; flex-direction: row; align-items: center;
    padding: 8px 12px; gap: 2px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line);
  }
  .brand { padding: 0 8px 0 0; }
  .brand span { display: none; }
  .nav { display: flex; gap: 2px; }
  .nav a { height: 34px; padding: 0 10px; white-space: nowrap; }
  .side .foot { margin: 0 0 0 auto; }
  .main { padding: 20px 16px 96px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-row { grid-template-columns: minmax(0, 1fr) 70px; }
  .field-row > :nth-child(n+3) { grid-column: auto; }
  .hide-sm { display: none !important; }
  .page-head > .grow { flex-basis: 100%; }
  .toolbar .input-icon { max-width: none; flex-basis: 100%; }
  .data td, .data th { padding-left: 10px; padding-right: 10px; }
}

/* ---------- 动效 ---------- */
@media (prefers-reduced-motion: no-preference) {
  .rise { animation: rise .45s var(--ease) both; }
  .rise-2 { animation-delay: .06s; }
  .rise-3 { animation-delay: .12s; }
  .toast { animation: toast-in .35s var(--ease) both; }
  .toast.leave { animation: toast-out .25s ease-in both; }
  dialog[open] { animation: pop .22s var(--ease); }
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }
@keyframes pop { from { opacity: 0; transform: scale(.97); } }



/* 归还点屏幕（平板 / 电脑常亮显示） */
.station { min-height: 100dvh; display: grid; grid-template-rows: auto 1fr; gap: 24px; padding: 28px clamp(16px, 4vw, 48px); max-width: 1200px; margin: 0 auto; }
.station-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.station-head h1 { margin-left: auto; font-size: clamp(22px, 3vw, 32px); }
.station-body { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 56px); align-items: center; }
.station-qr { padding: clamp(16px, 3vw, 32px); display: grid; justify-items: center; gap: 14px; }
.station-qr img { width: min(100%, 62vh); aspect-ratio: 1; background: #fff; border-radius: 12px; padding: 10px; image-rendering: pixelated; }
.station-timer { width: min(100%, 62vh); height: 4px; border-radius: 99px; overflow: hidden; }
.station-timer i { display: block; height: 100%; background: var(--accent); transform-origin: left; transition: transform .25s linear; }
.station-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px; counter-reset: s; }
.station-steps li { display: grid; grid-template-columns: 44px 1fr; column-gap: 16px; counter-increment: s; }
.station-steps li::before { content: counter(s); grid-row: span 2; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--ink); color: var(--on-ink); font-size: 20px; font-weight: 650; }
.station-steps b { font-size: clamp(18px, 2.2vw, 26px); }
.station-steps span { color: var(--text-3); font-size: clamp(14px, 1.5vw, 17px); }
@media (max-width: 760px) { .station-body { grid-template-columns: 1fr; } }

/* 页面内扫码 */
.scanner { position: fixed; inset: 0; z-index: 40; background: #000; color: #fff; }
.scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scanner-frame { position: absolute; left: 50%; top: 42%; width: min(68vw, 300px); aspect-ratio: 1; transform: translate(-50%, -50%);
  border-radius: 20px; box-shadow: 0 0 0 100vmax rgb(0 0 0 / .45); outline: 3px solid rgb(255 255 255 / .9); outline-offset: -3px; }
.scanner-close { position: absolute; top: calc(14px + env(safe-area-inset-top)); right: 14px; display: grid; place-items: center; width: 44px; height: 44px;
  border: 0; border-radius: 50%; background: rgb(0 0 0 / .45); color: #fff; cursor: pointer; }
.scanner-foot { position: absolute; left: 0; right: 0; bottom: 0; padding: 24px 20px calc(32px + env(safe-area-inset-bottom)); text-align: center; }
.scanner-foot b { font-size: 18px; }
.scanner-msg { margin-top: 6px; font-size: 14px; color: rgb(255 255 255 / .8); min-height: 1.6em; }
.scanner-msg.ok { color: #5fd08f; font-weight: 600; }
.scanner-msg.err { color: #ffb4ab; }
@media (prefers-reduced-motion: no-preference) {
  .scanner-frame { animation: frame-pulse 2s ease-in-out infinite; }
}
@keyframes frame-pulse { 50% { outline-color: rgb(255 255 255 / .55); } }
.dv-status .dv-note { display: flex; align-items: center; gap: 4px; margin-top: 6px; font-size: 13px; color: var(--text-3); }

/* 扫码详情：主卡 / 操作 / 历史三级结构。控件 8px，容器 14px。 */
.device-page { max-width: 1040px; margin: auto; padding: 0 32px 32px; --tone: var(--ok); --tone-soft: var(--ok-soft); }
.device-page.dv-out { --tone: var(--warn); --tone-soft: var(--warn-soft); }
.device-page.dv-late { --tone: var(--bad); --tone-soft: var(--bad-soft); }
.device-page.dv-wait { --tone: var(--accent); --tone-soft: var(--accent-soft); }
.device-topbar { min-height: 100px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.device-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; font-size: 16px; }
.device-brand > .ic { color: var(--accent); }
.device-topnote { color: var(--text-3); font-size: 12px; }
.device-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.device-overview { grid-column: 1 / -1; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: 0 8px 30px rgb(40 55 90 / .035); }
.device-page .dv-band { background: none; padding: 28px 32px 0; --tone: inherit; }
.device-page .dv-wrap { max-width: none; margin: 0; padding: 0; }
.device-heading { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 550; color: var(--text-3); }
.device-state { display: inline-flex; align-items: center; gap: 7px; color: var(--tone); background: var(--tone-soft); border-radius: 99px; padding: 5px 12px; font-weight: 600; }
.device-state::before { content: ""; width: 5px; height: 5px; background: currentColor; border-radius: 50%; }
.device-title-row { display: flex; align-items: center; gap: 20px; margin: 20px 0 28px; }
.device-title-row > div { min-width: 0; }
.device-emblem { display: grid; place-items: center; flex: none; width: 76px; height: 76px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); color: var(--text-2); }
.device-page .dv-name { font-size: 38px; line-height: 1.3; font-weight: 700; letter-spacing: -.04em; margin: 0; overflow-wrap: anywhere; }
.device-page .dv-code { display: flex; align-items: center; gap: 10px; color: var(--text-3); font-size: 12px; margin-top: 7px; }
.device-page .dv-code .mono { font-size: 13px; color: var(--text-2); letter-spacing: .04em; }
.device-page .dv-status { margin: 0; padding: 20px 22px; border: 1px solid color-mix(in srgb, var(--tone) 16%, transparent); border-radius: 8px; background: var(--tone-soft); gap: 14px; color: var(--tone); }
.device-page .dv-status > .ic { width: 24px; height: 24px; }
.device-page .dv-status > div { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; min-width: 0; width: 100%; }
.device-page .dv-status b { font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }
.device-page .dv-status span { font-size: 12px; margin: 0 0 0 auto; }
.device-page .dv-status .dv-note { flex-basis: 100%; margin: 0; }
.device-page .dv-info { padding: 26px 32px 28px; }
.device-section-title { display: none; }
.device-page .dv-specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; gap: 22px 32px; }
.device-page .dv-specs > div { display: flex; align-items: baseline; gap: 18px; }
.device-page .dv-specs dt { font-size: 13px; color: var(--text-3); flex: none; }
.device-page .dv-specs dd { font-size: 15px; font-weight: 550; margin: 0; }
.device-action, .device-history { min-width: 0; padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.device-action-heading { position: relative; padding-left: 48px; }
.device-action-icon { position: absolute; left: 0; top: 0; display: grid; place-items: center; height: 34px; width: 34px; background: var(--accent-soft); color: var(--accent); border-radius: 8px; }
.device-action-icon .ic { width: 19px; height: 19px; }
.device-action-heading h2 { font-size: 19px; font-weight: 650; padding-top: 2px; }
.device-action-heading p { font-size: 12px; line-height: 1.8; color: var(--text-3); margin-top: 8px; }
.device-page .dock { position: static; padding: 0; margin: 24px 0 0; background: none; border: 0; backdrop-filter: none; }
.device-page .dock form { gap: 10px; }
.device-page .dock .label { font-size: 13px; color: var(--text-2); }
.device-page .dock .input { height: 48px; font-size: 16px; background: var(--bg); border-color: var(--line); }
.device-page .dock .input:focus { border-color: var(--accent); background: var(--surface); }
.device-page .dock .hint { font-size: 11px; display: flex; align-items: center; gap: 5px; }
.device-page .dock .btn { margin-top: 8px; height: 48px; font-size: 15px; border-radius: 8px; background: var(--accent); color: #fff; }
.device-page .dock .btn:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.device-help { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 18px; }
.device-help h3 { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 550; color: var(--text-2); margin-bottom: 8px; }
.device-help p { font-size: 12px; line-height: 1.9; color: var(--text-3); }
.device-identity { display: flex; align-items: center; gap: 10px; padding: 16px 0 0; margin-top: 16px; font-size: 13px; }
.device-identity span { margin-right: auto; color: var(--text-3); }
.device-identity b { min-width: 0; overflow-wrap: anywhere; }
.device-identity .ic { color: var(--text-3); }
.device-page .dv-hist { border: 0; }
.device-page .dv-hist summary { padding: 0; min-height: 34px; font-size: 17px; color: var(--text); gap: 10px; }
.device-page .dv-hist summary > .ic:first-child { width: 19px; height: 19px; color: var(--text-3); }
.device-page .dv-hist summary .muted { font-size: 11px; padding: 2px 7px; background: var(--surface-2); border-radius: 4px; }
.device-page .dv-hist .timeline { padding: 26px 0 0; max-height: 390px; overflow: auto; }
.device-page .timeline li { padding-left: 24px; padding-bottom: 23px; font-size: 13px; overflow-wrap: anywhere; }
.device-page .timeline li:last-child { padding-bottom: 0; }
.device-page .timeline .when { margin-top: 5px; font-size: 11px; line-height: 1.9; }
.device-no-history { display: flex; align-items: center; gap: 10px; padding: 18px 0; font-size: 13px; color: var(--text-3); }
.device-footer { display: flex; justify-content: center; align-items: center; gap: 6px; padding: 28px 0 0; font-size: 11px; color: var(--text-3); }
@media (max-width: 767px) {
  .device-page { padding: 0 16px calc(24px + env(safe-area-inset-bottom)); }
  .device-topbar { min-height: 76px; padding-top: env(safe-area-inset-top); }
  .device-brand { font-size: 14px; gap: 7px; }
  .device-topnote { font-size: 10px; }
  .device-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .device-page .dv-band { padding: 20px 20px 0; }
  .device-title-row { gap: 14px; margin: 18px 0 22px; }
  .device-emblem { width: 58px; height: 58px; }
  .device-emblem .ic { width: 29px; height: 29px; }
  .device-page .dv-name { font-size: 30px; }
  .device-page .dv-status { padding: 15px; gap: 10px; }
  .device-page .dv-status > div { display: block; }
  .device-page .dv-status b { font-size: 16px; }
  .device-page .dv-status span { display: block; margin-top: 5px; font-size: 11px; }
  .device-page .dv-info { padding: 20px; }
  .device-page .dv-specs { gap: 16px; }
  .device-page .dv-specs > div { display: block; }
  .device-page .dv-specs dt { font-size: 11px; }
  .device-page .dv-specs dd { font-size: 14px; margin-top: 5px; }
  .device-action, .device-history { padding: 22px 20px; }
  .device-page .dock { margin-top: 22px; }
  .device-page .dv-hist .timeline { max-height: none; }
  .device-footer { font-size: 10px; padding-top: 24px; }
}
@media (prefers-color-scheme: dark) {
  .device-page .dock .btn { color: #111a35; }
}
@media (prefers-reduced-motion: reduce) {
  .device-page *, .device-page *::before, .device-page *::after { transition: none !important; animation: none !important; }
}
