/* ============================================================
   VOLTPRO · 设计系统 v2
   布局：桌面左侧栏 + 顶部操作区；移动端顶栏 + 底部导航
   ============================================================ */
:root {
  /* 品牌色取自 logo 文件的渐变：深蓝 #17497A → 亮蓝 #4AA2DA */
  --brand: #1b4f8c;
  --brand-2: #2f7fc4;
  --brand-deep: #123a6b;
  --brand-sky: #4aa2da;
  --brand-soft: #eef5fb;
  --brand-line: #c3dbf0;

  --bg: #f4f6f8;
  --surface: #ffffff;
  --line: #e6eaef;
  --line-soft: #f1f4f7;

  --ink: #0f172a;
  --ink-2: #475569;
  --ink-3: #8a97a8;

  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --ok: #16a34a;
  --ok-bg: #f0fdf4;
  --warn: #d97706;
  --warn-bg: #fffbeb;

  --r-card: 14px;
  --r-ctl: 10px;
  --r-pill: 999px;

  --sh-1: 0 1px 2px rgba(15, 23, 42, .04);
  --sh-2: 0 1px 2px rgba(15, 23, 42, .04), 0 6px 20px rgba(15, 23, 42, .05);
  --sh-3: 0 12px 40px rgba(15, 23, 42, .16);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
          "Noto Sans SC", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;

  --side-w: 232px;
  --top-h: 64px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--brand); text-decoration: none; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; }
code { font-family: var(--mono); font-size: 12.5px; background: var(--line-soft); padding: 1px 5px; border-radius: 5px; }

.boot { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; gap: 12px; }
.boot-logo { font-size: 28px; font-weight: 800; color: var(--brand); }
.boot-text { color: var(--ink-3); }

/* ============================================================
   骨架：侧栏 + 主区
   ============================================================ */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--side-w);
  flex: 0 0 var(--side-w);
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.side-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 18px 18px;
}
.side-brand .bolt { font-size: 20px; }
.side-brand-txt { line-height: 1.2; min-width: 0; }
.side-brand-txt b { display: block; font-size: 15px; font-weight: 800; letter-spacing: -.2px; }
.side-brand-txt small {
  display: block; font-size: 11px; color: var(--ink-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px;
}

.nav { display: flex; flex-direction: column; gap: 2px; padding: 6px 10px; flex: 1; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--r-ctl);
  color: var(--ink-2); font-weight: 500; font-size: 13.5px;
  position: relative; transition: background .12s, color .12s;
}
.nav-item .ni { font-size: 16px; width: 18px; text-align: center; }
.nav-item:hover { background: var(--line-soft); color: var(--ink); }
.nav-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.nav-item.active::before {
  content: ''; position: absolute; left: -10px; top: 9px; bottom: 9px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--brand);
}

