/* ============ 设计变量 ============ */
:root {
  --ink: #0f172a;
  --ink-2: #475569;
  --ink-3: #8494a8;
  --line: #e7ebf2;
  --line-soft: #f1f4f9;
  --bg: #f4f6fb;
  --card: #ffffff;
  --brand: #2563eb;
  --brand-2: #1d4ed8;
  --brand-soft: #eef4ff;
  --accent: #2563eb;
  --accent-soft: #eff4ff;
  --ok: #0f9d6e;
  --ok-soft: #e8f7f1;
  --warn: #b8790d;
  --warn-soft: #fdf3e1;
  --danger: #dc2626;
  --danger-soft: #fdeeee;
  --radius: 13px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 6px 18px rgba(15, 23, 42, 0.04);
  --mono: "SFMono-Regular", "JetBrains Mono", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-wrap: break-word;
}

a { color: var(--brand-2); text-decoration: none; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ============ 载入 ============ */
.boot {
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.boot-logo {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: linear-gradient(145deg, #3b82f6, #1d4ed8);
  color: #fff;
  display: grid; place-items: center;
  font-size: 26px; font-weight: 700;
  letter-spacing: -1px;
  box-shadow: 0 8px 24px rgba(30, 58, 95, .25);
}
.boot-text { color: var(--ink-3); font-size: 13px; letter-spacing: 2px; }

/* ============ 登录 ============ */
.login-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 620px;
  background: var(--bg);
}
.login-art {
  position: relative;
  overflow: hidden;
  padding: 48px 54px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(150deg, #1e3a8a 0%, #2563eb 48%, #7c5cfc 100%);
  color: #fff;
}
.login-art::before,
.login-art::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, .10);
  pointer-events: none;
}
.login-art::before { width: 460px; height: 460px; right: -170px; top: -140px; }
.login-art::after { width: 320px; height: 320px; left: -120px; bottom: -120px; background: rgba(255, 255, 255, .07); }
.grid-deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .16;
  background-image:
    linear-gradient(rgba(255,255,255,.6) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.6) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(circle at 72% 42%, #000 0%, transparent 72%);
  mask-image: radial-gradient(circle at 72% 42%, #000 0%, transparent 72%);
}
.login-brand { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.login-brand .mark {
  width: 44px; height: 44px; border-radius: 12px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.22);
  backdrop-filter: blur(6px);
  display: grid; place-items: center;
  font-size: 20px; font-weight: 700;
}
.login-brand h1 { font-size: 17px; margin: 0; letter-spacing: .02em; }
.login-brand p { margin: 3px 0 0; font-size: 11px; color: rgba(255,255,255,.6); letter-spacing: 2.5px; }

.login-copy { position: relative; z-index: 1; margin: auto 0; max-width: 440px; }
.login-copy h2 {
  font-size: 35px; line-height: 1.36; margin: 0 0 16px; font-weight: 750; letter-spacing: -.01em;
}
.login-copy h2 em { font-style: normal; color: #c7d9ff; }
.login-copy p { color: rgba(255,255,255,.82); font-size: 14.5px; line-height: 1.85; margin: 0; }
.login-feats { list-style: none; margin: 30px 0 0; padding: 0; display: grid; gap: 12px; }
.login-feats li { display: flex; align-items: center; gap: 11px; font-size: 13.5px; color: rgba(255,255,255,.92); }
.login-feats .ic {
  width: 19px; height: 19px; flex: none; border-radius: 50%;
  background: rgba(255,255,255,.18); display: grid; place-items: center;
}
.login-feats .ic svg { width: 11px; height: 11px; }

.login-flow { position: relative; z-index: 1; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 18px; }
.login-flow span {
  font-size: 11.5px; padding: 5px 10px; border-radius: 100px;
  background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.14);
  color: rgba(255,255,255,.82);
}
.login-flow i { color: rgba(255,255,255,.3); font-style: normal; font-size: 11px; }
.login-aside-foot { position: relative; z-index: 1; margin: 0; font-size: 12px; color: rgba(255,255,255,.6); }

.login-panel {
  background: var(--card);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 42px 56px;
  border-left: 1px solid var(--line);
  max-height: 100vh;
  overflow-y: auto;
}
.login-head h3 { margin: 0; font-size: 24px; font-weight: 750; letter-spacing: -.01em; }
.login-head .sub { color: var(--ink-3); font-size: 13px; margin: 7px 0 24px; line-height: 1.7; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 7px; font-weight: 600; }

.input, .select, .textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  font-size: 14px;
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .14);
}
.input::placeholder { color: #b6c1cd; }
.textarea { resize: vertical; min-height: 64px; }
.input.num { text-align: right; font-variant-numeric: tabular-nums; }

.login-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.login-fields .field { margin-bottom: 18px; }
.login-panel form .btn-lg { height: 46px; font-size: 14.5px; }

.login-error {
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: 9px;
  padding: 9px 12px;
  font-size: 13px;
  margin-bottom: 14px;
  display: none;
}

/* —— 模拟账号 —— */
.demo-block {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px dashed var(--line);
}
.demo-hd { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.demo-hd .t { display: flex; flex-direction: column; gap: 2px; }
.demo-hd .t b { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.demo-hd .t span { font-size: 11.5px; color: var(--ink-3); }
.demo-hd .pwd { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.demo-hd .pwd code {
  background: var(--brand-soft); color: var(--brand); border-radius: 5px;
  padding: 1px 6px; font-family: var(--mono); font-size: 11px; font-weight: 600;
}
.demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.demo-card {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.demo-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
.demo-card:hover {
  border-color: #bcd2fb;
  box-shadow: 0 6px 18px rgba(37, 99, 235, .10);
  transform: translateY(-1px);
}
.demo-card.busy { opacity: .55; pointer-events: none; }
.demo-card .ic {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand);
}
.demo-card .ic svg { width: 17px; height: 17px; }
.demo-card .ic.boss { background: #f3f0ff; color: #6d4aff; }
.demo-card .ic.tech { background: #eef4ff; color: #2563eb; }
.demo-card .ic.stamping_manager { background: #fff4e6; color: #c2740a; }
.demo-card .ic.stamping_inspector { background: #e8f6fb; color: #0e86a8; }
.demo-card .ic.bending_manager { background: #e9f7f2; color: #0f9d6e; }
.demo-card .ic.bending_inspector { background: #eef2ff; color: #4f46e5; }
.demo-card .ic.warehouse { background: #f1f5f9; color: #475569; }
.demo-card .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.demo-card .r { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.demo-card .r b { font-size: 12.5px; font-weight: 650; color: var(--ink); white-space: nowrap; }
.demo-card .r em { font-style: normal; font-size: 11px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo-card .d { font-size: 11px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo-card .go { flex: none; color: #c4cedb; display: grid; place-items: center; transition: color .15s, transform .15s; }
.demo-card .go svg { width: 14px; height: 14px; }
.demo-card:hover .go { color: var(--brand); transform: translateX(2px); }
.demo-loading { grid-column: 1 / -1; font-size: 12px; color: var(--ink-3); padding: 10px 2px; }

.login-hint { margin-top: 18px; font-size: 11.5px; color: var(--ink-3); line-height: 1.85; }
.login-hint code { background: var(--line-soft); padding: 1px 6px; border-radius: 4px; font-family: var(--mono); font-size: 11px; color: var(--ink-2); }

@media (max-width: 1180px) {
  .login-wrap { grid-template-columns: minmax(0, 1fr) 560px; }
  .login-panel { padding: 36px 40px; }
}
@media (max-width: 900px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-panel { padding: 34px 26px 48px; max-height: none; }
}
@media (max-width: 480px) {
  .login-fields, .demo-grid { grid-template-columns: 1fr; }
}

/* ============ 布局 ============ */
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }

.sidebar {
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sb-brand {
  padding: 20px 18px 18px;
  display: flex; align-items: center; gap: 11px;
  border-bottom: 1px solid var(--line-soft);
}
.sb-brand .mark {
  width: 38px; height: 38px; border-radius: 10px; flex: none;
  background: linear-gradient(145deg, #3b82f6, #1d4ed8);
  color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 17px;
}
.sb-brand .name { font-size: 14px; font-weight: 600; line-height: 1.3; }
.sb-brand .sub { font-size: 11px; color: var(--ink-3); letter-spacing: 1px; }

.sb-role {
  margin: 14px 14px 6px;
  padding: 10px 12px;
  background: var(--brand-soft);
  border-radius: 9px;
  display: flex; align-items: center; gap: 9px;
}
.sb-role .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex: none; }
.sb-role .t { font-size: 12px; color: var(--ink-2); }
.sb-role .t b { color: var(--brand); font-weight: 600; }

.sb-nav { flex: 1; overflow-y: auto; padding: 8px 10px 16px; }
.sb-group { font-size: 10px; color: var(--ink-3); letter-spacing: 1.5px; padding: 14px 10px 6px; font-weight: 600; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px;
  border-radius: 9px;
  color: var(--ink-2);
  font-size: 13.5px;
  cursor: pointer;
  margin-bottom: 2px;
  border: none; background: none; width: 100%; text-align: left;
  transition: background .12s, color .12s;
  position: relative;
}
.nav-item svg { width: 17px; height: 17px; flex: none; opacity: .75; }
.nav-item:hover { background: var(--line-soft); color: var(--ink); }
.nav-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav-item.active svg { opacity: 1; color: var(--brand-2); }
.nav-item.active::before {
  content: ""; position: absolute; left: 0; top: 9px; bottom: 9px;
  width: 3px; border-radius: 3px; background: var(--accent);
}
.nav-item .count {
  margin-left: auto; font-size: 11px; background: var(--accent); color: #fff;
  border-radius: 20px; padding: 0 7px; min-width: 19px; text-align: center; line-height: 18px;
  font-weight: 600;
}
.nav-item.active .count { background: var(--accent); }

.sb-foot { padding: 12px 14px; border-top: 1px solid var(--line-soft); }

/* ============ 主区 ============ */
.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: 66px;
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 30;
}
.topbar h2 { font-size: 16px; margin: 0; font-weight: 600; }
.topbar .crumb { font-size: 12px; color: var(--ink-3); }
.topbar .spacer { flex: 1; }

.userbox { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; font-size: 13px; font-weight: 600;
}
.userbox .meta { line-height: 1.3; }
.userbox .meta .n { font-size: 13px; font-weight: 600; }
.userbox .meta .r { font-size: 11px; color: var(--ink-3); }

.content { padding: 22px 24px 60px; max-width: 1440px; width: 100%; }

/* ============ 卡片 ============ */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-hd {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; gap: 12px;
}
.card-hd h3 { margin: 0; font-size: 14.5px; font-weight: 600; }
.card-hd .sub { font-size: 12px; color: var(--ink-3); margin-left: 2px; }
.card-hd .spacer { flex: 1; }
.card-bd { padding: 18px; }
.card-bd.tight { padding: 0; }

.section-title {
  font-size: 13px; font-weight: 600; color: var(--ink-2);
  margin: 0 0 12px; display: flex; align-items: center; gap: 8px;
}
.section-title::before {
  content: ""; width: 3px; height: 13px; background: var(--brand); border-radius: 2px;
}

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-side { grid-template-columns: minmax(0, 1fr) 340px; }

/* ============ 统计卡 ============ */
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
}
.stat .label { font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.stat .value {
  font-size: 28px; font-weight: 650; letter-spacing: -.5px; margin-top: 8px;
  font-variant-numeric: tabular-nums;
}
.stat .value small { font-size: 13px; font-weight: 400; color: var(--ink-3); margin-left: 4px; }
.stat .foot { font-size: 11.5px; color: var(--ink-3); margin-top: 6px; }
.stat.accent .value { color: var(--accent); }
.stat.warn { border-color: #f3dcc0; background: linear-gradient(180deg, #fffdfa, #fff8ef); }
.stat.warn .value { color: var(--warn); }

/* 可点击的统计卡（老板看板库存看板 → 直达库存页面） */
.stat-link {
  display: block;
  width: 100%;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease;
}
.stat-link .foot { padding-right: 20px; }
.stat-go {
  position: absolute;
  top: 15px; right: 15px;
  width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-3);
  opacity: .45;
  transition: opacity .16s ease, color .16s ease, transform .16s ease;
}
.stat-go .ic-svg { width: 14px; height: 14px; }
.stat-link:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: 0 6px 18px -8px rgba(20, 44, 70, .22); }
.stat-link:hover .stat-go { opacity: 1; color: var(--accent); transform: translateX(2px); }
.stat-link:active { transform: translateY(0); }
.stat-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (hover: none) {
  .stat-link .stat-go { opacity: .7; }
}

/* ============ 按钮 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 15px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .14s;
  white-space: nowrap;
  line-height: 1.4;
}
.btn:hover { border-color: #cfd9e4; background: #fbfcfe; color: var(--ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: #d76a1f; border-color: #d76a1f; color: #fff; }
.btn-danger { color: var(--danger); border-color: #f0d2ce; background: #fff; }
.btn-danger:hover { background: var(--danger-soft); border-color: #e5b5ae; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--line-soft); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn-sm svg { width: 13px; height: 13px; }
.btn-block { width: 100%; }
.btn-lg { padding: 11px 20px; font-size: 14px; }

/* ============ 表格 ============ */
.table-wrap { overflow-x: auto; }
table.tb { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tb th {
  text-align: left;
  font-weight: 500;
  color: var(--ink-3);
  font-size: 11.5px;
  letter-spacing: .4px;
  padding: 10px 14px;
  background: #fafcfe;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  position: sticky; top: 0;
}
table.tb td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
table.tb tbody tr:hover { background: #fbfcfe; }
table.tb tbody tr:last-child td { border-bottom: none; }
table.tb .num { text-align: right; font-variant-numeric: tabular-nums; }
table.tb .mono { font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
table.tb .actions { display: flex; gap: 6px; justify-content: flex-end; }

.empty {
  padding: 54px 20px;
  text-align: center;
  color: var(--ink-3);
}
.empty .ic { font-size: 30px; opacity: .3; margin-bottom: 10px; }
.empty .t { font-size: 13px; }
.empty .d { font-size: 12px; color: #a9b5c2; margin-top: 4px; }

/* ============ 徽章 ============ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; padding: 2px 9px; border-radius: 20px;
  background: var(--line-soft); color: var(--ink-2);
  white-space: nowrap; font-weight: 500;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .7; }
.badge.no-dot::before { display: none; }
.badge-pending_accept { background: #eef1f5; color: #5b6b7c; }
.badge-scheduling { background: var(--warn-soft); color: var(--warn); }
.badge-stamping_inspect { background: #e8f0fb; color: #2c5b96; }
.badge-bending_assign { background: #f0ecfa; color: #6247a8; }
.badge-bending_inspect { background: #f0ecfa; color: #6247a8; }
.badge-pending_stock { background: #e4f4f4; color: #157070; }
.badge-stocking { background: var(--warn-soft); color: var(--warn); }
.badge-stocked { background: var(--ok-soft); color: var(--ok); }
.badge-ready_ship { background: #e8f4f8; color: #0f6d8c; }
.badge-shipped { background: #eaf2ea; color: #2f6b3a; }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.badge-plain { background: #f5f7fa; color: var(--ink-2); }

.tag {
  display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 5px;
  background: var(--line-soft); color: var(--ink-2);
}
.tag.mono { font-family: var(--mono); }

/* ============ 表单 ============ */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.hint { font-size: 11.5px; color: var(--ink-3); margin-top: 5px; }
.hint.warn { color: var(--warn); }

.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-soft);
  background: #fcfdff;
}
.toolbar .grow { flex: 1; }
.toolbar .input, .toolbar .select { width: auto; min-width: 130px; padding: 7px 11px; font-size: 12.5px; border-radius: 8px; }
.search-box { position: relative; }
.search-box .input { padding-left: 32px; min-width: 210px; }
.search-box svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--ink-3); }

/* ============ 老板 · 订单固定查询 ============ */
.bq-card { margin-bottom: 16px; }
.bq-bd { padding: 14px 18px 16px; }
.bq-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bq-bar .input, .bq-bar .select { font-size: 13px; padding: 9px 12px; }
.bq-bar .select { width: auto; flex: 0 0 auto; min-width: 168px; }
.bq-search { flex: 1 1 360px; min-width: 0; }
.bq-search .input { width: 100%; min-width: 0; padding: 9px 36px 9px 34px; }
.bq-clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px; padding: 0; border: none; border-radius: 6px;
  background: none; color: var(--ink-3); cursor: pointer;
  display: none; place-items: center;
}
.bq-clear svg { position: static; transform: none; width: 13px; height: 13px; }
.bq-search.has-val .bq-clear { display: grid; }
.bq-clear:hover { background: #eef2f7; color: var(--ink); }

.bq-pinwrap {
  margin-top: 12px; padding: 10px 12px;
  background: #f7f9fd; border: 1px dashed #d8e2f2; border-radius: 10px;
}
.bq-pin-hd { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); margin-bottom: 8px; }
.bq-pin-hd > svg { width: 13px; height: 13px; color: var(--brand); }
.bq-count { color: var(--ink-3); }
.bq-link { border: none; background: none; color: var(--ink-3); font-size: 12px; cursor: pointer; padding: 2px 4px; border-radius: 5px; }
.bq-link:hover { color: var(--danger); background: #fff; }
.bq-pins { display: flex; flex-wrap: wrap; gap: 8px; }
.bq-chip {
  display: flex; align-items: center; gap: 7px;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 8px 6px 10px; cursor: pointer; font-size: 12.5px; max-width: 100%;
}
.bq-chip:hover { border-color: var(--brand); box-shadow: 0 2px 8px rgba(37, 99, 235, .12); }
.bq-chip-no { font-weight: 650; }
.bq-chip-sub { color: var(--ink-3); font-size: 12px; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bq-chip-x {
  width: 20px; height: 20px; flex: none; padding: 0; border: none; border-radius: 5px;
  background: none; color: var(--ink-3); cursor: pointer; display: grid; place-items: center;
}
.bq-chip-x svg { width: 11px; height: 11px; }
.bq-chip-x:hover { background: #fdecec; color: var(--danger); }

.bq-list { margin-top: 12px; }
.bq-result-hd { font-size: 12px; color: var(--ink-3); padding: 2px 2px 8px; }
.bq-result-hd b { color: var(--brand); }
.bq-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; margin-bottom: 8px;
  background: #fff; border: 1px solid var(--line-soft); border-radius: 10px;
  cursor: pointer; transition: border-color .15s, box-shadow .15s, background .15s;
}
.bq-item:last-child { margin-bottom: 0; }
.bq-item:hover { border-color: #cfdcf3; box-shadow: 0 2px 10px rgba(16, 32, 56, .07); }
.bq-item.is-pin { background: #f6f9ff; border-color: #d6e4ff; }
.bq-body { flex: 1; min-width: 0; }
.bq-line1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bq-no { font-size: 13.5px; }
.bq-qty { font-size: 12px; color: var(--ink-3); }
.bq-line2 { font-size: 12px; color: var(--ink-3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bq-arrow { color: var(--ink-3); display: flex; }
.bq-arrow svg { width: 14px; height: 14px; }
.bq-pin {
  width: 30px; height: 30px; flex: none; padding: 0;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
  color: var(--ink-3); cursor: pointer; display: grid; place-items: center;
}
.bq-pin svg { width: 14px; height: 14px; }
.bq-pin:hover { border-color: var(--brand); color: var(--brand); }
.bq-pin.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.bq-pin-mini { padding: 5px 7px; }
.bq-pin-mini svg { width: 13px; height: 13px; }
.bq-pin-mini.on { color: var(--brand); border-color: #b9cff7; background: #eff4ff; }
.btn.on { color: var(--brand); border-color: #b9cff7; background: #eff4ff; }

.bq-empty { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 28px 12px; color: var(--ink-3); }
.bq-empty > svg { width: 20px; height: 20px; }
.bq-empty-t { font-size: 13px; color: var(--ink-2); }
.bq-empty-d { font-size: 12px; margin-top: 2px; }

/* ============ 订单流转步骤 ============ */
.flow {
  display: flex; align-items: center; gap: 0; flex-wrap: wrap;
  padding: 14px 18px; background: #fbfcfe; border-bottom: 1px solid var(--line-soft);
}
.flow .step {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--ink-3);
}
.flow .step .n {
  width: 19px; height: 19px; border-radius: 50%;
  background: #eef2f7; color: var(--ink-3);
  display: grid; place-items: center; font-size: 11px; font-weight: 600;
}
.flow .step.done .n { background: var(--ok); color: #fff; }
.flow .step.done { color: var(--ok); }
.flow .step.now .n { background: var(--accent); color: #fff; box-shadow: 0 0 0 3px var(--accent-soft); }
.flow .step.now { color: var(--accent); font-weight: 600; }
.flow .arrow { width: 22px; height: 1px; background: #dde5ee; margin: 0 8px; }

/* ============ 弹窗 ============ */
.modal-mask {
  position: fixed; inset: 0; background: rgba(16, 28, 44, .42);
  backdrop-filter: blur(2px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 6vh 20px 40px;
  z-index: 200;
  overflow-y: auto;
  animation: fade .16s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 560px;
  box-shadow: 0 24px 60px rgba(10, 22, 40, .22);
  animation: rise .18s ease;
  overflow: hidden;
}
.modal.wide { max-width: 860px; }
.modal.xwide { max-width: 1080px; }
@keyframes rise { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-hd {
  padding: 17px 20px; border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; gap: 10px;
}
.modal-hd h3 { margin: 0; font-size: 15px; font-weight: 600; }
.modal-hd .close {
  margin-left: auto; border: none; background: none; cursor: pointer;
  color: var(--ink-3); font-size: 22px; line-height: 1; padding: 0 4px; border-radius: 6px;
}
.modal-hd .close:hover { color: var(--ink); background: var(--line-soft); }
.modal-bd { padding: 20px; max-height: 68vh; overflow-y: auto; }
.modal-ft {
  padding: 14px 20px; border-top: 1px solid var(--line-soft);
  display: flex; gap: 10px; justify-content: flex-end; background: #fcfdff;
}
.modal-ft .left { margin-right: auto; }

/* ============ 提示 ============ */
#toast-root { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 400; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: #fff; border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 16px;
  box-shadow: 0 8px 28px rgba(16,32,56,.14);
  font-size: 13px; display: flex; align-items: center; gap: 8px;
  animation: toastIn .2s ease;
  max-width: 480px;
}
@keyframes toastIn { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast.ok { border-color: #cfe8dd; }
.toast.ok .ic { color: var(--ok); }
.toast.err { border-color: #f0d2ce; }
.toast.err .ic { color: var(--danger); }
.toast .ic { font-weight: 700; }

/* ---- 图标默认尺寸与特例 ---- */
.ic-svg { width: 16px; height: 16px; flex: none; display: inline-block; vertical-align: -2px; }
.stat .label .ic-svg { width: 14px; height: 14px; opacity: .65; }
.empty .ic .ic-svg { width: 36px; height: 36px; }
.photo-box .ic .ic-svg { width: 22px; height: 22px; }
.alert-strip > .ic-svg { width: 17px; height: 17px; }
.section-title .ic-svg { width: 14px; height: 14px; }
.card-hd .ic-svg { width: 16px; height: 16px; }
table.tb .ic-svg { width: 13px; height: 13px; }

/* ============ 其他 ============ */
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--ink-3); font-size: 12px; }
.kv dd { margin: 0; }

.divider { height: 1px; background: var(--line-soft); margin: 16px 0; }

.photo-thumb {
  width: 46px; height: 46px; border-radius: 7px; object-fit: cover;
  border: 1px solid var(--line); cursor: zoom-in; display: block; background: #f4f7fa;
}
.photo-box {
  width: 100%; min-height: 110px; border: 1.5px dashed #d3dde8; border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  color: var(--ink-3); font-size: 12px; cursor: pointer; background: #fafcfe; padding: 12px;
  transition: border-color .15s, background .15s;
}
.photo-box:hover { border-color: var(--brand-2); background: #f7fafd; }
.photo-box img { max-height: 150px; border-radius: 8px; }
.photo-box .ic { font-size: 20px; opacity: .5; }

.chip-row { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
  font-size: 12px; padding: 5px 11px; border-radius: 20px;
  border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--ink-2);
  transition: all .12s;
}
.chip:hover { border-color: #cdd8e3; }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }

.seg {
  display: inline-flex; background: #eef2f7; border-radius: 8px; padding: 3px; gap: 2px;
}
.seg button {
  border: none; background: none; padding: 5px 13px; border-radius: 6px;
  font-size: 12.5px; color: var(--ink-2); cursor: pointer;
}
.seg button.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(16,32,56,.1); }

.bar {
  height: 6px; background: #eef2f7; border-radius: 10px; overflow: hidden;
}
.bar > i { display: block; height: 100%; background: var(--brand-2); border-radius: 10px; }
.bar > i.ok { background: var(--ok); }
.bar > i.warn { background: var(--warn); }

.pill-num {
  font-variant-numeric: tabular-nums; font-weight: 600;
}
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.flex { display: flex; align-items: center; gap: 8px; }
.flex-wrap { flex-wrap: wrap; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; } .mb16 { margin-bottom: 16px; }
.gap6 { gap: 6px; } .gap12 { gap: 12px; } .gap16 { gap: 16px; }

.line-row {
  display: grid;
  grid-template-columns: 122px 84px 96px 78px 58px 66px minmax(120px, 1fr) 34px;
  gap: 8px;
  align-items: start;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}
.line-row .input, .line-row .select { padding: 7px 10px; font-size: 12.5px; }
.line-head {
  font-size: 11px; color: var(--ink-3); letter-spacing: .3px;
  padding-bottom: 4px; border-bottom: 1px solid var(--line);
}

.hscroll { overflow-x: auto; }

.alert-strip {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(90deg, #fff8ef, #fffdfa);
  border: 1px solid #f3dcc0;
  border-radius: 10px;
  padding: 11px 15px;
  font-size: 13px;
  color: #8a5a07;
  margin-bottom: 16px;
}
.alert-strip .ic { color: var(--warn); font-size: 15px; }

@media (max-width: 1080px) {
  .grid-side { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .login-wrap { grid-template-columns: 1fr; }
  .login-art { display: none; }
}

/* ============ 手机端抽屉（默认隐藏） ============ */
.login-mbrand { display: none; }
.note-cols { columns: 2; column-gap: 40px; }
@keyframes toastDown { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

.nav-toggle {
  display: none;
  width: 38px; height: 38px; flex: none;
  align-items: center; justify-content: center;
  padding: 0; cursor: pointer;
  border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink-2);
  -webkit-tap-highlight-color: transparent;
}
.nav-toggle:active { background: var(--line-soft); }
.nav-toggle svg { width: 20px; height: 20px; }
.sb-close {
  display: none;
  margin-left: auto; width: 30px; height: 30px; flex: none;
  align-items: center; justify-content: center; padding: 0;
  border: none; border-radius: 8px; background: transparent;
  color: var(--ink-3); cursor: pointer;
}
.sb-close svg { width: 16px; height: 16px; }
.sb-close:active { background: var(--line-soft); }
.nav-scrim {
  position: fixed; inset: 0; z-index: 110;
  background: rgba(16, 28, 44, .44);
  opacity: 0; visibility: hidden;
  transition: opacity .22s ease, visibility .22s ease;
}

/* ============ 平板/手机 ============ */
@media (max-width: 780px) {
  /* —— 布局：侧栏改抽屉 —— */
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: 274px; max-width: 84vw; height: 100%;
    z-index: 120;
    transform: translateX(-100%);
    transition: transform .26s cubic-bezier(.32, .72, 0, 1);
    box-shadow: 0 24px 64px rgba(10, 22, 40, .26);
    overscroll-behavior: contain;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .shell.nav-open .sidebar { transform: none; }
  .shell.nav-open .nav-scrim { opacity: 1; visibility: visible; }
  .nav-toggle { display: inline-flex; }
  .sb-close { display: inline-flex; }
  .sb-nav { display: block; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .sb-group { display: block; }
  .sb-foot { display: block; }
  .nav-item { min-height: 44px; white-space: normal; }
  .nav-item:active { background: var(--brand-soft); }

  /* —— 顶栏 —— */
  .topbar {
    height: 56px; padding: 0 12px; gap: 10px;
    background: #fff; backdrop-filter: none;
    box-shadow: 0 1px 0 rgba(15, 23, 42, .05);
  }
  .topbar h2 {
    font-size: 15.5px; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .userbox .meta { display: none; }
  .avatar { width: 30px; height: 30px; font-size: 12px; }

  /* —— 内容区 —— */
  .content { padding: 14px 12px calc(76px + env(safe-area-inset-bottom)); }
  .card { border-radius: 12px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
  .card-hd { padding: 13px 14px; flex-wrap: wrap; gap: 8px; }
  .card-hd h3 { font-size: 14px; }
  .card-bd { padding: 14px; }
  .grid { gap: 12px; grid-template-columns: 1fr !important; }
  .grid-2, .grid-3, .grid-side, .form-grid { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

  .stat { padding: 13px 14px; border-radius: 12px; }
  .stat .value { font-size: 23px; margin-top: 6px; }
  .stat .label { font-size: 11.5px; }

  /* —— 表单：16px 防 iOS 自动放大 —— */
  .input, .select, .textarea { font-size: 16px; padding: 11px 12px; border-radius: 10px; }
  /* 任何输入控件都不得把页面撑宽（含内联 min-width） */
  .content .input, .content .select, .content .textarea,
  .modal .input, .modal .select, .modal .textarea {
    min-width: 0 !important; max-width: 100%;
  }
  .field, .form-grid > *, .grid > *, .toolbar > * { min-width: 0; }
  .field label { font-size: 12.5px; }
  .textarea { min-height: 76px; }
  .line-row .input, .line-row .select { font-size: 16px; padding: 10px 11px; }

  .btn { padding: 10px 15px; font-size: 13.5px; min-height: 40px; }
  .btn-sm { padding: 7px 11px; font-size: 12.5px; min-height: 34px; }
  .btn-lg { padding: 12px 20px; font-size: 15px; min-height: 46px; }

  /* —— 工具条：两列网格，铺满屏宽 —— */
  .toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    padding: 10px 12px; gap: 8px;
  }
  .toolbar > * { min-width: 0; }
  .toolbar .input, .toolbar .select {
    font-size: 16px; padding: 9px 11px;
    width: 100%; min-width: 0 !important;
  }
  .toolbar .grow { display: none; }
  .toolbar .search-box { grid-column: 1 / -1; }
  .toolbar .select { grid-column: 1 / -1; }
  .toolbar .grow-input { grid-column: 1 / -1; }
  .toolbar .date-range {
    grid-column: 1 / -1;
    display: flex; align-items: center; gap: 8px;
  }
  .toolbar .date-range .input { flex: 1 1 0; }
  .toolbar .date-range .muted { flex: none; font-size: 12.5px; }
  .search-box .input { width: 100%; min-width: 0; padding-left: 34px; }
  .toolbar .btn { grid-column: 1 / -1; justify-content: center; }
  .toolbar > span.small { grid-column: 1 / -1; }
  .toolbar label.flex { font-size: 12.5px; }
  .seg { grid-column: 1 / -1; display: flex; width: 100%; }
  .seg button {
    flex: 1 1 0; min-width: 0;
    padding: 7px 6px; font-size: 12.5px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }

  /* —— 表格：手机端一行一张卡，彻底贴合屏宽 —— */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }
  table.tb { font-size: 13px; min-width: 100%; }
  table.tb th { padding: 9px 11px; font-size: 11px; white-space: nowrap; }
  table.tb td {
    padding: 10px 11px;
    white-space: nowrap;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  table.tb td .tag, table.tb td .badge { vertical-align: middle; }
  table.tb th:first-child, table.tb td:first-child {
    position: sticky; left: 0; z-index: 1; background: #fff;
  }
  table.tb th:first-child { background: #fafcfe; }
  table.tb tbody tr:active { background: #f7fafd; }
  table.tb .actions { gap: 4px; }
  table.tb .mono { font-size: 11.5px; }

  /* 已转卡片结构的表格 */
  table.tb[data-mcards] { display: block; width: 100%; min-width: 0; }
  table.tb[data-mcards] thead { display: none; }
  table.tb[data-mcards] tbody { display: block; }
  table.tb[data-mcards] tbody tr {
    display: flex; flex-direction: column;
    padding: 11px 12px;
    margin-bottom: 9px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    white-space: normal;
  }
  table.tb[data-mcards] tbody tr:last-child { margin-bottom: 0; }
  table.tb[data-mcards] tbody tr:active { background: #fbfdff; }
  table.tb[data-mcards] td {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 3.5px 0;
    border: none;
    white-space: normal;
    max-width: none; overflow: visible; text-overflow: clip;
    position: static; background: transparent;
  }
  table.tb[data-mcards] td::before {
    content: attr(data-label);
    flex: 0 0 70px;
    color: var(--ink-3);
    font-size: 11.5px;
    font-weight: 400;
    line-height: 1.7;
    text-align: left;
  }
  table.tb[data-mcards] td.m-lead {
    display: block;
    order: -1;
    padding: 0 0 8px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
  }
  table.tb[data-mcards] td.m-lead::before { display: none; }
  table.tb[data-mcards] td.m-block { display: block; padding-top: 7px; }
  table.tb[data-mcards] td.m-block::before { display: block; margin-bottom: 5px; }
  table.tb[data-mcards] td.m-block .actions { justify-content: flex-start; flex-wrap: wrap; }
  table.tb[data-mcards] td.m-block .input { width: 100%; }
  table.tb[data-mcards] td.m-actions {
    display: block;
    order: 99;
    margin-top: 7px; padding-top: 9px;
    border-top: 1px dashed var(--line-soft);
  }
  table.tb[data-mcards] td.m-actions::before { display: none; }
  table.tb[data-mcards] td.m-actions .actions {
    justify-content: flex-end; flex-wrap: wrap; gap: 8px;
  }
  table.tb[data-mcards] td.m-actions .m-v { text-align: right; }
  table.tb[data-mcards] td.m-empty { display: none; }
  table.tb[data-mcards] .m-v {
    flex: 1 1 auto;
    min-width: 0;
    text-align: right;
    font-size: 13px;
    line-height: 1.65;
    overflow-wrap: anywhere;
  }
  table.tb[data-mcards] td.m-block .m-v { text-align: left; }
  table.tb[data-mcards] td.m-lead .tag { margin-top: 2px; }

  /* —— 流转步骤：编号胶囊自动换行，不再横向滑动 —— */
  .flow {
    flex-wrap: wrap; overflow: visible;
    gap: 6px; padding: 12px 14px;
  }
  .flow .step {
    flex: 0 0 auto;
    font-size: 11.5px; gap: 5px;
    padding: 4px 9px 4px 5px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 20px;
  }
  .flow .step .n { width: 17px; height: 17px; font-size: 10px; }
  .flow .arrow { display: none; }

  /* —— 建单单元：8 列表格改卡片 —— */
  .hscroll { overflow: visible; }
  .hscroll > div { min-width: 0 !important; }
  .line-head { display: none; }
  .line-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px 10px;
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fcfdff;
    position: relative;
  }
  .line-row .line-head { display: none; }
  .line-row .input, .line-row .select { font-size: 16px; padding: 10px 11px; }
  .line-row .input.num { text-align: left; }
  .line-row .input::placeholder { font-size: 14px; }
  .line-row > :nth-child(1) { grid-column: 1 / -1; margin-right: 0; }
  .line-row > :nth-child(4) { grid-column: 1 / -1; }
  .line-row > :nth-child(5),
  .line-row > :nth-child(6) { justify-content: flex-start; padding: 2px 0; }
  .line-row > :nth-child(7) { grid-column: 1 / -1; }
  .line-row > :nth-child(8) {
    position: absolute; top: 9px; right: 9px;
    width: 30px; height: 30px; padding: 0;
    display: grid; place-items: center;
    border: 1px solid var(--line); border-radius: 8px;
    background: #fff; color: var(--ink-3);
  }
  .line-row > :nth-child(8) svg { width: 15px; height: 15px; }
  .line-row > :nth-child(1) { padding-right: 40px; }

  /* —— 弹窗：全屏面板 —— */
  .modal-mask { padding: 0; align-items: stretch; }
  .modal, .modal.wide, .modal.xwide {
    max-width: none; width: 100%; height: 100%;
    border-radius: 0;
    display: flex; flex-direction: column;
    animation: sheetIn .22s cubic-bezier(.32, .72, 0, 1);
  }
  .modal-hd {
    padding: 14px 16px;
    position: sticky; top: 0; z-index: 2; background: #fff;
    padding-top: calc(14px + env(safe-area-inset-top));
  }
  .modal-bd { flex: 1; max-height: none; padding: 16px; }
  .modal-ft {
    position: sticky; bottom: 0; z-index: 2;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    gap: 8px;
  }
  .modal-ft .btn { flex: 1; }
  .modal-ft .left { flex: 0 0 auto; margin-right: auto; }

  /* —— 其他 —— */
  .kv { grid-template-columns: 84px 1fr; gap: 6px 10px; }
  .empty { padding: 40px 16px; }
  .alert-strip { font-size: 12.5px; padding: 10px 12px; align-items: flex-start; flex-wrap: wrap; }
  .alert-strip .btn { flex: none; }
  .photo-thumb { width: 52px; height: 52px; }
  #toast-root {
    top: auto;
    bottom: calc(16px + env(safe-area-inset-bottom));
    left: 12px; right: 12px; transform: none;
  }
  .toast { max-width: none; width: 100%; }
  /* 弹窗打开时，提示条抬高到底部按钮之上，避免遮住「保存」 */
  body:has(.modal-mask) #toast-root { bottom: calc(88px + env(safe-area-inset-bottom)); }
}

@media (max-width: 400px) {
  .toolbar .date-range { gap: 6px; }
  .toolbar .date-range .input[type="date"] { font-size: 13.5px; padding: 9px 5px 9px 8px; }
  .toolbar .date-range .muted { font-size: 11.5px; }
}

@media (max-width: 560px) {
  .login-fields, .demo-grid { grid-template-columns: 1fr; }
  .login-panel { padding: 26px 18px calc(40px + env(safe-area-inset-bottom)); }
  .login-head h3 { font-size: 21px; }
  .login-head .sub { margin-bottom: 18px; }
  .demo-block { margin-top: 20px; padding-top: 16px; }
  .demo-card { padding: 10px 12px; }
  .demo-card .ic { width: 36px; height: 36px; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .stat .value { font-size: 21px; }
}

@media (max-width: 900px) {
  .login-mbrand { display: flex; align-items: center; gap: 11px; margin-bottom: 22px; }
  .login-mbrand .mark {
    width: 40px; height: 40px; border-radius: 11px; flex: none;
    background: linear-gradient(145deg, #3b82f6, #1d4ed8);
    color: #fff; display: grid; place-items: center;
    font-weight: 700; font-size: 18px;
    box-shadow: 0 6px 16px rgba(37, 99, 235, .28);
  }
  .login-mbrand b { display: block; font-size: 15px; letter-spacing: .01em; }
  .login-mbrand span { font-size: 11px; color: var(--ink-3); letter-spacing: 1.5px; }
  .login-fields { gap: 0; }
}

@media (max-width: 780px) {
  #toast-root .toast { animation: toastDown .2s ease; }
  .note-cols { columns: 1; }

  /* —— 老板订单查询：搜索占满、筛选项整行、列表卡片化 —— */
  .bq-card { margin-bottom: 12px; }
  .bq-card .card-hd { flex-wrap: wrap; }
  .bq-card .card-hd .sub { flex: 1 1 100%; }
  .bq-bd { padding: 12px; }
  .bq-bar { gap: 8px; }
  .bq-search { flex: 1 1 100%; }
  .bq-search .input { font-size: 16px; padding: 11px 36px 11px 34px; }
  .bq-bar .select { width: 100%; min-width: 0; font-size: 16px; padding: 10px 11px; }
  .bq-pinwrap { padding: 10px; }
  .bq-pins { flex-direction: column; }
  .bq-chip { width: 100%; }
  .bq-chip-sub { flex: 1; max-width: none; }
  .bq-item { padding: 10px; gap: 8px; }
  .bq-line2 { white-space: normal; overflow: visible; }
  .bq-arrow { display: none; }
  .bq-pin { width: 34px; height: 34px; }
  .bq-empty { flex-direction: column; text-align: center; gap: 8px; padding: 22px 10px; }
}


/* 触屏设备去掉悬浮位移，减少重绘 */
@media (hover: none) {
  .demo-card:hover { transform: none; box-shadow: none; border-color: var(--line); }
  .demo-card:active { border-color: #bcd2fb; background: #f8fbff; }
  .btn:hover { background: #fff; color: var(--ink-2); }
  .btn-primary:hover { background: var(--brand); color: #fff; }
  .btn-accent:hover { background: var(--accent); color: #fff; }
  .btn-ghost:hover { background: transparent; }
  .btn-ghost:active { background: var(--line-soft); }
}

@keyframes sheetIn {
  from { transform: translateY(16px); opacity: .6; }
  to { transform: none; opacity: 1; }
}