.side-foot { padding: 12px; border-top: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 10px; }
.side-cta { justify-content: center; }
.side-user { display: flex; align-items: center; gap: 9px; padding: 4px 2px; }
.side-user .who { line-height: 1.25; min-width: 0; flex: 1; }
.side-user .who b { display: block; font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user .who span { display: block; font-size: 11px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 12px; flex: none; user-select: none;
}
.icon-btn {
  border: 0; background: transparent; color: var(--ink-3); cursor: pointer;
  width: 30px; height: 30px; border-radius: 8px; font-size: 15px; flex: none;
}
.icon-btn:hover { background: var(--line-soft); color: var(--ink); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--top-h); flex: none;
  display: flex; align-items: center; gap: 10px;
  padding: 0 24px;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.top-brand { align-items: center; gap: 8px; font-size: 15px; font-weight: 800; letter-spacing: -.2px; }
.top-brand .bolt { font-size: 17px; }
.topbar-cta { display: inline-flex; align-items: center; gap: 6px; }
.topbar-cta .plus { font-size: 15px; line-height: 1; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 24px; flex: 1; }

/* ============================================================
   排版
   ============================================================ */
h1.page-title { font-size: 22px; font-weight: 800; letter-spacing: -.5px; margin: 0 0 18px; }
.section-title {
  font-size: 11px; font-weight: 700; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: .7px; margin: 0 0 10px;
}
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.money.big { font-size: 20px; font-weight: 800; letter-spacing: -.4px; }
.divider { height: 1px; background: var(--line-soft); margin: 16px 0; }

.row { display: flex; gap: 12px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }
.mt { margin-top: 12px; }
.mb { margin-bottom: 12px; }

.kv { display: grid; grid-template-columns: 132px 1fr; gap: 10px 14px; font-size: 13.5px; margin: 0; }
.kv dt { color: var(--ink-3); font-size: 12.5px; padding-top: 1px; }
.kv dd { margin: 0; font-weight: 500; }

/* ============================================================
   卡片
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--sh-1);
}
.card + .card { margin-top: 16px; }
.card-head {
  display: flex; align-items: center; gap: 12px;
  padding: 15px 18px; border-bottom: 1px solid var(--line-soft);
}
.card-head h2 { margin: 0; font-size: 14.5px; font-weight: 700; letter-spacing: -.1px; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }

/* ============================================================
   统计卡
   ============================================================ */
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: 12px; margin-bottom: 18px;
}
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-card); padding: 16px 18px;
  box-shadow: var(--sh-1); cursor: pointer;
  transition: transform .14s, box-shadow .14s, border-color .14s;
  position: relative; overflow: hidden;
}
.stat::after {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--line); transition: background .14s;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--sh-2); border-color: var(--line); }
.stat .n { font-size: 28px; font-weight: 800; letter-spacing: -1.2px; line-height: 1.15; }
.stat .l { color: var(--ink-3); font-size: 12.5px; margin-top: 3px; }
.stat.warn::after { background: var(--warn); }
.stat.warn .n { color: var(--warn); }
.stat.info::after { background: #2563eb; }
.stat.info .n { color: #2563eb; }
.stat.purple::after { background: #7c3aed; }
.stat.purple .n { color: #7c3aed; }
.stat.ok::after { background: var(--ok); }
.stat.ok .n { color: var(--ok); }

/* ============================================================
   表格
   ============================================================ */
.table-wrap { overflow-x: auto; border-radius: 0 0 var(--r-card) var(--r-card); }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; font-weight: 600; color: var(--ink-3); font-size: 11px;
  text-transform: uppercase; letter-spacing: .6px; padding: 11px 16px;
  background: var(--line-soft); border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr.clickable { cursor: pointer; transition: background .1s; }
.table tbody tr.clickable:hover { background: #f8fafc; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ============================================================
   徽标
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px;
  border-radius: var(--r-pill); font-size: 11.5px; font-weight: 600; white-space: nowrap;
  background: var(--line-soft); color: var(--ink-2);
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.badge.DRAFT { background: #f1f5f9; color: #475569; }
.badge.OPEN { background: var(--warn-bg); color: var(--warn); }
.badge.ACCEPTED { background: #eff6ff; color: #2563eb; }
.badge.ASSIGNED { background: #eef2ff; color: #4f46e5; }
.badge.IN_PROGRESS { background: #ecfeff; color: #0891b2; }
.badge.PENDING_QC { background: #f5f3ff; color: #7c3aed; }
.badge.COMPLETED { background: var(--ok-bg); color: var(--ok); }
.badge.CLOSED { background: #ecfdf5; color: #047857; }
.badge.CANCELLED { background: var(--danger-bg); color: var(--danger); }
.badge.PENDING { background: #f1f5f9; color: #475569; }
.badge.PAUSED { background: var(--warn-bg); color: var(--warn); }
.badge.DONE { background: var(--ok-bg); color: var(--ok); }
.badge.UNPAID { background: var(--warn-bg); color: var(--warn); }
.badge.PARTIAL { background: #eff6ff; color: #2563eb; }
.badge.PAID { background: var(--ok-bg); color: var(--ok); }
.badge.ISSUED { background: #f5f3ff; color: #7c3aed; }
.badge.NONE { background: #f1f5f9; color: var(--ink-3); }
.badge.vehicle { background: #eff6ff; color: #2563eb; }
.badge.battery { background: #ecfdf5; color: #047857; }
.badge.warranty { background: #fef3c7; color: #b45309; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--line);
  font-size: 12.5px; cursor: pointer; color: var(--ink-2); white-space: nowrap;
  transition: all .12s; font-weight: 500;
}
.chip:hover { border-color: var(--brand-line); color: var(--brand); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }

/* ============================================================
   按钮
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: var(--r-ctl);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s, transform .06s, box-shadow .12s;
}
.btn:hover { background: var(--line-soft); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(180deg, var(--brand-2), var(--brand));
  border-color: var(--brand); color: #fff;
  box-shadow: 0 1px 2px rgba(15, 118, 110, .25);
}
.btn-primary:hover { filter: brightness(1.05); background: linear-gradient(180deg, var(--brand-2), var(--brand)); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.94); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--line-soft); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { padding: 12px 22px; font-size: 14.5px; border-radius: 11px; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============================================================
   表单
   ============================================================ */
.field { margin-bottom: 15px; }
.label {
  display: block; font-weight: 600; font-size: 12.5px;
  color: var(--ink-2); margin-bottom: 6px;
}
.label .req { color: var(--danger); margin-left: 2px; }
.label .hint { font-weight: 400; color: var(--ink-3); font-size: 11.5px; margin-left: 6px; }
.input, .select, .textarea {
  width: 100%; padding: 10px 13px; border: 1px solid var(--line);
  border-radius: var(--r-ctl); background: var(--surface); color: var(--ink);
  outline: none; transition: border-color .12s, box-shadow .12s;
}
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(13, 148, 136, .14);
}
.textarea { min-height: 76px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 16px; }
.form-grid.three { grid-template-columns: repeat(3, 1fr); }
.form-grid .full { grid-column: 1 / -1; }

.seg { display: flex; gap: 10px; flex-wrap: wrap; }
.seg-opt {
  flex: 1; min-width: 130px; padding: 13px 15px;
  border: 1.5px solid var(--line); border-radius: var(--r-ctl);
  background: var(--surface); cursor: pointer; text-align: center;
  font-weight: 600; font-size: 13px; transition: all .12s;
}
.seg-opt small { display: block; font-weight: 400; color: var(--ink-3); font-size: 11px; margin-top: 3px; }
.seg-opt:hover { border-color: var(--brand-line); }
.seg-opt.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.seg-opt.active small { color: var(--brand); opacity: .8; }

.switch { display: flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.switch input { width: 16px; height: 16px; accent-color: var(--brand); flex: none; }

/* ============================================================
   照片
   ============================================================ */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.photo-tile {
  position: relative; border-radius: 10px; overflow: hidden;
  background: var(--line-soft); aspect-ratio: 4/3;
  cursor: pointer; border: 1px solid var(--line);
}
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-tile .ph-badge {
  position: absolute; left: 6px; bottom: 6px;
  background: rgba(15, 23, 42, .72); color: #fff;
  font-size: 10px; padding: 2px 6px; border-radius: 5px;
  backdrop-filter: blur(4px);
}
.photo-tile.void { opacity: .45; }
.photo-add {
  display: grid; place-items: center; gap: 4px;
  border: 1.5px dashed var(--line); border-radius: 10px;
  aspect-ratio: 4/3; cursor: pointer; color: var(--ink-3);
  font-size: 12px; background: #fcfdfd; text-align: center; transition: all .12s;
}
.photo-add:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.photo-add .plus { font-size: 22px; line-height: 1; }
.upload-hint { font-size: 12px; color: var(--ink-3); margin-top: 8px; }
.upload-hint.bad { color: var(--danger); font-weight: 700; }
.upload-hint.ok { color: var(--ok); font-weight: 700; }

/* ============================================================
   时间线
   ============================================================ */
.timeline { position: relative; padding-left: 24px; }
.timeline::before {
  content: ''; position: absolute; left: 5px; top: 8px; bottom: 8px;
  width: 2px; background: var(--line);
}
.tl-item { position: relative; padding-bottom: 18px; }
.tl-item::before {
  content: ''; position: absolute; left: -24px; top: 5px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--brand);
}
.tl-item:last-child { padding-bottom: 0; }
.tl-item .tl-time { font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tl-item .tl-title { font-weight: 600; font-size: 13px; margin-top: 1px; }
.tl-item .tl-remark { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }

/* ============================================================
   杂项
   ============================================================ */
.empty { text-align: center; padding: 52px 20px; color: var(--ink-3); }
.empty .ico {
  font-size: 30px; margin-bottom: 10px; opacity: .55;
  width: 60px; height: 60px; border-radius: 50%; background: var(--line-soft);
  display: grid; place-items: center; margin-left: auto; margin-right: auto;
}
.notice {
  padding: 12px 15px; border-radius: var(--r-ctl); font-size: 13px;
  background: var(--warn-bg); color: #92400e; border: 1px solid #fde68a;
}
.notice.danger { background: var(--danger-bg); color: #991b1b; border-color: #fecaca; }
.notice.ok { background: var(--ok-bg); color: #166534; border-color: #bbf7d0; }
.notice.info { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }

.actions-bar {
  position: sticky; bottom: 0; background: var(--surface);
  border-top: 1px solid var(--line); padding: 13px 18px;
  display: flex; gap: 8px; flex-wrap: wrap;
  margin: 16px -18px -18px; border-radius: 0 0 var(--r-card) var(--r-card);
}

/* ============================================================
   登录
   ============================================================ */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr; }
.login-side {
  background:
    radial-gradient(circle at 18% 12%, rgba(74, 162, 218, .42), transparent 58%),
    radial-gradient(circle at 82% 84%, rgba(27, 79, 140, .55), transparent 60%),
    linear-gradient(150deg, #0b2a4e, #17497a 52%, #123a6b);
  color: #fff; display: grid; place-items: center; padding: 48px;
}
.login-side-inner { max-width: 340px; }
.login-logo-lg { display: block; width: 296px; height: auto; }
.login-tag { opacity: .82; margin-top: 14px; font-size: 14px; }
.login-points { list-style: none; padding: 0; margin: 34px 0 0; display: flex; flex-direction: column; gap: 12px; }
.login-points li { font-size: 13.5px; opacity: .9; }

.login-card {
  display: flex; flex-direction: column; justify-content: center;
  padding: 48px 56px; background: var(--surface);
}
.login-logo { font-size: 22px; font-weight: 800; color: var(--brand); letter-spacing: -.5px; }
.login-sub { color: var(--ink-3); font-size: 13px; margin: 5px 0 26px; }
.demo-accounts { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.demo-accounts .t { font-size: 11px; color: var(--ink-3); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .6px; }
.demo-accounts .list { display: flex; flex-wrap: wrap; gap: 6px; }
.demo-accounts button {
  border: 1px solid var(--line); background: var(--surface); border-radius: 7px;
  padding: 5px 10px; font-size: 11.5px; cursor: pointer; color: var(--ink-2);
}
.demo-accounts button:hover { border-color: var(--brand); color: var(--brand); }
.login-lang { display: flex; gap: 6px; margin-top: 20px; }
.login-lang button {
  border: 1px solid var(--line); background: var(--surface); border-radius: 7px;
  padding: 5px 12px; font-size: 12px; color: var(--ink-3); cursor: pointer; font-weight: 600;
}
.login-lang button.active { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

/* ============================================================
   语言切换
   ============================================================ */
.lang-switch { display: flex; background: var(--line-soft); border-radius: 9px; padding: 2px; }
.lang-switch button {
  border: 0; background: transparent; padding: 5px 9px; border-radius: 7px;
  font-size: 11.5px; font-weight: 700; color: var(--ink-3); cursor: pointer; line-height: 1.4;
}
.lang-switch button.active { background: var(--surface); color: var(--brand); box-shadow: var(--sh-1); }

/* ============================================================
   模态 / Toast / 队列提示
   ============================================================ */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .5);
  z-index: 100; display: grid; place-items: center; padding: 20px;
  animation: fade .15s; backdrop-filter: blur(2px);
}
.modal-card {
  background: var(--surface); border-radius: 16px; width: 100%; max-width: 470px;
  box-shadow: var(--sh-3); max-height: 88vh; display: flex; flex-direction: column;
  animation: pop .18s;
}
.modal-card.wide { max-width: 780px; }
.modal-head {
  padding: 17px 20px; border-bottom: 1px solid var(--line-soft);
  font-weight: 700; font-size: 15px; display: flex; align-items: center;
}
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot {
  padding: 15px 20px; border-top: 1px solid var(--line-soft);
  display: flex; gap: 8px; justify-content: flex-end;
}
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(8px); } }

#toast-root { position: fixed; top: 74px; right: 22px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 11px;
  font-size: 13px; box-shadow: var(--sh-3); max-width: 380px;
  animation: slide .2s; display: flex; gap: 9px; align-items: flex-start;
}
.toast.ok { background: #065f46; }
.toast.err { background: #991b1b; }
@keyframes slide { from { opacity: 0; transform: translateX(20px); } }

.queue-chip {
  position: fixed; right: 18px; bottom: 18px; z-index: 60;
  display: flex; align-items: center; gap: 9px;
  background: #78350f; color: #fff; padding: 11px 16px; border-radius: var(--r-pill);
  font-size: 12.5px; box-shadow: var(--sh-3); max-width: calc(100% - 36px);
}
.queue-chip[hidden] { display: none; }
.queue-chip b { font-weight: 800; }

.sig-canvas {
  width: 100%; height: 180px; border: 1.5px dashed var(--line);
  border-radius: var(--r-ctl); background: #fcfdfd; touch-action: none; cursor: crosshair;
}

/* ============================================================
   移动端
   ============================================================ */
.mobile-only { display: none !important; }
.bottom-nav { display: none; }
.hide-mobile { }

@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .sidebar { display: none; }
  .main { width: 100%; }
  .topbar { padding: 0 12px; height: 56px; }
  .top-brand.mobile-only { display: flex !important; }
  .avatar.mobile-only { display: grid !important; }
  .lang-switch.mobile-only { display: flex !important; }
  .container { padding: 14px 12px 84px; max-width: none; }
  .hide-mobile { display: none !important; }
  .hide-desktop { }

  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: rgba(255, 255, 255, .97); backdrop-filter: blur(8px);
    border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
  }
  .bottom-nav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 9px 0 8px; color: var(--ink-3); font-size: 10.5px; font-weight: 600;
  }
  .bottom-nav a .i { font-size: 19px; line-height: 1; }
  .bottom-nav a.active { color: var(--brand); }

  .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat { padding: 13px 14px; }
  .stat .n { font-size: 22px; }
  .stat .l { font-size: 11.5px; }
  .card-body { padding: 14px; }
  .card-head { padding: 13px 14px; }
  h1.page-title { font-size: 19px; margin-bottom: 14px; }
  .kv { grid-template-columns: 104px 1fr; gap: 8px 10px; }
  .photo-grid { grid-template-columns: repeat(3, 1fr); gap: 7px; }
  .table th { padding: 10px 8px; }
  .table td { padding: 10px 8px; }
  .order-sub { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .table .money { font-size: 12.5px; }
  .table .badge { max-width: 132px; overflow: hidden; text-overflow: ellipsis; }
  #toast-root { top: auto; bottom: 84px; left: 12px; right: 12px; }
  .toast { max-width: none; }
  .modal-card { max-width: none; }
  .queue-chip { bottom: 76px; right: 12px; left: 12px; justify-content: center; }
  .actions-bar { margin: 14px -14px -14px; padding: 11px 14px calc(11px + env(safe-area-inset-bottom)); }
  .actions-bar .btn { flex: 1; }

  .login-wrap { grid-template-columns: 1fr; }
  .login-side { display: none; }
  .login-card { padding: 32px 22px; }
}

@media (min-width: 901px) {
  .hide-desktop { display: none !important; }
}

/* ============================================================
   安装到手机
   ============================================================ */
.install-link {
  display: flex; align-items: center; gap: 6px; width: 100%;
  border: 1px solid var(--brand-line); background: var(--brand-soft);
  color: var(--brand); border-radius: var(--r-ctl);
  padding: 8px 11px; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.install-link:hover { filter: brightness(.97); }

.install-banner {
  display: flex; align-items: center; gap: 11px;
  margin: 12px 24px 0; padding: 12px 14px;
  background: linear-gradient(180deg, #ecfdf5, #f0fdfa);
  border: 1px solid var(--brand-line); border-radius: var(--r-card);
}
.install-banner .ib-icon { font-size: 20px; flex: none; }
.install-banner .ib-txt { min-width: 0; flex: 1; line-height: 1.35; }
.install-banner .ib-txt b { display: block; font-size: 13px; }
.install-banner .ib-txt span { display: block; font-size: 11.5px; color: var(--ink-3); }
.install-banner .btn { flex: none; }
.install-banner .icon-btn { flex: none; }

@media (max-width: 900px) {
  .install-banner { margin: 10px 12px 0; padding: 11px 12px; gap: 9px; }
  .install-banner .ib-txt span { display: none; }
}

/* ============================================================
   打印 / 单据
   ============================================================ */
.pr-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.print-sheet {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 32px 36px; max-width: 840px; margin: 0 auto;
  box-shadow: var(--sh-2); color: #111;
}
.pr-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; border-bottom: 2px solid #111; padding-bottom: 12px; }
.pr-logo { font-size: 18px; font-weight: 800; letter-spacing: -.3px; }
.pr-addr { font-size: 11.5px; color: #444; line-height: 1.5; }
.pr-doc { text-align: right; white-space: nowrap; }
.pr-title { font-size: 13px; font-weight: 800; letter-spacing: 1px; }
.pr-no { font-family: var(--mono); font-size: 15px; font-weight: 700; margin-top: 3px; }
.pr-meta { font-size: 11.5px; color: #444; }
.pr-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.pr-box { border: 1px solid #ddd; border-radius: 6px; padding: 9px 11px; font-size: 12px; line-height: 1.55; }
.pr-box-title { font-size: 10px; text-transform: uppercase; letter-spacing: .6px; color: #777; margin-bottom: 3px; }
.pr-table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 12px; }
.pr-table th { background: #f3f4f6; border: 1px solid #ddd; padding: 6px 8px; text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; }
.pr-table td { border: 1px solid #e5e7eb; padding: 6px 8px; }
.pr-table .r { text-align: right; }
.pr-table tfoot td { font-weight: 600; }
.pr-total td { background: #f9fafb; font-weight: 800; font-size: 13px; }
.pr-dim { color: #777; font-size: 11px; }
.pr-section-title { margin-top: 18px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: #555; border-bottom: 1px solid #e5e7eb; padding-bottom: 4px; }
.pr-task { margin-top: 9px; }
.pr-task-title { font-size: 12px; font-weight: 600; margin-bottom: 5px; }
.pr-photos { display: flex; gap: 6px; flex-wrap: wrap; }
.pr-photo { margin: 0; width: 118px; }
.pr-photo img { width: 118px; height: 88px; object-fit: cover; border: 1px solid #ddd; border-radius: 4px; display: block; }
.pr-photo figcaption { font-size: 9px; color: #777; text-align: center; }
.pr-sign { display: flex; gap: 26px; margin-top: 30px; }
.pr-sign-item { flex: 1; text-align: center; }
.pr-sign-label { font-size: 11px; color: #555; margin-bottom: 46px; }
.pr-sign-line { border-top: 1px solid #333; }
.pr-sign-img { max-width: 220px; border: 1px solid #ddd; border-radius: 4px; background: #fff; }
.pr-note { margin-top: 14px; font-size: 12px; border: 1px dashed #ccc; padding: 7px 10px; border-radius: 6px; }
.pr-foot { margin-top: 24px; border-top: 1px solid #e5e7eb; padding-top: 8px; font-size: 10px; color: #777; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

body.printing .sidebar, body.printing .topbar, body.printing .bottom-nav { display: none !important; }
body.printing .container { max-width: none; padding: 14px; }

@media (max-width: 900px) {
  .print-sheet { padding: 18px 16px; }
  .pr-head { flex-direction: column; }
  .pr-doc { text-align: left; }
  .pr-grid2 { grid-template-columns: 1fr; }
  .pr-sign { gap: 12px; }
  .pr-sign-label { margin-bottom: 34px; }
}

@media print {
  body { background: #fff !important; }
  .no-print, .sidebar, .topbar, .bottom-nav, #toast-root { display: none !important; }
  .main, .container { padding: 0 !important; max-width: none !important; display: block !important; }
  .print-sheet { border: 0; box-shadow: none; padding: 0; max-width: none; border-radius: 0; }
  .pr-task, .pr-photo, .pr-sign { break-inside: avoid; }
  .pr-table { break-inside: auto; }
  .pr-table tr { break-inside: avoid; }
  @page { size: A4; margin: 12mm; }
  a { color: inherit; text-decoration: none; }
}

/* ============================================================
   品牌资源（由 scripts/brand-logo.mjs 从 brand/logo-source.ai 生成）
   浅色界面用 *-dark 系列（深蓝字），深色背景用 *-light 系列（反白）
   ============================================================ */
.boot-logo-img { width: 176px; height: auto; }
.login-logo { display: block; width: 178px; height: auto; margin-bottom: 6px; }
.side-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 18px 16px 14px; }
.side-brand-img { display: block; width: 134px; height: auto; }
.side-brand-txt { margin-top: 7px; }
.side-brand-txt small { max-width: 190px; }
.top-brand-img { display: block; width: 104px; height: auto; }
.pr-logo-img { width: 150px; height: auto; display: block; margin-bottom: 6px; }

